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) {}
186 virtual ~java_lang_Object() {}
190 virtual inline java_handle_t* get_handle() const { return _handle; }
191 inline vftbl_t* get_vftbl () const;
192 inline classinfo* get_Class () const;
194 inline bool is_null () const;
195 inline bool is_non_null() const;
199 inline vftbl_t* java_lang_Object::get_vftbl() const
201 // XXX Move this to a GC inline function, e.g.
202 // gc->enter_critical();
205 // XXX This should be h->get_object();
206 java_object_t* o = LLNI_UNWRAP(_handle);
207 vftbl_t* vftbl = o->vftbl;
209 // XXX Move this to a GC inline function.
210 // gc->leave_critical();
216 inline classinfo* java_lang_Object::get_Class() const
218 return get_vftbl()->clazz;
222 inline bool java_lang_Object::is_null() const
224 return (_handle == NULL);
227 inline bool java_lang_Object::is_non_null() const
229 return (_handle != NULL);
241 class java_lang_Boolean : public java_lang_Object, private FieldAccess {
243 // Static offsets of the object's instance fields.
244 // TODO These offsets need to be checked on VM startup.
245 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
248 java_lang_Boolean(java_handle_t* h) : java_lang_Object(h) {}
250 inline uint8_t get_value();
251 inline void set_value(uint8_t value);
254 inline uint8_t java_lang_Boolean::get_value()
256 return get<int32_t>(_handle, offset_value);
259 inline void java_lang_Boolean::set_value(uint8_t value)
261 set(_handle, offset_value, (uint32_t) value);
273 class java_lang_Byte : public java_lang_Object, private FieldAccess {
275 // Static offsets of the object's instance fields.
276 // TODO These offsets need to be checked on VM startup.
277 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
280 java_lang_Byte(java_handle_t* h) : java_lang_Object(h) {}
282 inline int8_t get_value();
283 inline void set_value(int8_t value);
286 inline int8_t java_lang_Byte::get_value()
288 return get<int32_t>(_handle, offset_value);
291 inline void java_lang_Byte::set_value(int8_t value)
293 set(_handle, offset_value, (int32_t) value);
298 * java/lang/Character
305 class java_lang_Character : public java_lang_Object, private FieldAccess {
307 // Static offsets of the object's instance fields.
308 // TODO These offsets need to be checked on VM startup.
309 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
312 java_lang_Character(java_handle_t* h) : java_lang_Object(h) {}
314 inline uint16_t get_value();
315 inline void set_value(uint16_t value);
318 inline uint16_t java_lang_Character::get_value()
320 return get<int32_t>(_handle, offset_value);
323 inline void java_lang_Character::set_value(uint16_t value)
325 set(_handle, offset_value, (uint32_t) value);
337 class java_lang_Short : public java_lang_Object, private FieldAccess {
339 // Static offsets of the object's instance fields.
340 // TODO These offsets need to be checked on VM startup.
341 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
344 java_lang_Short(java_handle_t* h) : java_lang_Object(h) {}
346 inline int16_t get_value();
347 inline void set_value(int16_t value);
350 inline int16_t java_lang_Short::get_value()
352 return get<int32_t>(_handle, offset_value);
355 inline void java_lang_Short::set_value(int16_t value)
357 set(_handle, offset_value, (int32_t) value);
369 class java_lang_Integer : public java_lang_Object, private FieldAccess {
371 // Static offsets of the object's instance fields.
372 // TODO These offsets need to be checked on VM startup.
373 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
376 java_lang_Integer(java_handle_t* h) : java_lang_Object(h) {}
378 inline int32_t get_value();
379 inline void set_value(int32_t value);
382 inline int32_t java_lang_Integer::get_value()
384 return get<int32_t>(_handle, offset_value);
387 inline void java_lang_Integer::set_value(int32_t value)
389 set(_handle, offset_value, value);
401 class java_lang_Long : public java_lang_Object, private FieldAccess {
403 // Static offsets of the object's instance fields.
404 // TODO These offsets need to be checked on VM startup.
405 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
408 java_lang_Long(java_handle_t* h) : java_lang_Object(h) {}
410 inline int64_t get_value();
411 inline void set_value(int64_t value);
414 inline int64_t java_lang_Long::get_value()
416 return get<int64_t>(_handle, offset_value);
419 inline void java_lang_Long::set_value(int64_t value)
421 set(_handle, offset_value, value);
433 class java_lang_Float : public java_lang_Object, private FieldAccess {
435 // Static offsets of the object's instance fields.
436 // TODO These offsets need to be checked on VM startup.
437 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(float));
440 java_lang_Float(java_handle_t* h) : java_lang_Object(h) {}
442 inline float get_value();
443 inline void set_value(float value);
446 inline float java_lang_Float::get_value()
448 return get<float>(_handle, offset_value);
451 inline void java_lang_Float::set_value(float value)
453 set(_handle, offset_value, value);
465 class java_lang_Double : public java_lang_Object, private FieldAccess {
467 // Static offsets of the object's instance fields.
468 // TODO These offsets need to be checked on VM startup.
469 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(double));
472 java_lang_Double(java_handle_t* h) : java_lang_Object(h) {}
474 inline double get_value();
475 inline void set_value(double value);
478 inline double java_lang_Double::get_value()
480 return get<double>(_handle, offset_value);
483 inline void java_lang_Double::set_value(double value)
485 set(_handle, offset_value, value);
489 #if defined(ENABLE_JAVASE)
491 # if defined(ENABLE_ANNOTATIONS)
493 * OpenJDK sun/reflect/ConstantPool
498 * 1. java.lang.Object constantPoolOop;
500 class sun_reflect_ConstantPool : public java_lang_Object, private FieldAccess {
502 // Static offsets of the object's instance fields.
503 // TODO These offsets need to be checked on VM startup.
504 static const off_t offset_constantPoolOop = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
507 sun_reflect_ConstantPool(java_handle_t* h) : java_lang_Object(h) {}
508 sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop);
511 inline void set_constantPoolOop(classinfo* value);
512 inline void set_constantPoolOop(jclass value);
516 inline sun_reflect_ConstantPool::sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop) : java_lang_Object(h)
518 set_constantPoolOop(constantPoolOop);
522 inline void sun_reflect_ConstantPool::set_constantPoolOop(classinfo* value)
524 set(_handle, offset_constantPoolOop, value);
527 inline void sun_reflect_ConstantPool::set_constantPoolOop(jclass value)
529 // XXX jclass is a boxed object.
530 set_constantPoolOop(LLNI_classinfo_unwrap(value));
532 # endif // ENABLE_ANNOTATIONS
534 #endif // ENABLE_JAVASE
537 #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
540 * GNU Classpath java/lang/Class
545 * 1. java.lang.Object[] signers;
546 * 2. java.security.ProtectionDomain pd;
547 * 3. java.lang.Object vmdata;
548 * 4. java.lang.reflect.Constructor constructor;
550 class java_lang_Class : public java_lang_Object, private FieldAccess {
552 // Static offsets of the object's instance fields.
553 // TODO These offsets need to be checked on VM startup.
554 static const off_t offset_signers = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
555 static const off_t offset_pd = MEMORY_ALIGN(offset_signers + SIZEOF_VOID_P, SIZEOF_VOID_P);
556 static const off_t offset_vmdata = MEMORY_ALIGN(offset_pd + SIZEOF_VOID_P, SIZEOF_VOID_P);
557 static const off_t offset_constructor = MEMORY_ALIGN(offset_vmdata + SIZEOF_VOID_P, SIZEOF_VOID_P);
560 java_lang_Class(java_handle_t* h) : java_lang_Object(h) {}
563 inline void set_pd(java_handle_t* value);
564 inline void set_pd(jobject value);
567 inline void java_lang_Class::set_pd(java_handle_t* value)
569 set(_handle, offset_pd, value);
572 inline void java_lang_Class::set_pd(jobject value)
574 set_pd((java_handle_t*) value);
579 * GNU Classpath java/lang/StackTraceElement
584 * 1. java.lang.String fileName;
586 * 3. java.lang.String declaringClass;
587 * 4. java.lang.String methodName;
588 * 5. boolean isNative;
590 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
592 // Static offsets of the object's instance fields.
593 // TODO These offsets need to be checked on VM startup.
594 static const off_t offset_fileName = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
595 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
596 static const off_t offset_declaringClass = MEMORY_ALIGN(offset_lineNumber + sizeof(int32_t), SIZEOF_VOID_P);
597 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
598 static const off_t offset_isNative = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
601 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
602 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);
605 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)
607 java_lang_StackTraceElement((java_handle_t*) h);
609 set(_handle, offset_fileName, fileName);
610 set(_handle, offset_lineNumber, lineNumber);
611 set(_handle, offset_declaringClass, declaringClass);
612 set(_handle, offset_methodName, methodName);
613 set(_handle, offset_isNative, isNative);
618 * GNU Classpath java/lang/String
625 * 3. int cachedHashCode;
628 class java_lang_String : public java_lang_Object, private FieldAccess {
630 // Static offsets of the object's instance fields.
631 // TODO These offsets need to be checked on VM startup.
632 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
633 static const off_t offset_count = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
634 static const off_t offset_cachedHashCode = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
635 static const off_t offset_offset = MEMORY_ALIGN(offset_cachedHashCode + sizeof(int32_t), sizeof(int32_t));
638 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
639 java_lang_String(jstring h);
640 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
643 inline java_handle_chararray_t* get_value () const;
644 inline int32_t get_count () const;
645 inline int32_t get_offset() const;
648 inline void set_value (java_handle_chararray_t* value);
649 inline void set_count (int32_t value);
650 inline void set_offset(int32_t value);
653 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
655 java_lang_String((java_handle_t*) h);
658 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)
665 inline java_handle_chararray_t* java_lang_String::get_value() const
667 return get<java_handle_chararray_t*>(_handle, offset_value);
670 inline int32_t java_lang_String::get_count() const
672 return get<int32_t>(_handle, offset_count);
675 inline int32_t java_lang_String::get_offset() const
677 return get<int32_t>(_handle, offset_offset);
680 inline void java_lang_String::set_value(java_handle_chararray_t* value)
682 set(_handle, offset_value, value);
685 inline void java_lang_String::set_count(int32_t value)
687 set(_handle, offset_count, value);
690 inline void java_lang_String::set_offset(int32_t value)
692 set(_handle, offset_offset, value);
697 * GNU Classpath java/lang/Thread
702 * 1. java.lang.VMThread vmThread;
703 * 2. java.lang.ThreadGroup group;
704 * 3. java.lang.Runnable runnable;
705 * 4. java.lang.String name;
709 * 8. java.lang.Throwable stillborn;
710 * 9. java.lang.ClassLoader contextClassLoader;
711 * 10. boolean contextClassLoaderIsSystemClassLoader;
713 * 12. java.lang.Object parkBlocker;
714 * 13. gnu.java.util.WeakIdentityHashMap locals;
715 * 14. java_lang_Thread_UncaughtExceptionHandler exceptionHandler;
717 class java_lang_Thread : public java_lang_Object, private FieldAccess {
719 // Static offsets of the object's instance fields.
720 // TODO These offsets need to be checked on VM startup.
721 static const off_t offset_vmThread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
722 static const off_t offset_group = MEMORY_ALIGN(offset_vmThread + SIZEOF_VOID_P, SIZEOF_VOID_P);
723 static const off_t offset_runnable = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
724 static const off_t offset_name = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
725 static const off_t offset_daemon = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
726 static const off_t offset_priority = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
727 static const off_t offset_stacksize = MEMORY_ALIGN(offset_priority + sizeof(int32_t), sizeof(int64_t));
728 static const off_t offset_stillborn = MEMORY_ALIGN(offset_stacksize + sizeof(int64_t), SIZEOF_VOID_P);
729 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_stillborn + SIZEOF_VOID_P, SIZEOF_VOID_P);
730 static const off_t offset_contextClassLoaderIsSystemClassLoader = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
731 static const off_t offset_threadId = MEMORY_ALIGN(offset_contextClassLoaderIsSystemClassLoader + sizeof(int32_t), sizeof(int64_t));
732 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadId + sizeof(int64_t), SIZEOF_VOID_P);
733 static const off_t offset_locals = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
734 static const off_t offset_exceptionHandler = MEMORY_ALIGN(offset_locals + SIZEOF_VOID_P, SIZEOF_VOID_P);
737 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
738 // java_lang_Thread(threadobject* t);
741 inline java_handle_t* get_vmThread () const;
742 inline java_handle_t* get_group () const;
743 inline java_handle_t* get_name () const;
744 inline int32_t get_daemon () const;
745 inline int32_t get_priority () const;
746 inline java_handle_t* get_exceptionHandler() const;
749 inline void set_group(java_handle_t* value);
753 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
755 // java_lang_Thread(thread_get_object(t));
759 inline java_handle_t* java_lang_Thread::get_vmThread() const
761 return get<java_handle_t*>(_handle, offset_vmThread);
764 inline java_handle_t* java_lang_Thread::get_group() const
766 return get<java_handle_t*>(_handle, offset_group);
769 inline java_handle_t* java_lang_Thread::get_name() const
771 return get<java_handle_t*>(_handle, offset_name);
774 inline int32_t java_lang_Thread::get_daemon() const
776 return get<int32_t>(_handle, offset_daemon);
779 inline int32_t java_lang_Thread::get_priority() const
781 return get<int32_t>(_handle, offset_priority);
784 inline java_handle_t* java_lang_Thread::get_exceptionHandler() const
786 return get<java_handle_t*>(_handle, offset_exceptionHandler);
790 inline void java_lang_Thread::set_group(java_handle_t* value)
792 set(_handle, offset_group, value);
797 * GNU Classpath java/lang/VMThread
802 * 1. java.lang.Thread thread;
803 * 2. boolean running;
804 * 3. java.lang.VMThread vmdata;
806 class java_lang_VMThread : public java_lang_Object, private FieldAccess {
808 // Static offsets of the object's instance fields.
809 // TODO These offsets need to be checked on VM startup.
810 static const off_t offset_thread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
811 static const off_t offset_running = MEMORY_ALIGN(offset_thread + SIZEOF_VOID_P, sizeof(int32_t));
812 static const off_t offset_vmdata = MEMORY_ALIGN(offset_running + sizeof(int32_t), SIZEOF_VOID_P);
815 java_lang_VMThread(java_handle_t* h) : java_lang_Object(h) {}
816 java_lang_VMThread(jobject h);
817 java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata);
820 inline java_handle_t* get_thread() const;
821 inline threadobject* get_vmdata() const;
824 inline void set_thread(java_handle_t* value);
825 inline void set_vmdata(threadobject* value);
829 inline java_lang_VMThread::java_lang_VMThread(jobject h) : java_lang_Object(h)
831 java_lang_VMThread((java_handle_t*) h);
834 inline java_lang_VMThread::java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata) : java_lang_Object(h)
841 inline java_handle_t* java_lang_VMThread::get_thread() const
843 return get<java_handle_t*>(_handle, offset_thread);
846 inline threadobject* java_lang_VMThread::get_vmdata() const
848 return get<threadobject*>(_handle, offset_vmdata);
852 inline void java_lang_VMThread::set_thread(java_handle_t* value)
854 set(_handle, offset_thread, value);
857 inline void java_lang_VMThread::set_vmdata(threadobject* value)
859 set(_handle, offset_vmdata, value);
864 * GNU Classpath java/lang/Throwable
869 * 1. java.lang.String detailMessage;
870 * 2. java.lang.Throwable cause;
871 * 3. java.lang.StackTraceElement[] stackTrace;
872 * 4. java.lang.VMThrowable vmState;
874 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
876 // Static offsets of the object's instance fields.
877 // TODO These offsets need to be checked on VM startup.
878 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
879 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
880 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
881 static const off_t offset_vmState = MEMORY_ALIGN(offset_stackTrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
884 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
887 inline java_handle_t* get_detailMessage() const;
888 inline java_handle_t* get_cause () const;
889 inline java_handle_t* get_vmState () const;
893 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
895 return get<java_handle_t*>(_handle, offset_detailMessage);
898 inline java_handle_t* java_lang_Throwable::get_cause() const
900 return get<java_handle_t*>(_handle, offset_cause);
903 inline java_handle_t* java_lang_Throwable::get_vmState() const
905 return get<java_handle_t*>(_handle, offset_vmState);
910 * GNU Classpath java/lang/VMThrowable
915 * 1. java.lang.Object vmdata;
917 class java_lang_VMThrowable : public java_lang_Object, private FieldAccess {
919 // Static offsets of the object's instance fields.
920 // TODO These offsets need to be checked on VM startup.
921 static const off_t offset_vmdata = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
924 java_lang_VMThrowable(java_handle_t* h) : java_lang_Object(h) {}
925 java_lang_VMThrowable(jobject h);
927 inline java_handle_bytearray_t* get_vmdata() const;
928 inline void set_vmdata(java_handle_bytearray_t* value);
931 inline java_lang_VMThrowable::java_lang_VMThrowable(jobject h) : java_lang_Object(h)
933 java_lang_VMThrowable((java_handle_t*) h);
936 inline java_handle_bytearray_t* java_lang_VMThrowable::get_vmdata() const
938 return get<java_handle_bytearray_t*>(_handle, offset_vmdata);
941 inline void java_lang_VMThrowable::set_vmdata(java_handle_bytearray_t* value)
943 set(_handle, offset_vmdata, value);
948 * GNU Classpath java/lang/reflect/VMConstructor
953 * 1. java.lang.Class clazz;
955 * 3. byte[] annotations;
956 * 4. byte[] parameterAnnotations;
957 * 5. java.util.Map declaredAnnotations;
958 * 6. java.lang.reflect.Constructor cons;
960 class java_lang_reflect_VMConstructor : public java_lang_Object, private FieldAccess {
962 // Static offsets of the object's instance fields.
963 // TODO These offsets need to be checked on VM startup.
964 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
965 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
966 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
967 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
968 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
969 static const off_t offset_cons = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
972 java_lang_reflect_VMConstructor(java_handle_t* h) : java_lang_Object(h) {}
973 java_lang_reflect_VMConstructor(jobject h);
974 java_lang_reflect_VMConstructor(methodinfo* m);
977 inline classinfo* get_clazz () const;
978 inline int32_t get_slot () const;
979 inline java_handle_bytearray_t* get_annotations () const;
980 inline java_handle_bytearray_t* get_parameterAnnotations() const;
981 inline java_handle_t* get_declaredAnnotations () const;
982 inline java_handle_t* get_cons () const;
985 inline void set_clazz (classinfo* value);
986 inline void set_slot (int32_t value);
987 inline void set_annotations (java_handle_bytearray_t* value);
988 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
989 inline void set_declaredAnnotations (java_handle_t* value);
990 inline void set_cons (java_handle_t* value);
992 // Convenience functions.
993 inline methodinfo* get_method();
997 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(jobject h) : java_lang_Object(h)
999 java_lang_reflect_VMConstructor((java_handle_t*) h);
1002 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(methodinfo* m)
1004 _handle = builtin_new(class_java_lang_reflect_VMConstructor);
1009 int slot = m - m->clazz->methods;
1010 java_handle_bytearray_t* annotations = method_get_annotations(m);
1011 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1013 set_clazz(m->clazz);
1015 set_annotations(annotations);
1016 set_parameterAnnotations(parameterAnnotations);
1020 inline classinfo* java_lang_reflect_VMConstructor::get_clazz() const
1022 return get<classinfo*>(_handle, offset_clazz);
1025 inline int32_t java_lang_reflect_VMConstructor::get_slot() const
1027 return get<int32_t>(_handle, offset_slot);
1030 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_annotations() const
1032 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1035 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_parameterAnnotations() const
1037 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1040 inline java_handle_t* java_lang_reflect_VMConstructor::get_declaredAnnotations() const
1042 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1045 inline java_handle_t* java_lang_reflect_VMConstructor::get_cons() const
1047 return get<java_handle_t*>(_handle, offset_cons);
1050 inline void java_lang_reflect_VMConstructor::set_clazz(classinfo* value)
1052 set(_handle, offset_clazz, value);
1055 inline void java_lang_reflect_VMConstructor::set_slot(int32_t value)
1057 set(_handle, offset_slot, value);
1060 inline void java_lang_reflect_VMConstructor::set_annotations(java_handle_bytearray_t* value)
1062 set(_handle, offset_annotations, value);
1065 inline void java_lang_reflect_VMConstructor::set_parameterAnnotations(java_handle_bytearray_t* value)
1067 set(_handle, offset_parameterAnnotations, value);
1070 inline void java_lang_reflect_VMConstructor::set_declaredAnnotations(java_handle_t* value)
1072 set(_handle, offset_declaredAnnotations, value);
1075 inline void java_lang_reflect_VMConstructor::set_cons(java_handle_t* value)
1077 set(_handle, offset_cons, value);
1080 inline methodinfo* java_lang_reflect_VMConstructor::get_method()
1082 classinfo* c = get_clazz();
1083 int32_t slot = get_slot();
1084 methodinfo* m = &(c->methods[slot]);
1090 * GNU Classpath java/lang/reflect/Constructor
1096 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1097 * 3. java.lang.reflect.VMConstructor cons;
1099 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
1101 // Static offsets of the object's instance fields.
1102 // TODO These offsets need to be checked on VM startup.
1103 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1104 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1105 static const off_t offset_cons = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1108 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
1109 java_lang_reflect_Constructor(jobject h);
1110 java_lang_reflect_Constructor(methodinfo* m);
1112 java_handle_t* new_instance(java_handle_objectarray_t* args);
1115 inline int32_t get_flag() const;
1116 inline java_handle_t* get_cons() const;
1119 inline void set_cons(java_handle_t* value);
1121 // Convenience functions.
1122 inline methodinfo* get_method () const;
1123 inline int32_t get_override() const;
1127 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
1129 java_lang_reflect_Constructor((java_handle_t*) h);
1132 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
1134 java_lang_reflect_VMConstructor jlrvmc(m);
1136 if (jlrvmc.is_null())
1139 _handle = builtin_new(class_java_lang_reflect_Constructor);
1144 // Link the two Java objects.
1145 set_cons(jlrvmc.get_handle());
1146 jlrvmc.set_cons(get_handle());
1150 inline int32_t java_lang_reflect_Constructor::get_flag() const
1152 return get<int32_t>(_handle, offset_flag);
1155 inline java_handle_t* java_lang_reflect_Constructor::get_cons() const
1157 return get<java_handle_t*>(_handle, offset_cons);
1161 inline void java_lang_reflect_Constructor::set_cons(java_handle_t* value)
1163 set(_handle, offset_cons, value);
1167 inline methodinfo* java_lang_reflect_Constructor::get_method() const
1169 java_lang_reflect_VMConstructor jlrvmc(get_cons());
1170 return jlrvmc.get_method();
1173 inline int32_t java_lang_reflect_Constructor::get_override() const
1180 * GNU Classpath java/lang/reflect/VMField
1185 * 1. java.lang.Class clazz;
1186 * 2. java.lang.String name;
1188 * 4. byte[] annotations;
1189 * 5. java.lang.Map declaredAnnotations;
1190 * 6. java.lang.reflect.Field f;
1192 class java_lang_reflect_VMField : public java_lang_Object, private FieldAccess {
1194 // Static offsets of the object's instance fields.
1195 // TODO These offsets need to be checked on VM startup.
1196 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1197 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1198 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1199 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1200 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1201 static const off_t offset_f = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1204 java_lang_reflect_VMField(java_handle_t* h) : java_lang_Object(h) {}
1205 java_lang_reflect_VMField(jobject h);
1206 java_lang_reflect_VMField(fieldinfo* f);
1209 inline classinfo* get_clazz () const;
1210 inline int32_t get_slot () const;
1211 inline java_handle_bytearray_t* get_annotations () const;
1212 inline java_handle_t* get_declaredAnnotations() const;
1213 inline java_handle_t* get_f () const;
1216 inline void set_clazz (classinfo* value);
1217 inline void set_name (java_handle_t* value);
1218 inline void set_slot (int32_t value);
1219 inline void set_annotations (java_handle_bytearray_t* value);
1220 inline void set_declaredAnnotations(java_handle_t* value);
1221 inline void set_f (java_handle_t* value);
1223 // Convenience functions.
1224 inline fieldinfo* get_field() const;
1228 inline java_lang_reflect_VMField::java_lang_reflect_VMField(jobject h) : java_lang_Object(h)
1230 java_lang_reflect_VMField((java_handle_t*) h);
1233 inline java_lang_reflect_VMField::java_lang_reflect_VMField(fieldinfo* f)
1235 _handle = builtin_new(class_java_lang_reflect_VMField);
1240 java_handle_t* name = javastring_intern(javastring_new(f->name));
1241 int slot = f - f->clazz->fields;
1242 java_handle_bytearray_t* annotations = field_get_annotations(f);
1244 set_clazz(f->clazz);
1247 set_annotations(annotations);
1251 inline classinfo* java_lang_reflect_VMField::get_clazz() const
1253 return get<classinfo*>(_handle, offset_clazz);
1256 inline int32_t java_lang_reflect_VMField::get_slot() const
1258 return get<int32_t>(_handle, offset_slot);
1261 inline java_handle_bytearray_t* java_lang_reflect_VMField::get_annotations() const
1263 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1266 inline java_handle_t* java_lang_reflect_VMField::get_declaredAnnotations() const
1268 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1271 inline java_handle_t* java_lang_reflect_VMField::get_f() const
1273 return get<java_handle_t*>(_handle, offset_f);
1277 inline void java_lang_reflect_VMField::set_clazz(classinfo* value)
1279 set(_handle, offset_clazz, value);
1282 inline void java_lang_reflect_VMField::set_name(java_handle_t* value)
1284 set(_handle, offset_name, value);
1287 inline void java_lang_reflect_VMField::set_slot(int32_t value)
1289 set(_handle, offset_slot, value);
1292 inline void java_lang_reflect_VMField::set_annotations(java_handle_bytearray_t* value)
1294 set(_handle, offset_annotations, value);
1297 inline void java_lang_reflect_VMField::set_declaredAnnotations(java_handle_t* value)
1299 set(_handle, offset_declaredAnnotations, value);
1302 inline void java_lang_reflect_VMField::set_f(java_handle_t* value)
1304 set(_handle, offset_f, value);
1307 inline fieldinfo* java_lang_reflect_VMField::get_field() const
1309 classinfo* c = get_clazz();
1310 int32_t slot = get_slot();
1311 fieldinfo* f = &(c->fields[slot]);
1317 * GNU Classpath java/lang/reflect/Field
1323 * 2. gnu.java.lang.reflect.FieldSignatureParser p;
1324 * 3. java.lang.reflect.VMField f;
1326 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
1328 // Static offsets of the object's instance fields.
1329 // TODO These offsets need to be checked on VM startup.
1330 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1331 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1332 static const off_t offset_f = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1335 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
1336 java_lang_reflect_Field(jobject h);
1337 java_lang_reflect_Field(fieldinfo* f);
1340 inline int32_t get_flag() const;
1341 inline java_handle_t* get_f() const;
1344 inline void set_f(java_handle_t* value);
1346 // Convenience functions.
1347 inline fieldinfo* get_field() const;
1351 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
1353 java_lang_reflect_Field((java_handle_t*) h);
1356 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
1358 java_lang_reflect_VMField jlrvmf(f);
1360 if (jlrvmf.is_null())
1363 _handle = builtin_new(class_java_lang_reflect_Field);
1368 // Link the two Java objects.
1369 set_f(jlrvmf.get_handle());
1370 jlrvmf.set_f(get_handle());
1374 inline int32_t java_lang_reflect_Field::get_flag() const
1376 return get<int32_t>(_handle, offset_flag);
1379 inline java_handle_t* java_lang_reflect_Field::get_f() const
1381 return get<java_handle_t*>(_handle, offset_f);
1385 inline void java_lang_reflect_Field::set_f(java_handle_t* value)
1387 set(_handle, offset_f, value);
1391 inline fieldinfo* java_lang_reflect_Field::get_field() const
1393 java_lang_reflect_VMField jlrvmf(get_f());
1394 return jlrvmf.get_field();
1399 * GNU Classpath java/lang/reflect/VMMethod
1404 * 1. java.lang.Class clazz;
1405 * 2. java.lang.String name;
1407 * 4. byte[] annotations;
1408 * 5. byte[] parameterAnnotations;
1409 * 6. byte[] annotationDefault;
1410 * 7. java.lang.Map declaredAnnotations;
1411 * 8. java.lang.reflect.Method m;
1413 class java_lang_reflect_VMMethod : public java_lang_Object, private FieldAccess {
1415 // Static offsets of the object's instance fields.
1416 // TODO These offsets need to be checked on VM startup.
1417 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1418 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1419 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1420 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1421 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1422 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1423 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
1424 static const off_t offset_m = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1427 java_lang_reflect_VMMethod(java_handle_t* h) : java_lang_Object(h) {}
1428 java_lang_reflect_VMMethod(jobject h);
1429 java_lang_reflect_VMMethod(methodinfo* m);
1432 inline classinfo* get_clazz () const;
1433 inline int32_t get_slot () const;
1434 inline java_handle_bytearray_t* get_annotations () const;
1435 inline java_handle_bytearray_t* get_parameterAnnotations() const;
1436 inline java_handle_bytearray_t* get_annotationDefault () const;
1437 inline java_handle_t* get_declaredAnnotations () const;
1438 inline java_handle_t* get_m () const;
1441 inline void set_clazz (classinfo* value);
1442 inline void set_name (java_handle_t* value);
1443 inline void set_slot (int32_t value);
1444 inline void set_annotations (java_handle_bytearray_t* value);
1445 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
1446 inline void set_annotationDefault (java_handle_bytearray_t* value);
1447 inline void set_declaredAnnotations (java_handle_t* value);
1448 inline void set_m (java_handle_t* value);
1450 // Convenience functions.
1451 inline methodinfo* get_method() const;
1454 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(jobject h) : java_lang_Object(h)
1456 java_lang_reflect_VMMethod((java_handle_t*) h);
1459 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(methodinfo* m)
1461 _handle = builtin_new(class_java_lang_reflect_VMMethod);
1466 java_handle_t* name = javastring_intern(javastring_new(m->name));
1467 int slot = m - m->clazz->methods;
1468 java_handle_bytearray_t* annotations = method_get_annotations(m);
1469 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1470 java_handle_bytearray_t* annotationDefault = method_get_annotationdefault(m);
1472 set_clazz(m->clazz);
1475 set_annotations(annotations);
1476 set_parameterAnnotations(parameterAnnotations);
1477 set_annotationDefault(annotationDefault);
1480 inline classinfo* java_lang_reflect_VMMethod::get_clazz() const
1482 return get<classinfo*>(_handle, offset_clazz);
1485 inline int32_t java_lang_reflect_VMMethod::get_slot() const
1487 return get<int32_t>(_handle, offset_slot);
1490 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotations() const
1492 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1495 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_parameterAnnotations() const
1497 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1500 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotationDefault() const
1502 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
1505 inline java_handle_t* java_lang_reflect_VMMethod::get_declaredAnnotations() const
1507 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1510 inline java_handle_t* java_lang_reflect_VMMethod::get_m() const
1512 return get<java_handle_t*>(_handle, offset_m);
1515 inline void java_lang_reflect_VMMethod::set_clazz(classinfo* value)
1517 set(_handle, offset_clazz, value);
1520 inline void java_lang_reflect_VMMethod::set_name(java_handle_t* value)
1522 set(_handle, offset_name, value);
1525 inline void java_lang_reflect_VMMethod::set_slot(int32_t value)
1527 set(_handle, offset_slot, value);
1530 inline void java_lang_reflect_VMMethod::set_annotations(java_handle_bytearray_t* value)
1532 set(_handle, offset_annotations, value);
1535 inline void java_lang_reflect_VMMethod::set_parameterAnnotations(java_handle_bytearray_t* value)
1537 set(_handle, offset_parameterAnnotations, value);
1540 inline void java_lang_reflect_VMMethod::set_annotationDefault(java_handle_bytearray_t* value)
1542 set(_handle, offset_annotationDefault, value);
1545 inline void java_lang_reflect_VMMethod::set_declaredAnnotations(java_handle_t* value)
1547 set(_handle, offset_declaredAnnotations, value);
1550 inline void java_lang_reflect_VMMethod::set_m(java_handle_t* value)
1552 set(_handle, offset_m, value);
1555 inline methodinfo* java_lang_reflect_VMMethod::get_method() const
1557 classinfo* c = get_clazz();
1558 int32_t slot = get_slot();
1559 methodinfo* m = &(c->methods[slot]);
1565 * GNU Classpath java/lang/reflect/Method
1571 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1572 * 3. java.lang.reflect.VMMethod m;
1574 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
1576 // Static offsets of the object's instance fields.
1577 // TODO These offsets need to be checked on VM startup.
1578 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1579 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1580 static const off_t offset_m = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1583 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
1584 java_lang_reflect_Method(jobject h);
1585 java_lang_reflect_Method(methodinfo* m);
1587 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
1590 inline int32_t get_flag() const;
1591 inline java_handle_t* get_m() const;
1594 inline void set_m(java_handle_t* value);
1596 // Convenience functions.
1597 inline methodinfo* get_method () const;
1598 inline int32_t get_override() const;
1602 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
1604 java_lang_reflect_Method((java_handle_t*) h);
1607 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
1609 java_lang_reflect_VMMethod jlrvmm(m);
1611 if (jlrvmm.is_null())
1614 _handle = builtin_new(class_java_lang_reflect_Method);
1619 // Link the two Java objects.
1620 set_m(jlrvmm.get_handle());
1621 jlrvmm.set_m(get_handle());
1625 inline int32_t java_lang_reflect_Method::get_flag() const
1627 return get<int32_t>(_handle, offset_flag);
1630 inline java_handle_t* java_lang_reflect_Method::get_m() const
1632 return get<java_handle_t*>(_handle, offset_m);
1636 inline void java_lang_reflect_Method::set_m(java_handle_t* value)
1638 set(_handle, offset_m, value);
1642 inline methodinfo* java_lang_reflect_Method::get_method() const
1644 java_lang_reflect_VMMethod jlrvmm(get_m());
1645 return jlrvmm.get_method();
1648 inline int32_t java_lang_reflect_Method::get_override() const
1655 * GNU Classpath java/nio/Buffer
1664 * 5. gnu.classpath.Pointer address;
1666 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
1668 // Static offsets of the object's instance fields.
1669 // TODO These offsets need to be checked on VM startup.
1670 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1671 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1672 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1673 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1674 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1677 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
1680 inline int32_t get_cap() const;
1683 inline int32_t java_nio_Buffer::get_cap() const
1685 return get<int32_t>(_handle, offset_cap);
1690 * GNU Classpath java/nio/DirectByteBufferImpl
1699 * 5. gnu.classpath.Pointer address;
1700 * 6. java.nio.ByteOrder endian;
1701 * 7. byte[] backing_buffer;
1702 * 8. int array_offset;
1703 * 9. java.lang.Object owner;
1705 class java_nio_DirectByteBufferImpl : public java_lang_Object, private FieldAccess {
1707 // Static offsets of the object's instance fields.
1708 // TODO These offsets need to be checked on VM startup.
1709 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1710 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1711 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1712 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1713 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1714 static const off_t offset_endian = MEMORY_ALIGN(offset_address + SIZEOF_VOID_P, SIZEOF_VOID_P);
1715 static const off_t offset_backing_buffer = MEMORY_ALIGN(offset_endian + SIZEOF_VOID_P, SIZEOF_VOID_P);
1716 static const off_t offset_array_offset = MEMORY_ALIGN(offset_backing_buffer + SIZEOF_VOID_P, sizeof(int32_t));
1717 static const off_t offset_owner = MEMORY_ALIGN(offset_array_offset + sizeof(int32_t), SIZEOF_VOID_P);
1720 java_nio_DirectByteBufferImpl(java_handle_t* h) : java_lang_Object(h) {}
1721 java_nio_DirectByteBufferImpl(jobject h);
1724 inline java_handle_t* get_address() const;
1727 inline java_nio_DirectByteBufferImpl::java_nio_DirectByteBufferImpl(jobject h) : java_lang_Object(h)
1729 java_nio_DirectByteBufferImpl((java_handle_t*) h);
1732 inline java_handle_t* java_nio_DirectByteBufferImpl::get_address() const
1734 return get<java_handle_t*>(_handle, offset_address);
1739 * GNU Classpath gnu/classpath/Pointer
1741 * Actually there are two classes, gnu.classpath.Pointer32 and
1742 * gnu.classpath.Pointer64, but we only define the abstract super
1743 * class and use the int/long field as void* type.
1750 class gnu_classpath_Pointer : public java_lang_Object, private FieldAccess {
1752 // Static offsets of the object's instance fields.
1753 // TODO These offsets need to be checked on VM startup.
1754 static const off_t offset_data = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1757 gnu_classpath_Pointer(java_handle_t* h) : java_lang_Object(h) {}
1758 gnu_classpath_Pointer(java_handle_t* h, void* data);
1761 inline void* get_data() const;
1764 inline void set_data(void* value);
1767 inline gnu_classpath_Pointer::gnu_classpath_Pointer(java_handle_t* h, void* data) : java_lang_Object(h)
1772 inline void* gnu_classpath_Pointer::get_data() const
1774 return get<void*>(_handle, offset_data);
1777 inline void gnu_classpath_Pointer::set_data(void* value)
1779 set(_handle, offset_data, value);
1782 #endif // WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH
1785 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
1788 * OpenJDK java/lang/AssertionStatusDirectives
1793 * 1. java.lang.String[] classes;
1794 * 2. boolean[] classEnabled;
1795 * 3. java.lang.String[] packages;
1796 * 4. boolean[] packageEnabled;
1799 class java_lang_AssertionStatusDirectives : public java_lang_Object, private FieldAccess {
1801 // Static offsets of the object's instance fields.
1802 // TODO These offsets need to be checked on VM startup.
1803 static const off_t offset_classes = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1804 static const off_t offset_classEnabled = MEMORY_ALIGN(offset_classes + SIZEOF_VOID_P, SIZEOF_VOID_P);
1805 static const off_t offset_packages = MEMORY_ALIGN(offset_classEnabled + SIZEOF_VOID_P, SIZEOF_VOID_P);
1806 static const off_t offset_packageEnabled = MEMORY_ALIGN(offset_packages + SIZEOF_VOID_P, SIZEOF_VOID_P);
1807 static const off_t offset_deflt = MEMORY_ALIGN(offset_packageEnabled + SIZEOF_VOID_P, sizeof(int32_t));
1810 java_lang_AssertionStatusDirectives(java_handle_objectarray_t* classes, java_handle_booleanarray_t* classEnabled, java_handle_objectarray_t* packages, java_handle_booleanarray_t* packageEnabled);
1813 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)
1815 classinfo* c = load_class_bootstrap(utf_new_char("java/lang/AssertionStatusDirectives"));
1817 // FIXME Load the class at VM startup.
1821 _handle = builtin_new(c);
1826 set(_handle, offset_classes, classes);
1827 set(_handle, offset_classEnabled, classEnabled);
1828 set(_handle, offset_packages, packages);
1829 set(_handle, offset_packageEnabled, packageEnabled);
1834 * OpenJDK java/lang/StackTraceElement
1839 * 1. java.lang.String declaringClass;
1840 * 2. java.lang.String methodName;
1841 * 3. java.lang.String fileName;
1842 * 4. int lineNumber;
1844 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
1846 // Static offsets of the object's instance fields.
1847 // TODO These offsets need to be checked on VM startup.
1848 static const off_t offset_declaringClass = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1849 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
1850 static const off_t offset_fileName = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
1851 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
1854 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
1855 java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber);
1858 inline java_lang_StackTraceElement::java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber)
1860 _handle = builtin_new(class_java_lang_StackTraceElement);
1865 set(_handle, offset_declaringClass, declaringClass);
1866 set(_handle, offset_methodName, methodName);
1867 set(_handle, offset_fileName, fileName);
1868 set(_handle, offset_lineNumber, lineNumber);
1873 * OpenJDK java/lang/String
1883 class java_lang_String : public java_lang_Object, private FieldAccess {
1885 // Static offsets of the object's instance fields.
1886 // TODO These offsets need to be checked on VM startup.
1887 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1888 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
1889 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
1890 static const off_t offset_hash = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
1893 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
1894 java_lang_String(jstring h);
1895 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
1898 inline java_handle_chararray_t* get_value () const;
1899 inline int32_t get_offset() const;
1900 inline int32_t get_count () const;
1903 inline void set_value (java_handle_chararray_t* value);
1904 inline void set_offset(int32_t value);
1905 inline void set_count (int32_t value);
1908 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
1910 java_lang_String((java_handle_t*) h);
1913 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)
1920 inline java_handle_chararray_t* java_lang_String::get_value() const
1922 return get<java_handle_chararray_t*>(_handle, offset_value);
1925 inline int32_t java_lang_String::get_offset() const
1927 return get<int32_t>(_handle, offset_offset);
1930 inline int32_t java_lang_String::get_count() const
1932 return get<int32_t>(_handle, offset_count);
1935 inline void java_lang_String::set_value(java_handle_chararray_t* value)
1937 set(_handle, offset_value, value);
1940 inline void java_lang_String::set_offset(int32_t value)
1942 set(_handle, offset_offset, value);
1945 inline void java_lang_String::set_count(int32_t value)
1947 set(_handle, offset_count, value);
1952 * OpenJDK java/lang/Thread
1959 * 3. java_lang_Thread threadQ;
1961 * 5. boolean single_step;
1962 * 6. boolean daemon;
1963 * 7. boolean stillborn;
1964 * 8. java_lang_Runnable target;
1965 * 9. java_lang_ThreadGroup group;
1966 * 10. java_lang_ClassLoader contextClassLoader;
1967 * 11. java_security_AccessControlContext inheritedAccessControlContext;
1968 * 12. java_lang_ThreadLocal_ThreadLocalMap threadLocals;
1969 * 13. java_lang_ThreadLocal_ThreadLocalMap inheritableThreadLocals;
1970 * 14. long stackSize;
1971 * 15. long nativeParkEventPointer;
1973 * 17. int threadStatus;
1974 * 18. java_lang_Object parkBlocker;
1975 * 19. sun_nio_ch_Interruptible blocker;
1976 * 20. java_lang_Object blockerLock;
1977 * 21. boolean stopBeforeStart;
1978 * 22. java_lang_Throwable throwableFromStop;
1979 * 23. java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler;
1981 class java_lang_Thread : public java_lang_Object, private FieldAccess {
1983 // Static offsets of the object's instance fields.
1984 // TODO These offsets need to be checked on VM startup.
1985 static const off_t offset_name = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1986 static const off_t offset_priority = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1987 static const off_t offset_threadQ = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
1988 static const off_t offset_eetop = MEMORY_ALIGN(offset_threadQ + SIZEOF_VOID_P, sizeof(int64_t));
1989 static const off_t offset_single_step = MEMORY_ALIGN(offset_eetop + sizeof(int64_t), sizeof(int32_t));
1990 static const off_t offset_daemon = MEMORY_ALIGN(offset_single_step + sizeof(int32_t), sizeof(int32_t));
1991 static const off_t offset_stillborn = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
1992 static const off_t offset_target = MEMORY_ALIGN(offset_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
1993 static const off_t offset_group = MEMORY_ALIGN(offset_target + SIZEOF_VOID_P, SIZEOF_VOID_P);
1994 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
1995 static const off_t offset_inheritedAccessControlContext = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
1996 static const off_t offset_threadLocals = MEMORY_ALIGN(offset_inheritedAccessControlContext + SIZEOF_VOID_P, SIZEOF_VOID_P);
1997 static const off_t offset_inheritableThreadLocals = MEMORY_ALIGN(offset_threadLocals + SIZEOF_VOID_P, SIZEOF_VOID_P);
1998 static const off_t offset_stackSize = MEMORY_ALIGN(offset_inheritableThreadLocals + SIZEOF_VOID_P, sizeof(int64_t));
1999 static const off_t offset_nativeParkEventPointer = MEMORY_ALIGN(offset_stackSize + sizeof(int64_t), sizeof(int64_t));
2000 static const off_t offset_tid = MEMORY_ALIGN(offset_nativeParkEventPointer + sizeof(int64_t), sizeof(int64_t));
2001 static const off_t offset_threadStatus = MEMORY_ALIGN(offset_tid + sizeof(int64_t), sizeof(int32_t));
2002 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadStatus + sizeof(int32_t), SIZEOF_VOID_P);
2003 static const off_t offset_blocker = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2004 static const off_t offset_blockerLock = MEMORY_ALIGN(offset_blocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2005 static const off_t offset_stopBeforeStart = MEMORY_ALIGN(offset_blockerLock + SIZEOF_VOID_P, sizeof(int32_t));
2006 static const off_t offset_throwableFromStop = MEMORY_ALIGN(offset_stopBeforeStart + sizeof(int32_t), SIZEOF_VOID_P);
2007 static const off_t offset_uncaughtExceptionHandler = MEMORY_ALIGN(offset_throwableFromStop + SIZEOF_VOID_P, SIZEOF_VOID_P);
2010 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2011 // java_lang_Thread(threadobject* t);
2014 inline int32_t get_priority () const;
2015 inline int32_t get_daemon () const;
2016 inline java_handle_t* get_group () const;
2017 inline java_handle_t* get_uncaughtExceptionHandler() const;
2020 inline void set_priority(int32_t value);
2021 inline void set_group (java_handle_t* value);
2025 inline int32_t java_lang_Thread::get_priority() const
2027 return get<int32_t>(_handle, offset_priority);
2030 inline int32_t java_lang_Thread::get_daemon() const
2032 return get<int32_t>(_handle, offset_daemon);
2035 inline java_handle_t* java_lang_Thread::get_group() const
2037 return get<java_handle_t*>(_handle, offset_group);
2040 inline java_handle_t* java_lang_Thread::get_uncaughtExceptionHandler() const
2042 return get<java_handle_t*>(_handle, offset_uncaughtExceptionHandler);
2046 inline void java_lang_Thread::set_priority(int32_t value)
2048 set(_handle, offset_priority, value);
2051 inline void java_lang_Thread::set_group(java_handle_t* value)
2053 set(_handle, offset_group, value);
2059 * OpenJDK java/lang/Throwable
2064 * 1. java.lang.Object backtrace;
2065 * 2. java.lang.String detailMessage;
2066 * 3. java.lang.Throwable cause;
2067 * 4. java.lang.StackTraceElement[] stackTrace;
2069 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2071 // Static offsets of the object's instance fields.
2072 // TODO These offsets need to be checked on VM startup.
2073 static const off_t offset_backtrace = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2074 static const off_t offset_detailMessage = MEMORY_ALIGN(offset_backtrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
2075 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2076 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
2079 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2080 java_lang_Throwable(jobject h);
2081 java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace);
2084 inline java_handle_bytearray_t* get_backtrace () const;
2085 inline java_handle_t* get_detailMessage() const;
2086 inline java_handle_t* get_cause () const;
2089 inline void set_backtrace(java_handle_bytearray_t* value);
2093 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2095 java_lang_Throwable((java_handle_t*) h);
2098 inline java_lang_Throwable::java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace) : java_lang_Object(h)
2100 java_lang_Throwable((java_handle_t*) h);
2101 set_backtrace(backtrace);
2105 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2107 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2110 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2112 return get<java_handle_t*>(_handle, offset_detailMessage);
2115 inline java_handle_t* java_lang_Throwable::get_cause() const
2117 return get<java_handle_t*>(_handle, offset_cause);
2121 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2123 set(_handle, offset_backtrace, value);
2128 * OpenJDK java/lang/reflect/Constructor
2133 * 1. boolean override;
2134 * 2. java.lang.Class clazz;
2136 * 4. java.lang.Class[] parameterTypes;
2137 * 5. java.lang.Class[] exceptionTypes;
2139 * 7. java.lang.String signature;
2140 * 8. sun.reflect.generics.repository.ConstructorRepository genericInfo;
2141 * 9. byte[] annotations;
2142 * 10. byte[] parameterAnnotations;
2143 * 11. java.lang.Class securityCheckCache;
2144 * 12. sun.reflect.ConstructorAccessor constructorAccessor;
2145 * 13. java.lang.reflect.Constructor root;
2146 * 14. java.util.Map declaredAnnotations;
2148 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
2150 // Static offsets of the object's instance fields.
2151 // TODO These offsets need to be checked on VM startup.
2152 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2153 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2154 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2155 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2156 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2157 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2158 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2159 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2160 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2161 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2162 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2163 static const off_t offset_constructorAccessor = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2164 static const off_t offset_root = MEMORY_ALIGN(offset_constructorAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2165 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2168 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
2169 java_lang_reflect_Constructor(jobject h);
2170 java_lang_reflect_Constructor(methodinfo* m);
2172 java_handle_t* new_instance(java_handle_objectarray_t* args);
2175 inline int32_t get_override () const;
2176 inline classinfo* get_clazz () const;
2177 inline int32_t get_slot () const;
2178 inline java_handle_bytearray_t* get_annotations() const;
2181 inline void set_clazz (classinfo* value);
2182 inline void set_slot (int32_t value);
2183 inline void set_parameterTypes (java_handle_objectarray_t* value);
2184 inline void set_exceptionTypes (java_handle_objectarray_t* value);
2185 inline void set_modifiers (int32_t value);
2186 inline void set_signature (java_handle_t* value);
2187 inline void set_annotations (java_handle_bytearray_t* value);
2188 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
2190 // Convenience functions.
2191 inline methodinfo* get_method();
2195 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
2197 java_lang_reflect_Constructor((java_handle_t*) h);
2200 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
2202 _handle = builtin_new(class_java_lang_reflect_Constructor);
2207 int slot = m - m->clazz->methods;
2208 java_handle_objectarray_t* parameterTypes = method_get_parametertypearray(m);
2209 java_handle_objectarray_t* exceptionTypes = method_get_exceptionarray(m);
2210 java_handle_bytearray_t* annotations = method_get_annotations(m);
2211 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
2213 set_clazz(m->clazz);
2215 set_parameterTypes(parameterTypes);
2216 set_exceptionTypes(exceptionTypes);
2217 set_modifiers(m->flags & ACC_CLASS_REFLECT_MASK);
2218 set_signature(m->signature ? javastring_new(m->signature) : NULL);
2219 set_annotations(annotations);
2220 set_parameterAnnotations(parameterAnnotations);
2224 inline int32_t java_lang_reflect_Constructor::get_override() const
2226 return get<int32_t>(_handle, offset_override);
2229 inline classinfo* java_lang_reflect_Constructor::get_clazz() const
2231 return get<classinfo*>(_handle, offset_clazz);
2234 inline int32_t java_lang_reflect_Constructor::get_slot() const
2236 return get<int32_t>(_handle, offset_slot);
2239 inline java_handle_bytearray_t* java_lang_reflect_Constructor::get_annotations() const
2241 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2245 inline void java_lang_reflect_Constructor::set_clazz(classinfo* value)
2247 set(_handle, offset_clazz, value);
2250 inline void java_lang_reflect_Constructor::set_slot(int32_t value)
2252 set(_handle, offset_slot, value);
2255 inline void java_lang_reflect_Constructor::set_parameterTypes(java_handle_objectarray_t* value)
2257 set(_handle, offset_parameterTypes, value);
2260 inline void java_lang_reflect_Constructor::set_exceptionTypes(java_handle_objectarray_t* value)
2262 set(_handle, offset_exceptionTypes, value);
2265 inline void java_lang_reflect_Constructor::set_modifiers(int32_t value)
2267 set(_handle, offset_modifiers, value);
2270 inline void java_lang_reflect_Constructor::set_signature(java_handle_t* value)
2272 set(_handle, offset_signature, value);
2275 inline void java_lang_reflect_Constructor::set_annotations(java_handle_bytearray_t* value)
2277 set(_handle, offset_annotations, value);
2280 inline void java_lang_reflect_Constructor::set_parameterAnnotations(java_handle_bytearray_t* value)
2282 set(_handle, offset_parameterAnnotations, value);
2286 inline methodinfo* java_lang_reflect_Constructor::get_method()
2288 classinfo* c = get_clazz();
2289 int32_t slot = get_slot();
2290 methodinfo* m = &(c->methods[slot]);
2296 * OpenJDK java/lang/reflect/Field
2301 * 1. boolean override;
2302 * 2. java.lang.Class clazz;
2304 * 4. java.lang.String name;
2305 * 5. java.lang.Class type;
2307 * 7. java.lang.String signature;
2308 * 8. sun.reflect.generics.repository.FieldRepository genericInfo;
2309 * 9. byte[] annotations;
2310 * 10. sun.reflect.FieldAccessor fieldAccessor;
2311 * 11. sun.reflect.FieldAccessor overrideFieldAccessor;
2312 * 12. java.lang.reflect.Field root;
2313 * 13. java.lang.Class securityCheckCache;
2314 * 14. java.lang.Class securityCheckTargetClassCache;
2315 * 15. java.util.Map declaredAnnotations;
2317 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
2319 // Static offsets of the object's instance fields.
2320 // TODO These offsets need to be checked on VM startup.
2321 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2322 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2323 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2324 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2325 static const off_t offset_type = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2326 static const off_t offset_modifiers = MEMORY_ALIGN(offset_type + SIZEOF_VOID_P, sizeof(int32_t));
2327 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2328 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2329 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2330 static const off_t offset_fieldAccessor = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2331 static const off_t offset_overrideFieldAccessor = MEMORY_ALIGN(offset_fieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2332 static const off_t offset_root = MEMORY_ALIGN(offset_overrideFieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2333 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2334 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2335 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2338 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
2339 java_lang_reflect_Field(jobject h);
2340 java_lang_reflect_Field(fieldinfo* f);
2343 inline int32_t get_override () const;
2344 inline classinfo* get_clazz () const;
2345 inline int32_t get_slot () const;
2346 inline java_handle_bytearray_t* get_annotations() const;
2349 inline void set_clazz (classinfo* value);
2350 inline void set_slot (int32_t value);
2351 inline void set_name (java_handle_t* value);
2352 inline void set_type (classinfo* value);
2353 inline void set_modifiers (int32_t value);
2354 inline void set_signature (java_handle_t* value);
2355 inline void set_annotations(java_handle_bytearray_t* value);
2357 // Convenience functions.
2358 inline fieldinfo* get_field() const;
2362 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
2364 java_lang_reflect_Field((java_handle_t*) h);
2367 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
2369 _handle = builtin_new(class_java_lang_reflect_Field);
2375 set_clazz(f->clazz);
2376 set_slot(f - f->clazz->fields);
2377 set_name(javastring_intern(javastring_new(f->name)));
2378 set_type(field_get_type(f));
2379 set_modifiers(f->flags);
2380 set_signature(f->signature ? javastring_new(f->signature) : NULL);
2381 set_annotations(field_get_annotations(f));
2385 inline int32_t java_lang_reflect_Field::get_override() const
2387 return get<int32_t>(_handle, offset_override);
2390 inline classinfo* java_lang_reflect_Field::get_clazz() const
2392 return get<classinfo*>(_handle, offset_clazz);
2395 inline int32_t java_lang_reflect_Field::get_slot() const
2397 return get<int32_t>(_handle, offset_slot);
2400 inline java_handle_bytearray_t* java_lang_reflect_Field::get_annotations() const
2402 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2406 inline void java_lang_reflect_Field::set_clazz(classinfo* value)
2408 set(_handle, offset_clazz, value);
2411 inline void java_lang_reflect_Field::set_slot(int32_t value)
2413 set(_handle, offset_slot, value);
2416 inline void java_lang_reflect_Field::set_name(java_handle_t* value)
2418 set(_handle, offset_name, value);
2421 inline void java_lang_reflect_Field::set_type(classinfo* value)
2423 set(_handle, offset_type, value);
2426 inline void java_lang_reflect_Field::set_modifiers(int32_t value)
2428 set(_handle, offset_modifiers, value);
2431 inline void java_lang_reflect_Field::set_signature(java_handle_t* value)
2433 set(_handle, offset_signature, value);
2436 inline void java_lang_reflect_Field::set_annotations(java_handle_bytearray_t* value)
2438 set(_handle, offset_annotations, value);
2442 inline fieldinfo* java_lang_reflect_Field::get_field() const
2444 classinfo* c = get_clazz();
2445 int32_t slot = get_slot();
2446 fieldinfo* f = &(c->fields[slot]);
2452 * OpenJDK java/lang/reflect/Method
2457 * 1. boolean override;
2458 * 2. java.lang.Class clazz;
2460 * 4. java.lang.String name;
2461 * 5. java.lang.Class returnType;
2462 * 6. java.lang.Class[] parameterTypes;
2463 * 7. java.lang.Class[] exceptionTypes;
2465 * 9. java.lang.String signature;
2466 * 10 sun.reflect.generics.repository.ConstructorRepository genericInfo;
2467 * 11. byte[] annotations;
2468 * 12. byte[] parameterAnnotations;
2469 * 13. byte[] annotationDefault;
2470 * 14. sun.reflect.MethodAccessor methodAccessor;
2471 * 15. java.lang.reflect.Method root;
2472 * 16. java.lang.Class securityCheckCache;
2473 * 17. java.lang.Class securityCheckTargetClassCache;
2474 * 18. java.util.Map declaredAnnotations;
2476 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
2478 // Static offsets of the object's instance fields.
2479 // TODO These offsets need to be checked on VM startup.
2480 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2481 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2482 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2483 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2484 static const off_t offset_returnType = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2485 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_returnType + SIZEOF_VOID_P, SIZEOF_VOID_P);
2486 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2487 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2488 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2489 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2490 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2491 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2492 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2493 static const off_t offset_methodAccessor = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
2494 static const off_t offset_root = MEMORY_ALIGN(offset_methodAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2495 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2496 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2497 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2500 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
2501 java_lang_reflect_Method(jobject h);
2502 java_lang_reflect_Method(methodinfo* m);
2504 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
2507 inline int32_t get_override () const;
2508 inline classinfo* get_clazz () const;
2509 inline int32_t get_slot () const;
2510 inline java_handle_bytearray_t* get_annotations () const;
2511 inline java_handle_bytearray_t* get_parameterAnnotations() const;
2512 inline java_handle_bytearray_t* get_annotationDefault () const;
2516 // Convenience functions.
2517 inline methodinfo* get_method() const;
2521 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
2523 java_lang_reflect_Method((java_handle_t*) h);
2526 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
2528 _handle = builtin_new(class_java_lang_reflect_Method);
2533 set(_handle, offset_clazz, m->clazz);
2534 set(_handle, offset_slot, m - m->clazz->methods);
2535 set(_handle, offset_name, javastring_intern(javastring_new(m->name)));
2536 set(_handle, offset_returnType, method_returntype_get(m));
2537 set(_handle, offset_parameterTypes, method_get_parametertypearray(m));
2538 set(_handle, offset_exceptionTypes, method_get_exceptionarray(m));
2539 set(_handle, offset_modifiers, m->flags & ACC_CLASS_REFLECT_MASK);
2540 set(_handle, offset_signature, m->signature ? javastring_new(m->signature) : NULL);
2541 set(_handle, offset_annotations, method_get_annotations(m));
2542 set(_handle, offset_parameterAnnotations, method_get_parameterannotations(m));
2543 set(_handle, offset_annotationDefault, method_get_annotationdefault(m));
2547 inline int32_t java_lang_reflect_Method::get_override() const
2549 return get<int32_t>(_handle, offset_override);
2552 inline classinfo* java_lang_reflect_Method::get_clazz() const
2554 return get<classinfo*>(_handle, offset_clazz);
2557 inline int32_t java_lang_reflect_Method::get_slot() const
2559 return get<int32_t>(_handle, offset_slot);
2562 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotations() const
2564 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2567 inline java_handle_bytearray_t* java_lang_reflect_Method::get_parameterAnnotations() const
2569 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
2572 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotationDefault() const
2574 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
2578 inline methodinfo* java_lang_reflect_Method::get_method() const
2580 classinfo* c = get_clazz();
2581 int32_t slot = get_slot();
2582 methodinfo* m = &(c->methods[slot]);
2588 * OpenJDK java/nio/Buffer
2599 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
2601 // Static offsets of the object's instance fields.
2602 // TODO These offsets need to be checked on VM startup.
2603 static const off_t offset_mark = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2604 static const off_t offset_position = MEMORY_ALIGN(offset_mark + sizeof(int32_t), sizeof(int32_t));
2605 static const off_t offset_limit = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2606 static const off_t offset_capacity = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
2607 static const off_t offset_address = MEMORY_ALIGN(offset_capacity + sizeof(int32_t), sizeof(int64_t));
2610 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
2611 java_nio_Buffer(jobject h) : java_lang_Object(h) {}
2614 inline void* get_address() const;
2618 inline void* java_nio_Buffer::get_address() const
2620 return get<void*>(_handle, offset_address);
2623 #endif // WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
2626 #if defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
2629 * CLDC 1.1 com/sun/cldchi/jvm/FileDescriptor
2638 class com_sun_cldchi_jvm_FileDescriptor : public java_lang_Object, private FieldAccess {
2640 // Static offsets of the object's instance fields.
2641 // TODO These offsets need to be checked on VM startup.
2642 static const off_t offset_pointer = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
2643 static const off_t offset_position = MEMORY_ALIGN(offset_pointer + sizeof(int64_t), sizeof(int32_t));
2644 static const off_t offset_length = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2647 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h) : java_lang_Object(h) {}
2648 com_sun_cldchi_jvm_FileDescriptor(jobject h);
2649 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, int64_t pointer, int32_t position, int32_t length);
2650 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, com_sun_cldchi_jvm_FileDescriptor& fd);
2653 inline int64_t get_pointer () const;
2654 inline int32_t get_position() const;
2655 inline int32_t get_length () const;
2658 inline void set_pointer (int64_t value);
2659 inline void set_position(int32_t value);
2660 inline void set_length (int32_t value);
2664 inline com_sun_cldchi_jvm_FileDescriptor::com_sun_cldchi_jvm_FileDescriptor(jobject h) : java_lang_Object(h)
2666 com_sun_cldchi_jvm_FileDescriptor((java_handle_t*) h);
2669 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)
2671 set_pointer(pointer);
2672 set_position(position);
2676 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)
2678 com_sun_cldchi_jvm_FileDescriptor(h, fd.get_pointer(), fd.get_position(), fd.get_length());
2682 inline int64_t com_sun_cldchi_jvm_FileDescriptor::get_pointer() const
2684 return get<int64_t>(_handle, offset_pointer);
2687 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_position() const
2689 return get<int32_t>(_handle, offset_position);
2692 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_length() const
2694 return get<int32_t>(_handle, offset_length);
2698 inline void com_sun_cldchi_jvm_FileDescriptor::set_pointer(int64_t value)
2700 set(_handle, offset_pointer, value);
2703 inline void com_sun_cldchi_jvm_FileDescriptor::set_position(int32_t value)
2705 set(_handle, offset_position, value);
2708 inline void com_sun_cldchi_jvm_FileDescriptor::set_length(int32_t value)
2710 set(_handle, offset_length, value);
2715 * CLDC 1.1 java/lang/String
2724 class java_lang_String : public java_lang_Object, private FieldAccess {
2726 // Static offsets of the object's instance fields.
2727 // TODO These offsets need to be checked on VM startup.
2728 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2729 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
2730 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
2733 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
2734 java_lang_String(jstring h);
2735 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
2738 inline java_handle_chararray_t* get_value () const;
2739 inline int32_t get_offset() const;
2740 inline int32_t get_count () const;
2743 inline void set_value (java_handle_chararray_t* value);
2744 inline void set_offset(int32_t value);
2745 inline void set_count (int32_t value);
2748 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
2750 java_lang_String((java_handle_t*) h);
2753 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)
2760 inline java_handle_chararray_t* java_lang_String::get_value() const
2762 return get<java_handle_chararray_t*>(_handle, offset_value);
2765 inline int32_t java_lang_String::get_offset() const
2767 return get<int32_t>(_handle, offset_offset);
2770 inline int32_t java_lang_String::get_count() const
2772 return get<int32_t>(_handle, offset_count);
2775 inline void java_lang_String::set_value(java_handle_chararray_t* value)
2777 set(_handle, offset_value, value);
2780 inline void java_lang_String::set_offset(int32_t value)
2782 set(_handle, offset_offset, value);
2785 inline void java_lang_String::set_count(int32_t value)
2787 set(_handle, offset_count, value);
2792 * CLDC 1.1 java/lang/Thread
2798 * 2. java.lang.Runnable runnable;
2799 * 3. java.lang.Object vm_thread;
2800 * 4. int is_terminated;
2801 * 5. int is_stillborn;
2804 class java_lang_Thread : public java_lang_Object, private FieldAccess {
2806 // Static offsets of the object's instance fields.
2807 // TODO These offsets need to be checked on VM startup.
2808 static const off_t offset_priority = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2809 static const off_t offset_runnable = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
2810 static const off_t offset_vm_thread = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
2811 static const off_t offset_is_terminated = MEMORY_ALIGN(offset_vm_thread + SIZEOF_VOID_P, sizeof(int32_t));
2812 static const off_t offset_is_stillborn = MEMORY_ALIGN(offset_is_terminated + sizeof(int32_t), sizeof(int32_t));
2813 static const off_t offset_name = MEMORY_ALIGN(offset_is_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
2816 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2817 java_lang_Thread(jobject h);
2818 // java_lang_Thread(threadobject* t);
2821 inline int32_t get_priority () const;
2822 inline threadobject* get_vm_thread() const;
2823 inline java_handle_chararray_t* get_name () const;
2826 inline void set_vm_thread(threadobject* value);
2830 inline java_lang_Thread::java_lang_Thread(jobject h) : java_lang_Object(h)
2832 java_lang_Thread((java_handle_t*) h);
2835 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
2837 // java_lang_Thread(thread_get_object(t));
2841 inline int32_t java_lang_Thread::get_priority() const
2843 return get<int32_t>(_handle, offset_priority);
2846 inline threadobject* java_lang_Thread::get_vm_thread() const
2848 return get<threadobject*>(_handle, offset_vm_thread);
2851 inline java_handle_chararray_t* java_lang_Thread::get_name() const
2853 return get<java_handle_chararray_t*>(_handle, offset_name);
2857 inline void java_lang_Thread::set_vm_thread(threadobject* value)
2859 set(_handle, offset_vm_thread, value);
2864 * CLDC 1.1 java/lang/Throwable
2869 * 1. java.lang.String detailMessage;
2870 * 2. java.lang.Object backtrace;
2872 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2874 // Static offsets of the object's instance fields.
2875 // TODO These offsets need to be checked on VM startup.
2876 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2877 static const off_t offset_backtrace = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2880 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2881 java_lang_Throwable(jobject h);
2884 inline java_handle_t* get_detailMessage() const;
2885 inline java_handle_bytearray_t* get_backtrace () const;
2888 inline void set_backtrace(java_handle_bytearray_t* value);
2892 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2894 java_lang_Throwable((java_handle_t*) h);
2898 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2900 return get<java_handle_t*>(_handle, offset_detailMessage);
2903 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2905 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2909 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2911 set(_handle, offset_backtrace, value);
2914 #endif // WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1
2918 // Legacy C interface.
2919 java_handle_t* java_lang_reflect_Constructor_create(methodinfo* m);
2920 java_handle_t* java_lang_reflect_Field_create(fieldinfo* f);
2921 java_handle_t* java_lang_reflect_Method_create(methodinfo* m);
2925 #endif // _JAVAOBJECTS_HPP
2929 * These are local overrides for various environment variables in Emacs.
2930 * Please do not remove this and leave it at the end of the file, where
2931 * Emacs will automagically detect them.
2932 * ---------------------------------------------------------------------
2935 * indent-tabs-mode: t