New ClassLinker::CreateArrayClass
- Added ClassLinker::CreateArrayClass for use by ClassLinker::FindClass
- Replaced hand crafted ClassLinker::char_array_class_ initialization with call to FindClass
- Removed ClassLinker::LoadClass public interfaces, kept only one internally
- Removed JType
- Cleanedup gtest naming convention
- Added RuntimeTest for common test initialization such as Thread::Init
- Switched from assert to DCHECK which found some bit rotted code
- Expanded class_linker_test to array classes and also also array rank
and interface count in existing cases
Change-Id: Ie3d71c8b434c8521f4ea8d2f07b1c4c905ee1d90
diff --git a/src/class_linker.h b/src/class_linker.h
index 7f85da5..47f8c24 100644
--- a/src/class_linker.h
+++ b/src/class_linker.h
@@ -33,11 +33,7 @@
return FindClass(descriptor, NULL);
}
- bool LoadClass(const StringPiece& descriptor, Class* klass);
-
- bool LoadClass(const RawDexFile::ClassDef& class_def, Class* klass);
-
- Class* FindPrimitiveClass(JType type);
+ Class* FindPrimitiveClass(char type);
bool InitializeClass(Class* klass);
@@ -58,7 +54,11 @@
void Init();
- Class* CreatePrimitiveClass(JType type, const char* descriptor);
+ Class* CreatePrimitiveClass(const StringPiece& descriptor);
+
+ Class* CreateArrayClass(const StringPiece& descriptor, Object* class_loader);
+
+ void LoadClass(const RawDexFile::ClassDef& class_def, Class* klass);
void LoadInterfaces(const RawDexFile::ClassDef& class_def, Class *klass);
@@ -113,6 +113,14 @@
// TODO: classpath
+ Class* java_lang_Class_;
+ Class* java_lang_Object_;
+ Class* java_lang_ref_Field_;
+ Class* java_lang_ref_Method_;
+ Class* java_lang_Cloneable_;
+ Class* java_io_Serializable_;
+ Class* java_lang_String_;
+
Class* primitive_boolean_;
Class* primitive_char_;
Class* primitive_float_;
@@ -123,11 +131,6 @@
Class* primitive_long_;
Class* primitive_void_;
- Class* java_lang_Class_;
- Class* java_lang_Object_;
- Class* java_lang_ref_Field_;
- Class* java_lang_ref_Method_;
- Class* java_lang_String_;
Class* char_array_class_;
DISALLOW_COPY_AND_ASSIGN(ClassLinker);