+/**
+ * OpenJDK java/lang/ClassLoader
+ *
+ * Object layout:
+ *
+ * 0. object header
+ * 1. boolean initialized
+ * 2. java.lang.ClassLoader parent
+ * [other fields are not used]
+ */
+class java_lang_ClassLoader : public java_lang_Object, private FieldAccess {
+private:
+ // Static offsets of the object's instance fields.
+ // TODO These offsets need to be checked on VM startup.
+ static const off_t offset_initialized = MEMORY_ALIGN(sizeof(java_object_t), sizeof(int32_t));
+ static const off_t offset_parent = MEMORY_ALIGN(offset_initialized + sizeof(int32_t), SIZEOF_VOID_P);
+
+public:
+ java_lang_ClassLoader(java_handle_t* h) : java_lang_Object(h) {}
+
+ // Getters.
+ java_handle_t* get_parent() const;
+
+ // Invocation wrappers for static methods.
+ static java_handle_t* invoke_getSystemClassLoader();
+};
+
+inline java_handle_t* java_lang_ClassLoader::get_parent() const
+{
+ return get<java_handle_t*>(_handle, offset_parent);
+}
+
+