2
Copyright (C) 2006-2012 Jeroen Frijters
4
This software is provided 'as-is', without any express or implied
5
warranty. In no event will the authors be held liable for any damages
6
arising from the use of this software.
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
27
import cli.System.IntPtr;
28
import cli.System.Runtime.InteropServices.Marshal;
29
import cli.System.Security.Permissions.SecurityAction;
30
import cli.System.Security.Permissions.SecurityPermissionAttribute;
31
import ikvm.lang.Internal;
32
import java.lang.reflect.Field;
33
import java.lang.reflect.Modifier;
34
import java.lang.reflect.ReflectHelper;
35
import java.security.ProtectionDomain;
36
import java.util.ArrayList;
38
public final class Unsafe
40
public static final int INVALID_FIELD_OFFSET = -1;
41
public static final int ARRAY_BYTE_BASE_OFFSET = 0;
42
// NOTE sun.corba.Bridge actually access this field directly (via reflection),
43
// so the name must match the JDK name.
44
private static final Unsafe theUnsafe = new Unsafe();
45
private static final ArrayList<Field> fields = new ArrayList<Field>();
49
@ikvm.internal.HasCallerID
50
public static Unsafe getUnsafe()
52
if(ikvm.internal.CallerID.getCallerID().getCallerClassLoader() != null)
54
throw new SecurityException("Unsafe");
59
// this is the intrinsified version of objectFieldOffset(XXX.class.getDeclaredField("xxx"))
60
public long objectFieldOffset(Class c, String field)
62
return fieldOffset(ReflectHelper.createFieldAndMakeAccessible(c, field));
65
// NOTE we have a really lame (and slow) implementation!
66
public long objectFieldOffset(Field field)
68
if(Modifier.isStatic(field.getModifiers()))
70
throw new IllegalArgumentException();
72
return fieldOffset(field);
76
public int fieldOffset(Field original)
78
Field copy = ReflectHelper.copyFieldAndMakeAccessible(original);
81
int id = fields.size();
87
public int arrayBaseOffset(Class c)
89
// don't change this, the Unsafe intrinsics depend on this value
93
public int arrayIndexScale(Class c)
95
// don't change this, the Unsafe intrinsics depend on this value
99
private static Field getField(long offset)
103
return fields.get((int)offset);
107
public boolean compareAndSwapObject(Object obj, long offset, Object expect, Object update)
109
if(obj instanceof Object[])
111
Object[] arr = (Object[])obj;
112
int index = (int)offset;
115
if(arr[index] == expect)
125
Field field = getField(offset);
130
if(field.get(obj) == expect)
132
field.set(obj, update);
137
catch(IllegalAccessException x)
139
throw (InternalError)new InternalError().initCause(x);
145
public void putObjectVolatile(Object obj, long offset, Object newValue)
147
if(obj instanceof Object[])
151
((Object[])obj)[(int)offset] = newValue;
156
Field field = getField(offset);
161
field.set(obj, newValue);
163
catch(IllegalAccessException x)
165
throw (InternalError)new InternalError().initCause(x);
171
public void putOrderedObject(Object obj, long offset, Object newValue)
173
putObjectVolatile(obj, offset, newValue);
176
public Object getObjectVolatile(Object obj, long offset)
178
if(obj instanceof Object[])
182
return ((Object[])obj)[(int)offset];
187
Field field = getField(offset);
192
return field.get(obj);
194
catch(IllegalAccessException x)
196
throw (InternalError)new InternalError().initCause(x);
202
public boolean compareAndSwapInt(Object obj, long offset, int expect, int update)
204
if(obj instanceof int[])
206
int[] arr = (int[])obj;
207
int index = (int)offset;
210
if(arr[index] == expect)
220
Field field = getField(offset);
225
if(field.getInt(obj) == expect)
227
field.setInt(obj, update);
232
catch(IllegalAccessException x)
234
throw (InternalError)new InternalError().initCause(x);
240
public void putIntVolatile(Object obj, long offset, int newValue)
242
if(obj instanceof int[])
246
((int[])obj)[(int)offset] = newValue;
251
Field field = getField(offset);
256
field.setInt(obj, newValue);
258
catch(IllegalAccessException x)
260
throw (InternalError)new InternalError().initCause(x);
266
public void putOrderedInt(Object obj, long offset, int newValue)
268
putIntVolatile(obj, offset, newValue);
271
public int getIntVolatile(Object obj, long offset)
273
if(obj instanceof int[])
277
return ((int[])obj)[(int)offset];
282
Field field = getField(offset);
287
return field.getInt(obj);
289
catch(IllegalAccessException x)
291
throw (InternalError)new InternalError().initCause(x);
297
public boolean compareAndSwapLong(Object obj, long offset, long expect, long update)
299
if(obj instanceof long[])
301
long[] arr = (long[])obj;
302
int index = (int)offset;
305
if(arr[index] == expect)
315
Field field = getField(offset);
320
if(field.getLong(obj) == expect)
322
field.setLong(obj, update);
327
catch(IllegalAccessException x)
329
throw (InternalError)new InternalError().initCause(x);
335
public void putLongVolatile(Object obj, long offset, long newValue)
337
if(obj instanceof long[])
341
((long[])obj)[(int)offset] = newValue;
346
Field field = getField(offset);
351
field.setLong(obj, newValue);
353
catch(IllegalAccessException x)
355
throw (InternalError)new InternalError().initCause(x);
361
public void putOrderedLong(Object obj, long offset, long newValue)
363
putLongVolatile(obj, offset, newValue);
366
public long getLongVolatile(Object obj, long offset)
368
if(obj instanceof long[])
372
return ((long[])obj)[(int)offset];
377
Field field = getField(offset);
382
return field.getLong(obj);
384
catch(IllegalAccessException x)
386
throw (InternalError)new InternalError().initCause(x);
392
public void putBoolean(Object obj, long offset, boolean newValue)
394
if (obj instanceof boolean[])
396
((boolean[])obj)[(int)offset] = newValue;
402
getField(offset).setBoolean(obj, newValue);
404
catch (IllegalAccessException x)
406
throw (InternalError)new InternalError().initCause(x);
411
public boolean getBoolean(Object obj, long offset)
413
if (obj instanceof boolean[])
415
return ((boolean[])obj)[(int)offset];
421
return getField(offset).getBoolean(obj);
423
catch (IllegalAccessException x)
425
throw (InternalError)new InternalError().initCause(x);
430
public void putByte(Object obj, long offset, byte newValue)
432
if (obj instanceof byte[])
434
((byte[])obj)[(int)offset] = newValue;
440
getField(offset).setByte(obj, newValue);
442
catch (IllegalAccessException x)
444
throw (InternalError)new InternalError().initCause(x);
449
public byte getByte(Object obj, long offset)
451
if (obj instanceof byte[])
453
return ((byte[])obj)[(int)offset];
459
return getField(offset).getByte(obj);
461
catch (IllegalAccessException x)
463
throw (InternalError)new InternalError().initCause(x);
468
public void putChar(Object obj, long offset, char newValue)
470
if (obj instanceof char[])
472
((char[])obj)[(int)offset] = newValue;
478
getField(offset).setChar(obj, newValue);
480
catch (IllegalAccessException x)
482
throw (InternalError)new InternalError().initCause(x);
487
public char getChar(Object obj, long offset)
489
if (obj instanceof char[])
491
return ((char[])obj)[(int)offset];
497
return getField(offset).getChar(obj);
499
catch (IllegalAccessException x)
501
throw (InternalError)new InternalError().initCause(x);
506
public void putShort(Object obj, long offset, short newValue)
508
if (obj instanceof short[])
510
((short[])obj)[(int)offset] = newValue;
516
getField(offset).setShort(obj, newValue);
518
catch (IllegalAccessException x)
520
throw (InternalError)new InternalError().initCause(x);
525
public short getShort(Object obj, long offset)
527
if (obj instanceof short[])
529
return ((short[])obj)[(int)offset];
535
return getField(offset).getShort(obj);
537
catch (IllegalAccessException x)
539
throw (InternalError)new InternalError().initCause(x);
544
public void putInt(Object obj, long offset, int newValue)
546
if (obj instanceof int[])
548
((int[])obj)[(int)offset] = newValue;
554
getField(offset).setInt(obj, newValue);
556
catch (IllegalAccessException x)
558
throw (InternalError)new InternalError().initCause(x);
563
public int getInt(Object obj, long offset)
565
if (obj instanceof int[])
567
return ((int[])obj)[(int)offset];
573
return getField(offset).getInt(obj);
575
catch (IllegalAccessException x)
577
throw (InternalError)new InternalError().initCause(x);
582
public void putFloat(Object obj, long offset, float newValue)
584
if (obj instanceof float[])
586
((float[])obj)[(int)offset] = newValue;
592
getField(offset).setFloat(obj, newValue);
594
catch (IllegalAccessException x)
596
throw (InternalError)new InternalError().initCause(x);
601
public float getFloat(Object obj, long offset)
603
if (obj instanceof float[])
605
return ((float[])obj)[(int)offset];
611
return getField(offset).getFloat(obj);
613
catch (IllegalAccessException x)
615
throw (InternalError)new InternalError().initCause(x);
620
public void putLong(Object obj, long offset, long newValue)
622
if (obj instanceof long[])
624
((long[])obj)[(int)offset] = newValue;
630
getField(offset).setLong(obj, newValue);
632
catch (IllegalAccessException x)
634
throw (InternalError)new InternalError().initCause(x);
639
public long getLong(Object obj, long offset)
641
if (obj instanceof long[])
643
return ((long[])obj)[(int)offset];
649
return getField(offset).getLong(obj);
651
catch (IllegalAccessException x)
653
throw (InternalError)new InternalError().initCause(x);
658
public void putDouble(Object obj, long offset, double newValue)
660
if (obj instanceof double[])
662
((double[])obj)[(int)offset] = newValue;
668
getField(offset).setDouble(obj, newValue);
670
catch (IllegalAccessException x)
672
throw (InternalError)new InternalError().initCause(x);
677
public double getDouble(Object obj, long offset)
679
if (obj instanceof double[])
681
return ((double[])obj)[(int)offset];
687
return getField(offset).getDouble(obj);
689
catch (IllegalAccessException x)
691
throw (InternalError)new InternalError().initCause(x);
696
public void putObject(Object obj, long offset, Object newValue)
698
if (obj instanceof Object[])
700
((Object[])obj)[(int)offset] = newValue;
706
getField(offset).set(obj, newValue);
708
catch (IllegalAccessException x)
710
throw (InternalError)new InternalError().initCause(x);
715
public Object getObject(Object obj, long offset)
717
if (obj instanceof Object[])
719
return ((Object[])obj)[(int)offset];
725
return getField(offset).get(obj);
727
catch (IllegalAccessException x)
729
throw (InternalError)new InternalError().initCause(x);
735
public int getInt(Object o, int offset)
737
return getInt(o, (long)offset);
741
public void putInt(Object o, int offset, int x)
743
putInt(o, (long)offset, x);
747
public Object getObject(Object o, int offset)
749
return getObject(o, (long)offset);
753
public void putObject(Object o, int offset, Object x)
755
putObject(o, (long)offset, x);
759
public boolean getBoolean(Object o, int offset)
761
return getBoolean(o, (long)offset);
765
public void putBoolean(Object o, int offset, boolean x)
767
putBoolean(o, (long)offset, x);
771
public byte getByte(Object o, int offset)
773
return getByte(o, (long)offset);
777
public void putByte(Object o, int offset, byte x)
779
putByte(o, (long)offset, x);
783
public short getShort(Object o, int offset)
785
return getShort(o, (long)offset);
789
public void putShort(Object o, int offset, short x)
791
putShort(o, (long)offset, x);
795
public char getChar(Object o, int offset)
797
return getChar(o, (long)offset);
801
public void putChar(Object o, int offset, char x)
803
putChar(o, (long)offset, x);
807
public long getLong(Object o, int offset)
809
return getLong(o, (long)offset);
813
public void putLong(Object o, int offset, long x)
815
putLong(o, (long)offset, x);
819
public float getFloat(Object o, int offset)
821
return getFloat(o, (long)offset);
825
public void putFloat(Object o, int offset, float x)
827
putFloat(o, (long)offset, x);
831
public double getDouble(Object o, int offset)
833
return getDouble(o, (long)offset);
837
public void putDouble(Object o, int offset, double x)
839
putDouble(o, (long)offset, x);
842
public native void throwException(Throwable t);
844
public native void ensureClassInitialized(Class clazz);
846
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, SerializationFormatter = true)
847
@cli.System.Security.SecurityCriticalAttribute.Annotation
848
public native Object allocateInstance(Class clazz) throws InstantiationException;
850
public int addressSize()
852
return IntPtr.get_Size();
855
public int pageSize()
860
// The really unsafe methods start here. They are all have a LinkDemand for unmanaged code.
862
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
863
@cli.System.Security.SecurityCriticalAttribute.Annotation
864
public long allocateMemory(long bytes)
868
if (false) throw new cli.System.OutOfMemoryException();
869
return Marshal.AllocHGlobal(IntPtr.op_Explicit(bytes)).ToInt64();
871
catch (cli.System.OutOfMemoryException x)
873
throw new OutOfMemoryError(x.get_Message());
877
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
878
@cli.System.Security.SecurityCriticalAttribute.Annotation
879
public void freeMemory(long address)
881
Marshal.FreeHGlobal(IntPtr.op_Explicit(address));
884
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
885
@cli.System.Security.SecurityCriticalAttribute.Annotation
886
public void setMemory(long address, long bytes, byte value)
890
putByte(address++, value);
894
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
895
@cli.System.Security.SecurityCriticalAttribute.Annotation
896
public void copyMemory(long srcAddress, long destAddress, long bytes)
900
putByte(destAddress++, getByte(srcAddress++));
904
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
905
@cli.System.Security.SecurityCriticalAttribute.Annotation
906
public void copyMemory(Object srcBase, long srcOffset, Object destBase, long destOffset, long bytes)
910
if (destBase instanceof byte[])
912
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (byte[])destBase, (int)destOffset, (int)bytes);
914
else if (destBase instanceof boolean[])
916
byte[] tmp = new byte[(int)bytes];
917
copyMemory(srcBase, srcOffset, tmp, 0, bytes);
918
copyMemory(tmp, 0, destBase, destOffset, bytes);
920
else if (destBase instanceof short[])
922
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (short[])destBase, (int)(destOffset >> 1), (int)(bytes >> 1));
924
else if (destBase instanceof char[])
926
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (char[])destBase, (int)(destOffset >> 1), (int)(bytes >> 1));
928
else if (destBase instanceof int[])
930
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (int[])destBase, (int)(destOffset >> 2), (int)(bytes >> 2));
932
else if (destBase instanceof float[])
934
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (float[])destBase, (int)(destOffset >> 2), (int)(bytes >> 2));
936
else if (destBase instanceof long[])
938
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (long[])destBase, (int)(destOffset >> 3), (int)(bytes >> 3));
940
else if (destBase instanceof double[])
942
cli.System.Runtime.InteropServices.Marshal.Copy(IntPtr.op_Explicit(srcOffset), (double[])destBase, (int)(destOffset >> 3), (int)(bytes >> 3));
944
else if (destBase == null)
946
copyMemory(srcOffset, destOffset, bytes);
950
throw new IllegalArgumentException();
953
else if (srcBase instanceof cli.System.Array && destBase instanceof cli.System.Array)
955
cli.System.Buffer.BlockCopy((cli.System.Array)srcBase, (int)srcOffset, (cli.System.Array)destBase, (int)destOffset, (int)bytes);
959
if (srcBase instanceof byte[])
961
cli.System.Runtime.InteropServices.Marshal.Copy((byte[])srcBase, (int)srcOffset, IntPtr.op_Explicit(destOffset), (int)bytes);
963
else if (srcBase instanceof boolean[])
965
byte[] tmp = new byte[(int)bytes];
966
copyMemory(srcBase, srcOffset, tmp, 0, bytes);
967
copyMemory(tmp, 0, destBase, destOffset, bytes);
969
else if (srcBase instanceof short[])
971
cli.System.Runtime.InteropServices.Marshal.Copy((short[])srcBase, (int)(srcOffset >> 1), IntPtr.op_Explicit(destOffset), (int)(bytes >> 1));
973
else if (srcBase instanceof char[])
975
cli.System.Runtime.InteropServices.Marshal.Copy((char[])srcBase, (int)(srcOffset >> 1), IntPtr.op_Explicit(destOffset), (int)(bytes >> 1));
977
else if (srcBase instanceof int[])
979
cli.System.Runtime.InteropServices.Marshal.Copy((int[])srcBase, (int)(srcOffset >> 2), IntPtr.op_Explicit(destOffset), (int)(bytes >> 2));
981
else if (srcBase instanceof float[])
983
cli.System.Runtime.InteropServices.Marshal.Copy((float[])srcBase, (int)(srcOffset >> 2), IntPtr.op_Explicit(destOffset), (int)(bytes >> 2));
985
else if (srcBase instanceof long[])
987
cli.System.Runtime.InteropServices.Marshal.Copy((long[])srcBase, (int)(srcOffset >> 3), IntPtr.op_Explicit(destOffset), (int)(bytes >> 3));
989
else if (srcBase instanceof double[])
991
cli.System.Runtime.InteropServices.Marshal.Copy((double[])srcBase, (int)(srcOffset >> 3), IntPtr.op_Explicit(destOffset), (int)(bytes >> 3));
995
throw new IllegalArgumentException();
1000
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1001
@cli.System.Security.SecurityCriticalAttribute.Annotation
1002
public byte getByte(long address)
1004
return cli.System.Runtime.InteropServices.Marshal.ReadByte(IntPtr.op_Explicit(address));
1007
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1008
@cli.System.Security.SecurityCriticalAttribute.Annotation
1009
public void putByte(long address, byte x)
1011
cli.System.Runtime.InteropServices.Marshal.WriteByte(IntPtr.op_Explicit(address), x);
1014
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1015
@cli.System.Security.SecurityCriticalAttribute.Annotation
1016
public short getShort(long address)
1018
return cli.System.Runtime.InteropServices.Marshal.ReadInt16(IntPtr.op_Explicit(address));
1021
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1022
@cli.System.Security.SecurityCriticalAttribute.Annotation
1023
public void putShort(long address, short x)
1025
cli.System.Runtime.InteropServices.Marshal.WriteInt16(IntPtr.op_Explicit(address), x);
1028
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1029
@cli.System.Security.SecurityCriticalAttribute.Annotation
1030
public char getChar(long address)
1032
return (char)cli.System.Runtime.InteropServices.Marshal.ReadInt16(IntPtr.op_Explicit(address));
1035
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1036
@cli.System.Security.SecurityCriticalAttribute.Annotation
1037
public void putChar(long address, char x)
1039
cli.System.Runtime.InteropServices.Marshal.WriteInt16(IntPtr.op_Explicit(address), (short)x);
1042
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1043
@cli.System.Security.SecurityCriticalAttribute.Annotation
1044
public int getInt(long address)
1046
return cli.System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr.op_Explicit(address));
1049
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1050
@cli.System.Security.SecurityCriticalAttribute.Annotation
1051
public void putInt(long address, int x)
1053
cli.System.Runtime.InteropServices.Marshal.WriteInt32(IntPtr.op_Explicit(address), x);
1056
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1057
@cli.System.Security.SecurityCriticalAttribute.Annotation
1058
public long getLong(long address)
1060
return cli.System.Runtime.InteropServices.Marshal.ReadInt64(IntPtr.op_Explicit(address));
1063
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1064
@cli.System.Security.SecurityCriticalAttribute.Annotation
1065
public void putLong(long address, long x)
1067
cli.System.Runtime.InteropServices.Marshal.WriteInt64(IntPtr.op_Explicit(address), x);
1070
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1071
@cli.System.Security.SecurityCriticalAttribute.Annotation
1072
public long getAddress(long address)
1074
return cli.System.Runtime.InteropServices.Marshal.ReadIntPtr(IntPtr.op_Explicit(address)).ToInt64();
1077
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1078
@cli.System.Security.SecurityCriticalAttribute.Annotation
1079
public void putAddress(long address, long x)
1081
cli.System.Runtime.InteropServices.Marshal.WriteIntPtr(IntPtr.op_Explicit(address), IntPtr.op_Explicit(x));
1084
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1085
@cli.System.Security.SecurityCriticalAttribute.Annotation
1086
public float getFloat(long address)
1088
return Float.intBitsToFloat(getInt(address));
1091
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1092
@cli.System.Security.SecurityCriticalAttribute.Annotation
1093
public void putFloat(long address, float x)
1095
putInt(address, Float.floatToIntBits(x));
1098
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1099
@cli.System.Security.SecurityCriticalAttribute.Annotation
1100
public double getDouble(long address)
1102
return Double.longBitsToDouble(getLong(address));
1105
@SecurityPermissionAttribute.Annotation(value = SecurityAction.__Enum.LinkDemand, UnmanagedCode = true)
1106
@cli.System.Security.SecurityCriticalAttribute.Annotation
1107
public void putDouble(long address, double x)
1109
putLong(address, Double.doubleToLongBits(x));
1112
public int getLoadAverage(double[] loadavg, int nelems)
1117
public void park(boolean isAbsolute, long time)
1121
java.util.concurrent.locks.LockSupport.parkUntil(time);
1125
java.util.concurrent.locks.LockSupport.parkNanos(time);
1129
public void unpark(Object thread)
1131
java.util.concurrent.locks.LockSupport.unpark((Thread)thread);
1134
public Object staticFieldBase(Field f)
1139
public native Class defineClass(String name, byte[] buf, int offset, int length, ClassLoader cl, ProtectionDomain pd);
1141
public void monitorEnter(Object o)
1143
cli.System.Threading.Monitor.Enter(o);
1146
public void monitorExit(Object o)
1148
cli.System.Threading.Monitor.Exit(o);
1151
public boolean tryMonitorEnter(Object o)
1153
return cli.System.Threading.Monitor.TryEnter(o);