1 /* src/vm/javaobjects.hpp - functions to create and access Java objects
3 Copyright (C) 2008 Theobroma Systems Ltd.
5 This file is part of CACAO.
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2, or (at
10 your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #ifndef _JAVAOBJECTS_HPP
26 #define _JAVAOBJECTS_HPP
32 #include "mm/memory.h"
34 #include "native/llni.h"
38 #include "vm/global.h"
39 #include "vm/globals.hpp"
40 #include "vm/method.h"
46 * This class provides low-level functions to access Java object
49 * These functions do NOT take care about the GC critical section!
50 * Please use FieldAccess wherever possible.
52 class RawFieldAccess {
54 template<class T> static inline T raw_get(void* address, const off_t offset);
55 template<class T> static inline void raw_set(void* address, const off_t offset, T value);
59 template<class T> inline T RawFieldAccess::raw_get(void* address, const off_t offset)
61 T* p = (T*) (((uintptr_t) address) + offset);
66 template<class T> inline void RawFieldAccess::raw_set(void* address, const off_t offset, T value)
68 T* p = (T*) (((uintptr_t) address) + offset);
74 * This classes provides functions to access Java object instance
75 * fields. These functions enter a critical GC section before
76 * accessing the Java object throught the handle and leave it
79 class FieldAccess : private RawFieldAccess {
81 template<class T> static inline T get(java_handle_t* h, const off_t offset);
82 template<class T> static inline void set(java_handle_t* h, const off_t offset, T value);
85 template<class T> inline T FieldAccess::get(java_handle_t* h, const off_t offset)
90 // XXX Move this to a GC inline function, e.g.
91 // gc->enter_critical();
94 // XXX This should be _handle->get_object();
97 result = raw_get<T>(o, offset);
99 // XXX Move this to a GC inline function.
100 // gc->leave_critical();
106 template<> inline java_handle_t* FieldAccess::get(java_handle_t* h, const off_t offset)
109 java_object_t* result;
110 java_handle_t* hresult;
112 // XXX Move this to a GC inline function, e.g.
113 // gc->enter_critical();
116 // XXX This should be _handle->get_object();
119 result = raw_get<java_object_t*>(o, offset);
121 hresult = LLNI_WRAP(result);
123 // XXX Move this to a GC inline function.
124 // gc->leave_critical();
131 template<class T> inline void FieldAccess::set(java_handle_t* h, const off_t offset, T value)
135 // XXX Move this to a GC inline function, e.g.
136 // gc->enter_critical();
139 // XXX This should be h->get_object();
142 raw_set(o, offset, value);
144 // XXX Move this to a GC inline function.
145 // gc->leave_critical();
149 template<> inline void FieldAccess::set<java_handle_t*>(java_handle_t* h, const off_t offset, java_handle_t* value)
152 java_object_t* ovalue;
154 // XXX Move this to a GC inline function, e.g.
155 // gc->enter_critical();
158 // XXX This should be h->get_object();
160 ovalue = LLNI_UNWRAP(value);
162 raw_set(o, offset, ovalue);
164 // XXX Move this to a GC inline function.
165 // gc->leave_critical();
177 class java_lang_Object {
179 // Handle of Java object.
180 java_handle_t* _handle;
183 java_lang_Object() : _handle(NULL) {}
184 java_lang_Object(java_handle_t* h) : _handle(h) {}
185 java_lang_Object(jobject h) : _handle((java_handle_t*) h) {}
189 virtual inline java_handle_t* get_handle() const { return _handle; }
190 inline vftbl_t* get_vftbl () const;
191 inline classinfo* get_Class () const;
193 inline bool is_null () const;
194 inline bool is_non_null() const;
198 inline vftbl_t* java_lang_Object::get_vftbl() const
200 // XXX Move this to a GC inline function, e.g.
201 // gc->enter_critical();
204 // XXX This should be h->get_object();
205 java_object_t* o = LLNI_UNWRAP(_handle);
206 vftbl_t* vftbl = o->vftbl;
208 // XXX Move this to a GC inline function.
209 // gc->leave_critical();
215 inline classinfo* java_lang_Object::get_Class() const
217 return get_vftbl()->clazz;
221 inline bool java_lang_Object::is_null() const
223 return (_handle == NULL);
226 inline bool java_lang_Object::is_non_null() const
228 return (_handle != NULL);
240 class java_lang_Boolean : public java_lang_Object, private FieldAccess {
242 // Static offsets of the object's instance fields.
243 // TODO These offsets need to be checked on VM startup.
244 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
247 java_lang_Boolean(java_handle_t* h) : java_lang_Object(h) {}
249 inline uint8_t get_value();
250 inline void set_value(uint8_t value);
253 inline uint8_t java_lang_Boolean::get_value()
255 return get<int32_t>(_handle, offset_value);
258 inline void java_lang_Boolean::set_value(uint8_t value)
260 set(_handle, offset_value, (uint32_t) value);
272 class java_lang_Byte : public java_lang_Object, private FieldAccess {
274 // Static offsets of the object's instance fields.
275 // TODO These offsets need to be checked on VM startup.
276 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
279 java_lang_Byte(java_handle_t* h) : java_lang_Object(h) {}
281 inline int8_t get_value();
282 inline void set_value(int8_t value);
285 inline int8_t java_lang_Byte::get_value()
287 return get<int32_t>(_handle, offset_value);
290 inline void java_lang_Byte::set_value(int8_t value)
292 set(_handle, offset_value, (int32_t) value);
297 * java/lang/Character
304 class java_lang_Character : public java_lang_Object, private FieldAccess {
306 // Static offsets of the object's instance fields.
307 // TODO These offsets need to be checked on VM startup.
308 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
311 java_lang_Character(java_handle_t* h) : java_lang_Object(h) {}
313 inline uint16_t get_value();
314 inline void set_value(uint16_t value);
317 inline uint16_t java_lang_Character::get_value()
319 return get<int32_t>(_handle, offset_value);
322 inline void java_lang_Character::set_value(uint16_t value)
324 set(_handle, offset_value, (uint32_t) value);
336 class java_lang_Short : public java_lang_Object, private FieldAccess {
338 // Static offsets of the object's instance fields.
339 // TODO These offsets need to be checked on VM startup.
340 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
343 java_lang_Short(java_handle_t* h) : java_lang_Object(h) {}
345 inline int16_t get_value();
346 inline void set_value(int16_t value);
349 inline int16_t java_lang_Short::get_value()
351 return get<int32_t>(_handle, offset_value);
354 inline void java_lang_Short::set_value(int16_t value)
356 set(_handle, offset_value, (int32_t) value);
368 class java_lang_Integer : public java_lang_Object, private FieldAccess {
370 // Static offsets of the object's instance fields.
371 // TODO These offsets need to be checked on VM startup.
372 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
375 java_lang_Integer(java_handle_t* h) : java_lang_Object(h) {}
377 inline int32_t get_value();
378 inline void set_value(int32_t value);
381 inline int32_t java_lang_Integer::get_value()
383 return get<int32_t>(_handle, offset_value);
386 inline void java_lang_Integer::set_value(int32_t value)
388 set(_handle, offset_value, value);
400 class java_lang_Long : public java_lang_Object, private FieldAccess {
402 // Static offsets of the object's instance fields.
403 // TODO These offsets need to be checked on VM startup.
404 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
407 java_lang_Long(java_handle_t* h) : java_lang_Object(h) {}
409 inline int64_t get_value();
410 inline void set_value(int64_t value);
413 inline int64_t java_lang_Long::get_value()
415 return get<int64_t>(_handle, offset_value);
418 inline void java_lang_Long::set_value(int64_t value)
420 set(_handle, offset_value, value);
432 class java_lang_Float : public java_lang_Object, private FieldAccess {
434 // Static offsets of the object's instance fields.
435 // TODO These offsets need to be checked on VM startup.
436 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(float));
439 java_lang_Float(java_handle_t* h) : java_lang_Object(h) {}
441 inline float get_value();
442 inline void set_value(float value);
445 inline float java_lang_Float::get_value()
447 return get<float>(_handle, offset_value);
450 inline void java_lang_Float::set_value(float value)
452 set(_handle, offset_value, value);
464 class java_lang_Double : public java_lang_Object, private FieldAccess {
466 // Static offsets of the object's instance fields.
467 // TODO These offsets need to be checked on VM startup.
468 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(double));
471 java_lang_Double(java_handle_t* h) : java_lang_Object(h) {}
473 inline double get_value();
474 inline void set_value(double value);
477 inline double java_lang_Double::get_value()
479 return get<double>(_handle, offset_value);
482 inline void java_lang_Double::set_value(double value)
484 set(_handle, offset_value, value);
488 #if defined(ENABLE_JAVASE)
490 # if defined(ENABLE_ANNOTATIONS)
492 * OpenJDK sun/reflect/ConstantPool
497 * 1. java.lang.Object constantPoolOop;
499 class sun_reflect_ConstantPool : public java_lang_Object, private FieldAccess {
501 // Static offsets of the object's instance fields.
502 // TODO These offsets need to be checked on VM startup.
503 static const off_t offset_constantPoolOop = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
506 sun_reflect_ConstantPool(java_handle_t* h) : java_lang_Object(h) {}
507 sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop);
510 inline void set_constantPoolOop(classinfo* value);
511 inline void set_constantPoolOop(jclass value);
515 inline sun_reflect_ConstantPool::sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop) : java_lang_Object(h)
517 set_constantPoolOop(constantPoolOop);
521 inline void sun_reflect_ConstantPool::set_constantPoolOop(classinfo* value)
523 set(_handle, offset_constantPoolOop, value);
526 inline void sun_reflect_ConstantPool::set_constantPoolOop(jclass value)
528 // XXX jclass is a boxed object.
529 set_constantPoolOop(LLNI_classinfo_unwrap(value));
531 # endif // ENABLE_ANNOTATIONS
533 #endif // ENABLE_JAVASE
536 #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
539 * GNU Classpath java/lang/Class
544 * 1. java.lang.Object[] signers;
545 * 2. java.security.ProtectionDomain pd;
546 * 3. java.lang.Object vmdata;
547 * 4. java.lang.reflect.Constructor constructor;
549 class java_lang_Class : public java_lang_Object, private FieldAccess {
551 // Static offsets of the object's instance fields.
552 // TODO These offsets need to be checked on VM startup.
553 static const off_t offset_signers = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
554 static const off_t offset_pd = MEMORY_ALIGN(offset_signers + SIZEOF_VOID_P, SIZEOF_VOID_P);
555 static const off_t offset_vmdata = MEMORY_ALIGN(offset_pd + SIZEOF_VOID_P, SIZEOF_VOID_P);
556 static const off_t offset_constructor = MEMORY_ALIGN(offset_vmdata + SIZEOF_VOID_P, SIZEOF_VOID_P);
559 java_lang_Class(java_handle_t* h) : java_lang_Object(h) {}
562 inline void set_pd(java_handle_t* value);
563 inline void set_pd(jobject value);
566 inline void java_lang_Class::set_pd(java_handle_t* value)
568 set(_handle, offset_pd, value);
571 inline void java_lang_Class::set_pd(jobject value)
573 set_pd((java_handle_t*) value);
578 * GNU Classpath java/lang/StackTraceElement
583 * 1. java.lang.String fileName;
585 * 3. java.lang.String declaringClass;
586 * 4. java.lang.String methodName;
587 * 5. boolean isNative;
589 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
591 // Static offsets of the object's instance fields.
592 // TODO These offsets need to be checked on VM startup.
593 static const off_t offset_fileName = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
594 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
595 static const off_t offset_declaringClass = MEMORY_ALIGN(offset_lineNumber + sizeof(int32_t), SIZEOF_VOID_P);
596 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
597 static const off_t offset_isNative = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
600 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
601 java_lang_StackTraceElement(java_handle_t* h, java_handle_t* fileName, int32_t lineNumber, java_handle_t* declaringClass, java_handle_t* methodName, uint8_t isNative);
604 inline java_lang_StackTraceElement::java_lang_StackTraceElement(java_handle_t* h, java_handle_t* fileName, int32_t lineNumber, java_handle_t* declaringClass, java_handle_t* methodName, uint8_t isNative) : java_lang_Object(h)
606 java_lang_StackTraceElement((java_handle_t*) h);
608 set(_handle, offset_fileName, fileName);
609 set(_handle, offset_lineNumber, lineNumber);
610 set(_handle, offset_declaringClass, declaringClass);
611 set(_handle, offset_methodName, methodName);
612 set(_handle, offset_isNative, isNative);
617 * GNU Classpath java/lang/String
624 * 3. int cachedHashCode;
627 class java_lang_String : public java_lang_Object, private FieldAccess {
629 // Static offsets of the object's instance fields.
630 // TODO These offsets need to be checked on VM startup.
631 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
632 static const off_t offset_count = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
633 static const off_t offset_cachedHashCode = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
634 static const off_t offset_offset = MEMORY_ALIGN(offset_cachedHashCode + sizeof(int32_t), sizeof(int32_t));
637 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
638 java_lang_String(jstring h);
639 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
642 inline java_handle_chararray_t* get_value () const;
643 inline int32_t get_count () const;
644 inline int32_t get_offset() const;
647 inline void set_value (java_handle_chararray_t* value);
648 inline void set_count (int32_t value);
649 inline void set_offset(int32_t value);
652 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
654 java_lang_String((java_handle_t*) h);
657 inline java_lang_String::java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset) : java_lang_Object(h)
664 inline java_handle_chararray_t* java_lang_String::get_value() const
666 return get<java_handle_chararray_t*>(_handle, offset_value);
669 inline int32_t java_lang_String::get_count() const
671 return get<int32_t>(_handle, offset_count);
674 inline int32_t java_lang_String::get_offset() const
676 return get<int32_t>(_handle, offset_offset);
679 inline void java_lang_String::set_value(java_handle_chararray_t* value)
681 set(_handle, offset_value, value);
684 inline void java_lang_String::set_count(int32_t value)
686 set(_handle, offset_count, value);
689 inline void java_lang_String::set_offset(int32_t value)
691 set(_handle, offset_offset, value);
696 * GNU Classpath java/lang/Thread
701 * 1. java.lang.VMThread vmThread;
702 * 2. java.lang.ThreadGroup group;
703 * 3. java.lang.Runnable runnable;
704 * 4. java.lang.String name;
708 * 8. java.lang.Throwable stillborn;
709 * 9. java.lang.ClassLoader contextClassLoader;
710 * 10. boolean contextClassLoaderIsSystemClassLoader;
712 * 12. java.lang.Object parkBlocker;
713 * 13. gnu.java.util.WeakIdentityHashMap locals;
714 * 14. java_lang_Thread_UncaughtExceptionHandler exceptionHandler;
716 class java_lang_Thread : public java_lang_Object, private FieldAccess {
718 // Static offsets of the object's instance fields.
719 // TODO These offsets need to be checked on VM startup.
720 static const off_t offset_vmThread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
721 static const off_t offset_group = MEMORY_ALIGN(offset_vmThread + SIZEOF_VOID_P, SIZEOF_VOID_P);
722 static const off_t offset_runnable = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
723 static const off_t offset_name = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
724 static const off_t offset_daemon = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
725 static const off_t offset_priority = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
726 static const off_t offset_stacksize = MEMORY_ALIGN(offset_priority + sizeof(int32_t), sizeof(int64_t));
727 static const off_t offset_stillborn = MEMORY_ALIGN(offset_stacksize + sizeof(int64_t), SIZEOF_VOID_P);
728 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_stillborn + SIZEOF_VOID_P, SIZEOF_VOID_P);
729 static const off_t offset_contextClassLoaderIsSystemClassLoader = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
730 static const off_t offset_threadId = MEMORY_ALIGN(offset_contextClassLoaderIsSystemClassLoader + sizeof(int32_t), sizeof(int64_t));
731 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadId + sizeof(int64_t), SIZEOF_VOID_P);
732 static const off_t offset_locals = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
733 static const off_t offset_exceptionHandler = MEMORY_ALIGN(offset_locals + SIZEOF_VOID_P, SIZEOF_VOID_P);
736 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
737 // java_lang_Thread(threadobject* t);
740 inline java_handle_t* get_vmThread () const;
741 inline java_handle_t* get_group () const;
742 inline java_handle_t* get_name () const;
743 inline int32_t get_daemon () const;
744 inline int32_t get_priority () const;
745 inline java_handle_t* get_exceptionHandler() const;
748 inline void set_group(java_handle_t* value);
752 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
754 // java_lang_Thread(thread_get_object(t));
758 inline java_handle_t* java_lang_Thread::get_vmThread() const
760 return get<java_handle_t*>(_handle, offset_vmThread);
763 inline java_handle_t* java_lang_Thread::get_group() const
765 return get<java_handle_t*>(_handle, offset_group);
768 inline java_handle_t* java_lang_Thread::get_name() const
770 return get<java_handle_t*>(_handle, offset_name);
773 inline int32_t java_lang_Thread::get_daemon() const
775 return get<int32_t>(_handle, offset_daemon);
778 inline int32_t java_lang_Thread::get_priority() const
780 return get<int32_t>(_handle, offset_priority);
783 inline java_handle_t* java_lang_Thread::get_exceptionHandler() const
785 return get<java_handle_t*>(_handle, offset_exceptionHandler);
789 inline void java_lang_Thread::set_group(java_handle_t* value)
791 set(_handle, offset_group, value);
796 * GNU Classpath java/lang/VMThread
801 * 1. java.lang.Thread thread;
802 * 2. boolean running;
803 * 3. java.lang.VMThread vmdata;
805 class java_lang_VMThread : public java_lang_Object, private FieldAccess {
807 // Static offsets of the object's instance fields.
808 // TODO These offsets need to be checked on VM startup.
809 static const off_t offset_thread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
810 static const off_t offset_running = MEMORY_ALIGN(offset_thread + SIZEOF_VOID_P, sizeof(int32_t));
811 static const off_t offset_vmdata = MEMORY_ALIGN(offset_running + sizeof(int32_t), SIZEOF_VOID_P);
814 java_lang_VMThread(java_handle_t* h) : java_lang_Object(h) {}
815 java_lang_VMThread(jobject h);
816 java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata);
819 inline java_handle_t* get_thread() const;
820 inline threadobject* get_vmdata() const;
823 inline void set_thread(java_handle_t* value);
824 inline void set_vmdata(threadobject* value);
828 inline java_lang_VMThread::java_lang_VMThread(jobject h) : java_lang_Object(h)
830 java_lang_VMThread((java_handle_t*) h);
833 inline java_lang_VMThread::java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata) : java_lang_Object(h)
840 inline java_handle_t* java_lang_VMThread::get_thread() const
842 return get<java_handle_t*>(_handle, offset_thread);
845 inline threadobject* java_lang_VMThread::get_vmdata() const
847 return get<threadobject*>(_handle, offset_vmdata);
851 inline void java_lang_VMThread::set_thread(java_handle_t* value)
853 set(_handle, offset_thread, value);
856 inline void java_lang_VMThread::set_vmdata(threadobject* value)
858 set(_handle, offset_vmdata, value);
863 * GNU Classpath java/lang/Throwable
868 * 1. java.lang.String detailMessage;
869 * 2. java.lang.Throwable cause;
870 * 3. java.lang.StackTraceElement[] stackTrace;
871 * 4. java.lang.VMThrowable vmState;
873 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
875 // Static offsets of the object's instance fields.
876 // TODO These offsets need to be checked on VM startup.
877 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
878 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
879 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
880 static const off_t offset_vmState = MEMORY_ALIGN(offset_stackTrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
883 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
886 inline java_handle_t* get_detailMessage() const;
887 inline java_handle_t* get_cause () const;
888 inline java_handle_t* get_vmState () const;
892 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
894 return get<java_handle_t*>(_handle, offset_detailMessage);
897 inline java_handle_t* java_lang_Throwable::get_cause() const
899 return get<java_handle_t*>(_handle, offset_cause);
902 inline java_handle_t* java_lang_Throwable::get_vmState() const
904 return get<java_handle_t*>(_handle, offset_vmState);
909 * GNU Classpath java/lang/VMThrowable
914 * 1. java.lang.Object vmdata;
916 class java_lang_VMThrowable : public java_lang_Object, private FieldAccess {
918 // Static offsets of the object's instance fields.
919 // TODO These offsets need to be checked on VM startup.
920 static const off_t offset_vmdata = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
923 java_lang_VMThrowable(java_handle_t* h) : java_lang_Object(h) {}
924 java_lang_VMThrowable(jobject h);
926 inline java_handle_bytearray_t* get_vmdata() const;
927 inline void set_vmdata(java_handle_bytearray_t* value);
930 inline java_lang_VMThrowable::java_lang_VMThrowable(jobject h) : java_lang_Object(h)
932 java_lang_VMThrowable((java_handle_t*) h);
935 inline java_handle_bytearray_t* java_lang_VMThrowable::get_vmdata() const
937 return get<java_handle_bytearray_t*>(_handle, offset_vmdata);
940 inline void java_lang_VMThrowable::set_vmdata(java_handle_bytearray_t* value)
942 set(_handle, offset_vmdata, value);
947 * GNU Classpath java/lang/reflect/VMConstructor
952 * 1. java.lang.Class clazz;
954 * 3. byte[] annotations;
955 * 4. byte[] parameterAnnotations;
956 * 5. java.util.Map declaredAnnotations;
957 * 6. java.lang.reflect.Constructor cons;
959 class java_lang_reflect_VMConstructor : public java_lang_Object, private FieldAccess {
961 // Static offsets of the object's instance fields.
962 // TODO These offsets need to be checked on VM startup.
963 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
964 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
965 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
966 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
967 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
968 static const off_t offset_cons = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
971 java_lang_reflect_VMConstructor(java_handle_t* h) : java_lang_Object(h) {}
972 java_lang_reflect_VMConstructor(jobject h);
973 java_lang_reflect_VMConstructor(methodinfo* m);
976 inline classinfo* get_clazz () const;
977 inline int32_t get_slot () const;
978 inline java_handle_bytearray_t* get_annotations () const;
979 inline java_handle_bytearray_t* get_parameterAnnotations() const;
980 inline java_handle_t* get_declaredAnnotations () const;
981 inline java_handle_t* get_cons () const;
984 inline void set_clazz (classinfo* value);
985 inline void set_slot (int32_t value);
986 inline void set_annotations (java_handle_bytearray_t* value);
987 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
988 inline void set_declaredAnnotations (java_handle_t* value);
989 inline void set_cons (java_handle_t* value);
991 // Convenience functions.
992 inline methodinfo* get_method();
996 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(jobject h) : java_lang_Object(h)
998 java_lang_reflect_VMConstructor((java_handle_t*) h);
1001 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(methodinfo* m)
1003 _handle = builtin_new(class_java_lang_reflect_VMConstructor);
1008 int slot = m - m->clazz->methods;
1009 java_handle_bytearray_t* annotations = method_get_annotations(m);
1010 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1012 set_clazz(m->clazz);
1014 set_annotations(annotations);
1015 set_parameterAnnotations(parameterAnnotations);
1019 inline classinfo* java_lang_reflect_VMConstructor::get_clazz() const
1021 return get<classinfo*>(_handle, offset_clazz);
1024 inline int32_t java_lang_reflect_VMConstructor::get_slot() const
1026 return get<int32_t>(_handle, offset_slot);
1029 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_annotations() const
1031 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1034 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_parameterAnnotations() const
1036 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1039 inline java_handle_t* java_lang_reflect_VMConstructor::get_declaredAnnotations() const
1041 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1044 inline java_handle_t* java_lang_reflect_VMConstructor::get_cons() const
1046 return get<java_handle_t*>(_handle, offset_cons);
1049 inline void java_lang_reflect_VMConstructor::set_clazz(classinfo* value)
1051 set(_handle, offset_clazz, value);
1054 inline void java_lang_reflect_VMConstructor::set_slot(int32_t value)
1056 set(_handle, offset_slot, value);
1059 inline void java_lang_reflect_VMConstructor::set_annotations(java_handle_bytearray_t* value)
1061 set(_handle, offset_annotations, value);
1064 inline void java_lang_reflect_VMConstructor::set_parameterAnnotations(java_handle_bytearray_t* value)
1066 set(_handle, offset_parameterAnnotations, value);
1069 inline void java_lang_reflect_VMConstructor::set_declaredAnnotations(java_handle_t* value)
1071 set(_handle, offset_declaredAnnotations, value);
1074 inline void java_lang_reflect_VMConstructor::set_cons(java_handle_t* value)
1076 set(_handle, offset_cons, value);
1079 inline methodinfo* java_lang_reflect_VMConstructor::get_method()
1081 classinfo* c = get_clazz();
1082 int32_t slot = get_slot();
1083 methodinfo* m = &(c->methods[slot]);
1089 * GNU Classpath java/lang/reflect/Constructor
1095 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1096 * 3. java.lang.reflect.VMConstructor cons;
1098 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
1100 // Static offsets of the object's instance fields.
1101 // TODO These offsets need to be checked on VM startup.
1102 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1103 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1104 static const off_t offset_cons = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1107 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
1108 java_lang_reflect_Constructor(jobject h);
1109 java_lang_reflect_Constructor(methodinfo* m);
1111 java_handle_t* new_instance(java_handle_objectarray_t* args);
1114 inline int32_t get_flag() const;
1115 inline java_handle_t* get_cons() const;
1118 inline void set_cons(java_handle_t* value);
1120 // Convenience functions.
1121 inline methodinfo* get_method () const;
1122 inline int32_t get_override() const;
1126 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
1128 java_lang_reflect_Constructor((java_handle_t*) h);
1131 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
1133 java_lang_reflect_VMConstructor jlrvmc(m);
1135 if (jlrvmc.is_null())
1138 _handle = builtin_new(class_java_lang_reflect_Constructor);
1143 // Link the two Java objects.
1144 set_cons(jlrvmc.get_handle());
1145 jlrvmc.set_cons(get_handle());
1149 inline int32_t java_lang_reflect_Constructor::get_flag() const
1151 return get<int32_t>(_handle, offset_flag);
1154 inline java_handle_t* java_lang_reflect_Constructor::get_cons() const
1156 return get<java_handle_t*>(_handle, offset_cons);
1160 inline void java_lang_reflect_Constructor::set_cons(java_handle_t* value)
1162 set(_handle, offset_cons, value);
1166 inline methodinfo* java_lang_reflect_Constructor::get_method() const
1168 java_lang_reflect_VMConstructor jlrvmc(get_cons());
1169 return jlrvmc.get_method();
1172 inline int32_t java_lang_reflect_Constructor::get_override() const
1179 * GNU Classpath java/lang/reflect/VMField
1184 * 1. java.lang.Class clazz;
1185 * 2. java.lang.String name;
1187 * 4. byte[] annotations;
1188 * 5. java.lang.Map declaredAnnotations;
1189 * 6. java.lang.reflect.Field f;
1191 class java_lang_reflect_VMField : public java_lang_Object, private FieldAccess {
1193 // Static offsets of the object's instance fields.
1194 // TODO These offsets need to be checked on VM startup.
1195 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1196 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1197 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1198 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1199 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1200 static const off_t offset_f = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1203 java_lang_reflect_VMField(java_handle_t* h) : java_lang_Object(h) {}
1204 java_lang_reflect_VMField(jobject h);
1205 java_lang_reflect_VMField(fieldinfo* f);
1208 inline classinfo* get_clazz () const;
1209 inline int32_t get_slot () const;
1210 inline java_handle_bytearray_t* get_annotations () const;
1211 inline java_handle_t* get_declaredAnnotations() const;
1212 inline java_handle_t* get_f () const;
1215 inline void set_clazz (classinfo* value);
1216 inline void set_name (java_handle_t* value);
1217 inline void set_slot (int32_t value);
1218 inline void set_annotations (java_handle_bytearray_t* value);
1219 inline void set_declaredAnnotations(java_handle_t* value);
1220 inline void set_f (java_handle_t* value);
1222 // Convenience functions.
1223 inline fieldinfo* get_field() const;
1227 inline java_lang_reflect_VMField::java_lang_reflect_VMField(jobject h) : java_lang_Object(h)
1229 java_lang_reflect_VMField((java_handle_t*) h);
1232 inline java_lang_reflect_VMField::java_lang_reflect_VMField(fieldinfo* f)
1234 _handle = builtin_new(class_java_lang_reflect_VMField);
1239 java_handle_t* name = javastring_intern(javastring_new(f->name));
1240 int slot = f - f->clazz->fields;
1241 java_handle_bytearray_t* annotations = field_get_annotations(f);
1243 set_clazz(f->clazz);
1246 set_annotations(annotations);
1250 inline classinfo* java_lang_reflect_VMField::get_clazz() const
1252 return get<classinfo*>(_handle, offset_clazz);
1255 inline int32_t java_lang_reflect_VMField::get_slot() const
1257 return get<int32_t>(_handle, offset_slot);
1260 inline java_handle_bytearray_t* java_lang_reflect_VMField::get_annotations() const
1262 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1265 inline java_handle_t* java_lang_reflect_VMField::get_declaredAnnotations() const
1267 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1270 inline java_handle_t* java_lang_reflect_VMField::get_f() const
1272 return get<java_handle_t*>(_handle, offset_f);
1276 inline void java_lang_reflect_VMField::set_clazz(classinfo* value)
1278 set(_handle, offset_clazz, value);
1281 inline void java_lang_reflect_VMField::set_name(java_handle_t* value)
1283 set(_handle, offset_name, value);
1286 inline void java_lang_reflect_VMField::set_slot(int32_t value)
1288 set(_handle, offset_slot, value);
1291 inline void java_lang_reflect_VMField::set_annotations(java_handle_bytearray_t* value)
1293 set(_handle, offset_annotations, value);
1296 inline void java_lang_reflect_VMField::set_declaredAnnotations(java_handle_t* value)
1298 set(_handle, offset_declaredAnnotations, value);
1301 inline void java_lang_reflect_VMField::set_f(java_handle_t* value)
1303 set(_handle, offset_f, value);
1306 inline fieldinfo* java_lang_reflect_VMField::get_field() const
1308 classinfo* c = get_clazz();
1309 int32_t slot = get_slot();
1310 fieldinfo* f = &(c->fields[slot]);
1316 * GNU Classpath java/lang/reflect/Field
1322 * 2. gnu.java.lang.reflect.FieldSignatureParser p;
1323 * 3. java.lang.reflect.VMField f;
1325 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
1327 // Static offsets of the object's instance fields.
1328 // TODO These offsets need to be checked on VM startup.
1329 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1330 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1331 static const off_t offset_f = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1334 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
1335 java_lang_reflect_Field(jobject h);
1336 java_lang_reflect_Field(fieldinfo* f);
1339 inline int32_t get_flag() const;
1340 inline java_handle_t* get_f() const;
1343 inline void set_f(java_handle_t* value);
1345 // Convenience functions.
1346 inline fieldinfo* get_field() const;
1350 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
1352 java_lang_reflect_Field((java_handle_t*) h);
1355 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
1357 java_lang_reflect_VMField jlrvmf(f);
1359 if (jlrvmf.is_null())
1362 _handle = builtin_new(class_java_lang_reflect_Field);
1367 // Link the two Java objects.
1368 set_f(jlrvmf.get_handle());
1369 jlrvmf.set_f(get_handle());
1373 inline int32_t java_lang_reflect_Field::get_flag() const
1375 return get<int32_t>(_handle, offset_flag);
1378 inline java_handle_t* java_lang_reflect_Field::get_f() const
1380 return get<java_handle_t*>(_handle, offset_f);
1384 inline void java_lang_reflect_Field::set_f(java_handle_t* value)
1386 set(_handle, offset_f, value);
1390 inline fieldinfo* java_lang_reflect_Field::get_field() const
1392 java_lang_reflect_VMField jlrvmf(get_f());
1393 return jlrvmf.get_field();
1398 * GNU Classpath java/lang/reflect/VMMethod
1403 * 1. java.lang.Class clazz;
1404 * 2. java.lang.String name;
1406 * 4. byte[] annotations;
1407 * 5. byte[] parameterAnnotations;
1408 * 6. byte[] annotationDefault;
1409 * 7. java.lang.Map declaredAnnotations;
1410 * 8. java.lang.reflect.Method m;
1412 class java_lang_reflect_VMMethod : public java_lang_Object, private FieldAccess {
1414 // Static offsets of the object's instance fields.
1415 // TODO These offsets need to be checked on VM startup.
1416 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1417 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1418 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1419 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1420 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1421 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1422 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
1423 static const off_t offset_m = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1426 java_lang_reflect_VMMethod(java_handle_t* h) : java_lang_Object(h) {}
1427 java_lang_reflect_VMMethod(jobject h);
1428 java_lang_reflect_VMMethod(methodinfo* m);
1431 inline classinfo* get_clazz () const;
1432 inline int32_t get_slot () const;
1433 inline java_handle_bytearray_t* get_annotations () const;
1434 inline java_handle_bytearray_t* get_parameterAnnotations() const;
1435 inline java_handle_bytearray_t* get_annotationDefault () const;
1436 inline java_handle_t* get_declaredAnnotations () const;
1437 inline java_handle_t* get_m () const;
1440 inline void set_clazz (classinfo* value);
1441 inline void set_name (java_handle_t* value);
1442 inline void set_slot (int32_t value);
1443 inline void set_annotations (java_handle_bytearray_t* value);
1444 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
1445 inline void set_annotationDefault (java_handle_bytearray_t* value);
1446 inline void set_declaredAnnotations (java_handle_t* value);
1447 inline void set_m (java_handle_t* value);
1449 // Convenience functions.
1450 inline methodinfo* get_method() const;
1453 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(jobject h) : java_lang_Object(h)
1455 java_lang_reflect_VMMethod((java_handle_t*) h);
1458 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(methodinfo* m)
1460 _handle = builtin_new(class_java_lang_reflect_VMMethod);
1465 java_handle_t* name = javastring_intern(javastring_new(m->name));
1466 int slot = m - m->clazz->methods;
1467 java_handle_bytearray_t* annotations = method_get_annotations(m);
1468 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1469 java_handle_bytearray_t* annotationDefault = method_get_annotationdefault(m);
1471 set_clazz(m->clazz);
1474 set_annotations(annotations);
1475 set_parameterAnnotations(parameterAnnotations);
1476 set_annotationDefault(annotationDefault);
1479 inline classinfo* java_lang_reflect_VMMethod::get_clazz() const
1481 return get<classinfo*>(_handle, offset_clazz);
1484 inline int32_t java_lang_reflect_VMMethod::get_slot() const
1486 return get<int32_t>(_handle, offset_slot);
1489 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotations() const
1491 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1494 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_parameterAnnotations() const
1496 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1499 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotationDefault() const
1501 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
1504 inline java_handle_t* java_lang_reflect_VMMethod::get_declaredAnnotations() const
1506 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1509 inline java_handle_t* java_lang_reflect_VMMethod::get_m() const
1511 return get<java_handle_t*>(_handle, offset_m);
1514 inline void java_lang_reflect_VMMethod::set_clazz(classinfo* value)
1516 set(_handle, offset_clazz, value);
1519 inline void java_lang_reflect_VMMethod::set_name(java_handle_t* value)
1521 set(_handle, offset_name, value);
1524 inline void java_lang_reflect_VMMethod::set_slot(int32_t value)
1526 set(_handle, offset_slot, value);
1529 inline void java_lang_reflect_VMMethod::set_annotations(java_handle_bytearray_t* value)
1531 set(_handle, offset_annotations, value);
1534 inline void java_lang_reflect_VMMethod::set_parameterAnnotations(java_handle_bytearray_t* value)
1536 set(_handle, offset_parameterAnnotations, value);
1539 inline void java_lang_reflect_VMMethod::set_annotationDefault(java_handle_bytearray_t* value)
1541 set(_handle, offset_annotationDefault, value);
1544 inline void java_lang_reflect_VMMethod::set_declaredAnnotations(java_handle_t* value)
1546 set(_handle, offset_declaredAnnotations, value);
1549 inline void java_lang_reflect_VMMethod::set_m(java_handle_t* value)
1551 set(_handle, offset_m, value);
1554 inline methodinfo* java_lang_reflect_VMMethod::get_method() const
1556 classinfo* c = get_clazz();
1557 int32_t slot = get_slot();
1558 methodinfo* m = &(c->methods[slot]);
1564 * GNU Classpath java/lang/reflect/Method
1570 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1571 * 3. java.lang.reflect.VMMethod m;
1573 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
1575 // Static offsets of the object's instance fields.
1576 // TODO These offsets need to be checked on VM startup.
1577 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1578 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1579 static const off_t offset_m = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1582 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
1583 java_lang_reflect_Method(jobject h);
1584 java_lang_reflect_Method(methodinfo* m);
1586 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
1589 inline int32_t get_flag() const;
1590 inline java_handle_t* get_m() const;
1593 inline void set_m(java_handle_t* value);
1595 // Convenience functions.
1596 inline methodinfo* get_method () const;
1597 inline int32_t get_override() const;
1601 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
1603 java_lang_reflect_Method((java_handle_t*) h);
1606 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
1608 java_lang_reflect_VMMethod jlrvmm(m);
1610 if (jlrvmm.is_null())
1613 _handle = builtin_new(class_java_lang_reflect_Method);
1618 // Link the two Java objects.
1619 set_m(jlrvmm.get_handle());
1620 jlrvmm.set_m(get_handle());
1624 inline int32_t java_lang_reflect_Method::get_flag() const
1626 return get<int32_t>(_handle, offset_flag);
1629 inline java_handle_t* java_lang_reflect_Method::get_m() const
1631 return get<java_handle_t*>(_handle, offset_m);
1635 inline void java_lang_reflect_Method::set_m(java_handle_t* value)
1637 set(_handle, offset_m, value);
1641 inline methodinfo* java_lang_reflect_Method::get_method() const
1643 java_lang_reflect_VMMethod jlrvmm(get_m());
1644 return jlrvmm.get_method();
1647 inline int32_t java_lang_reflect_Method::get_override() const
1654 * GNU Classpath java/nio/Buffer
1663 * 5. gnu.classpath.Pointer address;
1665 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
1667 // Static offsets of the object's instance fields.
1668 // TODO These offsets need to be checked on VM startup.
1669 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1670 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1671 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1672 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1673 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1676 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
1679 inline int32_t get_cap() const;
1682 inline int32_t java_nio_Buffer::get_cap() const
1684 return get<int32_t>(_handle, offset_cap);
1689 * GNU Classpath java/nio/DirectByteBufferImpl
1698 * 5. gnu.classpath.Pointer address;
1699 * 6. java.nio.ByteOrder endian;
1700 * 7. byte[] backing_buffer;
1701 * 8. int array_offset;
1702 * 9. java.lang.Object owner;
1704 class java_nio_DirectByteBufferImpl : public java_lang_Object, private FieldAccess {
1706 // Static offsets of the object's instance fields.
1707 // TODO These offsets need to be checked on VM startup.
1708 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1709 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1710 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1711 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1712 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1713 static const off_t offset_endian = MEMORY_ALIGN(offset_address + SIZEOF_VOID_P, SIZEOF_VOID_P);
1714 static const off_t offset_backing_buffer = MEMORY_ALIGN(offset_endian + SIZEOF_VOID_P, SIZEOF_VOID_P);
1715 static const off_t offset_array_offset = MEMORY_ALIGN(offset_backing_buffer + SIZEOF_VOID_P, sizeof(int32_t));
1716 static const off_t offset_owner = MEMORY_ALIGN(offset_array_offset + sizeof(int32_t), SIZEOF_VOID_P);
1719 java_nio_DirectByteBufferImpl(java_handle_t* h) : java_lang_Object(h) {}
1720 java_nio_DirectByteBufferImpl(jobject h);
1723 inline java_handle_t* get_address() const;
1726 inline java_nio_DirectByteBufferImpl::java_nio_DirectByteBufferImpl(jobject h) : java_lang_Object(h)
1728 java_nio_DirectByteBufferImpl((java_handle_t*) h);
1731 inline java_handle_t* java_nio_DirectByteBufferImpl::get_address() const
1733 return get<java_handle_t*>(_handle, offset_address);
1738 * GNU Classpath gnu/classpath/Pointer
1740 * Actually there are two classes, gnu.classpath.Pointer32 and
1741 * gnu.classpath.Pointer64, but we only define the abstract super
1742 * class and use the int/long field as void* type.
1749 class gnu_classpath_Pointer : public java_lang_Object, private FieldAccess {
1751 // Static offsets of the object's instance fields.
1752 // TODO These offsets need to be checked on VM startup.
1753 static const off_t offset_data = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1756 gnu_classpath_Pointer(java_handle_t* h) : java_lang_Object(h) {}
1757 gnu_classpath_Pointer(java_handle_t* h, void* data);
1760 inline void* get_data() const;
1763 inline void set_data(void* value);
1766 inline gnu_classpath_Pointer::gnu_classpath_Pointer(java_handle_t* h, void* data) : java_lang_Object(h)
1771 inline void* gnu_classpath_Pointer::get_data() const
1773 return get<void*>(_handle, offset_data);
1776 inline void gnu_classpath_Pointer::set_data(void* value)
1778 set(_handle, offset_data, value);
1781 #endif // WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH
1784 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
1787 * OpenJDK java/lang/AssertionStatusDirectives
1792 * 1. java.lang.String[] classes;
1793 * 2. boolean[] classEnabled;
1794 * 3. java.lang.String[] packages;
1795 * 4. boolean[] packageEnabled;
1798 class java_lang_AssertionStatusDirectives : public java_lang_Object, private FieldAccess {
1800 // Static offsets of the object's instance fields.
1801 // TODO These offsets need to be checked on VM startup.
1802 static const off_t offset_classes = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1803 static const off_t offset_classEnabled = MEMORY_ALIGN(offset_classes + SIZEOF_VOID_P, SIZEOF_VOID_P);
1804 static const off_t offset_packages = MEMORY_ALIGN(offset_classEnabled + SIZEOF_VOID_P, SIZEOF_VOID_P);
1805 static const off_t offset_packageEnabled = MEMORY_ALIGN(offset_packages + SIZEOF_VOID_P, SIZEOF_VOID_P);
1806 static const off_t offset_deflt = MEMORY_ALIGN(offset_packageEnabled + SIZEOF_VOID_P, sizeof(int32_t));
1809 java_lang_AssertionStatusDirectives(java_handle_objectarray_t* classes, java_handle_booleanarray_t* classEnabled, java_handle_objectarray_t* packages, java_handle_booleanarray_t* packageEnabled);
1812 inline java_lang_AssertionStatusDirectives::java_lang_AssertionStatusDirectives(java_handle_objectarray_t* classes, java_handle_booleanarray_t* classEnabled, java_handle_objectarray_t* packages, java_handle_booleanarray_t* packageEnabled)
1814 classinfo* c = load_class_bootstrap(utf_new_char("java/lang/AssertionStatusDirectives"));
1816 // FIXME Load the class at VM startup.
1820 _handle = builtin_new(c);
1825 set(_handle, offset_classes, classes);
1826 set(_handle, offset_classEnabled, classEnabled);
1827 set(_handle, offset_packages, packages);
1828 set(_handle, offset_packageEnabled, packageEnabled);
1833 * OpenJDK java/lang/StackTraceElement
1838 * 1. java.lang.String declaringClass;
1839 * 2. java.lang.String methodName;
1840 * 3. java.lang.String fileName;
1841 * 4. int lineNumber;
1843 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
1845 // Static offsets of the object's instance fields.
1846 // TODO These offsets need to be checked on VM startup.
1847 static const off_t offset_declaringClass = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1848 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
1849 static const off_t offset_fileName = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
1850 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
1853 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
1854 java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber);
1857 inline java_lang_StackTraceElement::java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber)
1859 _handle = builtin_new(class_java_lang_StackTraceElement);
1864 set(_handle, offset_declaringClass, declaringClass);
1865 set(_handle, offset_methodName, methodName);
1866 set(_handle, offset_fileName, fileName);
1867 set(_handle, offset_lineNumber, lineNumber);
1872 * OpenJDK java/lang/String
1882 class java_lang_String : public java_lang_Object, private FieldAccess {
1884 // Static offsets of the object's instance fields.
1885 // TODO These offsets need to be checked on VM startup.
1886 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1887 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
1888 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
1889 static const off_t offset_hash = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
1892 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
1893 java_lang_String(jstring h);
1894 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
1897 inline java_handle_chararray_t* get_value () const;
1898 inline int32_t get_offset() const;
1899 inline int32_t get_count () const;
1902 inline void set_value (java_handle_chararray_t* value);
1903 inline void set_offset(int32_t value);
1904 inline void set_count (int32_t value);
1907 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
1909 java_lang_String((java_handle_t*) h);
1912 inline java_lang_String::java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset) : java_lang_Object(h)
1919 inline java_handle_chararray_t* java_lang_String::get_value() const
1921 return get<java_handle_chararray_t*>(_handle, offset_value);
1924 inline int32_t java_lang_String::get_offset() const
1926 return get<int32_t>(_handle, offset_offset);
1929 inline int32_t java_lang_String::get_count() const
1931 return get<int32_t>(_handle, offset_count);
1934 inline void java_lang_String::set_value(java_handle_chararray_t* value)
1936 set(_handle, offset_value, value);
1939 inline void java_lang_String::set_offset(int32_t value)
1941 set(_handle, offset_offset, value);
1944 inline void java_lang_String::set_count(int32_t value)
1946 set(_handle, offset_count, value);
1951 * OpenJDK java/lang/Thread
1958 * 3. java_lang_Thread threadQ;
1960 * 5. boolean single_step;
1961 * 6. boolean daemon;
1962 * 7. boolean stillborn;
1963 * 8. java_lang_Runnable target;
1964 * 9. java_lang_ThreadGroup group;
1965 * 10. java_lang_ClassLoader contextClassLoader;
1966 * 11. java_security_AccessControlContext inheritedAccessControlContext;
1967 * 12. java_lang_ThreadLocal_ThreadLocalMap threadLocals;
1968 * 13. java_lang_ThreadLocal_ThreadLocalMap inheritableThreadLocals;
1969 * 14. long stackSize;
1970 * 15. long nativeParkEventPointer;
1972 * 17. int threadStatus;
1973 * 18. java_lang_Object parkBlocker;
1974 * 19. sun_nio_ch_Interruptible blocker;
1975 * 20. java_lang_Object blockerLock;
1976 * 21. boolean stopBeforeStart;
1977 * 22. java_lang_Throwable throwableFromStop;
1978 * 23. java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler;
1980 class java_lang_Thread : public java_lang_Object, private FieldAccess {
1982 // Static offsets of the object's instance fields.
1983 // TODO These offsets need to be checked on VM startup.
1984 static const off_t offset_name = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1985 static const off_t offset_priority = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1986 static const off_t offset_threadQ = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
1987 static const off_t offset_eetop = MEMORY_ALIGN(offset_threadQ + SIZEOF_VOID_P, sizeof(int64_t));
1988 static const off_t offset_single_step = MEMORY_ALIGN(offset_eetop + sizeof(int64_t), sizeof(int32_t));
1989 static const off_t offset_daemon = MEMORY_ALIGN(offset_single_step + sizeof(int32_t), sizeof(int32_t));
1990 static const off_t offset_stillborn = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
1991 static const off_t offset_target = MEMORY_ALIGN(offset_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
1992 static const off_t offset_group = MEMORY_ALIGN(offset_target + SIZEOF_VOID_P, SIZEOF_VOID_P);
1993 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
1994 static const off_t offset_inheritedAccessControlContext = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
1995 static const off_t offset_threadLocals = MEMORY_ALIGN(offset_inheritedAccessControlContext + SIZEOF_VOID_P, SIZEOF_VOID_P);
1996 static const off_t offset_inheritableThreadLocals = MEMORY_ALIGN(offset_threadLocals + SIZEOF_VOID_P, SIZEOF_VOID_P);
1997 static const off_t offset_stackSize = MEMORY_ALIGN(offset_inheritableThreadLocals + SIZEOF_VOID_P, sizeof(int64_t));
1998 static const off_t offset_nativeParkEventPointer = MEMORY_ALIGN(offset_stackSize + sizeof(int64_t), sizeof(int64_t));
1999 static const off_t offset_tid = MEMORY_ALIGN(offset_nativeParkEventPointer + sizeof(int64_t), sizeof(int64_t));
2000 static const off_t offset_threadStatus = MEMORY_ALIGN(offset_tid + sizeof(int64_t), sizeof(int32_t));
2001 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadStatus + sizeof(int32_t), SIZEOF_VOID_P);
2002 static const off_t offset_blocker = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2003 static const off_t offset_blockerLock = MEMORY_ALIGN(offset_blocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2004 static const off_t offset_stopBeforeStart = MEMORY_ALIGN(offset_blockerLock + SIZEOF_VOID_P, sizeof(int32_t));
2005 static const off_t offset_throwableFromStop = MEMORY_ALIGN(offset_stopBeforeStart + sizeof(int32_t), SIZEOF_VOID_P);
2006 static const off_t offset_uncaughtExceptionHandler = MEMORY_ALIGN(offset_throwableFromStop + SIZEOF_VOID_P, SIZEOF_VOID_P);
2009 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2010 // java_lang_Thread(threadobject* t);
2013 inline int32_t get_priority () const;
2014 inline int32_t get_daemon () const;
2015 inline java_handle_t* get_group () const;
2016 inline java_handle_t* get_uncaughtExceptionHandler() const;
2019 inline void set_priority(int32_t value);
2020 inline void set_group (java_handle_t* value);
2024 inline int32_t java_lang_Thread::get_priority() const
2026 return get<int32_t>(_handle, offset_priority);
2029 inline int32_t java_lang_Thread::get_daemon() const
2031 return get<int32_t>(_handle, offset_daemon);
2034 inline java_handle_t* java_lang_Thread::get_group() const
2036 return get<java_handle_t*>(_handle, offset_group);
2039 inline java_handle_t* java_lang_Thread::get_uncaughtExceptionHandler() const
2041 return get<java_handle_t*>(_handle, offset_uncaughtExceptionHandler);
2045 inline void java_lang_Thread::set_priority(int32_t value)
2047 set(_handle, offset_priority, value);
2050 inline void java_lang_Thread::set_group(java_handle_t* value)
2052 set(_handle, offset_group, value);
2058 * OpenJDK java/lang/Throwable
2063 * 1. java.lang.Object backtrace;
2064 * 2. java.lang.String detailMessage;
2065 * 3. java.lang.Throwable cause;
2066 * 4. java.lang.StackTraceElement[] stackTrace;
2068 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2070 // Static offsets of the object's instance fields.
2071 // TODO These offsets need to be checked on VM startup.
2072 static const off_t offset_backtrace = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2073 static const off_t offset_detailMessage = MEMORY_ALIGN(offset_backtrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
2074 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2075 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
2078 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2079 java_lang_Throwable(jobject h);
2080 java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace);
2083 inline java_handle_bytearray_t* get_backtrace () const;
2084 inline java_handle_t* get_detailMessage() const;
2085 inline java_handle_t* get_cause () const;
2088 inline void set_backtrace(java_handle_bytearray_t* value);
2092 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2094 java_lang_Throwable((java_handle_t*) h);
2097 inline java_lang_Throwable::java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace) : java_lang_Object(h)
2099 java_lang_Throwable((java_handle_t*) h);
2100 set_backtrace(backtrace);
2104 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2106 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2109 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2111 return get<java_handle_t*>(_handle, offset_detailMessage);
2114 inline java_handle_t* java_lang_Throwable::get_cause() const
2116 return get<java_handle_t*>(_handle, offset_cause);
2120 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2122 set(_handle, offset_backtrace, value);
2127 * OpenJDK java/lang/reflect/Constructor
2132 * 1. boolean override;
2133 * 2. java.lang.Class clazz;
2135 * 4. java.lang.Class[] parameterTypes;
2136 * 5. java.lang.Class[] exceptionTypes;
2138 * 7. java.lang.String signature;
2139 * 8. sun.reflect.generics.repository.ConstructorRepository genericInfo;
2140 * 9. byte[] annotations;
2141 * 10. byte[] parameterAnnotations;
2142 * 11. java.lang.Class securityCheckCache;
2143 * 12. sun.reflect.ConstructorAccessor constructorAccessor;
2144 * 13. java.lang.reflect.Constructor root;
2145 * 14. java.util.Map declaredAnnotations;
2147 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
2149 // Static offsets of the object's instance fields.
2150 // TODO These offsets need to be checked on VM startup.
2151 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2152 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2153 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2154 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2155 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2156 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2157 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2158 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2159 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2160 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2161 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2162 static const off_t offset_constructorAccessor = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2163 static const off_t offset_root = MEMORY_ALIGN(offset_constructorAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2164 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2167 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
2168 java_lang_reflect_Constructor(jobject h);
2169 java_lang_reflect_Constructor(methodinfo* m);
2171 java_handle_t* new_instance(java_handle_objectarray_t* args);
2174 inline int32_t get_override () const;
2175 inline classinfo* get_clazz () const;
2176 inline int32_t get_slot () const;
2177 inline java_handle_bytearray_t* get_annotations() const;
2180 inline void set_clazz (classinfo* value);
2181 inline void set_slot (int32_t value);
2182 inline void set_parameterTypes (java_handle_objectarray_t* value);
2183 inline void set_exceptionTypes (java_handle_objectarray_t* value);
2184 inline void set_modifiers (int32_t value);
2185 inline void set_signature (java_handle_t* value);
2186 inline void set_annotations (java_handle_bytearray_t* value);
2187 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
2189 // Convenience functions.
2190 inline methodinfo* get_method();
2194 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
2196 java_lang_reflect_Constructor((java_handle_t*) h);
2199 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
2201 _handle = builtin_new(class_java_lang_reflect_Constructor);
2206 int slot = m - m->clazz->methods;
2207 java_handle_objectarray_t* parameterTypes = method_get_parametertypearray(m);
2208 java_handle_objectarray_t* exceptionTypes = method_get_exceptionarray(m);
2209 java_handle_bytearray_t* annotations = method_get_annotations(m);
2210 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
2212 set_clazz(m->clazz);
2214 set_parameterTypes(parameterTypes);
2215 set_exceptionTypes(exceptionTypes);
2216 set_modifiers(m->flags & ACC_CLASS_REFLECT_MASK);
2217 set_signature(m->signature ? javastring_new(m->signature) : NULL);
2218 set_annotations(annotations);
2219 set_parameterAnnotations(parameterAnnotations);
2223 inline int32_t java_lang_reflect_Constructor::get_override() const
2225 return get<int32_t>(_handle, offset_override);
2228 inline classinfo* java_lang_reflect_Constructor::get_clazz() const
2230 return get<classinfo*>(_handle, offset_clazz);
2233 inline int32_t java_lang_reflect_Constructor::get_slot() const
2235 return get<int32_t>(_handle, offset_slot);
2238 inline java_handle_bytearray_t* java_lang_reflect_Constructor::get_annotations() const
2240 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2244 inline void java_lang_reflect_Constructor::set_clazz(classinfo* value)
2246 set(_handle, offset_clazz, value);
2249 inline void java_lang_reflect_Constructor::set_slot(int32_t value)
2251 set(_handle, offset_slot, value);
2254 inline void java_lang_reflect_Constructor::set_parameterTypes(java_handle_objectarray_t* value)
2256 set(_handle, offset_parameterTypes, value);
2259 inline void java_lang_reflect_Constructor::set_exceptionTypes(java_handle_objectarray_t* value)
2261 set(_handle, offset_exceptionTypes, value);
2264 inline void java_lang_reflect_Constructor::set_modifiers(int32_t value)
2266 set(_handle, offset_modifiers, value);
2269 inline void java_lang_reflect_Constructor::set_signature(java_handle_t* value)
2271 set(_handle, offset_signature, value);
2274 inline void java_lang_reflect_Constructor::set_annotations(java_handle_bytearray_t* value)
2276 set(_handle, offset_annotations, value);
2279 inline void java_lang_reflect_Constructor::set_parameterAnnotations(java_handle_bytearray_t* value)
2281 set(_handle, offset_parameterAnnotations, value);
2285 inline methodinfo* java_lang_reflect_Constructor::get_method()
2287 classinfo* c = get_clazz();
2288 int32_t slot = get_slot();
2289 methodinfo* m = &(c->methods[slot]);
2295 * OpenJDK java/lang/reflect/Field
2300 * 1. boolean override;
2301 * 2. java.lang.Class clazz;
2303 * 4. java.lang.String name;
2304 * 5. java.lang.Class type;
2306 * 7. java.lang.String signature;
2307 * 8. sun.reflect.generics.repository.FieldRepository genericInfo;
2308 * 9. byte[] annotations;
2309 * 10. sun.reflect.FieldAccessor fieldAccessor;
2310 * 11. sun.reflect.FieldAccessor overrideFieldAccessor;
2311 * 12. java.lang.reflect.Field root;
2312 * 13. java.lang.Class securityCheckCache;
2313 * 14. java.lang.Class securityCheckTargetClassCache;
2314 * 15. java.util.Map declaredAnnotations;
2316 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
2318 // Static offsets of the object's instance fields.
2319 // TODO These offsets need to be checked on VM startup.
2320 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2321 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2322 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2323 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2324 static const off_t offset_type = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2325 static const off_t offset_modifiers = MEMORY_ALIGN(offset_type + SIZEOF_VOID_P, sizeof(int32_t));
2326 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2327 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2328 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2329 static const off_t offset_fieldAccessor = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2330 static const off_t offset_overrideFieldAccessor = MEMORY_ALIGN(offset_fieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2331 static const off_t offset_root = MEMORY_ALIGN(offset_overrideFieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2332 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2333 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2334 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2337 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
2338 java_lang_reflect_Field(jobject h);
2339 java_lang_reflect_Field(fieldinfo* f);
2342 inline int32_t get_override () const;
2343 inline classinfo* get_clazz () const;
2344 inline int32_t get_slot () const;
2345 inline java_handle_bytearray_t* get_annotations() const;
2348 inline void set_clazz (classinfo* value);
2349 inline void set_slot (int32_t value);
2350 inline void set_name (java_handle_t* value);
2351 inline void set_type (classinfo* value);
2352 inline void set_modifiers (int32_t value);
2353 inline void set_signature (java_handle_t* value);
2354 inline void set_annotations(java_handle_bytearray_t* value);
2356 // Convenience functions.
2357 inline fieldinfo* get_field() const;
2361 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
2363 java_lang_reflect_Field((java_handle_t*) h);
2366 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
2368 _handle = builtin_new(class_java_lang_reflect_Field);
2374 set_clazz(f->clazz);
2375 set_slot(f - f->clazz->fields);
2376 set_name(javastring_intern(javastring_new(f->name)));
2377 set_type(field_get_type(f));
2378 set_modifiers(f->flags);
2379 set_signature(f->signature ? javastring_new(f->signature) : NULL);
2380 set_annotations(field_get_annotations(f));
2384 inline int32_t java_lang_reflect_Field::get_override() const
2386 return get<int32_t>(_handle, offset_override);
2389 inline classinfo* java_lang_reflect_Field::get_clazz() const
2391 return get<classinfo*>(_handle, offset_clazz);
2394 inline int32_t java_lang_reflect_Field::get_slot() const
2396 return get<int32_t>(_handle, offset_slot);
2399 inline java_handle_bytearray_t* java_lang_reflect_Field::get_annotations() const
2401 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2405 inline void java_lang_reflect_Field::set_clazz(classinfo* value)
2407 set(_handle, offset_clazz, value);
2410 inline void java_lang_reflect_Field::set_slot(int32_t value)
2412 set(_handle, offset_slot, value);
2415 inline void java_lang_reflect_Field::set_name(java_handle_t* value)
2417 set(_handle, offset_name, value);
2420 inline void java_lang_reflect_Field::set_type(classinfo* value)
2422 set(_handle, offset_type, value);
2425 inline void java_lang_reflect_Field::set_modifiers(int32_t value)
2427 set(_handle, offset_modifiers, value);
2430 inline void java_lang_reflect_Field::set_signature(java_handle_t* value)
2432 set(_handle, offset_signature, value);
2435 inline void java_lang_reflect_Field::set_annotations(java_handle_bytearray_t* value)
2437 set(_handle, offset_annotations, value);
2441 inline fieldinfo* java_lang_reflect_Field::get_field() const
2443 classinfo* c = get_clazz();
2444 int32_t slot = get_slot();
2445 fieldinfo* f = &(c->fields[slot]);
2451 * OpenJDK java/lang/reflect/Method
2456 * 1. boolean override;
2457 * 2. java.lang.Class clazz;
2459 * 4. java.lang.String name;
2460 * 5. java.lang.Class returnType;
2461 * 6. java.lang.Class[] parameterTypes;
2462 * 7. java.lang.Class[] exceptionTypes;
2464 * 9. java.lang.String signature;
2465 * 10 sun.reflect.generics.repository.ConstructorRepository genericInfo;
2466 * 11. byte[] annotations;
2467 * 12. byte[] parameterAnnotations;
2468 * 13. byte[] annotationDefault;
2469 * 14. sun.reflect.MethodAccessor methodAccessor;
2470 * 15. java.lang.reflect.Method root;
2471 * 16. java.lang.Class securityCheckCache;
2472 * 17. java.lang.Class securityCheckTargetClassCache;
2473 * 18. java.util.Map declaredAnnotations;
2475 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
2477 // Static offsets of the object's instance fields.
2478 // TODO These offsets need to be checked on VM startup.
2479 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2480 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2481 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2482 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2483 static const off_t offset_returnType = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2484 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_returnType + SIZEOF_VOID_P, SIZEOF_VOID_P);
2485 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2486 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2487 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2488 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2489 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2490 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2491 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2492 static const off_t offset_methodAccessor = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
2493 static const off_t offset_root = MEMORY_ALIGN(offset_methodAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2494 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2495 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2496 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2499 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
2500 java_lang_reflect_Method(jobject h);
2501 java_lang_reflect_Method(methodinfo* m);
2503 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
2506 inline int32_t get_override () const;
2507 inline classinfo* get_clazz () const;
2508 inline int32_t get_slot () const;
2509 inline java_handle_bytearray_t* get_annotations () const;
2510 inline java_handle_bytearray_t* get_parameterAnnotations() const;
2511 inline java_handle_bytearray_t* get_annotationDefault () const;
2515 // Convenience functions.
2516 inline methodinfo* get_method() const;
2520 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
2522 java_lang_reflect_Method((java_handle_t*) h);
2525 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
2527 _handle = builtin_new(class_java_lang_reflect_Method);
2532 set(_handle, offset_clazz, m->clazz);
2533 set(_handle, offset_slot, m - m->clazz->methods);
2534 set(_handle, offset_name, javastring_intern(javastring_new(m->name)));
2535 set(_handle, offset_returnType, method_returntype_get(m));
2536 set(_handle, offset_parameterTypes, method_get_parametertypearray(m));
2537 set(_handle, offset_exceptionTypes, method_get_exceptionarray(m));
2538 set(_handle, offset_modifiers, m->flags & ACC_CLASS_REFLECT_MASK);
2539 set(_handle, offset_signature, m->signature ? javastring_new(m->signature) : NULL);
2540 set(_handle, offset_annotations, method_get_annotations(m));
2541 set(_handle, offset_parameterAnnotations, method_get_parameterannotations(m));
2542 set(_handle, offset_annotationDefault, method_get_annotationdefault(m));
2546 inline int32_t java_lang_reflect_Method::get_override() const
2548 return get<int32_t>(_handle, offset_override);
2551 inline classinfo* java_lang_reflect_Method::get_clazz() const
2553 return get<classinfo*>(_handle, offset_clazz);
2556 inline int32_t java_lang_reflect_Method::get_slot() const
2558 return get<int32_t>(_handle, offset_slot);
2561 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotations() const
2563 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2566 inline java_handle_bytearray_t* java_lang_reflect_Method::get_parameterAnnotations() const
2568 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
2571 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotationDefault() const
2573 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
2577 inline methodinfo* java_lang_reflect_Method::get_method() const
2579 classinfo* c = get_clazz();
2580 int32_t slot = get_slot();
2581 methodinfo* m = &(c->methods[slot]);
2587 * OpenJDK java/nio/Buffer
2598 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
2600 // Static offsets of the object's instance fields.
2601 // TODO These offsets need to be checked on VM startup.
2602 static const off_t offset_mark = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2603 static const off_t offset_position = MEMORY_ALIGN(offset_mark + sizeof(int32_t), sizeof(int32_t));
2604 static const off_t offset_limit = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2605 static const off_t offset_capacity = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
2606 static const off_t offset_address = MEMORY_ALIGN(offset_capacity + sizeof(int32_t), sizeof(int64_t));
2609 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
2610 java_nio_Buffer(jobject h) : java_lang_Object(h) {}
2613 inline void* get_address() const;
2617 inline void* java_nio_Buffer::get_address() const
2619 return get<void*>(_handle, offset_address);
2622 #endif // WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
2625 #if defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
2628 * CLDC 1.1 com/sun/cldchi/jvm/FileDescriptor
2637 class com_sun_cldchi_jvm_FileDescriptor : public java_lang_Object, private FieldAccess {
2639 // Static offsets of the object's instance fields.
2640 // TODO These offsets need to be checked on VM startup.
2641 static const off_t offset_pointer = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
2642 static const off_t offset_position = MEMORY_ALIGN(offset_pointer + sizeof(int64_t), sizeof(int32_t));
2643 static const off_t offset_length = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2646 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h) : java_lang_Object(h) {}
2647 com_sun_cldchi_jvm_FileDescriptor(jobject h);
2648 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, int64_t pointer, int32_t position, int32_t length);
2649 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, com_sun_cldchi_jvm_FileDescriptor& fd);
2652 inline int64_t get_pointer () const;
2653 inline int32_t get_position() const;
2654 inline int32_t get_length () const;
2657 inline void set_pointer (int64_t value);
2658 inline void set_position(int32_t value);
2659 inline void set_length (int32_t value);
2663 inline com_sun_cldchi_jvm_FileDescriptor::com_sun_cldchi_jvm_FileDescriptor(jobject h) : java_lang_Object(h)
2665 com_sun_cldchi_jvm_FileDescriptor((java_handle_t*) h);
2668 inline com_sun_cldchi_jvm_FileDescriptor::com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, int64_t pointer, int32_t position, int32_t length) : java_lang_Object(h)
2670 set_pointer(pointer);
2671 set_position(position);
2675 inline com_sun_cldchi_jvm_FileDescriptor::com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, com_sun_cldchi_jvm_FileDescriptor& fd) : java_lang_Object(h)
2677 com_sun_cldchi_jvm_FileDescriptor(h, fd.get_pointer(), fd.get_position(), fd.get_length());
2681 inline int64_t com_sun_cldchi_jvm_FileDescriptor::get_pointer() const
2683 return get<int64_t>(_handle, offset_pointer);
2686 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_position() const
2688 return get<int32_t>(_handle, offset_position);
2691 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_length() const
2693 return get<int32_t>(_handle, offset_length);
2697 inline void com_sun_cldchi_jvm_FileDescriptor::set_pointer(int64_t value)
2699 set(_handle, offset_pointer, value);
2702 inline void com_sun_cldchi_jvm_FileDescriptor::set_position(int32_t value)
2704 set(_handle, offset_position, value);
2707 inline void com_sun_cldchi_jvm_FileDescriptor::set_length(int32_t value)
2709 set(_handle, offset_length, value);
2714 * CLDC 1.1 java/lang/String
2723 class java_lang_String : public java_lang_Object, private FieldAccess {
2725 // Static offsets of the object's instance fields.
2726 // TODO These offsets need to be checked on VM startup.
2727 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2728 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
2729 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
2732 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
2733 java_lang_String(jstring h);
2734 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
2737 inline java_handle_chararray_t* get_value () const;
2738 inline int32_t get_offset() const;
2739 inline int32_t get_count () const;
2742 inline void set_value (java_handle_chararray_t* value);
2743 inline void set_offset(int32_t value);
2744 inline void set_count (int32_t value);
2747 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
2749 java_lang_String((java_handle_t*) h);
2752 inline java_lang_String::java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset) : java_lang_Object(h)
2759 inline java_handle_chararray_t* java_lang_String::get_value() const
2761 return get<java_handle_chararray_t*>(_handle, offset_value);
2764 inline int32_t java_lang_String::get_offset() const
2766 return get<int32_t>(_handle, offset_offset);
2769 inline int32_t java_lang_String::get_count() const
2771 return get<int32_t>(_handle, offset_count);
2774 inline void java_lang_String::set_value(java_handle_chararray_t* value)
2776 set(_handle, offset_value, value);
2779 inline void java_lang_String::set_offset(int32_t value)
2781 set(_handle, offset_offset, value);
2784 inline void java_lang_String::set_count(int32_t value)
2786 set(_handle, offset_count, value);
2791 * CLDC 1.1 java/lang/Thread
2797 * 2. java.lang.Runnable runnable;
2798 * 3. java.lang.Object vm_thread;
2799 * 4. int is_terminated;
2800 * 5. int is_stillborn;
2803 class java_lang_Thread : public java_lang_Object, private FieldAccess {
2805 // Static offsets of the object's instance fields.
2806 // TODO These offsets need to be checked on VM startup.
2807 static const off_t offset_priority = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2808 static const off_t offset_runnable = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
2809 static const off_t offset_vm_thread = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
2810 static const off_t offset_is_terminated = MEMORY_ALIGN(offset_vm_thread + SIZEOF_VOID_P, sizeof(int32_t));
2811 static const off_t offset_is_stillborn = MEMORY_ALIGN(offset_is_terminated + sizeof(int32_t), sizeof(int32_t));
2812 static const off_t offset_name = MEMORY_ALIGN(offset_is_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
2815 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2816 java_lang_Thread(jobject h);
2817 // java_lang_Thread(threadobject* t);
2820 inline int32_t get_priority () const;
2821 inline threadobject* get_vm_thread() const;
2822 inline java_handle_chararray_t* get_name () const;
2825 inline void set_vm_thread(threadobject* value);
2829 inline java_lang_Thread::java_lang_Thread(jobject h) : java_lang_Object(h)
2831 java_lang_Thread((java_handle_t*) h);
2834 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
2836 // java_lang_Thread(thread_get_object(t));
2840 inline int32_t java_lang_Thread::get_priority() const
2842 return get<int32_t>(_handle, offset_priority);
2845 inline threadobject* java_lang_Thread::get_vm_thread() const
2847 return get<threadobject*>(_handle, offset_vm_thread);
2850 inline java_handle_chararray_t* java_lang_Thread::get_name() const
2852 return get<java_handle_chararray_t*>(_handle, offset_name);
2856 inline void java_lang_Thread::set_vm_thread(threadobject* value)
2858 set(_handle, offset_vm_thread, value);
2863 * CLDC 1.1 java/lang/Throwable
2868 * 1. java.lang.String detailMessage;
2869 * 2. java.lang.Object backtrace;
2871 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2873 // Static offsets of the object's instance fields.
2874 // TODO These offsets need to be checked on VM startup.
2875 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2876 static const off_t offset_backtrace = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2879 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2880 java_lang_Throwable(jobject h);
2883 inline java_handle_t* get_detailMessage() const;
2884 inline java_handle_bytearray_t* get_backtrace () const;
2887 inline void set_backtrace(java_handle_bytearray_t* value);
2891 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2893 java_lang_Throwable((java_handle_t*) h);
2897 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2899 return get<java_handle_t*>(_handle, offset_detailMessage);
2902 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2904 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2908 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2910 set(_handle, offset_backtrace, value);
2913 #endif // WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1
2917 // Legacy C interface.
2918 java_handle_t* java_lang_reflect_Constructor_create(methodinfo* m);
2919 java_handle_t* java_lang_reflect_Field_create(fieldinfo* f);
2920 java_handle_t* java_lang_reflect_Method_create(methodinfo* m);
2924 #endif // _JAVAOBJECTS_HPP
2928 * These are local overrides for various environment variables in Emacs.
2929 * Please do not remove this and leave it at the end of the file, where
2930 * Emacs will automagically detect them.
2931 * ---------------------------------------------------------------------
2934 * indent-tabs-mode: t