diff options
author | Mathieu Chartier <mathieuc@google.com> | 2012-09-18 08:57:04 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2012-09-21 17:32:56 -0700 |
commit | 66f19258f9728d4ffe026074d8fd429d639802fa (patch) | |
tree | fd94009774c6cbbb1528ea096e606133bd35f104 /src/greenland | |
parent | a5e1e3d153990845d80cb8d013157210f11a473c (diff) | |
download | art-66f19258f9728d4ffe026074d8fd429d639802fa.zip art-66f19258f9728d4ffe026074d8fd429d639802fa.tar.gz art-66f19258f9728d4ffe026074d8fd429d639802fa.tar.bz2 |
Change dex cache to be java object instead of array, add pointer to dex file in dex cache.
Generic clean up to facilitate having GDB macros for Pretty* helper functions.
Improved cleanliness of DexCache since having it as an object array was not the best solution.
Fixed a bug in InOrderWalk caused by ResolveType sometimes allocating classes.
Rename C++ Method to AbstractMethod and add two new classes Constructor, Method which both inherit from AbstractMethod.
Rename done to have the C++ code be closer to the java code.
Change-Id: I4995b4c5e47a3822192b08afa24a639d3b1f4da9
Diffstat (limited to 'src/greenland')
-rw-r--r-- | src/greenland/arm/arm_invoke_stub_compiler.cc | 2 | ||||
-rw-r--r-- | src/greenland/runtime/support_alloc.cc | 8 | ||||
-rw-r--r-- | src/greenland/runtime/support_dexcache.cc | 2 | ||||
-rw-r--r-- | src/greenland/runtime/support_exception.cc | 4 | ||||
-rw-r--r-- | src/greenland/runtime/support_field.cc | 2 | ||||
-rw-r--r-- | src/greenland/runtime_entry_points.h | 16 | ||||
-rw-r--r-- | src/greenland/x86/x86_invoke_stub_compiler.cc | 2 |
7 files changed, 18 insertions, 18 deletions
diff --git a/src/greenland/arm/arm_invoke_stub_compiler.cc b/src/greenland/arm/arm_invoke_stub_compiler.cc index f14b35f..2360ed7 100644 --- a/src/greenland/arm/arm_invoke_stub_compiler.cc +++ b/src/greenland/arm/arm_invoke_stub_compiler.cc @@ -137,7 +137,7 @@ CompiledInvokeStub* CreateInvokeStub(bool is_static, const char* shorty, uint32_ } // Load the code pointer we are about to call. - __ LoadFromOffset(kLoadWord, IP, R0, Method::GetCodeOffset().Int32Value()); + __ LoadFromOffset(kLoadWord, IP, R0, AbstractMethod::GetCodeOffset().Int32Value()); // Do the call. __ blx(IP); diff --git a/src/greenland/runtime/support_alloc.cc b/src/greenland/runtime/support_alloc.cc index 5198903..dd7850d 100644 --- a/src/greenland/runtime/support_alloc.cc +++ b/src/greenland/runtime/support_alloc.cc @@ -25,28 +25,28 @@ using namespace art::greenland; namespace { Object* art_alloc_array_from_code(uint32_t type_idx, - Method* referrer, + AbstractMethod* referrer, uint32_t length, Thread* thread) { return AllocArrayFromCode(type_idx, referrer, length, thread, false); } Object* art_alloc_array_from_code_with_access_check(uint32_t type_idx, - Method* referrer, + AbstractMethod* referrer, uint32_t length, Thread* thread) { return AllocArrayFromCode(type_idx, referrer, length, thread, true); } Object* art_check_and_alloc_array_from_code(uint32_t type_idx, - Method* referrer, + AbstractMethod* referrer, uint32_t length, Thread* thread) { return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, false); } Object* art_check_and_alloc_array_from_code_with_access_check(uint32_t type_idx, - Method* referrer, + AbstractMethod* referrer, uint32_t length, Thread* thread) { return CheckAndAllocArrayFromCode(type_idx, referrer, length, thread, true); diff --git a/src/greenland/runtime/support_dexcache.cc b/src/greenland/runtime/support_dexcache.cc index 903e5cc..9d36aad 100644 --- a/src/greenland/runtime/support_dexcache.cc +++ b/src/greenland/runtime/support_dexcache.cc @@ -24,7 +24,7 @@ using namespace art::greenland; namespace { -Object* art_resolve_string(Method* referrer, uint32_t string_idx) { +Object* art_resolve_string(AbstractMethod* referrer, uint32_t string_idx) { return ResolveStringFromCode(referrer, string_idx); } diff --git a/src/greenland/runtime/support_exception.cc b/src/greenland/runtime/support_exception.cc index 2470051..4bc910a 100644 --- a/src/greenland/runtime/support_exception.cc +++ b/src/greenland/runtime/support_exception.cc @@ -25,7 +25,7 @@ using namespace art::greenland; namespace { -int32_t art_find_catch_block(Method* current_method, uint32_t ti_offset) { +int32_t art_find_catch_block(AbstractMethod* current_method, uint32_t ti_offset) { Thread* thread = art_get_current_thread(); Class* exception_type = thread->GetException()->GetClass(); MethodHelper mh(current_method); @@ -66,7 +66,7 @@ void art_throw_null_pointer_exception(uint32_t dex_pc) { Thread* thread = art_get_current_thread(); NthCallerVisitor visitor(0); thread->WalkStack(&visitor); - Method* throw_method = visitor.caller; + AbstractMethod* throw_method = visitor.caller; ThrowNullPointerExceptionFromDexPC(thread, throw_method, dex_pc); } diff --git a/src/greenland/runtime/support_field.cc b/src/greenland/runtime/support_field.cc index 523740f..e5fa814 100644 --- a/src/greenland/runtime/support_field.cc +++ b/src/greenland/runtime/support_field.cc @@ -24,7 +24,7 @@ using namespace art::greenland; namespace { -Object* art_get_obj_static_from_code(uint32_t field_idx, Method* referrer) { +Object* art_get_obj_static_from_code(uint32_t field_idx, AbstractMethod* referrer) { Field* field = FindFieldFast(field_idx, referrer, false, false, sizeof(Object*)); if (LIKELY(field != NULL)) { return field->GetObj(NULL); diff --git a/src/greenland/runtime_entry_points.h b/src/greenland/runtime_entry_points.h index 8cd8ce4..9ee053e 100644 --- a/src/greenland/runtime_entry_points.h +++ b/src/greenland/runtime_entry_points.h @@ -27,7 +27,7 @@ namespace art { -class Method; +class AbstractMethod; class Object; class Thread; @@ -40,36 +40,36 @@ struct PACKED RuntimeEntryPoints { //---------------------------------------------------------------------------- // Exception //---------------------------------------------------------------------------- - int32_t (*FindCatchBlock)(Method* current_method, uint32_t ti_offset); + int32_t (*FindCatchBlock)(AbstractMethod* current_method, uint32_t ti_offset); void (*ThrowIndexOutOfBounds)(int32_t length, int32_t index); void (*ThrowNullPointerException)(unsigned dex_pc); //---------------------------------------------------------------------------- // Alloc //---------------------------------------------------------------------------- - Object* (*AllocArray)(uint32_t type_idx, Method* referrer, + Object* (*AllocArray)(uint32_t type_idx, AbstractMethod* referrer, uint32_t length, Thread* thread); - Object* (*AllocArrayWithAccessCheck)(uint32_t type_idx, Method* referrer, + Object* (*AllocArrayWithAccessCheck)(uint32_t type_idx, AbstractMethod* referrer, uint32_t length, Thread* thread); - Object* (*CheckAndAllocArray)(uint32_t type_idx, Method* referrer, + Object* (*CheckAndAllocArray)(uint32_t type_idx, AbstractMethod* referrer, uint32_t length, Thread* thread); Object* (*CheckAndAllocArrayWithAccessCheck)(uint32_t type_idx, - Method* referrer, + AbstractMethod* referrer, uint32_t length, Thread* thread); //---------------------------------------------------------------------------- // DexCache //---------------------------------------------------------------------------- - Object* (*ResolveString)(Method* referrer, uint32_t string_idx); + Object* (*ResolveString)(AbstractMethod* referrer, uint32_t string_idx); //---------------------------------------------------------------------------- // Field //---------------------------------------------------------------------------- - Object* (*GetObjectStatic)(uint32_t field_idx, Method* referrer); + Object* (*GetObjectStatic)(uint32_t field_idx, AbstractMethod* referrer); //---------------------------------------------------------------------------- // Cast diff --git a/src/greenland/x86/x86_invoke_stub_compiler.cc b/src/greenland/x86/x86_invoke_stub_compiler.cc index 18a7765..872a9da 100644 --- a/src/greenland/x86/x86_invoke_stub_compiler.cc +++ b/src/greenland/x86/x86_invoke_stub_compiler.cc @@ -128,7 +128,7 @@ CompiledInvokeStub* CreateInvokeStub(bool is_static, const char* shorty, uint32_ } } - __ call(Address(EAX, Method::GetCodeOffset())); // Call code off of method + __ call(Address(EAX, AbstractMethod::GetCodeOffset())); // Call code off of method // Pop arguments up to EBX and the return address. __ addl(ESP, Immediate(frame_size + pad_size - (2 * kPointerSize))); |