summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dex/inline_method_analyser.cc5
-rw-r--r--compiler/optimizing/optimizing_compiler.cc8
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/dex/inline_method_analyser.cc b/compiler/dex/inline_method_analyser.cc
index 85cf83c099..0567fe12c8 100644
--- a/compiler/dex/inline_method_analyser.cc
+++ b/compiler/dex/inline_method_analyser.cc
@@ -147,8 +147,11 @@ ArtMethod* GetTargetConstructor(ArtMethod* method, const Instruction* invoke_dir
accessor.RegistersSize() - accessor.InsSize());
}
uint32_t method_index = invoke_direct->VRegB_35c();
+ StackHandleScope<2> hs(Thread::Current());
+ Handle<mirror::DexCache> h_dex_cache = hs.NewHandle(method->GetDexCache());
+ Handle<mirror::ClassLoader> h_class_loader = hs.NewHandle(method->GetClassLoader());
ArtMethod* target_method = Runtime::Current()->GetClassLinker()->LookupResolvedMethod(
- method_index, method->GetDexCache(), method->GetClassLoader());
+ method_index, h_dex_cache, h_class_loader);
if (kIsDebugBuild && target_method != nullptr) {
CHECK(!target_method->IsStatic());
CHECK(target_method->IsConstructor());
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 45d534a9ec..a75ac9239b 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1183,14 +1183,14 @@ CompiledMethod* OptimizingCompiler::JniCompile(uint32_t access_flags,
const CompilerOptions& compiler_options = GetCompilerOptions();
if (compiler_options.IsBootImage()) {
ScopedObjectAccess soa(Thread::Current());
- ArtMethod* method = runtime->GetClassLinker()->LookupResolvedMethod(
- method_idx, dex_cache.Get(), /*class_loader=*/ nullptr);
+ VariableSizedHandleScope handles(soa.Self());
+ ScopedNullHandle<mirror::ClassLoader> class_loader; // null means boot class path loader.
+ ArtMethod* method =
+ runtime->GetClassLinker()->LookupResolvedMethod(method_idx, dex_cache, class_loader);
// Try to compile a fully intrinsified implementation. Do not try to do this for
// signature polymorphic methods as the InstructionBuilder cannot handle them;
// and it would be useless as they always have a slow path for type conversions.
if (method != nullptr && UNLIKELY(method->IsIntrinsic()) && !method->IsSignaturePolymorphic()) {
- VariableSizedHandleScope handles(soa.Self());
- ScopedNullHandle<mirror::ClassLoader> class_loader; // null means boot class path loader.
Handle<mirror::Class> compiling_class = handles.NewHandle(method->GetDeclaringClass());
DexCompilationUnit dex_compilation_unit(
class_loader,