386 references to slot
System.Runtime.InteropServices.JavaScript (386)
System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.CoreCLR.cs (5)
30ctx.ReleaseJSOwnedObjectByGCHandle(arg1.slot.GCHandle); 50GCHandle callback_gc_handle = (GCHandle)arg1.slot.GCHandle; 81var holder = ctx.GetPromiseHolder(arg1.slot.GCHandle); 85ctx.ReleasePromiseHolder(arg1.slot.GCHandle); 109GCHandle exception_gc_handle = (GCHandle)arg1.slot.GCHandle;
System\Runtime\InteropServices\JavaScript\JSFunctionBinding.cs (8)
244if (exceptionArg.slot.Type != MarshalerType.None) 304res.slot.Type = MarshalerType.TaskPreCreated; 305res.slot.GCHandle = holder.GCHandle; 322arguments[1].slot.Type = MarshalerType.DiscardNoWait; 355if (arguments[1].slot.Type == MarshalerType.None) 357var holderHandle = (GCHandle)arguments[1].slot.GCHandle; 379if (exceptionArg.slot.Type != MarshalerType.None) 469if (exc.slot.Type != MarshalerType.None)
System\Runtime\InteropServices\JavaScript\JSMarshalerArgument.cs (2)
83slot.Type = MarshalerType.None; 90slot.ReceiverShouldFree = false;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.BigInt64.cs (9)
20if (slot.Type == MarshalerType.None) 25value = slot.Int64Value; 38slot.Type = MarshalerType.BigInt64; 39slot.Int64Value = value; 52if (slot.Type == MarshalerType.None) 57value = slot.Int64Value; 72slot.Type = MarshalerType.BigInt64; 73slot.Int64Value = value.Value; 77slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Bool.cs (9)
20if (slot.Type == MarshalerType.None) 25value = slot.BooleanValue; 38slot.Type = MarshalerType.Boolean; 39slot.BooleanValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.BooleanValue; 72slot.Type = MarshalerType.Boolean; 73slot.BooleanValue = value.Value; 77slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (34)
20if (slot.Type == MarshalerType.None) 25value = slot.ByteValue; 38slot.Type = MarshalerType.Byte; 39slot.ByteValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.ByteValue; 72slot.Type = MarshalerType.Byte; 73slot.ByteValue = value.Value; 77slot.Type = MarshalerType.None; 88if (slot.Type == MarshalerType.None) 93value = new byte[slot.Length]; 94Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 95NativeMemory.Free((void*)slot.IntPtrValue); 107slot.Type = MarshalerType.None; 110slot.Length = value.Length; 111slot.Type = MarshalerType.Array; 112slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(byte))); 113slot.ElementType = MarshalerType.Byte; 114Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length); 125var array = (byte[])((GCHandle)slot.GCHandle).Target!; 127int byteOffset = (int)(slot.IntPtrValue - (nint)refPtr); 128value = new ArraySegment<byte>(array, byteOffset, slot.Length); 140slot.Type = MarshalerType.None; 143slot.Type = MarshalerType.ArraySegment; 145slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(value.Array, GCHandleType.Pinned); 147slot.IntPtrValue = refPtr + value.Offset; 148slot.Length = value.Count; 158value = new Span<byte>((void*)slot.IntPtrValue, slot.Length); 169slot.Length = value.Length; 170slot.IntPtrValue = (IntPtr)Unsafe.AsPointer(ref value.GetPinnableReference()); 171slot.Type = MarshalerType.Span;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Char.cs (9)
20if (slot.Type == MarshalerType.None) 25value = slot.CharValue; 38slot.Type = MarshalerType.Char; 39slot.CharValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.CharValue; 72slot.Type = MarshalerType.Char; 73slot.CharValue = value.Value; 77slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.DateTime.cs (18)
20if (slot.Type == MarshalerType.None) 25value = DateTimeOffset.FromUnixTimeMilliseconds((long)slot.DoubleValue); 38slot.Type = MarshalerType.DateTimeOffset; 39slot.DoubleValue = (double)value.ToUnixTimeMilliseconds(); 52if (slot.Type == MarshalerType.None) 57value = DateTimeOffset.FromUnixTimeMilliseconds((long)slot.DoubleValue); 72slot.Type = MarshalerType.DateTimeOffset; 73slot.DoubleValue = value.Value.ToUnixTimeMilliseconds(); ; 77slot.Type = MarshalerType.None; 91if (slot.Type == MarshalerType.None) 96value = DateTimeOffset.FromUnixTimeMilliseconds((long)slot.DoubleValue).UtcDateTime; 109slot.Type = MarshalerType.DateTime; 110slot.DoubleValue = new DateTimeOffset(value.Ticks, TimeSpan.Zero).ToUnixTimeMilliseconds(); 123if (slot.Type == MarshalerType.None) 128value = DateTimeOffset.FromUnixTimeMilliseconds((long)slot.DoubleValue).UtcDateTime; 143slot.Type = MarshalerType.DateTime; 144slot.DoubleValue = new DateTimeOffset(value.Value.Ticks, TimeSpan.Zero).ToUnixTimeMilliseconds(); 148slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (34)
20if (slot.Type == MarshalerType.None) 25value = slot.DoubleValue; 38slot.Type = MarshalerType.Double; 39slot.DoubleValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.DoubleValue; 72slot.Type = MarshalerType.Double; 73slot.DoubleValue = value.Value; 77slot.Type = MarshalerType.None; 91if (slot.Type == MarshalerType.None) 96value = new double[slot.Length]; 97Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 98NativeMemory.Free((void*)slot.IntPtrValue); 113slot.Type = MarshalerType.None; 116slot.Type = MarshalerType.Array; 117slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(double))); 118slot.Length = value.Length; 119slot.ElementType = MarshalerType.Double; 120Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length); 131var array = (double[])((GCHandle)slot.GCHandle).Target!; 133int byteOffset = (int)(slot.IntPtrValue - (nint)refPtr); 134value = new ArraySegment<double>(array, byteOffset / sizeof(double), slot.Length); 146slot.Type = MarshalerType.None; 149slot.Type = MarshalerType.ArraySegment; 151slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(value.Array, GCHandleType.Pinned); 153slot.IntPtrValue = refPtr + (value.Offset * sizeof(double)); 154slot.Length = value.Count; 164value = new Span<double>((void*)slot.IntPtrValue, slot.Length); 175slot.Length = value.Length; 176slot.IntPtrValue = (IntPtr)Unsafe.AsPointer(ref value.GetPinnableReference()); 177slot.Type = MarshalerType.Span;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Exception.cs (10)
20if (slot.Type == MarshalerType.None) 25if (slot.Type == MarshalerType.Exception) 29value = (Exception)((GCHandle)slot.GCHandle).Target; 35if (slot.JSHandle != IntPtr.Zero) 39jsException = ctx.CreateCSOwnedProxy(slot.JSHandle); 60slot.Type = MarshalerType.None; 89slot.Type = MarshalerType.JSException; 90slot.JSHandle = jsException.JSHandle; 95slot.Type = MarshalerType.Exception; 98slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cpy);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Func.cs (32)
167if (slot.Type == MarshalerType.None) 174var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 187if (slot.Type == MarshalerType.None) 194var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 209if (slot.Type == MarshalerType.None) 216var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 233if (slot.Type == MarshalerType.None) 240var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 423if (slot.Type == MarshalerType.None) 430var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 445if (slot.Type == MarshalerType.None) 452var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 470if (slot.Type == MarshalerType.None) 477var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 496if (slot.Type == MarshalerType.None) 502var holder = ctx.CreateCSOwnedProxy(slot.JSHandle); 520slot.Type = MarshalerType.Function; 522slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 542slot.Type = MarshalerType.Action; 544slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 568slot.Type = MarshalerType.Action; 570slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 598slot.Type = MarshalerType.Action; 600slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 620slot.Type = MarshalerType.Function; 622slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 646slot.Type = MarshalerType.Function; 648slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 676slot.Type = MarshalerType.Function; 678slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb); 710slot.Type = MarshalerType.Function; 712slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(cb);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int16.cs (9)
20if (slot.Type == MarshalerType.None) 25value = slot.Int16Value; 38slot.Type = MarshalerType.Int16; 39slot.Int16Value = value; 52if (slot.Type == MarshalerType.None) 57value = slot.Int16Value; 72slot.Type = MarshalerType.Int16; 73slot.Int16Value = value.Value; 77slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (34)
20if (slot.Type == MarshalerType.None) 25value = slot.Int32Value; 38slot.Type = MarshalerType.Int32; 39slot.Int32Value = value; 52if (slot.Type == MarshalerType.None) 57value = slot.Int32Value; 72slot.Type = MarshalerType.Int32; 73slot.Int32Value = value.Value; 77slot.Type = MarshalerType.None; 88if (slot.Type == MarshalerType.None) 93value = new int[slot.Length]; 94Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 95NativeMemory.Free((void*)slot.IntPtrValue); 107slot.Type = MarshalerType.None; 110slot.Type = MarshalerType.Array; 111slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(int))); 112slot.Length = value.Length; 113slot.ElementType = MarshalerType.Int32; 114Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length); 125var array = (int[])((GCHandle)slot.GCHandle).Target!; 127int byteOffset = (int)(slot.IntPtrValue - (nint)refPtr); 128value = new ArraySegment<int>(array, byteOffset / sizeof(int), slot.Length); 140slot.Type = MarshalerType.None; 144slot.Type = MarshalerType.ArraySegment; 145slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(value.Array, GCHandleType.Pinned); 147slot.IntPtrValue = refPtr + (value.Offset * sizeof(int)); 148slot.Length = value.Count; 158value = new Span<int>((void*)slot.IntPtrValue, slot.Length); 169slot.Length = value.Length; 170slot.IntPtrValue = (IntPtr)Unsafe.AsPointer(ref value.GetPinnableReference()); 171slot.Type = MarshalerType.Span;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int52.cs (9)
23if (slot.Type == MarshalerType.None) 28value = (long)slot.DoubleValue; 46slot.Type = MarshalerType.Int52; 47slot.DoubleValue = value; 60if (slot.Type == MarshalerType.None) 65value = (long)slot.DoubleValue; 84slot.Type = MarshalerType.Int52; 85slot.DoubleValue = value.Value; 89slot.Type = MarshalerType.None;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.IntPtr.cs (13)
20if (slot.Type == MarshalerType.None) 25value = slot.IntPtrValue; 38slot.Type = MarshalerType.IntPtr; 39slot.IntPtrValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.IntPtrValue; 72slot.Type = MarshalerType.IntPtr; 73slot.IntPtrValue = value.Value; 77slot.Type = MarshalerType.None; 91if (slot.Type == MarshalerType.None) 96value = (byte*)slot.IntPtrValue; 109slot.Type = MarshalerType.IntPtr; 110slot.IntPtrValue = (IntPtr)value;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.JSObject.cs (16)
20if (slot.Type == MarshalerType.None) 26value = ctx.CreateCSOwnedProxy(slot.JSHandle); 41slot.Type = MarshalerType.None; 61slot.Type = MarshalerType.JSObject; 62slot.JSHandle = value.JSHandle; 76if (slot.Type == MarshalerType.None) 82value = new JSObject?[slot.Length]; 83JSMarshalerArgument* payload = (JSMarshalerArgument*)slot.IntPtrValue; 84for (int i = 0; i < slot.Length; i++) 91NativeMemory.Free((void*)slot.IntPtrValue); 106slot.Type = MarshalerType.None; 109slot.Length = value.Length; 111slot.Type = MarshalerType.Array; 112slot.ElementType = MarshalerType.JSObject; 115for (int i = 0; i < slot.Length; i++) 122slot.IntPtrValue = (IntPtr)payload;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Object.cs (36)
26if (slot.Type == MarshalerType.None) 30else if (slot.Type == MarshalerType.Object) 32value = ((GCHandle)slot.GCHandle).Target; 34else if (slot.Type == MarshalerType.Boolean) 39else if (slot.Type == MarshalerType.Double) 44else if (slot.Type == MarshalerType.Single) 49else if (slot.Type == MarshalerType.JSObject) 54else if (slot.Type == MarshalerType.String) 59else if (slot.Type == MarshalerType.Exception) 64else if (slot.Type == MarshalerType.DateTime) 69else if (slot.Type == MarshalerType.JSException) 74else if (slot.Type == MarshalerType.Array) 76if (slot.ElementType == MarshalerType.Byte) 81else if (slot.ElementType == MarshalerType.Double) 86else if (slot.ElementType == MarshalerType.Single) 91else if (slot.ElementType == MarshalerType.Int32) 96else if (slot.ElementType == MarshalerType.Object) 103throw new NotSupportedException(SR.Format(SR.ToManagedNotImplemented, slot.ElementType + "[]")); 106else if (slot.Type == MarshalerType.Task || slot.Type == MarshalerType.TaskResolved || slot.Type == MarshalerType.TaskRejected) 116throw new NotSupportedException(SR.Format(SR.ToManagedNotImplemented, slot.Type)); 132slot.Type = MarshalerType.None; 338slot.Type = MarshalerType.Object; 340slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(value); 354if (slot.Type == MarshalerType.None) 360value = new object?[slot.Length]; 361JSMarshalerArgument* payload = (JSMarshalerArgument*)slot.IntPtrValue; 362for (int i = 0; i < slot.Length; i++) 372NativeMemory.Free((void*)slot.IntPtrValue); 387slot.Type = MarshalerType.None; 390slot.Length = value.Length; 392slot.Type = MarshalerType.Array; 398for (int i = 0; i < slot.Length; i++) 405slot.ElementType = MarshalerType.Object; 406slot.IntPtrValue = (IntPtr)payload;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (34)
20if (slot.Type == MarshalerType.None) 25value = slot.SingleValue; 38slot.Type = MarshalerType.Single; 39slot.SingleValue = value; 52if (slot.Type == MarshalerType.None) 57value = slot.SingleValue; 72slot.Type = MarshalerType.Single; 73slot.SingleValue = value.Value; 77slot.Type = MarshalerType.None; 91if (slot.Type == MarshalerType.None) 96value = new float[slot.Length]; 97Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 98NativeMemory.Free((void*)slot.IntPtrValue); 113slot.Type = MarshalerType.None; 116slot.Type = MarshalerType.Array; 117slot.IntPtrValue = (IntPtr)NativeMemory.Alloc((nuint)(value.Length * sizeof(float))); 118slot.Length = value.Length; 119slot.ElementType = MarshalerType.Single; 120Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length); 131var array = (float[])((GCHandle)slot.GCHandle).Target!; 133int byteOffset = (int)(slot.IntPtrValue - (nint)refPtr); 134value = new ArraySegment<float>(array, byteOffset / sizeof(float), slot.Length); 146slot.Type = MarshalerType.None; 149slot.Type = MarshalerType.ArraySegment; 151slot.GCHandle = ctx.GetJSOwnedObjectGCHandle(value.Array, GCHandleType.Pinned); 153slot.IntPtrValue = refPtr + (value.Offset * sizeof(float)); 154slot.Length = value.Count; 164value = new Span<float>((void*)slot.IntPtrValue, slot.Length); 175slot.Length = value.Length; 176slot.IntPtrValue = (IntPtr)Unsafe.AsPointer(ref value.GetPinnableReference()); 177slot.Type = MarshalerType.Span;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.String.cs (19)
20if (slot.Type == MarshalerType.None) 26value = Marshal.PtrToStringUni(slot.IntPtrValue, slot.Length); 27NativeMemory.Free((void*)slot.IntPtrValue); 48slot.Type = MarshalerType.None; 52slot.Type = MarshalerType.String; 54slot.IntPtrValue = Marshal.StringToHGlobalUni(value); // alloc, JS side will free 55slot.Length = value.Length; 81if (slot.Type == MarshalerType.None) 87value = new string?[slot.Length]; 88JSMarshalerArgument* payload = (JSMarshalerArgument*)slot.IntPtrValue; 89for (int i = 0; i < slot.Length; i++) 99NativeMemory.Free((void*)slot.IntPtrValue); 114slot.Type = MarshalerType.None; 117slot.Length = value.Length; 119slot.Type = MarshalerType.Array; 125for (int i = 0; i < slot.Length; i++) 132slot.IntPtrValue = (IntPtr)payload; 133slot.ElementType = MarshalerType.String;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Task.cs (46)
44if (slot.Type == MarshalerType.None) 54PromiseHolder holder = ctx.GetPromiseHolder(slot.GCHandle); 68if (arg_2.slot.Type != MarshalerType.None) 104if (slot.Type == MarshalerType.None) 114var holder = ctx.GetPromiseHolder(slot.GCHandle); 129if (arg_2.slot.Type != MarshalerType.None) 171slot.Type = MarshalerType.None; 181slot.ElementType = slot.Type; 182slot.Type = MarshalerType.TaskRejected; 190slot.ElementType = slot.Type; 194slot.ElementType = MarshalerType.Void; 196slot.Type = MarshalerType.TaskResolved; 202if (slot.Type != MarshalerType.TaskPreCreated) 205slot.JSHandle = ctx.AllocJSVHandle(); 206slot.Type = MarshalerType.Task; 214var taskHolder = ctx.CreateCSOwnedProxy(slot.JSHandle); 267slot.Type = MarshalerType.None; 276slot.ElementType = slot.Type; 277slot.Type = MarshalerType.TaskRejected; 282slot.ElementType = MarshalerType.Void; 283slot.Type = MarshalerType.TaskResolved; 288if (slot.Type != MarshalerType.TaskPreCreated) 291slot.JSHandle = ctx.AllocJSVHandle(); 292slot.Type = MarshalerType.Task; 300var taskHolder = ctx.CreateCSOwnedProxy(slot.JSHandle); 343slot.Type = MarshalerType.None; 353slot.ElementType = slot.Type; 354slot.Type = MarshalerType.TaskRejected; 361slot.ElementType = slot.Type; 362slot.Type = MarshalerType.TaskResolved; 367if (slot.Type != MarshalerType.TaskPreCreated) 370slot.JSHandle = ctx.AllocJSVHandle(); 371slot.Type = MarshalerType.Task; 379var taskHolder = ctx.CreateCSOwnedProxy(slot.JSHandle); 466arg_handle.slot.Type = MarshalerType.TaskRejected; 467arg_handle.slot.JSHandle = holder.JSHandle; 501arg_handle.slot.Type = MarshalerType.TaskResolved; 502arg_handle.slot.JSHandle = holder.JSHandle; 504arg_value.slot.Type = MarshalerType.Void; 535arg_handle.slot.Type = MarshalerType.TaskResolved; 536arg_handle.slot.JSHandle = holder.JSHandle;