diff options
author | 2015-05-27 17:18:33 +0100 | |
---|---|---|
committer | 2015-05-28 10:44:36 +0100 | |
commit | 76b1e1799a713a19218de26b171b0aef48a59e98 (patch) | |
tree | 897d0d22d246367eb09d8b825b43c384074083f4 /compiler/optimizing/builder.cc | |
parent | 382f5c24eb663ca8fa39a94a038349138a00272a (diff) |
Add a HCurrentMethod node.
This enables register allocation for the current method, so
that users of it don't always load it from the stack.
Currently only used by HLoadClass. Will make follow-up
CLs for the other users.
Change-Id: If73324d85643102faba47fabbbd2755eb258c59c
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 49a0444f94..c142e4ddb5 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -712,7 +712,11 @@ bool HGraphBuilder::BuildInvoke(const Instruction& instruction, } else { clinit_check_requirement = HInvokeStaticOrDirect::ClinitCheckRequirement::kExplicit; HLoadClass* load_class = new (arena_) HLoadClass( - storage_index, *dex_compilation_unit_->GetDexFile(), is_referrer_class, dex_pc); + graph_->GetCurrentMethod(), + storage_index, + *dex_compilation_unit_->GetDexFile(), + is_referrer_class, + dex_pc); current_block_->AddInstruction(load_class); clinit_check = new (arena_) HClinitCheck(load_class, dex_pc); current_block_->AddInstruction(clinit_check); @@ -915,8 +919,11 @@ bool HGraphBuilder::BuildStaticFieldAccess(const Instruction& instruction, *outer_compilation_unit_->GetDexFile(), storage_index); bool is_initialized = resolved_field->GetDeclaringClass()->IsInitialized() && is_in_dex_cache; - HLoadClass* constant = new (arena_) HLoadClass( - storage_index, *dex_compilation_unit_->GetDexFile(), is_referrer_class, dex_pc); + HLoadClass* constant = new (arena_) HLoadClass(graph_->GetCurrentMethod(), + storage_index, + *dex_compilation_unit_->GetDexFile(), + is_referrer_class, + dex_pc); current_block_->AddInstruction(constant); HInstruction* cls = constant; @@ -1152,6 +1159,7 @@ bool HGraphBuilder::BuildTypeCheck(const Instruction& instruction, } HInstruction* object = LoadLocal(reference, Primitive::kPrimNot); HLoadClass* cls = new (arena_) HLoadClass( + graph_->GetCurrentMethod(), type_index, *dex_compilation_unit_->GetDexFile(), IsOutermostCompilingClass(type_index), @@ -2167,6 +2175,7 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32 return false; } current_block_->AddInstruction(new (arena_) HLoadClass( + graph_->GetCurrentMethod(), type_index, *dex_compilation_unit_->GetDexFile(), IsOutermostCompilingClass(type_index), |