public static IshtarObject *ToIshtarObject(nint dotnet_value, CallFrame frame = null, IshtarObject **node = null) { var obj = IshtarGC.AllocObject(TYPE_RAW.AsRuntimeClass(), node); obj->vtable = (void **)dotnet_value; return(obj); }
public static IshtarObject *ToIshtarObject(string str, CallFrame frame = null, IshtarObject **node = null) { var arg = IshtarGC.AllocObject(TYPE_STRING.AsRuntimeClass(), node); var clazz = IshtarUnsafe.AsRef <RuntimeIshtarClass>(arg->clazz); arg->vtable[clazz.Field["!!value"].vtable_offset] = StringStorage.Intern(str); return(arg); }
public static IshtarObject *ToIshtarObject(float dotnet_value, CallFrame frame = null, IshtarObject **node = null) { var obj = IshtarGC.AllocObject(TYPE_I8.AsRuntimeClass(), node); var clazz = IshtarUnsafe.AsRef <RuntimeIshtarClass>(obj->clazz); obj->vtable[clazz.Field["!!value"].vtable_offset] = (int *)BitConverter.SingleToInt32Bits(dotnet_value); return(obj); }
public static IshtarObject *ToIshtarObject(long dotnet_value, CallFrame frame = null, IshtarObject **node = null) { var obj = IshtarGC.AllocObject(TYPE_I8.AsRuntimeClass(), node); var clazz = IshtarUnsafe.AsRef <RuntimeIshtarClass>(obj->clazz); obj->vtable[clazz.Field["!!value"].vtable_offset] = (long *)dotnet_value; return(obj); }
public void ThrowException(RuntimeIshtarClass @class, string message) { this.exception = new CallFrameException() { value = IshtarGC.AllocObject(@class) }; if (@class.FindField("message") is null) { throw new InvalidOperationException($"Class '{@class.FullName}' is not contained 'message' field."); } this.exception.value->vtable[@class.Field["message"].vtable_offset] = IshtarMarshal.ToIshtarObject(message); }
public void ThrowException(RuntimeIshtarClass @class) => this.exception = new CallFrameException() { value = IshtarGC.AllocObject(@class) };