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"
37 #include "vm/field.hpp"
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)
92 // XXX This should be _handle->get_object();
95 result = raw_get<T>(o, offset);
102 template<> inline java_handle_t* FieldAccess::get(java_handle_t* h, const off_t offset)
105 java_object_t* result;
106 java_handle_t* hresult;
108 GC::critical_enter();
110 // XXX This should be _handle->get_object();
113 result = raw_get<java_object_t*>(o, offset);
115 hresult = LLNI_WRAP(result);
117 GC::critical_leave();
123 template<class T> inline void FieldAccess::set(java_handle_t* h, const off_t offset, T value)
127 GC::critical_enter();
129 // XXX This should be h->get_object();
132 raw_set(o, offset, value);
134 GC::critical_leave();
137 template<> inline void FieldAccess::set<java_handle_t*>(java_handle_t* h, const off_t offset, java_handle_t* value)
140 java_object_t* ovalue;
142 GC::critical_enter();
144 // XXX This should be h->get_object();
146 ovalue = LLNI_UNWRAP(value);
148 raw_set(o, offset, ovalue);
150 GC::critical_leave();
161 class java_lang_Object {
163 // Handle of Java object.
164 java_handle_t* _handle;
167 java_lang_Object() : _handle(NULL) {}
168 java_lang_Object(java_handle_t* h) : _handle(h) {}
169 java_lang_Object(jobject h) : _handle((java_handle_t*) h) {}
170 virtual ~java_lang_Object() {}
173 virtual inline java_handle_t* get_handle () const { return _handle; }
174 inline vftbl_t* get_vftbl () const;
175 inline classinfo* get_Class () const;
176 inline int32_t get_hashcode() const;
178 inline bool is_null () const;
179 inline bool is_non_null() const;
183 inline vftbl_t* java_lang_Object::get_vftbl() const
185 GC::critical_enter();
187 // XXX This should be h->get_object();
188 java_object_t* o = LLNI_UNWRAP(_handle);
189 vftbl_t* vftbl = o->vftbl;
191 GC::critical_leave();
196 inline classinfo* java_lang_Object::get_Class() const
198 return get_vftbl()->clazz;
201 inline int32_t java_lang_Object::get_hashcode() const
203 #if defined(ENABLE_GC_CACAO)
204 return heap_get_hashcode(_handle);
209 GC::critical_enter();
211 // XXX This should be h->get_object();
212 o = LLNI_UNWRAP(_handle);
214 hashcode = (int32_t)(intptr_t) o;
216 GC::critical_leave();
223 inline bool java_lang_Object::is_null() const
225 return (_handle == NULL);
228 inline bool java_lang_Object::is_non_null() const
230 return (_handle != NULL);
242 class java_lang_Boolean : public java_lang_Object, private FieldAccess {
244 // Static offsets of the object's instance fields.
245 // TODO These offsets need to be checked on VM startup.
246 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
249 java_lang_Boolean(java_handle_t* h) : java_lang_Object(h) {}
251 inline uint8_t get_value();
252 inline void set_value(uint8_t value);
255 inline uint8_t java_lang_Boolean::get_value()
257 return get<int32_t>(_handle, offset_value);
260 inline void java_lang_Boolean::set_value(uint8_t value)
262 set(_handle, offset_value, (uint32_t) value);
274 class java_lang_Byte : public java_lang_Object, private FieldAccess {
276 // Static offsets of the object's instance fields.
277 // TODO These offsets need to be checked on VM startup.
278 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
281 java_lang_Byte(java_handle_t* h) : java_lang_Object(h) {}
283 inline int8_t get_value();
284 inline void set_value(int8_t value);
287 inline int8_t java_lang_Byte::get_value()
289 return get<int32_t>(_handle, offset_value);
292 inline void java_lang_Byte::set_value(int8_t value)
294 set(_handle, offset_value, (int32_t) value);
299 * java/lang/Character
306 class java_lang_Character : public java_lang_Object, private FieldAccess {
308 // Static offsets of the object's instance fields.
309 // TODO These offsets need to be checked on VM startup.
310 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
313 java_lang_Character(java_handle_t* h) : java_lang_Object(h) {}
315 inline uint16_t get_value();
316 inline void set_value(uint16_t value);
319 inline uint16_t java_lang_Character::get_value()
321 return get<int32_t>(_handle, offset_value);
324 inline void java_lang_Character::set_value(uint16_t value)
326 set(_handle, offset_value, (uint32_t) value);
338 class java_lang_Short : public java_lang_Object, private FieldAccess {
340 // Static offsets of the object's instance fields.
341 // TODO These offsets need to be checked on VM startup.
342 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
345 java_lang_Short(java_handle_t* h) : java_lang_Object(h) {}
347 inline int16_t get_value();
348 inline void set_value(int16_t value);
351 inline int16_t java_lang_Short::get_value()
353 return get<int32_t>(_handle, offset_value);
356 inline void java_lang_Short::set_value(int16_t value)
358 set(_handle, offset_value, (int32_t) value);
370 class java_lang_Integer : public java_lang_Object, private FieldAccess {
372 // Static offsets of the object's instance fields.
373 // TODO These offsets need to be checked on VM startup.
374 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
377 java_lang_Integer(java_handle_t* h) : java_lang_Object(h) {}
379 inline int32_t get_value();
380 inline void set_value(int32_t value);
383 inline int32_t java_lang_Integer::get_value()
385 return get<int32_t>(_handle, offset_value);
388 inline void java_lang_Integer::set_value(int32_t value)
390 set(_handle, offset_value, value);
402 class java_lang_Long : public java_lang_Object, private FieldAccess {
404 // Static offsets of the object's instance fields.
405 // TODO These offsets need to be checked on VM startup.
406 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
409 java_lang_Long(java_handle_t* h) : java_lang_Object(h) {}
411 inline int64_t get_value();
412 inline void set_value(int64_t value);
415 inline int64_t java_lang_Long::get_value()
417 return get<int64_t>(_handle, offset_value);
420 inline void java_lang_Long::set_value(int64_t value)
422 set(_handle, offset_value, value);
434 class java_lang_Float : public java_lang_Object, private FieldAccess {
436 // Static offsets of the object's instance fields.
437 // TODO These offsets need to be checked on VM startup.
438 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(float));
441 java_lang_Float(java_handle_t* h) : java_lang_Object(h) {}
443 inline float get_value();
444 inline void set_value(float value);
447 inline float java_lang_Float::get_value()
449 return get<float>(_handle, offset_value);
452 inline void java_lang_Float::set_value(float value)
454 set(_handle, offset_value, value);
466 class java_lang_Double : public java_lang_Object, private FieldAccess {
468 // Static offsets of the object's instance fields.
469 // TODO These offsets need to be checked on VM startup.
470 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), sizeof(double));
473 java_lang_Double(java_handle_t* h) : java_lang_Object(h) {}
475 inline double get_value();
476 inline void set_value(double value);
479 inline double java_lang_Double::get_value()
481 return get<double>(_handle, offset_value);
484 inline void java_lang_Double::set_value(double value)
486 set(_handle, offset_value, value);
490 #if defined(ENABLE_JAVASE)
492 # if defined(ENABLE_ANNOTATIONS)
494 * OpenJDK sun/reflect/ConstantPool
499 * 1. java.lang.Object constantPoolOop;
501 class sun_reflect_ConstantPool : public java_lang_Object, private FieldAccess {
503 // Static offsets of the object's instance fields.
504 // TODO These offsets need to be checked on VM startup.
505 static const off_t offset_constantPoolOop = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
508 sun_reflect_ConstantPool(java_handle_t* h) : java_lang_Object(h) {}
509 sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop);
512 inline void set_constantPoolOop(classinfo* value);
513 inline void set_constantPoolOop(jclass value);
517 inline sun_reflect_ConstantPool::sun_reflect_ConstantPool(java_handle_t* h, jclass constantPoolOop) : java_lang_Object(h)
519 set_constantPoolOop(constantPoolOop);
523 inline void sun_reflect_ConstantPool::set_constantPoolOop(classinfo* value)
525 set(_handle, offset_constantPoolOop, value);
528 inline void sun_reflect_ConstantPool::set_constantPoolOop(jclass value)
530 // XXX jclass is a boxed object.
531 set_constantPoolOop(LLNI_classinfo_unwrap(value));
533 # endif // ENABLE_ANNOTATIONS
535 #endif // ENABLE_JAVASE
538 #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
541 * GNU Classpath java/lang/Class
546 * 1. java.lang.Object[] signers;
547 * 2. java.security.ProtectionDomain pd;
548 * 3. java.lang.Object vmdata;
549 * 4. java.lang.reflect.Constructor constructor;
551 class java_lang_Class : public java_lang_Object, private FieldAccess {
553 // Static offsets of the object's instance fields.
554 // TODO These offsets need to be checked on VM startup.
555 static const off_t offset_signers = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
556 static const off_t offset_pd = MEMORY_ALIGN(offset_signers + SIZEOF_VOID_P, SIZEOF_VOID_P);
557 static const off_t offset_vmdata = MEMORY_ALIGN(offset_pd + SIZEOF_VOID_P, SIZEOF_VOID_P);
558 static const off_t offset_constructor = MEMORY_ALIGN(offset_vmdata + SIZEOF_VOID_P, SIZEOF_VOID_P);
561 java_lang_Class(java_handle_t* h) : java_lang_Object(h) {}
564 inline void set_pd(java_handle_t* value);
565 inline void set_pd(jobject value);
568 inline void java_lang_Class::set_pd(java_handle_t* value)
570 set(_handle, offset_pd, value);
573 inline void java_lang_Class::set_pd(jobject value)
575 set_pd((java_handle_t*) value);
580 * GNU Classpath java/lang/StackTraceElement
585 * 1. java.lang.String fileName;
587 * 3. java.lang.String declaringClass;
588 * 4. java.lang.String methodName;
589 * 5. boolean isNative;
591 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
593 // Static offsets of the object's instance fields.
594 // TODO These offsets need to be checked on VM startup.
595 static const off_t offset_fileName = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
596 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
597 static const off_t offset_declaringClass = MEMORY_ALIGN(offset_lineNumber + sizeof(int32_t), SIZEOF_VOID_P);
598 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
599 static const off_t offset_isNative = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
602 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
603 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);
606 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)
608 java_lang_StackTraceElement((java_handle_t*) h);
610 set(_handle, offset_fileName, fileName);
611 set(_handle, offset_lineNumber, lineNumber);
612 set(_handle, offset_declaringClass, declaringClass);
613 set(_handle, offset_methodName, methodName);
614 set(_handle, offset_isNative, isNative);
619 * GNU Classpath java/lang/String
626 * 3. int cachedHashCode;
629 class java_lang_String : public java_lang_Object, private FieldAccess {
631 // Static offsets of the object's instance fields.
632 // TODO These offsets need to be checked on VM startup.
633 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
634 static const off_t offset_count = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
635 static const off_t offset_cachedHashCode = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
636 static const off_t offset_offset = MEMORY_ALIGN(offset_cachedHashCode + sizeof(int32_t), sizeof(int32_t));
639 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
640 java_lang_String(jstring h);
641 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
644 inline java_handle_chararray_t* get_value () const;
645 inline int32_t get_count () const;
646 inline int32_t get_offset() const;
649 inline void set_value (java_handle_chararray_t* value);
650 inline void set_count (int32_t value);
651 inline void set_offset(int32_t value);
654 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
656 java_lang_String((java_handle_t*) h);
659 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)
666 inline java_handle_chararray_t* java_lang_String::get_value() const
668 return get<java_handle_chararray_t*>(_handle, offset_value);
671 inline int32_t java_lang_String::get_count() const
673 return get<int32_t>(_handle, offset_count);
676 inline int32_t java_lang_String::get_offset() const
678 return get<int32_t>(_handle, offset_offset);
681 inline void java_lang_String::set_value(java_handle_chararray_t* value)
683 set(_handle, offset_value, value);
686 inline void java_lang_String::set_count(int32_t value)
688 set(_handle, offset_count, value);
691 inline void java_lang_String::set_offset(int32_t value)
693 set(_handle, offset_offset, value);
698 * GNU Classpath java/lang/Thread
703 * 1. java.lang.VMThread vmThread;
704 * 2. java.lang.ThreadGroup group;
705 * 3. java.lang.Runnable runnable;
706 * 4. java.lang.String name;
710 * 8. java.lang.Throwable stillborn;
711 * 9. java.lang.ClassLoader contextClassLoader;
712 * 10. boolean contextClassLoaderIsSystemClassLoader;
714 * 12. java.lang.Object parkBlocker;
715 * 13. gnu.java.util.WeakIdentityHashMap locals;
716 * 14. java_lang_Thread_UncaughtExceptionHandler exceptionHandler;
718 class java_lang_Thread : public java_lang_Object, private FieldAccess {
720 // Static offsets of the object's instance fields.
721 // TODO These offsets need to be checked on VM startup.
722 static const off_t offset_vmThread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
723 static const off_t offset_group = MEMORY_ALIGN(offset_vmThread + SIZEOF_VOID_P, SIZEOF_VOID_P);
724 static const off_t offset_runnable = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
725 static const off_t offset_name = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
726 static const off_t offset_daemon = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
727 static const off_t offset_priority = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
728 static const off_t offset_stacksize = MEMORY_ALIGN(offset_priority + sizeof(int32_t), sizeof(int64_t));
729 static const off_t offset_stillborn = MEMORY_ALIGN(offset_stacksize + sizeof(int64_t), SIZEOF_VOID_P);
730 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_stillborn + SIZEOF_VOID_P, SIZEOF_VOID_P);
731 static const off_t offset_contextClassLoaderIsSystemClassLoader = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
732 static const off_t offset_threadId = MEMORY_ALIGN(offset_contextClassLoaderIsSystemClassLoader + sizeof(int32_t), sizeof(int64_t));
733 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadId + sizeof(int64_t), SIZEOF_VOID_P);
734 static const off_t offset_locals = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
735 static const off_t offset_exceptionHandler = MEMORY_ALIGN(offset_locals + SIZEOF_VOID_P, SIZEOF_VOID_P);
738 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
739 // java_lang_Thread(threadobject* t);
742 inline java_handle_t* get_vmThread () const;
743 inline java_handle_t* get_group () const;
744 inline java_handle_t* get_name () const;
745 inline int32_t get_daemon () const;
746 inline int32_t get_priority () const;
747 inline java_handle_t* get_exceptionHandler() const;
750 inline void set_group(java_handle_t* value);
754 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
756 // java_lang_Thread(thread_get_object(t));
760 inline java_handle_t* java_lang_Thread::get_vmThread() const
762 return get<java_handle_t*>(_handle, offset_vmThread);
765 inline java_handle_t* java_lang_Thread::get_group() const
767 return get<java_handle_t*>(_handle, offset_group);
770 inline java_handle_t* java_lang_Thread::get_name() const
772 return get<java_handle_t*>(_handle, offset_name);
775 inline int32_t java_lang_Thread::get_daemon() const
777 return get<int32_t>(_handle, offset_daemon);
780 inline int32_t java_lang_Thread::get_priority() const
782 return get<int32_t>(_handle, offset_priority);
785 inline java_handle_t* java_lang_Thread::get_exceptionHandler() const
787 return get<java_handle_t*>(_handle, offset_exceptionHandler);
791 inline void java_lang_Thread::set_group(java_handle_t* value)
793 set(_handle, offset_group, value);
798 * GNU Classpath java/lang/VMThread
803 * 1. java.lang.Thread thread;
804 * 2. boolean running;
805 * 3. java.lang.VMThread vmdata;
807 class java_lang_VMThread : public java_lang_Object, private FieldAccess {
809 // Static offsets of the object's instance fields.
810 // TODO These offsets need to be checked on VM startup.
811 static const off_t offset_thread = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
812 static const off_t offset_running = MEMORY_ALIGN(offset_thread + SIZEOF_VOID_P, sizeof(int32_t));
813 static const off_t offset_vmdata = MEMORY_ALIGN(offset_running + sizeof(int32_t), SIZEOF_VOID_P);
816 java_lang_VMThread(java_handle_t* h) : java_lang_Object(h) {}
817 java_lang_VMThread(jobject h);
818 java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata);
821 inline java_handle_t* get_thread() const;
822 inline threadobject* get_vmdata() const;
825 inline void set_thread(java_handle_t* value);
826 inline void set_vmdata(threadobject* value);
830 inline java_lang_VMThread::java_lang_VMThread(jobject h) : java_lang_Object(h)
832 java_lang_VMThread((java_handle_t*) h);
835 inline java_lang_VMThread::java_lang_VMThread(java_handle_t* h, java_handle_t* thread, threadobject* vmdata) : java_lang_Object(h)
842 inline java_handle_t* java_lang_VMThread::get_thread() const
844 return get<java_handle_t*>(_handle, offset_thread);
847 inline threadobject* java_lang_VMThread::get_vmdata() const
849 return get<threadobject*>(_handle, offset_vmdata);
853 inline void java_lang_VMThread::set_thread(java_handle_t* value)
855 set(_handle, offset_thread, value);
858 inline void java_lang_VMThread::set_vmdata(threadobject* value)
860 set(_handle, offset_vmdata, value);
865 * GNU Classpath java/lang/Throwable
870 * 1. java.lang.String detailMessage;
871 * 2. java.lang.Throwable cause;
872 * 3. java.lang.StackTraceElement[] stackTrace;
873 * 4. java.lang.VMThrowable vmState;
875 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
877 // Static offsets of the object's instance fields.
878 // TODO These offsets need to be checked on VM startup.
879 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
880 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
881 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
882 static const off_t offset_vmState = MEMORY_ALIGN(offset_stackTrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
885 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
888 inline java_handle_t* get_detailMessage() const;
889 inline java_handle_t* get_cause () const;
890 inline java_handle_t* get_vmState () const;
894 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
896 return get<java_handle_t*>(_handle, offset_detailMessage);
899 inline java_handle_t* java_lang_Throwable::get_cause() const
901 return get<java_handle_t*>(_handle, offset_cause);
904 inline java_handle_t* java_lang_Throwable::get_vmState() const
906 return get<java_handle_t*>(_handle, offset_vmState);
911 * GNU Classpath java/lang/VMThrowable
916 * 1. java.lang.Object vmdata;
918 class java_lang_VMThrowable : public java_lang_Object, private FieldAccess {
920 // Static offsets of the object's instance fields.
921 // TODO These offsets need to be checked on VM startup.
922 static const off_t offset_vmdata = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
925 java_lang_VMThrowable(java_handle_t* h) : java_lang_Object(h) {}
926 java_lang_VMThrowable(jobject h);
928 inline java_handle_bytearray_t* get_vmdata() const;
929 inline void set_vmdata(java_handle_bytearray_t* value);
932 inline java_lang_VMThrowable::java_lang_VMThrowable(jobject h) : java_lang_Object(h)
934 java_lang_VMThrowable((java_handle_t*) h);
937 inline java_handle_bytearray_t* java_lang_VMThrowable::get_vmdata() const
939 return get<java_handle_bytearray_t*>(_handle, offset_vmdata);
942 inline void java_lang_VMThrowable::set_vmdata(java_handle_bytearray_t* value)
944 set(_handle, offset_vmdata, value);
949 * GNU Classpath java/lang/reflect/VMConstructor
954 * 1. java.lang.Class clazz;
956 * 3. byte[] annotations;
957 * 4. byte[] parameterAnnotations;
958 * 5. java.util.Map declaredAnnotations;
959 * 6. java.lang.reflect.Constructor cons;
961 class java_lang_reflect_VMConstructor : public java_lang_Object, private FieldAccess {
963 // Static offsets of the object's instance fields.
964 // TODO These offsets need to be checked on VM startup.
965 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
966 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
967 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
968 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
969 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
970 static const off_t offset_cons = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
973 java_lang_reflect_VMConstructor(java_handle_t* h) : java_lang_Object(h) {}
974 java_lang_reflect_VMConstructor(jobject h);
975 java_lang_reflect_VMConstructor(methodinfo* m);
978 inline classinfo* get_clazz () const;
979 inline int32_t get_slot () const;
980 inline java_handle_bytearray_t* get_annotations () const;
981 inline java_handle_bytearray_t* get_parameterAnnotations() const;
982 inline java_handle_t* get_declaredAnnotations () const;
983 inline java_handle_t* get_cons () const;
986 inline void set_clazz (classinfo* value);
987 inline void set_slot (int32_t value);
988 inline void set_annotations (java_handle_bytearray_t* value);
989 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
990 inline void set_declaredAnnotations (java_handle_t* value);
991 inline void set_cons (java_handle_t* value);
993 // Convenience functions.
994 inline methodinfo* get_method();
998 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(jobject h) : java_lang_Object(h)
1000 java_lang_reflect_VMConstructor((java_handle_t*) h);
1003 inline java_lang_reflect_VMConstructor::java_lang_reflect_VMConstructor(methodinfo* m)
1005 _handle = builtin_new(class_java_lang_reflect_VMConstructor);
1010 int slot = m - m->clazz->methods;
1011 java_handle_bytearray_t* annotations = method_get_annotations(m);
1012 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1014 set_clazz(m->clazz);
1016 set_annotations(annotations);
1017 set_parameterAnnotations(parameterAnnotations);
1021 inline classinfo* java_lang_reflect_VMConstructor::get_clazz() const
1023 return get<classinfo*>(_handle, offset_clazz);
1026 inline int32_t java_lang_reflect_VMConstructor::get_slot() const
1028 return get<int32_t>(_handle, offset_slot);
1031 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_annotations() const
1033 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1036 inline java_handle_bytearray_t* java_lang_reflect_VMConstructor::get_parameterAnnotations() const
1038 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1041 inline java_handle_t* java_lang_reflect_VMConstructor::get_declaredAnnotations() const
1043 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1046 inline java_handle_t* java_lang_reflect_VMConstructor::get_cons() const
1048 return get<java_handle_t*>(_handle, offset_cons);
1051 inline void java_lang_reflect_VMConstructor::set_clazz(classinfo* value)
1053 set(_handle, offset_clazz, value);
1056 inline void java_lang_reflect_VMConstructor::set_slot(int32_t value)
1058 set(_handle, offset_slot, value);
1061 inline void java_lang_reflect_VMConstructor::set_annotations(java_handle_bytearray_t* value)
1063 set(_handle, offset_annotations, value);
1066 inline void java_lang_reflect_VMConstructor::set_parameterAnnotations(java_handle_bytearray_t* value)
1068 set(_handle, offset_parameterAnnotations, value);
1071 inline void java_lang_reflect_VMConstructor::set_declaredAnnotations(java_handle_t* value)
1073 set(_handle, offset_declaredAnnotations, value);
1076 inline void java_lang_reflect_VMConstructor::set_cons(java_handle_t* value)
1078 set(_handle, offset_cons, value);
1081 inline methodinfo* java_lang_reflect_VMConstructor::get_method()
1083 classinfo* c = get_clazz();
1084 int32_t slot = get_slot();
1085 methodinfo* m = &(c->methods[slot]);
1091 * GNU Classpath java/lang/reflect/Constructor
1097 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1098 * 3. java.lang.reflect.VMConstructor cons;
1100 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
1102 // Static offsets of the object's instance fields.
1103 // TODO These offsets need to be checked on VM startup.
1104 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1105 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1106 static const off_t offset_cons = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1109 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
1110 java_lang_reflect_Constructor(jobject h);
1111 java_lang_reflect_Constructor(methodinfo* m);
1113 java_handle_t* new_instance(java_handle_objectarray_t* args);
1116 inline int32_t get_flag() const;
1117 inline java_handle_t* get_cons() const;
1120 inline void set_cons(java_handle_t* value);
1122 // Convenience functions.
1123 inline methodinfo* get_method () const;
1124 inline int32_t get_override() const;
1128 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
1130 java_lang_reflect_Constructor((java_handle_t*) h);
1133 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
1135 java_lang_reflect_VMConstructor jlrvmc(m);
1137 if (jlrvmc.is_null())
1140 _handle = builtin_new(class_java_lang_reflect_Constructor);
1145 // Link the two Java objects.
1146 set_cons(jlrvmc.get_handle());
1147 jlrvmc.set_cons(get_handle());
1151 inline int32_t java_lang_reflect_Constructor::get_flag() const
1153 return get<int32_t>(_handle, offset_flag);
1156 inline java_handle_t* java_lang_reflect_Constructor::get_cons() const
1158 return get<java_handle_t*>(_handle, offset_cons);
1162 inline void java_lang_reflect_Constructor::set_cons(java_handle_t* value)
1164 set(_handle, offset_cons, value);
1168 inline methodinfo* java_lang_reflect_Constructor::get_method() const
1170 java_lang_reflect_VMConstructor jlrvmc(get_cons());
1171 return jlrvmc.get_method();
1174 inline int32_t java_lang_reflect_Constructor::get_override() const
1181 * GNU Classpath java/lang/reflect/VMField
1186 * 1. java.lang.Class clazz;
1187 * 2. java.lang.String name;
1189 * 4. byte[] annotations;
1190 * 5. java.lang.Map declaredAnnotations;
1191 * 6. java.lang.reflect.Field f;
1193 class java_lang_reflect_VMField : public java_lang_Object, private FieldAccess {
1195 // Static offsets of the object's instance fields.
1196 // TODO These offsets need to be checked on VM startup.
1197 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1198 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1199 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1200 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1201 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1202 static const off_t offset_f = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1205 java_lang_reflect_VMField(java_handle_t* h) : java_lang_Object(h) {}
1206 java_lang_reflect_VMField(jobject h);
1207 java_lang_reflect_VMField(fieldinfo* f);
1210 inline classinfo* get_clazz () const;
1211 inline int32_t get_slot () const;
1212 inline java_handle_bytearray_t* get_annotations () const;
1213 inline java_handle_t* get_declaredAnnotations() const;
1214 inline java_handle_t* get_f () const;
1217 inline void set_clazz (classinfo* value);
1218 inline void set_name (java_handle_t* value);
1219 inline void set_slot (int32_t value);
1220 inline void set_annotations (java_handle_bytearray_t* value);
1221 inline void set_declaredAnnotations(java_handle_t* value);
1222 inline void set_f (java_handle_t* value);
1224 // Convenience functions.
1225 inline fieldinfo* get_field() const;
1229 inline java_lang_reflect_VMField::java_lang_reflect_VMField(jobject h) : java_lang_Object(h)
1231 java_lang_reflect_VMField((java_handle_t*) h);
1234 inline java_lang_reflect_VMField::java_lang_reflect_VMField(fieldinfo* f)
1236 _handle = builtin_new(class_java_lang_reflect_VMField);
1241 java_handle_t* name = javastring_intern(javastring_new(f->name));
1242 int slot = f - f->clazz->fields;
1243 java_handle_bytearray_t* annotations = field_get_annotations(f);
1245 set_clazz(f->clazz);
1248 set_annotations(annotations);
1252 inline classinfo* java_lang_reflect_VMField::get_clazz() const
1254 return get<classinfo*>(_handle, offset_clazz);
1257 inline int32_t java_lang_reflect_VMField::get_slot() const
1259 return get<int32_t>(_handle, offset_slot);
1262 inline java_handle_bytearray_t* java_lang_reflect_VMField::get_annotations() const
1264 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1267 inline java_handle_t* java_lang_reflect_VMField::get_declaredAnnotations() const
1269 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1272 inline java_handle_t* java_lang_reflect_VMField::get_f() const
1274 return get<java_handle_t*>(_handle, offset_f);
1278 inline void java_lang_reflect_VMField::set_clazz(classinfo* value)
1280 set(_handle, offset_clazz, value);
1283 inline void java_lang_reflect_VMField::set_name(java_handle_t* value)
1285 set(_handle, offset_name, value);
1288 inline void java_lang_reflect_VMField::set_slot(int32_t value)
1290 set(_handle, offset_slot, value);
1293 inline void java_lang_reflect_VMField::set_annotations(java_handle_bytearray_t* value)
1295 set(_handle, offset_annotations, value);
1298 inline void java_lang_reflect_VMField::set_declaredAnnotations(java_handle_t* value)
1300 set(_handle, offset_declaredAnnotations, value);
1303 inline void java_lang_reflect_VMField::set_f(java_handle_t* value)
1305 set(_handle, offset_f, value);
1308 inline fieldinfo* java_lang_reflect_VMField::get_field() const
1310 classinfo* c = get_clazz();
1311 int32_t slot = get_slot();
1312 fieldinfo* f = &(c->fields[slot]);
1318 * GNU Classpath java/lang/reflect/Field
1324 * 2. gnu.java.lang.reflect.FieldSignatureParser p;
1325 * 3. java.lang.reflect.VMField f;
1327 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
1329 // Static offsets of the object's instance fields.
1330 // TODO These offsets need to be checked on VM startup.
1331 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1332 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1333 static const off_t offset_f = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1336 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
1337 java_lang_reflect_Field(jobject h);
1338 java_lang_reflect_Field(fieldinfo* f);
1341 inline int32_t get_flag() const;
1342 inline java_handle_t* get_f() const;
1345 inline void set_f(java_handle_t* value);
1347 // Convenience functions.
1348 inline fieldinfo* get_field() const;
1352 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
1354 java_lang_reflect_Field((java_handle_t*) h);
1357 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
1359 java_lang_reflect_VMField jlrvmf(f);
1361 if (jlrvmf.is_null())
1364 _handle = builtin_new(class_java_lang_reflect_Field);
1369 // Link the two Java objects.
1370 set_f(jlrvmf.get_handle());
1371 jlrvmf.set_f(get_handle());
1375 inline int32_t java_lang_reflect_Field::get_flag() const
1377 return get<int32_t>(_handle, offset_flag);
1380 inline java_handle_t* java_lang_reflect_Field::get_f() const
1382 return get<java_handle_t*>(_handle, offset_f);
1386 inline void java_lang_reflect_Field::set_f(java_handle_t* value)
1388 set(_handle, offset_f, value);
1392 inline fieldinfo* java_lang_reflect_Field::get_field() const
1394 java_lang_reflect_VMField jlrvmf(get_f());
1395 return jlrvmf.get_field();
1400 * GNU Classpath java/lang/reflect/VMMethod
1405 * 1. java.lang.Class clazz;
1406 * 2. java.lang.String name;
1408 * 4. byte[] annotations;
1409 * 5. byte[] parameterAnnotations;
1410 * 6. byte[] annotationDefault;
1411 * 7. java.lang.Map declaredAnnotations;
1412 * 8. java.lang.reflect.Method m;
1414 class java_lang_reflect_VMMethod : public java_lang_Object, private FieldAccess {
1416 // Static offsets of the object's instance fields.
1417 // TODO These offsets need to be checked on VM startup.
1418 static const off_t offset_clazz = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1419 static const off_t offset_name = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, SIZEOF_VOID_P);
1420 static const off_t offset_slot = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1421 static const off_t offset_annotations = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
1422 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1423 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1424 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
1425 static const off_t offset_m = MEMORY_ALIGN(offset_declaredAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
1428 java_lang_reflect_VMMethod(java_handle_t* h) : java_lang_Object(h) {}
1429 java_lang_reflect_VMMethod(jobject h);
1430 java_lang_reflect_VMMethod(methodinfo* m);
1433 inline classinfo* get_clazz () const;
1434 inline int32_t get_slot () const;
1435 inline java_handle_bytearray_t* get_annotations () const;
1436 inline java_handle_bytearray_t* get_parameterAnnotations() const;
1437 inline java_handle_bytearray_t* get_annotationDefault () const;
1438 inline java_handle_t* get_declaredAnnotations () const;
1439 inline java_handle_t* get_m () const;
1442 inline void set_clazz (classinfo* value);
1443 inline void set_name (java_handle_t* value);
1444 inline void set_slot (int32_t value);
1445 inline void set_annotations (java_handle_bytearray_t* value);
1446 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
1447 inline void set_annotationDefault (java_handle_bytearray_t* value);
1448 inline void set_declaredAnnotations (java_handle_t* value);
1449 inline void set_m (java_handle_t* value);
1451 // Convenience functions.
1452 inline methodinfo* get_method() const;
1455 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(jobject h) : java_lang_Object(h)
1457 java_lang_reflect_VMMethod((java_handle_t*) h);
1460 inline java_lang_reflect_VMMethod::java_lang_reflect_VMMethod(methodinfo* m)
1462 _handle = builtin_new(class_java_lang_reflect_VMMethod);
1467 java_handle_t* name = javastring_intern(javastring_new(m->name));
1468 int slot = m - m->clazz->methods;
1469 java_handle_bytearray_t* annotations = method_get_annotations(m);
1470 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
1471 java_handle_bytearray_t* annotationDefault = method_get_annotationdefault(m);
1473 set_clazz(m->clazz);
1476 set_annotations(annotations);
1477 set_parameterAnnotations(parameterAnnotations);
1478 set_annotationDefault(annotationDefault);
1481 inline classinfo* java_lang_reflect_VMMethod::get_clazz() const
1483 return get<classinfo*>(_handle, offset_clazz);
1486 inline int32_t java_lang_reflect_VMMethod::get_slot() const
1488 return get<int32_t>(_handle, offset_slot);
1491 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotations() const
1493 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
1496 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_parameterAnnotations() const
1498 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
1501 inline java_handle_bytearray_t* java_lang_reflect_VMMethod::get_annotationDefault() const
1503 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
1506 inline java_handle_t* java_lang_reflect_VMMethod::get_declaredAnnotations() const
1508 return get<java_handle_t*>(_handle, offset_declaredAnnotations);
1511 inline java_handle_t* java_lang_reflect_VMMethod::get_m() const
1513 return get<java_handle_t*>(_handle, offset_m);
1516 inline void java_lang_reflect_VMMethod::set_clazz(classinfo* value)
1518 set(_handle, offset_clazz, value);
1521 inline void java_lang_reflect_VMMethod::set_name(java_handle_t* value)
1523 set(_handle, offset_name, value);
1526 inline void java_lang_reflect_VMMethod::set_slot(int32_t value)
1528 set(_handle, offset_slot, value);
1531 inline void java_lang_reflect_VMMethod::set_annotations(java_handle_bytearray_t* value)
1533 set(_handle, offset_annotations, value);
1536 inline void java_lang_reflect_VMMethod::set_parameterAnnotations(java_handle_bytearray_t* value)
1538 set(_handle, offset_parameterAnnotations, value);
1541 inline void java_lang_reflect_VMMethod::set_annotationDefault(java_handle_bytearray_t* value)
1543 set(_handle, offset_annotationDefault, value);
1546 inline void java_lang_reflect_VMMethod::set_declaredAnnotations(java_handle_t* value)
1548 set(_handle, offset_declaredAnnotations, value);
1551 inline void java_lang_reflect_VMMethod::set_m(java_handle_t* value)
1553 set(_handle, offset_m, value);
1556 inline methodinfo* java_lang_reflect_VMMethod::get_method() const
1558 classinfo* c = get_clazz();
1559 int32_t slot = get_slot();
1560 methodinfo* m = &(c->methods[slot]);
1566 * GNU Classpath java/lang/reflect/Method
1572 * 2. gnu.java.lang.reflect.MethodSignatureParser p;
1573 * 3. java.lang.reflect.VMMethod m;
1575 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
1577 // Static offsets of the object's instance fields.
1578 // TODO These offsets need to be checked on VM startup.
1579 static const off_t offset_flag = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1580 static const off_t offset_p = MEMORY_ALIGN(offset_flag + sizeof(int32_t), SIZEOF_VOID_P);
1581 static const off_t offset_m = MEMORY_ALIGN(offset_p + SIZEOF_VOID_P, SIZEOF_VOID_P);
1584 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
1585 java_lang_reflect_Method(jobject h);
1586 java_lang_reflect_Method(methodinfo* m);
1588 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
1591 inline int32_t get_flag() const;
1592 inline java_handle_t* get_m() const;
1595 inline void set_m(java_handle_t* value);
1597 // Convenience functions.
1598 inline methodinfo* get_method () const;
1599 inline int32_t get_override() const;
1603 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
1605 java_lang_reflect_Method((java_handle_t*) h);
1608 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
1610 java_lang_reflect_VMMethod jlrvmm(m);
1612 if (jlrvmm.is_null())
1615 _handle = builtin_new(class_java_lang_reflect_Method);
1620 // Link the two Java objects.
1621 set_m(jlrvmm.get_handle());
1622 jlrvmm.set_m(get_handle());
1626 inline int32_t java_lang_reflect_Method::get_flag() const
1628 return get<int32_t>(_handle, offset_flag);
1631 inline java_handle_t* java_lang_reflect_Method::get_m() const
1633 return get<java_handle_t*>(_handle, offset_m);
1637 inline void java_lang_reflect_Method::set_m(java_handle_t* value)
1639 set(_handle, offset_m, value);
1643 inline methodinfo* java_lang_reflect_Method::get_method() const
1645 java_lang_reflect_VMMethod jlrvmm(get_m());
1646 return jlrvmm.get_method();
1649 inline int32_t java_lang_reflect_Method::get_override() const
1656 * GNU Classpath java/nio/Buffer
1665 * 5. gnu.classpath.Pointer address;
1667 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
1669 // Static offsets of the object's instance fields.
1670 // TODO These offsets need to be checked on VM startup.
1671 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1672 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1673 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1674 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1675 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1678 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
1681 inline int32_t get_cap() const;
1684 inline int32_t java_nio_Buffer::get_cap() const
1686 return get<int32_t>(_handle, offset_cap);
1691 * GNU Classpath java/nio/DirectByteBufferImpl
1700 * 5. gnu.classpath.Pointer address;
1701 * 6. java.nio.ByteOrder endian;
1702 * 7. byte[] backing_buffer;
1703 * 8. int array_offset;
1704 * 9. java.lang.Object owner;
1706 class java_nio_DirectByteBufferImpl : public java_lang_Object, private FieldAccess {
1708 // Static offsets of the object's instance fields.
1709 // TODO These offsets need to be checked on VM startup.
1710 static const off_t offset_cap = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
1711 static const off_t offset_limit = MEMORY_ALIGN(offset_cap + sizeof(int32_t), sizeof(int32_t));
1712 static const off_t offset_pos = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
1713 static const off_t offset_mark = MEMORY_ALIGN(offset_pos + sizeof(int32_t), sizeof(int32_t));
1714 static const off_t offset_address = MEMORY_ALIGN(offset_mark + sizeof(int32_t), SIZEOF_VOID_P);
1715 static const off_t offset_endian = MEMORY_ALIGN(offset_address + SIZEOF_VOID_P, SIZEOF_VOID_P);
1716 static const off_t offset_backing_buffer = MEMORY_ALIGN(offset_endian + SIZEOF_VOID_P, SIZEOF_VOID_P);
1717 static const off_t offset_array_offset = MEMORY_ALIGN(offset_backing_buffer + SIZEOF_VOID_P, sizeof(int32_t));
1718 static const off_t offset_owner = MEMORY_ALIGN(offset_array_offset + sizeof(int32_t), SIZEOF_VOID_P);
1721 java_nio_DirectByteBufferImpl(java_handle_t* h) : java_lang_Object(h) {}
1722 java_nio_DirectByteBufferImpl(jobject h);
1725 inline java_handle_t* get_address() const;
1728 inline java_nio_DirectByteBufferImpl::java_nio_DirectByteBufferImpl(jobject h) : java_lang_Object(h)
1730 java_nio_DirectByteBufferImpl((java_handle_t*) h);
1733 inline java_handle_t* java_nio_DirectByteBufferImpl::get_address() const
1735 return get<java_handle_t*>(_handle, offset_address);
1740 * GNU Classpath gnu/classpath/Pointer
1742 * Actually there are two classes, gnu.classpath.Pointer32 and
1743 * gnu.classpath.Pointer64, but we only define the abstract super
1744 * class and use the int/long field as void* type.
1751 class gnu_classpath_Pointer : public java_lang_Object, private FieldAccess {
1753 // Static offsets of the object's instance fields.
1754 // TODO These offsets need to be checked on VM startup.
1755 static const off_t offset_data = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1758 gnu_classpath_Pointer(java_handle_t* h) : java_lang_Object(h) {}
1759 gnu_classpath_Pointer(java_handle_t* h, void* data);
1762 inline void* get_data() const;
1765 inline void set_data(void* value);
1768 inline gnu_classpath_Pointer::gnu_classpath_Pointer(java_handle_t* h, void* data) : java_lang_Object(h)
1773 inline void* gnu_classpath_Pointer::get_data() const
1775 return get<void*>(_handle, offset_data);
1778 inline void gnu_classpath_Pointer::set_data(void* value)
1780 set(_handle, offset_data, value);
1783 #endif // WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH
1786 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
1789 * OpenJDK java/lang/AssertionStatusDirectives
1794 * 1. java.lang.String[] classes;
1795 * 2. boolean[] classEnabled;
1796 * 3. java.lang.String[] packages;
1797 * 4. boolean[] packageEnabled;
1800 class java_lang_AssertionStatusDirectives : public java_lang_Object, private FieldAccess {
1802 // Static offsets of the object's instance fields.
1803 // TODO These offsets need to be checked on VM startup.
1804 static const off_t offset_classes = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1805 static const off_t offset_classEnabled = MEMORY_ALIGN(offset_classes + SIZEOF_VOID_P, SIZEOF_VOID_P);
1806 static const off_t offset_packages = MEMORY_ALIGN(offset_classEnabled + SIZEOF_VOID_P, SIZEOF_VOID_P);
1807 static const off_t offset_packageEnabled = MEMORY_ALIGN(offset_packages + SIZEOF_VOID_P, SIZEOF_VOID_P);
1808 static const off_t offset_deflt = MEMORY_ALIGN(offset_packageEnabled + SIZEOF_VOID_P, sizeof(int32_t));
1811 java_lang_AssertionStatusDirectives(java_handle_objectarray_t* classes, java_handle_booleanarray_t* classEnabled, java_handle_objectarray_t* packages, java_handle_booleanarray_t* packageEnabled);
1814 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)
1816 classinfo* c = load_class_bootstrap(utf_new_char("java/lang/AssertionStatusDirectives"));
1818 // FIXME Load the class at VM startup.
1822 _handle = builtin_new(c);
1827 set(_handle, offset_classes, classes);
1828 set(_handle, offset_classEnabled, classEnabled);
1829 set(_handle, offset_packages, packages);
1830 set(_handle, offset_packageEnabled, packageEnabled);
1835 * OpenJDK java/lang/StackTraceElement
1840 * 1. java.lang.String declaringClass;
1841 * 2. java.lang.String methodName;
1842 * 3. java.lang.String fileName;
1843 * 4. int lineNumber;
1845 class java_lang_StackTraceElement : public java_lang_Object, private FieldAccess {
1847 // Static offsets of the object's instance fields.
1848 // TODO These offsets need to be checked on VM startup.
1849 static const off_t offset_declaringClass = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1850 static const off_t offset_methodName = MEMORY_ALIGN(offset_declaringClass + SIZEOF_VOID_P, SIZEOF_VOID_P);
1851 static const off_t offset_fileName = MEMORY_ALIGN(offset_methodName + SIZEOF_VOID_P, SIZEOF_VOID_P);
1852 static const off_t offset_lineNumber = MEMORY_ALIGN(offset_fileName + SIZEOF_VOID_P, sizeof(int32_t));
1855 java_lang_StackTraceElement(java_handle_t* h) : java_lang_Object(h) {}
1856 java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber);
1859 inline java_lang_StackTraceElement::java_lang_StackTraceElement(java_handle_t* declaringClass, java_handle_t* methodName, java_handle_t* fileName, int32_t lineNumber)
1861 _handle = builtin_new(class_java_lang_StackTraceElement);
1866 set(_handle, offset_declaringClass, declaringClass);
1867 set(_handle, offset_methodName, methodName);
1868 set(_handle, offset_fileName, fileName);
1869 set(_handle, offset_lineNumber, lineNumber);
1874 * OpenJDK java/lang/String
1884 class java_lang_String : public java_lang_Object, private FieldAccess {
1886 // Static offsets of the object's instance fields.
1887 // TODO These offsets need to be checked on VM startup.
1888 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1889 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
1890 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
1891 static const off_t offset_hash = MEMORY_ALIGN(offset_count + sizeof(int32_t), sizeof(int32_t));
1894 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
1895 java_lang_String(jstring h);
1896 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
1899 inline java_handle_chararray_t* get_value () const;
1900 inline int32_t get_offset() const;
1901 inline int32_t get_count () const;
1904 inline void set_value (java_handle_chararray_t* value);
1905 inline void set_offset(int32_t value);
1906 inline void set_count (int32_t value);
1909 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
1911 java_lang_String((java_handle_t*) h);
1914 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)
1921 inline java_handle_chararray_t* java_lang_String::get_value() const
1923 return get<java_handle_chararray_t*>(_handle, offset_value);
1926 inline int32_t java_lang_String::get_offset() const
1928 return get<int32_t>(_handle, offset_offset);
1931 inline int32_t java_lang_String::get_count() const
1933 return get<int32_t>(_handle, offset_count);
1936 inline void java_lang_String::set_value(java_handle_chararray_t* value)
1938 set(_handle, offset_value, value);
1941 inline void java_lang_String::set_offset(int32_t value)
1943 set(_handle, offset_offset, value);
1946 inline void java_lang_String::set_count(int32_t value)
1948 set(_handle, offset_count, value);
1953 * OpenJDK java/lang/Thread
1960 * 3. java_lang_Thread threadQ;
1962 * 5. boolean single_step;
1963 * 6. boolean daemon;
1964 * 7. boolean stillborn;
1965 * 8. java_lang_Runnable target;
1966 * 9. java_lang_ThreadGroup group;
1967 * 10. java_lang_ClassLoader contextClassLoader;
1968 * 11. java_security_AccessControlContext inheritedAccessControlContext;
1969 * 12. java_lang_ThreadLocal_ThreadLocalMap threadLocals;
1970 * 13. java_lang_ThreadLocal_ThreadLocalMap inheritableThreadLocals;
1971 * 14. long stackSize;
1972 * 15. long nativeParkEventPointer;
1974 * 17. int threadStatus;
1975 * 18. java_lang_Object parkBlocker;
1976 * 19. sun_nio_ch_Interruptible blocker;
1977 * 20. java_lang_Object blockerLock;
1978 * 21. boolean stopBeforeStart;
1979 * 22. java_lang_Throwable throwableFromStop;
1980 * 23. java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler;
1982 class java_lang_Thread : public java_lang_Object, private FieldAccess {
1984 // Static offsets of the object's instance fields.
1985 // TODO These offsets need to be checked on VM startup.
1986 static const off_t offset_name = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
1987 static const off_t offset_priority = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, sizeof(int32_t));
1988 static const off_t offset_threadQ = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
1989 static const off_t offset_eetop = MEMORY_ALIGN(offset_threadQ + SIZEOF_VOID_P, sizeof(int64_t));
1990 static const off_t offset_single_step = MEMORY_ALIGN(offset_eetop + sizeof(int64_t), sizeof(int32_t));
1991 static const off_t offset_daemon = MEMORY_ALIGN(offset_single_step + sizeof(int32_t), sizeof(int32_t));
1992 static const off_t offset_stillborn = MEMORY_ALIGN(offset_daemon + sizeof(int32_t), sizeof(int32_t));
1993 static const off_t offset_target = MEMORY_ALIGN(offset_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
1994 static const off_t offset_group = MEMORY_ALIGN(offset_target + SIZEOF_VOID_P, SIZEOF_VOID_P);
1995 static const off_t offset_contextClassLoader = MEMORY_ALIGN(offset_group + SIZEOF_VOID_P, SIZEOF_VOID_P);
1996 static const off_t offset_inheritedAccessControlContext = MEMORY_ALIGN(offset_contextClassLoader + SIZEOF_VOID_P, SIZEOF_VOID_P);
1997 static const off_t offset_threadLocals = MEMORY_ALIGN(offset_inheritedAccessControlContext + SIZEOF_VOID_P, SIZEOF_VOID_P);
1998 static const off_t offset_inheritableThreadLocals = MEMORY_ALIGN(offset_threadLocals + SIZEOF_VOID_P, SIZEOF_VOID_P);
1999 static const off_t offset_stackSize = MEMORY_ALIGN(offset_inheritableThreadLocals + SIZEOF_VOID_P, sizeof(int64_t));
2000 static const off_t offset_nativeParkEventPointer = MEMORY_ALIGN(offset_stackSize + sizeof(int64_t), sizeof(int64_t));
2001 static const off_t offset_tid = MEMORY_ALIGN(offset_nativeParkEventPointer + sizeof(int64_t), sizeof(int64_t));
2002 static const off_t offset_threadStatus = MEMORY_ALIGN(offset_tid + sizeof(int64_t), sizeof(int32_t));
2003 static const off_t offset_parkBlocker = MEMORY_ALIGN(offset_threadStatus + sizeof(int32_t), SIZEOF_VOID_P);
2004 static const off_t offset_blocker = MEMORY_ALIGN(offset_parkBlocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2005 static const off_t offset_blockerLock = MEMORY_ALIGN(offset_blocker + SIZEOF_VOID_P, SIZEOF_VOID_P);
2006 static const off_t offset_stopBeforeStart = MEMORY_ALIGN(offset_blockerLock + SIZEOF_VOID_P, sizeof(int32_t));
2007 static const off_t offset_throwableFromStop = MEMORY_ALIGN(offset_stopBeforeStart + sizeof(int32_t), SIZEOF_VOID_P);
2008 static const off_t offset_uncaughtExceptionHandler = MEMORY_ALIGN(offset_throwableFromStop + SIZEOF_VOID_P, SIZEOF_VOID_P);
2011 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2012 // java_lang_Thread(threadobject* t);
2015 inline int32_t get_priority () const;
2016 inline int32_t get_daemon () const;
2017 inline java_handle_t* get_group () const;
2018 inline java_handle_t* get_uncaughtExceptionHandler() const;
2021 inline void set_priority(int32_t value);
2022 inline void set_group (java_handle_t* value);
2026 inline int32_t java_lang_Thread::get_priority() const
2028 return get<int32_t>(_handle, offset_priority);
2031 inline int32_t java_lang_Thread::get_daemon() const
2033 return get<int32_t>(_handle, offset_daemon);
2036 inline java_handle_t* java_lang_Thread::get_group() const
2038 return get<java_handle_t*>(_handle, offset_group);
2041 inline java_handle_t* java_lang_Thread::get_uncaughtExceptionHandler() const
2043 return get<java_handle_t*>(_handle, offset_uncaughtExceptionHandler);
2047 inline void java_lang_Thread::set_priority(int32_t value)
2049 set(_handle, offset_priority, value);
2052 inline void java_lang_Thread::set_group(java_handle_t* value)
2054 set(_handle, offset_group, value);
2060 * OpenJDK java/lang/Throwable
2065 * 1. java.lang.Object backtrace;
2066 * 2. java.lang.String detailMessage;
2067 * 3. java.lang.Throwable cause;
2068 * 4. java.lang.StackTraceElement[] stackTrace;
2070 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2072 // Static offsets of the object's instance fields.
2073 // TODO These offsets need to be checked on VM startup.
2074 static const off_t offset_backtrace = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2075 static const off_t offset_detailMessage = MEMORY_ALIGN(offset_backtrace + SIZEOF_VOID_P, SIZEOF_VOID_P);
2076 static const off_t offset_cause = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2077 static const off_t offset_stackTrace = MEMORY_ALIGN(offset_cause + SIZEOF_VOID_P, SIZEOF_VOID_P);
2080 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2081 java_lang_Throwable(jobject h);
2082 java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace);
2085 inline java_handle_bytearray_t* get_backtrace () const;
2086 inline java_handle_t* get_detailMessage() const;
2087 inline java_handle_t* get_cause () const;
2090 inline void set_backtrace(java_handle_bytearray_t* value);
2094 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2096 java_lang_Throwable((java_handle_t*) h);
2099 inline java_lang_Throwable::java_lang_Throwable(jobject h, java_handle_bytearray_t* backtrace) : java_lang_Object(h)
2101 java_lang_Throwable((java_handle_t*) h);
2102 set_backtrace(backtrace);
2106 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2108 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2111 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2113 return get<java_handle_t*>(_handle, offset_detailMessage);
2116 inline java_handle_t* java_lang_Throwable::get_cause() const
2118 return get<java_handle_t*>(_handle, offset_cause);
2122 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2124 set(_handle, offset_backtrace, value);
2129 * OpenJDK java/lang/reflect/Constructor
2134 * 1. boolean override;
2135 * 2. java.lang.Class clazz;
2137 * 4. java.lang.Class[] parameterTypes;
2138 * 5. java.lang.Class[] exceptionTypes;
2140 * 7. java.lang.String signature;
2141 * 8. sun.reflect.generics.repository.ConstructorRepository genericInfo;
2142 * 9. byte[] annotations;
2143 * 10. byte[] parameterAnnotations;
2144 * 11. java.lang.Class securityCheckCache;
2145 * 12. sun.reflect.ConstructorAccessor constructorAccessor;
2146 * 13. java.lang.reflect.Constructor root;
2147 * 14. java.util.Map declaredAnnotations;
2149 class java_lang_reflect_Constructor : public java_lang_Object, private FieldAccess {
2151 // Static offsets of the object's instance fields.
2152 // TODO These offsets need to be checked on VM startup.
2153 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2154 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2155 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2156 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2157 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2158 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2159 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2160 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2161 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2162 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2163 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2164 static const off_t offset_constructorAccessor = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2165 static const off_t offset_root = MEMORY_ALIGN(offset_constructorAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2166 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2169 java_lang_reflect_Constructor(java_handle_t* h) : java_lang_Object(h) {}
2170 java_lang_reflect_Constructor(jobject h);
2171 java_lang_reflect_Constructor(methodinfo* m);
2173 java_handle_t* new_instance(java_handle_objectarray_t* args);
2176 inline int32_t get_override () const;
2177 inline classinfo* get_clazz () const;
2178 inline int32_t get_slot () const;
2179 inline java_handle_bytearray_t* get_annotations() const;
2182 inline void set_clazz (classinfo* value);
2183 inline void set_slot (int32_t value);
2184 inline void set_parameterTypes (java_handle_objectarray_t* value);
2185 inline void set_exceptionTypes (java_handle_objectarray_t* value);
2186 inline void set_modifiers (int32_t value);
2187 inline void set_signature (java_handle_t* value);
2188 inline void set_annotations (java_handle_bytearray_t* value);
2189 inline void set_parameterAnnotations(java_handle_bytearray_t* value);
2191 // Convenience functions.
2192 inline methodinfo* get_method();
2196 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(jobject h) : java_lang_Object(h)
2198 java_lang_reflect_Constructor((java_handle_t*) h);
2201 inline java_lang_reflect_Constructor::java_lang_reflect_Constructor(methodinfo* m)
2203 _handle = builtin_new(class_java_lang_reflect_Constructor);
2208 int slot = m - m->clazz->methods;
2209 java_handle_objectarray_t* parameterTypes = method_get_parametertypearray(m);
2210 java_handle_objectarray_t* exceptionTypes = method_get_exceptionarray(m);
2211 java_handle_bytearray_t* annotations = method_get_annotations(m);
2212 java_handle_bytearray_t* parameterAnnotations = method_get_parameterannotations(m);
2214 set_clazz(m->clazz);
2216 set_parameterTypes(parameterTypes);
2217 set_exceptionTypes(exceptionTypes);
2218 set_modifiers(m->flags & ACC_CLASS_REFLECT_MASK);
2219 set_signature(m->signature ? javastring_new(m->signature) : NULL);
2220 set_annotations(annotations);
2221 set_parameterAnnotations(parameterAnnotations);
2225 inline int32_t java_lang_reflect_Constructor::get_override() const
2227 return get<int32_t>(_handle, offset_override);
2230 inline classinfo* java_lang_reflect_Constructor::get_clazz() const
2232 return get<classinfo*>(_handle, offset_clazz);
2235 inline int32_t java_lang_reflect_Constructor::get_slot() const
2237 return get<int32_t>(_handle, offset_slot);
2240 inline java_handle_bytearray_t* java_lang_reflect_Constructor::get_annotations() const
2242 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2246 inline void java_lang_reflect_Constructor::set_clazz(classinfo* value)
2248 set(_handle, offset_clazz, value);
2251 inline void java_lang_reflect_Constructor::set_slot(int32_t value)
2253 set(_handle, offset_slot, value);
2256 inline void java_lang_reflect_Constructor::set_parameterTypes(java_handle_objectarray_t* value)
2258 set(_handle, offset_parameterTypes, value);
2261 inline void java_lang_reflect_Constructor::set_exceptionTypes(java_handle_objectarray_t* value)
2263 set(_handle, offset_exceptionTypes, value);
2266 inline void java_lang_reflect_Constructor::set_modifiers(int32_t value)
2268 set(_handle, offset_modifiers, value);
2271 inline void java_lang_reflect_Constructor::set_signature(java_handle_t* value)
2273 set(_handle, offset_signature, value);
2276 inline void java_lang_reflect_Constructor::set_annotations(java_handle_bytearray_t* value)
2278 set(_handle, offset_annotations, value);
2281 inline void java_lang_reflect_Constructor::set_parameterAnnotations(java_handle_bytearray_t* value)
2283 set(_handle, offset_parameterAnnotations, value);
2287 inline methodinfo* java_lang_reflect_Constructor::get_method()
2289 classinfo* c = get_clazz();
2290 int32_t slot = get_slot();
2291 methodinfo* m = &(c->methods[slot]);
2297 * OpenJDK java/lang/reflect/Field
2302 * 1. boolean override;
2303 * 2. java.lang.Class clazz;
2305 * 4. java.lang.String name;
2306 * 5. java.lang.Class type;
2308 * 7. java.lang.String signature;
2309 * 8. sun.reflect.generics.repository.FieldRepository genericInfo;
2310 * 9. byte[] annotations;
2311 * 10. sun.reflect.FieldAccessor fieldAccessor;
2312 * 11. sun.reflect.FieldAccessor overrideFieldAccessor;
2313 * 12. java.lang.reflect.Field root;
2314 * 13. java.lang.Class securityCheckCache;
2315 * 14. java.lang.Class securityCheckTargetClassCache;
2316 * 15. java.util.Map declaredAnnotations;
2318 class java_lang_reflect_Field : public java_lang_Object, private FieldAccess {
2320 // Static offsets of the object's instance fields.
2321 // TODO These offsets need to be checked on VM startup.
2322 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2323 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2324 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2325 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2326 static const off_t offset_type = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2327 static const off_t offset_modifiers = MEMORY_ALIGN(offset_type + SIZEOF_VOID_P, sizeof(int32_t));
2328 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2329 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2330 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2331 static const off_t offset_fieldAccessor = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2332 static const off_t offset_overrideFieldAccessor = MEMORY_ALIGN(offset_fieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2333 static const off_t offset_root = MEMORY_ALIGN(offset_overrideFieldAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2334 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2335 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2336 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2339 java_lang_reflect_Field(java_handle_t* h) : java_lang_Object(h) {}
2340 java_lang_reflect_Field(jobject h);
2341 java_lang_reflect_Field(fieldinfo* f);
2344 inline int32_t get_override () const;
2345 inline classinfo* get_clazz () const;
2346 inline int32_t get_slot () const;
2347 inline java_handle_bytearray_t* get_annotations() const;
2350 inline void set_clazz (classinfo* value);
2351 inline void set_slot (int32_t value);
2352 inline void set_name (java_handle_t* value);
2353 inline void set_type (classinfo* value);
2354 inline void set_modifiers (int32_t value);
2355 inline void set_signature (java_handle_t* value);
2356 inline void set_annotations(java_handle_bytearray_t* value);
2358 // Convenience functions.
2359 inline fieldinfo* get_field() const;
2363 inline java_lang_reflect_Field::java_lang_reflect_Field(jobject h) : java_lang_Object(h)
2365 java_lang_reflect_Field((java_handle_t*) h);
2368 inline java_lang_reflect_Field::java_lang_reflect_Field(fieldinfo* f)
2370 _handle = builtin_new(class_java_lang_reflect_Field);
2376 set_clazz(f->clazz);
2377 set_slot(f - f->clazz->fields);
2378 set_name(javastring_intern(javastring_new(f->name)));
2379 set_type(field_get_type(f));
2380 set_modifiers(f->flags);
2381 set_signature(f->signature ? javastring_new(f->signature) : NULL);
2382 set_annotations(field_get_annotations(f));
2386 inline int32_t java_lang_reflect_Field::get_override() const
2388 return get<int32_t>(_handle, offset_override);
2391 inline classinfo* java_lang_reflect_Field::get_clazz() const
2393 return get<classinfo*>(_handle, offset_clazz);
2396 inline int32_t java_lang_reflect_Field::get_slot() const
2398 return get<int32_t>(_handle, offset_slot);
2401 inline java_handle_bytearray_t* java_lang_reflect_Field::get_annotations() const
2403 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2407 inline void java_lang_reflect_Field::set_clazz(classinfo* value)
2409 set(_handle, offset_clazz, value);
2412 inline void java_lang_reflect_Field::set_slot(int32_t value)
2414 set(_handle, offset_slot, value);
2417 inline void java_lang_reflect_Field::set_name(java_handle_t* value)
2419 set(_handle, offset_name, value);
2422 inline void java_lang_reflect_Field::set_type(classinfo* value)
2424 set(_handle, offset_type, value);
2427 inline void java_lang_reflect_Field::set_modifiers(int32_t value)
2429 set(_handle, offset_modifiers, value);
2432 inline void java_lang_reflect_Field::set_signature(java_handle_t* value)
2434 set(_handle, offset_signature, value);
2437 inline void java_lang_reflect_Field::set_annotations(java_handle_bytearray_t* value)
2439 set(_handle, offset_annotations, value);
2443 inline fieldinfo* java_lang_reflect_Field::get_field() const
2445 classinfo* c = get_clazz();
2446 int32_t slot = get_slot();
2447 fieldinfo* f = &(c->fields[slot]);
2453 * OpenJDK java/lang/reflect/Method
2458 * 1. boolean override;
2459 * 2. java.lang.Class clazz;
2461 * 4. java.lang.String name;
2462 * 5. java.lang.Class returnType;
2463 * 6. java.lang.Class[] parameterTypes;
2464 * 7. java.lang.Class[] exceptionTypes;
2466 * 9. java.lang.String signature;
2467 * 10 sun.reflect.generics.repository.ConstructorRepository genericInfo;
2468 * 11. byte[] annotations;
2469 * 12. byte[] parameterAnnotations;
2470 * 13. byte[] annotationDefault;
2471 * 14. sun.reflect.MethodAccessor methodAccessor;
2472 * 15. java.lang.reflect.Method root;
2473 * 16. java.lang.Class securityCheckCache;
2474 * 17. java.lang.Class securityCheckTargetClassCache;
2475 * 18. java.util.Map declaredAnnotations;
2477 class java_lang_reflect_Method : public java_lang_Object, private FieldAccess {
2479 // Static offsets of the object's instance fields.
2480 // TODO These offsets need to be checked on VM startup.
2481 static const off_t offset_override = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2482 static const off_t offset_clazz = MEMORY_ALIGN(offset_override + sizeof(int32_t), SIZEOF_VOID_P);
2483 static const off_t offset_slot = MEMORY_ALIGN(offset_clazz + SIZEOF_VOID_P, sizeof(int32_t));
2484 static const off_t offset_name = MEMORY_ALIGN(offset_slot + sizeof(int32_t), SIZEOF_VOID_P);
2485 static const off_t offset_returnType = MEMORY_ALIGN(offset_name + SIZEOF_VOID_P, SIZEOF_VOID_P);
2486 static const off_t offset_parameterTypes = MEMORY_ALIGN(offset_returnType + SIZEOF_VOID_P, SIZEOF_VOID_P);
2487 static const off_t offset_exceptionTypes = MEMORY_ALIGN(offset_parameterTypes + SIZEOF_VOID_P, SIZEOF_VOID_P);
2488 static const off_t offset_modifiers = MEMORY_ALIGN(offset_exceptionTypes + SIZEOF_VOID_P, sizeof(int32_t));
2489 static const off_t offset_signature = MEMORY_ALIGN(offset_modifiers + sizeof(int32_t), SIZEOF_VOID_P);
2490 static const off_t offset_genericInfo = MEMORY_ALIGN(offset_signature + SIZEOF_VOID_P, SIZEOF_VOID_P);
2491 static const off_t offset_annotations = MEMORY_ALIGN(offset_genericInfo + SIZEOF_VOID_P, SIZEOF_VOID_P);
2492 static const off_t offset_parameterAnnotations = MEMORY_ALIGN(offset_annotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2493 static const off_t offset_annotationDefault = MEMORY_ALIGN(offset_parameterAnnotations + SIZEOF_VOID_P, SIZEOF_VOID_P);
2494 static const off_t offset_methodAccessor = MEMORY_ALIGN(offset_annotationDefault + SIZEOF_VOID_P, SIZEOF_VOID_P);
2495 static const off_t offset_root = MEMORY_ALIGN(offset_methodAccessor + SIZEOF_VOID_P, SIZEOF_VOID_P);
2496 static const off_t offset_securityCheckCache = MEMORY_ALIGN(offset_root + SIZEOF_VOID_P, SIZEOF_VOID_P);
2497 static const off_t offset_securityCheckTargetClassCache = MEMORY_ALIGN(offset_securityCheckCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2498 static const off_t offset_declaredAnnotations = MEMORY_ALIGN(offset_securityCheckTargetClassCache + SIZEOF_VOID_P, SIZEOF_VOID_P);
2501 java_lang_reflect_Method(java_handle_t* h) : java_lang_Object(h) {}
2502 java_lang_reflect_Method(jobject h);
2503 java_lang_reflect_Method(methodinfo* m);
2505 java_handle_t* invoke(java_handle_t* o, java_handle_objectarray_t* args);
2508 inline int32_t get_override () const;
2509 inline classinfo* get_clazz () const;
2510 inline int32_t get_slot () const;
2511 inline java_handle_bytearray_t* get_annotations () const;
2512 inline java_handle_bytearray_t* get_parameterAnnotations() const;
2513 inline java_handle_bytearray_t* get_annotationDefault () const;
2517 // Convenience functions.
2518 inline methodinfo* get_method() const;
2522 inline java_lang_reflect_Method::java_lang_reflect_Method(jobject h) : java_lang_Object(h)
2524 java_lang_reflect_Method((java_handle_t*) h);
2527 inline java_lang_reflect_Method::java_lang_reflect_Method(methodinfo* m)
2529 _handle = builtin_new(class_java_lang_reflect_Method);
2534 set(_handle, offset_clazz, m->clazz);
2535 set(_handle, offset_slot, (int32_t) (m - m->clazz->methods)); // This cast is important (see PR100).
2536 set(_handle, offset_name, javastring_intern(javastring_new(m->name)));
2537 set(_handle, offset_returnType, method_returntype_get(m));
2538 set(_handle, offset_parameterTypes, method_get_parametertypearray(m));
2539 set(_handle, offset_exceptionTypes, method_get_exceptionarray(m));
2540 set(_handle, offset_modifiers, (int32_t) (m->flags & ACC_CLASS_REFLECT_MASK));
2541 set(_handle, offset_signature, m->signature ? javastring_new(m->signature) : NULL);
2542 set(_handle, offset_annotations, method_get_annotations(m));
2543 set(_handle, offset_parameterAnnotations, method_get_parameterannotations(m));
2544 set(_handle, offset_annotationDefault, method_get_annotationdefault(m));
2548 inline int32_t java_lang_reflect_Method::get_override() const
2550 return get<int32_t>(_handle, offset_override);
2553 inline classinfo* java_lang_reflect_Method::get_clazz() const
2555 return get<classinfo*>(_handle, offset_clazz);
2558 inline int32_t java_lang_reflect_Method::get_slot() const
2560 return get<int32_t>(_handle, offset_slot);
2563 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotations() const
2565 return get<java_handle_bytearray_t*>(_handle, offset_annotations);
2568 inline java_handle_bytearray_t* java_lang_reflect_Method::get_parameterAnnotations() const
2570 return get<java_handle_bytearray_t*>(_handle, offset_parameterAnnotations);
2573 inline java_handle_bytearray_t* java_lang_reflect_Method::get_annotationDefault() const
2575 return get<java_handle_bytearray_t*>(_handle, offset_annotationDefault);
2579 inline methodinfo* java_lang_reflect_Method::get_method() const
2581 classinfo* c = get_clazz();
2582 int32_t slot = get_slot();
2583 methodinfo* m = &(c->methods[slot]);
2589 * OpenJDK java/nio/Buffer
2600 class java_nio_Buffer : public java_lang_Object, private FieldAccess {
2602 // Static offsets of the object's instance fields.
2603 // TODO These offsets need to be checked on VM startup.
2604 static const off_t offset_mark = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2605 static const off_t offset_position = MEMORY_ALIGN(offset_mark + sizeof(int32_t), sizeof(int32_t));
2606 static const off_t offset_limit = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2607 static const off_t offset_capacity = MEMORY_ALIGN(offset_limit + sizeof(int32_t), sizeof(int32_t));
2608 static const off_t offset_address = MEMORY_ALIGN(offset_capacity + sizeof(int32_t), sizeof(int64_t));
2611 java_nio_Buffer(java_handle_t* h) : java_lang_Object(h) {}
2612 java_nio_Buffer(jobject h) : java_lang_Object(h) {}
2615 inline void* get_address() const;
2619 inline void* java_nio_Buffer::get_address() const
2621 return get<void*>(_handle, offset_address);
2624 #endif // WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
2627 #if defined(WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1)
2630 * CLDC 1.1 com/sun/cldchi/jvm/FileDescriptor
2639 class com_sun_cldchi_jvm_FileDescriptor : public java_lang_Object, private FieldAccess {
2641 // Static offsets of the object's instance fields.
2642 // TODO These offsets need to be checked on VM startup.
2643 static const off_t offset_pointer = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int64_t));
2644 static const off_t offset_position = MEMORY_ALIGN(offset_pointer + sizeof(int64_t), sizeof(int32_t));
2645 static const off_t offset_length = MEMORY_ALIGN(offset_position + sizeof(int32_t), sizeof(int32_t));
2648 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h) : java_lang_Object(h) {}
2649 com_sun_cldchi_jvm_FileDescriptor(jobject h);
2650 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, int64_t pointer, int32_t position, int32_t length);
2651 com_sun_cldchi_jvm_FileDescriptor(java_handle_t* h, com_sun_cldchi_jvm_FileDescriptor& fd);
2654 inline int64_t get_pointer () const;
2655 inline int32_t get_position() const;
2656 inline int32_t get_length () const;
2659 inline void set_pointer (int64_t value);
2660 inline void set_position(int32_t value);
2661 inline void set_length (int32_t value);
2665 inline com_sun_cldchi_jvm_FileDescriptor::com_sun_cldchi_jvm_FileDescriptor(jobject h) : java_lang_Object(h)
2667 com_sun_cldchi_jvm_FileDescriptor((java_handle_t*) h);
2670 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)
2672 set_pointer(pointer);
2673 set_position(position);
2677 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)
2679 com_sun_cldchi_jvm_FileDescriptor(h, fd.get_pointer(), fd.get_position(), fd.get_length());
2683 inline int64_t com_sun_cldchi_jvm_FileDescriptor::get_pointer() const
2685 return get<int64_t>(_handle, offset_pointer);
2688 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_position() const
2690 return get<int32_t>(_handle, offset_position);
2693 inline int32_t com_sun_cldchi_jvm_FileDescriptor::get_length() const
2695 return get<int32_t>(_handle, offset_length);
2699 inline void com_sun_cldchi_jvm_FileDescriptor::set_pointer(int64_t value)
2701 set(_handle, offset_pointer, value);
2704 inline void com_sun_cldchi_jvm_FileDescriptor::set_position(int32_t value)
2706 set(_handle, offset_position, value);
2709 inline void com_sun_cldchi_jvm_FileDescriptor::set_length(int32_t value)
2711 set(_handle, offset_length, value);
2716 * CLDC 1.1 java/lang/String
2725 class java_lang_String : public java_lang_Object, private FieldAccess {
2727 // Static offsets of the object's instance fields.
2728 // TODO These offsets need to be checked on VM startup.
2729 static const off_t offset_value = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2730 static const off_t offset_offset = MEMORY_ALIGN(offset_value + SIZEOF_VOID_P, sizeof(int32_t));
2731 static const off_t offset_count = MEMORY_ALIGN(offset_offset + sizeof(int32_t), sizeof(int32_t));
2734 java_lang_String(java_handle_t* h) : java_lang_Object(h) {}
2735 java_lang_String(jstring h);
2736 java_lang_String(java_handle_t* h, java_handle_chararray_t* value, int32_t count, int32_t offset = 0);
2739 inline java_handle_chararray_t* get_value () const;
2740 inline int32_t get_offset() const;
2741 inline int32_t get_count () const;
2744 inline void set_value (java_handle_chararray_t* value);
2745 inline void set_offset(int32_t value);
2746 inline void set_count (int32_t value);
2749 inline java_lang_String::java_lang_String(jstring h) : java_lang_Object(h)
2751 java_lang_String((java_handle_t*) h);
2754 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)
2761 inline java_handle_chararray_t* java_lang_String::get_value() const
2763 return get<java_handle_chararray_t*>(_handle, offset_value);
2766 inline int32_t java_lang_String::get_offset() const
2768 return get<int32_t>(_handle, offset_offset);
2771 inline int32_t java_lang_String::get_count() const
2773 return get<int32_t>(_handle, offset_count);
2776 inline void java_lang_String::set_value(java_handle_chararray_t* value)
2778 set(_handle, offset_value, value);
2781 inline void java_lang_String::set_offset(int32_t value)
2783 set(_handle, offset_offset, value);
2786 inline void java_lang_String::set_count(int32_t value)
2788 set(_handle, offset_count, value);
2793 * CLDC 1.1 java/lang/Thread
2799 * 2. java.lang.Runnable runnable;
2800 * 3. java.lang.Object vm_thread;
2801 * 4. int is_terminated;
2802 * 5. int is_stillborn;
2805 class java_lang_Thread : public java_lang_Object, private FieldAccess {
2807 // Static offsets of the object's instance fields.
2808 // TODO These offsets need to be checked on VM startup.
2809 static const off_t offset_priority = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
2810 static const off_t offset_runnable = MEMORY_ALIGN(offset_priority + sizeof(int32_t), SIZEOF_VOID_P);
2811 static const off_t offset_vm_thread = MEMORY_ALIGN(offset_runnable + SIZEOF_VOID_P, SIZEOF_VOID_P);
2812 static const off_t offset_is_terminated = MEMORY_ALIGN(offset_vm_thread + SIZEOF_VOID_P, sizeof(int32_t));
2813 static const off_t offset_is_stillborn = MEMORY_ALIGN(offset_is_terminated + sizeof(int32_t), sizeof(int32_t));
2814 static const off_t offset_name = MEMORY_ALIGN(offset_is_stillborn + sizeof(int32_t), SIZEOF_VOID_P);
2817 java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
2818 java_lang_Thread(jobject h);
2819 // java_lang_Thread(threadobject* t);
2822 inline int32_t get_priority () const;
2823 inline threadobject* get_vm_thread() const;
2824 inline java_handle_chararray_t* get_name () const;
2827 inline void set_vm_thread(threadobject* value);
2831 inline java_lang_Thread::java_lang_Thread(jobject h) : java_lang_Object(h)
2833 java_lang_Thread((java_handle_t*) h);
2836 // inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
2838 // java_lang_Thread(thread_get_object(t));
2842 inline int32_t java_lang_Thread::get_priority() const
2844 return get<int32_t>(_handle, offset_priority);
2847 inline threadobject* java_lang_Thread::get_vm_thread() const
2849 return get<threadobject*>(_handle, offset_vm_thread);
2852 inline java_handle_chararray_t* java_lang_Thread::get_name() const
2854 return get<java_handle_chararray_t*>(_handle, offset_name);
2858 inline void java_lang_Thread::set_vm_thread(threadobject* value)
2860 set(_handle, offset_vm_thread, value);
2865 * CLDC 1.1 java/lang/Throwable
2870 * 1. java.lang.String detailMessage;
2871 * 2. java.lang.Object backtrace;
2873 class java_lang_Throwable : public java_lang_Object, private FieldAccess {
2875 // Static offsets of the object's instance fields.
2876 // TODO These offsets need to be checked on VM startup.
2877 static const off_t offset_detailMessage = MEMORY_ALIGN(sizeof(java_object_t), SIZEOF_VOID_P);
2878 static const off_t offset_backtrace = MEMORY_ALIGN(offset_detailMessage + SIZEOF_VOID_P, SIZEOF_VOID_P);
2881 java_lang_Throwable(java_handle_t* h) : java_lang_Object(h) {}
2882 java_lang_Throwable(jobject h);
2885 inline java_handle_t* get_detailMessage() const;
2886 inline java_handle_bytearray_t* get_backtrace () const;
2889 inline void set_backtrace(java_handle_bytearray_t* value);
2893 inline java_lang_Throwable::java_lang_Throwable(jobject h) : java_lang_Object(h)
2895 java_lang_Throwable((java_handle_t*) h);
2899 inline java_handle_t* java_lang_Throwable::get_detailMessage() const
2901 return get<java_handle_t*>(_handle, offset_detailMessage);
2904 inline java_handle_bytearray_t* java_lang_Throwable::get_backtrace() const
2906 return get<java_handle_bytearray_t*>(_handle, offset_backtrace);
2910 inline void java_lang_Throwable::set_backtrace(java_handle_bytearray_t* value)
2912 set(_handle, offset_backtrace, value);
2915 #endif // WITH_JAVA_RUNTIME_LIBRARY_CLDC1_1
2919 // Legacy C interface.
2920 java_handle_t* java_lang_reflect_Constructor_create(methodinfo* m);
2921 java_handle_t* java_lang_reflect_Field_create(fieldinfo* f);
2922 java_handle_t* java_lang_reflect_Method_create(methodinfo* m);
2926 #endif // _JAVAOBJECTS_HPP
2930 * These are local overrides for various environment variables in Emacs.
2931 * Please do not remove this and leave it at the end of the file, where
2932 * Emacs will automagically detect them.
2933 * ---------------------------------------------------------------------
2936 * indent-tabs-mode: t