summaryrefslogtreecommitdiffstats
path: root/compiler/driver
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-12-02 11:13:19 -0800
committerIan Rogers <irogers@google.com>2014-12-02 11:13:49 -0800
commite94652f1e321b2c8b71acbe5b07d2ebf69fbdb99 (patch)
treeb4c2a4435800222fa740a5ae57fa217b6aed0875 /compiler/driver
parentf25c2ec6b63e116f24f359a10b59c78768fde67a (diff)
downloadart-e94652f1e321b2c8b71acbe5b07d2ebf69fbdb99.zip
art-e94652f1e321b2c8b71acbe5b07d2ebf69fbdb99.tar.gz
art-e94652f1e321b2c8b71acbe5b07d2ebf69fbdb99.tar.bz2
Remove MethodHelper from the interpreter.
Use ShadowFrame to get the executing method to avoid a handle for the current method. Various associated bits of header file clean-up and removal of an unnecessary use of MethodHelper in CompilerDriver. Change-Id: I3b6f4413701e8fc6b0c58b0041a0dd15472bedaa
Diffstat (limited to 'compiler/driver')
-rw-r--r--compiler/driver/compiler_driver.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 2e9f835..6d7713f 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -35,6 +35,7 @@
#include "dex/quick/dex_file_method_inliner.h"
#include "driver/compiler_options.h"
#include "jni_internal.h"
+#include "method_helper.h"
#include "object_lock.h"
#include "profiler.h"
#include "runtime.h"
@@ -626,10 +627,10 @@ bool CompilerDriver::IsClassToCompile(const char* descriptor) const {
}
}
-static void ResolveExceptionsForMethod(MutableMethodHelper* mh,
+static void ResolveExceptionsForMethod(MutableHandle<mirror::ArtMethod> method_handle,
std::set<std::pair<uint16_t, const DexFile*>>& exceptions_to_resolve)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
- const DexFile::CodeItem* code_item = mh->GetMethod()->GetCodeItem();
+ const DexFile::CodeItem* code_item = method_handle->GetCodeItem();
if (code_item == nullptr) {
return; // native or abstract method
}
@@ -649,10 +650,10 @@ static void ResolveExceptionsForMethod(MutableMethodHelper* mh,
uint16_t encoded_catch_handler_handlers_type_idx =
DecodeUnsignedLeb128(&encoded_catch_handler_list);
// Add to set of types to resolve if not already in the dex cache resolved types
- if (!mh->GetMethod()->IsResolvedTypeIdx(encoded_catch_handler_handlers_type_idx)) {
+ if (!method_handle->IsResolvedTypeIdx(encoded_catch_handler_handlers_type_idx)) {
exceptions_to_resolve.insert(
std::pair<uint16_t, const DexFile*>(encoded_catch_handler_handlers_type_idx,
- mh->GetMethod()->GetDexFile()));
+ method_handle->GetDexFile()));
}
// ignore address associated with catch handler
DecodeUnsignedLeb128(&encoded_catch_handler_list);
@@ -669,14 +670,14 @@ static bool ResolveCatchBlockExceptionsClassVisitor(mirror::Class* c, void* arg)
std::set<std::pair<uint16_t, const DexFile*>>* exceptions_to_resolve =
reinterpret_cast<std::set<std::pair<uint16_t, const DexFile*>>*>(arg);
StackHandleScope<1> hs(Thread::Current());
- MutableMethodHelper mh(hs.NewHandle<mirror::ArtMethod>(nullptr));
+ MutableHandle<mirror::ArtMethod> method_handle(hs.NewHandle<mirror::ArtMethod>(nullptr));
for (size_t i = 0; i < c->NumVirtualMethods(); ++i) {
- mh.ChangeMethod(c->GetVirtualMethod(i));
- ResolveExceptionsForMethod(&mh, *exceptions_to_resolve);
+ method_handle.Assign(c->GetVirtualMethod(i));
+ ResolveExceptionsForMethod(method_handle, *exceptions_to_resolve);
}
for (size_t i = 0; i < c->NumDirectMethods(); ++i) {
- mh.ChangeMethod(c->GetDirectMethod(i));
- ResolveExceptionsForMethod(&mh, *exceptions_to_resolve);
+ method_handle.Assign(c->GetDirectMethod(i));
+ ResolveExceptionsForMethod(method_handle, *exceptions_to_resolve);
}
return true;
}