* src/native/jni.cpp: [OPENJDK] Implemented jni_GetDirectBufferCapacity.
[cacao.git] / src / vm / javaobjects.hpp
index 0aaa29504636106fac47a1081491b041cbc75838..b6061a1b8258f02210274a653fb8179155de4157 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/javaobjects.hpp - functions to create and access Java objects
 
-   Copyright (C) 2010, 2011
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
    Copyright (C) 2008, 2009 Theobroma Systems Ltd.
 
@@ -1969,6 +1969,7 @@ private:
        static off_t offset_group;
        static off_t offset_uncaughtExceptionHandler;
        static off_t offset_threadStatus;
+       static off_t offset_me;
 
 public:
        java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
@@ -1983,6 +1984,7 @@ public:
        void set_priority    (int32_t value);
        void set_group       (java_handle_t* value);
        void set_threadStatus(int32_t value);
+       void set_me          (java_handle_t* value);
 
        // Offset initializers
        static void set_priority_offset(int32_t off)     { offset_priority = off; }
@@ -1990,6 +1992,7 @@ public:
        static void set_group_offset(int32_t off)        { offset_group = off; }
        static void set_uncaughtExceptionHandler_offset(int32_t off) { offset_uncaughtExceptionHandler = off; }
        static void set_threadStatus_offset(int32_t off) { offset_threadStatus = off; }
+       static void set_me_offset(int32_t off) { offset_me = off; }
 };
 
 
@@ -2029,6 +2032,11 @@ inline void java_lang_Thread::set_threadStatus(int32_t value)
        set(_handle, offset_threadStatus, value);
 }
 
+inline void java_lang_Thread::set_me(java_handle_t* value)
+{
+       set(_handle, offset_me, value);
+}
+
 
 
 /**
@@ -2562,6 +2570,7 @@ public:
 
        // Getters.
        void* get_address() const;
+       int32_t get_capacity() const;
 };
 
 
@@ -2570,6 +2579,11 @@ inline void* java_nio_Buffer::get_address() const
        return get<void*>(_handle, offset_address);
 }
 
+inline int32_t java_nio_Buffer::get_capacity() const
+{
+       return get<int32_t>(_handle, offset_capacity);
+}
+
 #endif // WITH_JAVA_RUNTIME_LIBRARY_OPENJDK
 
 
@@ -2765,12 +2779,6 @@ public:
 };
 
 
-// inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
-// {
-//     java_lang_Thread(thread_get_object(t));
-// }
-
-
 inline int32_t java_lang_Thread::get_priority() const
 {
        return get<int32_t>(_handle, offset_priority);