1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.jvm
;
12 import cc
.squirreljme
.jvm
.mle
.brackets
.TypeBracket
;
13 import cc
.squirreljme
.runtime
.cldc
.annotation
.Exported
;
16 * This class is used special by the compiler to transform all the various
17 * operations into regular instructions rather than method calls.
19 * The compiler will take all of the method arguments and instead use their
20 * inputs and outputs from the values of registers instead. However due to
21 * this, this means that these instructions are purely primitive in that
22 * they must not depend on any aspect of the virtual machine.
27 @SuppressWarnings({"NewMethodNamingConvention", "OverlyComplexClass"})
28 public final class Assembly
40 * Returns the array length of the given object.
42 * @param __o The object to get the length of.
43 * @return The length of the array, will return a negative value if not
47 public static native int arrayLength(int __o
);
50 * Returns the array length of the given object.
52 * @param __o The object to get the length of.
53 * @return The length of the array, will return a negative value if not
57 public static native int arrayLength(Object __o
);
60 * Atomic comparison and set.
62 * @param __comp The value to compare and if matches, {@code __set} is
64 * @param __set The value to set if matched.
65 * @param __addr The address to write to.
66 * @return The value that was read before the set.
69 public static native int atomicCompareGetAndSet(int __comp
, int __set
,
73 * Atomically decrements a value and returns the result.
75 * @param __addr The address to decrement.
76 * @return The get value.
79 public static native int atomicDecrementAndGet(long __addr
);
82 * Atomically increments a value.
84 * @param __addr The address to increment.
87 public static native void atomicIncrement(long __addr
);
90 * Trigger breakpoint within the virtual machine.
94 public static native void breakpoint();
97 * Packs the given two integers to a double value.
99 * @param __lo The low value.
100 * @param __hi The high value.
101 * @return The double value.
104 public static native double doublePack(int __lo
, int __hi
);
107 * Double to raw long bits.
109 * @param __d The input double.
110 * @return The raw long bits.
113 public static native long doubleToRawLongBits(double __d
);
116 * Unpacks the high value of a double.
118 * @param __d The double to unpack.
119 * @return The unpacked high value.
123 public static native int doubleUnpackHigh(double __d
);
126 * Unpacks the low value of a double.
128 * @param __d The double to unpack.
129 * @return The unpacked low value.
133 public static native int doubleUnpackLow(double __d
);
136 * Performs explicit exception handling.
140 public static native void exceptionHandle();
143 * Float to raw int bits.
145 * @param __f The input float.
146 * @return The raw int bits.
149 public static native int floatToRawIntBits(float __f
);
152 * Integer bits to float.
154 * @param __b The input bits.
155 * @return The resulting float.
158 public static native float intBitsToFloat(int __b
);
161 * Invoke method at pointer.
163 * @param __addr The address to invoke.
164 * @param __pool The pool address to load.
167 public static native void invoke(int __addr
, int __pool
);
170 * Invoke method at pointer, with arguments.
172 * @param __addr The address to invoke.
173 * @param __pool The pool address to load.
174 * @param __a Argument.
177 public static native void invoke(int __addr
, int __pool
, int __a
);
180 * Invoke method at pointer, with arguments.
182 * @param __addr The address to invoke.
183 * @param __pool The pool address to load.
184 * @param __a Argument.
185 * @param __b Argument.
188 public static native void invoke(int __addr
, int __pool
, int __a
,
192 * Invoke method at pointer, with arguments.
194 * @param __addr The address to invoke.
195 * @param __pool The pool address to load.
196 * @param __a Argument.
197 * @param __b Argument.
198 * @param __c Argument.
201 public static native void invoke(int __addr
, int __pool
, int __a
,
205 * Invoke method at pointer, with arguments.
207 * @param __addr The address to invoke.
208 * @param __pool The pool address to load.
209 * @param __a Argument.
210 * @param __b Argument.
211 * @param __c Argument.
212 * @param __d Argument.
215 public static native void invoke(int __addr
, int __pool
, int __a
,
216 int __b
, int __c
, int __d
);
219 * Invoke method at pointer, with arguments.
221 * @param __addr The address to invoke.
222 * @param __pool The pool address to load.
223 * @param __a Argument.
224 * @param __b Argument.
225 * @param __c Argument.
226 * @param __d Argument.
227 * @param __e Argument.
230 public static native void invoke(int __addr
, int __pool
, int __a
,
231 int __b
, int __c
, int __d
, int __e
);
234 * Invoke method at pointer, with arguments.
236 * @param __addr The address to invoke.
237 * @param __pool The pool address to load.
238 * @param __a Argument.
239 * @param __b Argument.
240 * @param __c Argument.
241 * @param __d Argument.
242 * @param __e Argument.
243 * @param __f Argument.
246 public static native void invoke(int __addr
, int __pool
, int __a
,
247 int __b
, int __c
, int __d
, int __e
, int __f
);
250 * Invoke method at pointer, with arguments.
252 * @param __addr The address to invoke.
253 * @param __pool The pool address to load.
254 * @param __a Argument.
255 * @param __b Argument.
256 * @param __c Argument.
257 * @param __d Argument.
258 * @param __e Argument.
259 * @param __f Argument.
260 * @param __g Argument.
263 public static native void invoke(int __addr
, int __pool
, int __a
,
264 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
);
267 * Invoke method at pointer, with arguments.
269 * @param __addr The address to invoke.
270 * @param __pool The pool address to load.
271 * @param __a Argument.
272 * @param __b Argument.
273 * @param __c Argument.
274 * @param __d Argument.
275 * @param __e Argument.
276 * @param __f Argument.
277 * @param __g Argument.
278 * @param __h Argument.
281 public static native void invoke(int __addr
, int __pool
, int __a
,
282 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
, int __h
);
285 * Invoke method at pointer.
287 * @param __addr The address to invoke.
288 * @param __pool The pool address to load.
289 * @return The result of the invocation.
292 public static native int invokeV(int __addr
, int __pool
);
295 * Invoke method at pointer, with arguments.
297 * @param __addr The address to invoke.
298 * @param __pool The pool address to load.
299 * @param __a Argument.
300 * @return The result of the invocation.
303 public static native int invokeV(int __addr
, int __pool
, int __a
);
306 * Invoke method at pointer, with arguments.
308 * @param __addr The address to invoke.
309 * @param __pool The pool address to load.
310 * @param __a Argument.
311 * @param __b Argument.
312 * @return The result of the invocation.
315 public static native int invokeV(int __addr
, int __pool
, int __a
,
319 * Invoke method at pointer, with arguments.
321 * @param __addr The address to invoke.
322 * @param __pool The pool address to load.
323 * @param __a Argument.
324 * @param __b Argument.
325 * @param __c Argument.
326 * @return The result of the invocation.
329 public static native int invokeV(int __addr
, int __pool
, int __a
,
333 * Invoke method at pointer, with arguments.
335 * @param __addr The address to invoke.
336 * @param __pool The pool address to load.
337 * @param __a Argument.
338 * @param __b Argument.
339 * @param __c Argument.
340 * @param __d Argument.
341 * @return The result of the invocation.
344 public static native int invokeV(int __addr
, int __pool
, int __a
,
345 int __b
, int __c
, int __d
);
348 * Invoke method at pointer, with arguments.
350 * @param __addr The address to invoke.
351 * @param __pool The pool address to load.
352 * @param __a Argument.
353 * @param __b Argument.
354 * @param __c Argument.
355 * @param __d Argument.
356 * @param __e Argument.
357 * @return The result of the invocation.
360 public static native int invokeV(int __addr
, int __pool
, int __a
,
361 int __b
, int __c
, int __d
, int __e
);
364 * Invoke method at pointer, with arguments.
366 * @param __addr The address to invoke.
367 * @param __pool The pool address to load.
368 * @param __a Argument.
369 * @param __b Argument.
370 * @param __c Argument.
371 * @param __d Argument.
372 * @param __e Argument.
373 * @param __f Argument.
374 * @return The result of the invocation.
377 public static native int invokeV(int __addr
, int __pool
, int __a
,
378 int __b
, int __c
, int __d
, int __e
, int __f
);
381 * Invoke method at pointer, with arguments.
383 * @param __addr The address to invoke.
384 * @param __pool The pool address to load.
385 * @param __a Argument.
386 * @param __b Argument.
387 * @param __c Argument.
388 * @param __d Argument.
389 * @param __e Argument.
390 * @param __f Argument.
391 * @param __g Argument.
392 * @return The result of the invocation.
395 public static native int invokeV(int __addr
, int __pool
, int __a
,
396 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
);
399 * Invoke method at pointer, with arguments.
401 * @param __addr The address to invoke.
402 * @param __pool The pool address to load.
403 * @param __a Argument.
404 * @param __b Argument.
405 * @param __c Argument.
406 * @param __d Argument.
407 * @param __e Argument.
408 * @param __f Argument.
409 * @param __g Argument.
410 * @param __h Argument.
411 * @return The result of the invocation.
414 public static native int invokeV(int __addr
, int __pool
, int __a
,
415 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
, int __h
);
418 * Invoke method at pointer.
420 * @param __addr The address to invoke.
421 * @param __pool The pool address to load.
422 * @return The result of the invocation.
425 public static native long invokeVL(int __addr
, int __pool
);
428 * Invoke method at pointer, with arguments.
430 * @param __addr The address to invoke.
431 * @param __pool The pool address to load.
432 * @param __a Argument.
433 * @return The result of the invocation.
436 public static native long invokeVL(int __addr
, int __pool
, int __a
);
439 * Invoke method at pointer, with arguments.
441 * @param __addr The address to invoke.
442 * @param __pool The pool address to load.
443 * @param __a Argument.
444 * @param __b Argument.
445 * @return The result of the invocation.
448 public static native long invokeVL(int __addr
, int __pool
, int __a
,
452 * Invoke method at pointer, with arguments.
454 * @param __addr The address to invoke.
455 * @param __pool The pool address to load.
456 * @param __a Argument.
457 * @param __b Argument.
458 * @param __c Argument.
459 * @return The result of the invocation.
462 public static native long invokeVL(int __addr
, int __pool
, int __a
,
466 * Invoke method at pointer, with arguments.
468 * @param __addr The address to invoke.
469 * @param __pool The pool address to load.
470 * @param __a Argument.
471 * @param __b Argument.
472 * @param __c Argument.
473 * @param __d Argument.
474 * @return The result of the invocation.
477 public static native long invokeVL(int __addr
, int __pool
, int __a
,
478 int __b
, int __c
, int __d
);
481 * Invoke method at pointer, with arguments.
483 * @param __addr The address to invoke.
484 * @param __pool The pool address to load.
485 * @param __a Argument.
486 * @param __b Argument.
487 * @param __c Argument.
488 * @param __d Argument.
489 * @param __e Argument.
490 * @return The result of the invocation.
493 public static native long invokeVL(int __addr
, int __pool
, int __a
,
494 int __b
, int __c
, int __d
, int __e
);
497 * Invoke method at pointer, with arguments.
499 * @param __addr The address to invoke.
500 * @param __pool The pool address to load.
501 * @param __a Argument.
502 * @param __b Argument.
503 * @param __c Argument.
504 * @param __d Argument.
505 * @param __e Argument.
506 * @param __f Argument.
507 * @return The result of the invocation.
510 public static native long invokeVL(int __addr
, int __pool
, int __a
,
511 int __b
, int __c
, int __d
, int __e
, int __f
);
514 * Invoke method at pointer, with arguments.
516 * @param __addr The address to invoke.
517 * @param __pool The pool address to load.
518 * @param __a Argument.
519 * @param __b Argument.
520 * @param __c Argument.
521 * @param __d Argument.
522 * @param __e Argument.
523 * @param __f Argument.
524 * @param __g Argument.
525 * @return The result of the invocation.
528 public static native long invokeVL(int __addr
, int __pool
, int __a
,
529 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
);
532 * Invoke method at pointer, with arguments.
534 * @param __addr The address to invoke.
535 * @param __pool The pool pointer to load.
536 * @param __a Argument.
537 * @param __b Argument.
538 * @param __c Argument.
539 * @param __d Argument.
540 * @param __e Argument.
541 * @param __f Argument.
542 * @param __g Argument.
543 * @param __h Argument.
544 * @return The result of the invocation.
547 public static native long invokeVL(int __addr
, int __pool
, int __a
,
548 int __b
, int __c
, int __d
, int __e
, int __f
, int __g
, int __h
);
551 * Long bits to double.
553 * @param __b The input bits.
554 * @return The resulting double.
557 public static native double longBitsToDouble(long __b
);
560 * Packs the given two integers to a long value.
562 * @param __lo The low value.
563 * @param __hi The high value.
564 * @return The long value.
568 public static native long longPack(int __lo
, int __hi
);
571 * Unpack high value from long.
573 * @param __v The long value.
574 * @return The unpacked fragment.
578 public static native int longUnpackHigh(long __v
);
581 * Unpack low value from long.
583 * @param __v The long value.
584 * @return The unpacked fragment.
588 public static native int longUnpackLow(long __v
);
591 * Reads the given value from the memory handle.
593 * @param __mh The handle to read from.
594 * @param __off The offset into the handle.
595 * @return The value that was read.
598 public static native int memHandleReadByte(Object __mh
, int __off
);
601 * Reads the given value from the memory handle.
603 * @param __mh The handle to read from.
604 * @param __off The offset into the handle.
605 * @return The value that was read.
608 public static native int memHandleReadByte(int __mh
, int __off
);
611 * Reads the given value from the memory handle.
613 * @param __mh The handle to read from.
614 * @param __off The offset into the handle.
615 * @return The value that was read.
618 public static native double memHandleReadDouble(Object __mh
, int __off
);
621 * Reads the given value from the memory handle.
623 * @param __mh The handle to read from.
624 * @param __off The offset into the handle.
625 * @return The value that was read.
628 public static native double memHandleReadDouble(int __mh
, int __off
);
631 * Reads the given value from the memory handle.
633 * @param __mh The handle to read from.
634 * @param __off The offset into the handle.
635 * @return The value that was read.
638 public static native float memHandleReadFloat(Object __mh
, int __off
);
641 * Reads the given value from the memory handle.
643 * @param __mh The handle to read from.
644 * @param __off The offset into the handle.
645 * @return The value that was read.
648 public static native float memHandleReadFloat(int __mh
, int __off
);
651 * Reads the given value from the memory handle.
653 * @param __mh The handle to read from.
654 * @param __off The offset into the handle.
655 * @return The value that was read.
658 public static native int memHandleReadInt(Object __mh
, int __off
);
661 * Reads the given value from the memory handle.
663 * @param __mh The handle to read from.
664 * @param __off The offset into the handle.
665 * @return The value that was read.
668 public static native int memHandleReadInt(int __mh
, int __off
);
671 * Reads the given value from the memory handle.
673 * @param __mh The handle to read from.
674 * @param __off The offset into the handle.
675 * @return The value that was read.
678 public static native long memHandleReadLong(Object __mh
, int __off
);
681 * Reads the given value from the memory handle.
683 * @param __mh The handle to read from.
684 * @param __off The offset into the handle.
685 * @return The value that was read.
688 public static native long memHandleReadLong(int __mh
, int __off
);
691 * Reads the given value from the memory handle.
693 * @param __mh The handle to read from.
694 * @param __off The offset into the handle.
695 * @return The value that was read.
698 public static native Object
memHandleReadObject(Object __mh
, int __off
);
701 * Reads the given value from the memory handle.
703 * @param __mh The handle to read from.
704 * @param __off The offset into the handle.
705 * @return The value that was read.
708 public static native Object
memHandleReadObject(int __mh
, int __off
);
711 * Reads the given value from the memory handle.
713 * @param __mh The handle to read from.
714 * @param __off The offset into the handle.
715 * @return The value that was read.
718 public static native int memHandleReadShort(Object __mh
, int __off
);
721 * Reads the given value from the memory handle.
723 * @param __mh The handle to read from.
724 * @param __off The offset into the handle.
725 * @return The value that was read.
728 public static native int memHandleReadShort(int __mh
, int __off
);
731 * Writes the given value to the memory handle.
733 * @param __mh The handle to write to.
734 * @param __off The offset into the handle.
735 * @param __v The value to write.
738 public static native void memHandleWriteByte(Object __mh
, int __off
,
742 * Writes the given value to the memory handle.
744 * @param __mh The handle to write to.
745 * @param __off The offset into the handle.
746 * @param __v The value to write.
749 public static native void memHandleWriteByte(int __mh
, int __off
,
753 * Writes the given value to the memory handle.
755 * @param __mh The handle to write to.
756 * @param __off The offset into the handle.
757 * @param __v The value to write.
760 public static native void memHandleWriteCharacter(Object __mh
, int __off
,
764 * Writes the given value to the memory handle.
766 * @param __mh The handle to write to.
767 * @param __off The offset into the handle.
768 * @param __v The value to write.
771 public static native void memHandleWriteCharacter(int __mh
, int __off
,
775 * Writes the given value to the memory handle.
777 * @param __mh The handle to write to.
778 * @param __off The offset into the handle.
779 * @param __v The value to write.
782 public static native void memHandleWriteDouble(Object __mh
, int __off
,
786 * Writes the given value to the memory handle.
788 * @param __mh The handle to write to.
789 * @param __off The offset into the handle.
790 * @param __v The value to write.
793 public static native void memHandleWriteDouble(int __mh
, int __off
,
797 * Writes the given value to the memory handle.
799 * @param __mh The handle to write to.
800 * @param __off The offset into the handle.
801 * @param __v The value to write.
804 public static native void memHandleWriteFloat(Object __mh
, int __off
,
808 * Writes the given value to the memory handle.
810 * @param __mh The handle to write to.
811 * @param __off The offset into the handle.
812 * @param __v The value to write.
815 public static native void memHandleWriteFloat(int __mh
, int __off
,
819 * Writes the given value to the memory handle.
821 * @param __mh The handle to write to.
822 * @param __off The offset into the handle.
823 * @param __v The value to write.
826 public static native void memHandleWriteInt(Object __mh
, int __off
,
830 * Writes the given value to the memory handle.
832 * @param __mh The handle to write to.
833 * @param __off The offset into the handle.
834 * @param __v The value to write.
837 public static native void memHandleWriteInt(int __mh
, int __off
,
841 * Writes the given value to the memory handle.
843 * @param __mh The handle to write to.
844 * @param __off The offset into the handle.
845 * @param __v The value to write.
848 public static native void memHandleWriteLong(Object __mh
, int __off
,
852 * Writes the given value to the memory handle.
854 * @param __mh The handle to write to.
855 * @param __off The offset into the handle.
856 * @param __v The value to write.
859 public static native void memHandleWriteLong(int __mh
, int __off
,
863 * Writes the given value to the memory handle.
865 * @param __mh The handle to write to.
866 * @param __off The offset into the handle.
867 * @param __v The value to write.
870 public static native void memHandleWriteObject(Object __mh
, int __off
,
874 * Writes the given value to the memory handle.
876 * @param __mh The handle to write to.
877 * @param __off The offset into the handle.
878 * @param __v The value to write.
881 public static native void memHandleWriteObject(int __mh
, int __off
,
885 * Writes the given value to the memory handle.
887 * @param __mh The handle to write to.
888 * @param __off The offset into the handle.
889 * @param __v The value to write.
892 public static native void memHandleWriteShort(Object __mh
, int __off
,
896 * Writes the given value to the memory handle.
898 * @param __mh The handle to write to.
899 * @param __off The offset into the handle.
900 * @param __v The value to write.
903 public static native void memHandleWriteShort(int __mh
, int __off
,
907 * Reads byte from address.
909 * @param __p The pointer.
910 * @param __o The offset.
911 * @return The result of the read.
914 public static native int memReadByte(long __p
, int __o
);
917 * Reads character from address.
919 * @param __p The pointer.
920 * @param __o The offset.
921 * @return The result of the read.
924 public static native char memReadCharacter(long __p
, int __o
);
927 * Reads double from address.
929 * @param __p The pointer.
930 * @param __o The offset.
931 * @return The result of the read.
934 public static native double memReadDouble(long __p
, int __o
);
937 * Reads float from address.
939 * @param __p The pointer.
940 * @param __o The offset.
941 * @return The result of the read.
944 public static native float memReadFloat(long __p
, int __o
);
947 * Reads integer from address.
949 * @param __p The pointer.
950 * @param __o The offset.
951 * @return The result of the read.
954 public static native int memReadInt(long __p
, int __o
);
957 * Reads long from address.
959 * @param __p The pointer.
960 * @param __o The offset.
961 * @return The result of the read.
964 public static native long memReadLong(long __p
, int __o
);
967 * Reads object from address.
969 * @param __p The pointer.
970 * @param __o The offset.
971 * @return The result of the read.
974 public static native Object
memReadObject(long __p
, int __o
);
977 * Reads short from address.
979 * @param __p The pointer.
980 * @param __o The offset.
981 * @return The result of the read.
984 public static native int memReadShort(long __p
, int __o
);
987 * Writes byte to address.
989 * @param __p The pointer.
990 * @param __o The offset.
991 * @param __v The value to write.
994 public static native void memWriteByte(long __p
, int __o
, int __v
);
997 * Writes double to address.
999 * @param __p The pointer.
1000 * @param __o The offset.
1001 * @param __v The value to write.
1004 public static native void memWriteDouble(long __p
, int __o
, double __v
);
1007 * Writes float to address.
1009 * @param __p The pointer.
1010 * @param __o The offset.
1011 * @param __v The value to write.
1014 public static native void memWriteFloat(long __p
, int __o
, double __v
);
1017 * Writes integer to address.
1019 * @param __p The pointer.
1020 * @param __o The offset.
1021 * @param __v The value to write.
1024 public static native void memWriteInt(long __p
, int __o
, int __v
);
1027 * Writes long to address.
1029 * @param __p The pointer.
1030 * @param __o The offset.
1031 * @param __v The value to write.
1034 public static native void memWriteLong(long __p
, int __o
, long __v
);
1037 * Writes object to address.
1039 * @param __p The pointer.
1040 * @param __o The offset.
1041 * @param __v The value to write.
1044 public static native void memWriteObject(long __p
, int __o
, Object __v
);
1047 * Writes short to address.
1049 * @param __p The pointer.
1050 * @param __o The offset.
1051 * @param __v The value to write.
1054 public static native void memWriteShort(long __p
, int __o
, int __v
);
1057 * Atomically decrements an object's monitor count.
1059 * @param __p The object to count.
1060 * @return The resulting value.
1063 public static native int monitorCountDecrementAndGetAtomic(long __p
);
1066 * Atomically decrements an object's monitor count.
1068 * @param __p The object to count.
1069 * @return The resulting value.
1072 public static native int monitorCountDecrementAndGetAtomic(Object __p
);
1075 * Atomically increments an object's monitor count.
1077 * @param __p The object to count.
1078 * @return The resulting value.
1081 public static native int monitorCountIncrementAndGetAtomic(long __p
);
1084 * Atomically increments an object's monitor count.
1086 * @param __p The object to count.
1087 * @return The resulting value.
1090 public static native int monitorCountIncrementAndGetAtomic(Object __p
);
1093 * Atomically reads the object's monitor count.
1095 * @param __p The object to read.
1096 * @return The current monitor count.
1099 public static native int monitorCountGetAtomic(long __p
);
1102 * Atomically reads the object's monitor count.
1104 * @param __p The object to read.
1105 * @return The current monitor count.
1108 public static native int monitorCountGetAtomic(Object __p
);
1111 * Atomically writes the object's monitor count.
1113 * @param __p The object to write.
1114 * @param __v The count to write.
1117 public static native void monitorCountSetAtomic(long __p
, int __v
);
1120 * Atomically writes the object's monitor count.
1122 * @param __p The object to write.
1123 * @param __v The count to write.
1126 public static native void monitorCountSetAtomic(Object __p
, int __v
);
1129 * Atomically compares the owner of the object's monitor and sets it,
1130 * returning the value before it was set (or was unchanged).
1132 * @param __p The object to potentially modify.
1133 * @param __comp The owner to compare against.
1134 * @param __set The owner to set to, if the comparison succeeds.
1135 * @return The owner that originally was set.
1138 public static native Thread
monitorOwnerCompareGetAndSetAtomic(
1139 long __p
, long __comp
, long __set
);
1142 * Atomically compares the owner of the object's monitor and sets it,
1143 * returning the value before it was set (or was unchanged).
1145 * @param __p The object to potentially modify.
1146 * @param __comp The owner to compare against.
1147 * @param __set The owner to set to, if the comparison succeeds.
1148 * @return The owner that originally was set.
1151 public static native Thread
monitorOwnerCompareGetAndSetAtomic(
1152 Object __p
, long __comp
, long __set
);
1155 * Atomically compares the owner of the object's monitor and sets it,
1156 * returning the value before it was set (or was unchanged).
1158 * @param __p The object to potentially modify.
1159 * @param __comp The owner to compare against.
1160 * @param __set The owner to set to, if the comparison succeeds.
1161 * @return The owner that originally was set.
1164 public static native Thread
monitorOwnerCompareGetAndSetAtomic(
1165 long __p
, Thread __comp
, Thread __set
);
1168 * Atomically compares the owner of the object's monitor and sets it,
1169 * returning the value before it was set (or was unchanged).
1171 * @param __p The object to potentially modify.
1172 * @param __comp The owner to compare against.
1173 * @param __set The owner to set to, if the comparison succeeds.
1174 * @return The owner that originally was set.
1177 public static native Thread
monitorOwnerCompareGetAndSetAtomic(
1178 Object __p
, Thread __comp
, Thread __set
);
1181 * Atomically compares the owner of the object's monitor and sets it,
1182 * returning the value before it was set (or was unchanged).
1184 * @param __p The object to potentially modify.
1185 * @param __comp The owner to compare against.
1186 * @param __set The owner to set to, if the comparison succeeds.
1187 * @return The owner that originally was set.
1190 public static native long monitorOwnerCompareGetAndSetAtomicPointer(
1191 long __p
, long __comp
, long __set
);
1194 * Atomically compares the owner of the object's monitor and sets it,
1195 * returning the value before it was set (or was unchanged).
1197 * @param __p The object to potentially modify.
1198 * @param __comp The owner to compare against.
1199 * @param __set The owner to set to, if the comparison succeeds.
1200 * @return The owner that originally was set.
1203 public static native long monitorOwnerCompareGetAndSetAtomicPointer(
1204 Object __p
, long __comp
, long __set
);
1207 * Atomically compares the owner of the object's monitor and sets it,
1208 * returning the value before it was set (or was unchanged).
1210 * @param __p The object to potentially modify.
1211 * @param __comp The owner to compare against.
1212 * @param __set The owner to set to, if the comparison succeeds.
1213 * @return The owner that originally was set.
1216 public static native long monitorOwnerCompareGetAndSetAtomicPointer(
1217 long __p
, Thread __comp
, Thread __set
);
1220 * Atomically compares the owner of the object's monitor and sets it,
1221 * returning the value before it was set (or was unchanged).
1223 * @param __p The object to potentially modify.
1224 * @param __comp The owner to compare against.
1225 * @param __set The owner to set to, if the comparison succeeds.
1226 * @return The owner that originally was set.
1229 public static native long monitorOwnerCompareGetAndSetAtomicPointer(
1230 Object __p
, Thread __comp
, Thread __set
);
1233 * Returns the owner of an object's monitor.
1235 * @param __p The object to get the owner from.
1236 * @return The owner of the object's monitor.
1239 public static native Thread
monitorOwnerGetAtomic(long __p
);
1242 * Returns the owner of an object's monitor.
1244 * @param __p The object to get the owner from.
1245 * @return The owner of the object's monitor.
1248 public static native Thread
monitorOwnerGetAtomic(Object __p
);
1251 * Returns the owner of an object's monitor.
1253 * @param __p The object to get the owner from.
1254 * @return The owner of the object's monitor.
1257 public static native long monitorOwnerGetPointerAtomic(long __p
);
1260 * Returns the owner of an object's monitor.
1262 * @param __p The object to get the owner from.
1263 * @return The owner of the object's monitor.
1266 public static native long monitorOwnerGetPointerAtomic(Object __p
);
1269 * Sets the owner of an object's monitor.
1271 * @param __p The object which will be set the new owner.
1272 * @param __t The owner to set.
1275 public static native void monitorOwnerSetAtomic(long __p
, long __t
);
1278 * Sets the owner of an object's monitor.
1280 * @param __p The object which will be set the new owner.
1281 * @param __t The owner to set.
1284 public static native void monitorOwnerSetAtomic(long __p
, Thread __t
);
1287 * Sets the owner of an object's monitor.
1289 * @param __p The object which will be set the new owner.
1290 * @param __t The owner to set.
1293 public static native void monitorOwnerSetAtomic(Object __p
, long __t
);
1296 * Sets the owner of an object's monitor.
1298 * @param __p The object which will be set the new owner.
1299 * @param __t The owner to set.
1302 public static native void monitorOwnerSetAtomic(Object __p
, Thread __t
);
1305 * Used to convert an object to a pointer.
1307 * @param __o The object.
1308 * @return The pointer of the object.
1311 public static native int objectToPointer(Object __o
);
1314 * Used to convert an object to a pointer, do use reference queing for it
1315 * so that if the object is a candidate for reference counting it will
1318 * @param __o The object.
1319 * @return The pointer of the object.
1322 public static native int objectToPointerRefQueue(Object __o
);
1325 * Generates a ping, similar to a breakpoint but not fatal.
1329 public static native void ping();
1332 * Converts a pointer to {@link TypeBracket}.
1334 * @param __p The pointer.
1335 * @return The object of the pointer.
1338 public static native TypeBracket
pointerToTypeBracket(int __p
);
1341 * Used to convert a pointer to an object.
1343 * @param __p The pointer.
1344 * @return The object of the pointer.
1347 public static native Object
pointerToObject(int __p
);
1350 * Loads a value from the constant pool at the given index.
1352 * @param __p The memory address of the pool to access.
1353 * @param __i The index to load.
1354 * @return The read value.
1357 public static native int poolLoad(int __p
, int __i
);
1360 * Loads a value from the constant pool at the given index.
1362 * @param __p The object representation of the pool to access.
1363 * @param __i The index to load.
1364 * @return The read value.
1367 public static native int poolLoad(Object __p
, int __i
);
1370 * Perform reference counting logic on object.
1372 * @param __p The object to count up.
1375 public static native void refCount(int __p
);
1378 * Perform reference counting logic on object.
1380 * @param __p The object to count up.
1383 public static native void refCount(Object __p
);
1386 * Get reference count of object.
1388 * @param __p The object to get the count for.
1389 * @return The reference count of the object.
1392 public static native int refGetCount(int __p
);
1395 * Get reference count of object.
1397 * @param __p The object to get the count for.
1398 * @return The reference count of the object.
1401 public static native int refGetCount(Object __p
);
1404 * Set reference count of object.
1406 * @param __p The object to set the count for.
1407 * @param __v The value to set.
1410 public static native void refSetCount(int __p
, int __v
);
1413 * Set reference count of object.
1415 * @param __p The object to set the count for.
1416 * @param __v The value to set.
1419 public static native void refSetCount(Object __p
, int __v
);
1422 * Perform reference uncounting logic on object.
1424 * @param __p The object to count down.
1427 public static native void refUncount(int __p
);
1430 * Perform reference uncounting logic on object.
1432 * @param __p The object to count down.
1435 public static native void refUncount(Object __p
);
1438 * Return from the current frame.
1442 public static native void returnFrame();
1445 * Returns from the current frame, returning the given value.
1447 * @param __v The value to return.
1450 public static native void returnFrame(int __v
);
1453 * Returns from the current frame, returning both values.
1455 * @param __h The high value.
1456 * @param __l The low value.
1459 public static native void returnFrame(int __h
, int __l
);
1462 * Returns from the current frame, returning a long value.
1464 * @param __v The value.
1467 public static native void returnFrameLong(long __v
);
1470 * Returns the exception register.
1472 * @return The exception register.
1475 public static native Object
specialGetExceptionRegister();
1478 * Returns the exception register.
1480 * @return The exception register.
1483 public static native Throwable
specialGetExceptionRegisterThrowable();
1486 * Returns the exception register.
1488 * @return The exception register.
1491 public static native long specialGetExceptionRegisterPointer();
1494 * Returns the value of the current pool register.
1496 * @return The value of the pool register.
1499 public static native Object
specialGetPoolRegister();
1502 * Returns the value of the current pool register.
1504 * @return The value of the pool register.
1507 public static native long specialGetPoolRegisterPointer();
1510 * Returns the value of the return register, for long return values this
1511 * is the first high register.
1513 * @return The value of the return register.
1516 public static native int specialGetReturnRegister();
1519 * Reads the long value from the return register, treating it as a long
1522 * @return The value of the return register.
1525 public static native long specialGetReturnRegisterLong();
1528 * Returns the register representing the current thread.
1530 * @return The current thread register.
1533 public static native Thread
specialGetThreadRegister();
1536 * Returns the register representing the current thread.
1538 * @return The current thread register.
1541 public static native long specialGetThreadRegisterPointer();
1544 * Sets the value of the exception register.
1546 * @param __v The value to use.
1549 public static native void specialSetExceptionRegister(long __v
);
1552 * Sets the value of the exception register.
1554 * @param __v The value to use.
1557 public static native void specialSetExceptionRegister(Object __v
);
1560 * Sets the value of the constant pool register.
1562 * @param __v The new value of the constant pool register.
1565 public static native void specialSetPoolRegister(long __v
);
1568 * Sets the value of the constant pool register.
1570 * @param __v The new value of the constant pool register.
1573 public static native void specialSetPoolRegister(Object __v
);
1576 * Sets the current thread pointer.
1578 * @param __v The value to use.
1581 public static native void specialSetThreadRegister(long __v
);
1584 * Sets the current thread pointer.
1586 * @param __v The value to use.
1589 public static native void specialSetThreadRegister(Thread __v
);