summaryrefslogtreecommitdiff
path: root/compiler/optimizing/builder.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-05-22 15:37:09 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2015-05-22 15:37:09 +0100
commitd5111bf05fc0a9974280a80eeb43db6d5227a81e (patch)
treecd119fb5d07f8347699ce7551e9471f2740b21ba /compiler/optimizing/builder.cc
parentaa49c23d47e5fdfcf51380550ee864e9d30d082b (diff)
Do not use dex_compilation_unit after inlining.
It's incompatible with inlining, as inlined invokes/load class/new can be from another dex file. Change-Id: I8897b6a012942bc8e136f2bea70252d3fb3a7fa5
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r--compiler/optimizing/builder.cc22
1 files changed, 15 insertions, 7 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index c4eaabf899..49a0444f94 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -711,8 +711,8 @@ bool HGraphBuilder::BuildInvoke(const Instruction& instruction,
clinit_check_requirement = HInvokeStaticOrDirect::ClinitCheckRequirement::kNone;
} else {
clinit_check_requirement = HInvokeStaticOrDirect::ClinitCheckRequirement::kExplicit;
- HLoadClass* load_class =
- new (arena_) HLoadClass(storage_index, is_referrer_class, dex_pc);
+ HLoadClass* load_class = new (arena_) HLoadClass(
+ 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,7 +915,8 @@ 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, is_referrer_class, dex_pc);
+ HLoadClass* constant = new (arena_) HLoadClass(
+ storage_index, *dex_compilation_unit_->GetDexFile(), is_referrer_class, dex_pc);
current_block_->AddInstruction(constant);
HInstruction* cls = constant;
@@ -1151,7 +1152,10 @@ bool HGraphBuilder::BuildTypeCheck(const Instruction& instruction,
}
HInstruction* object = LoadLocal(reference, Primitive::kPrimNot);
HLoadClass* cls = new (arena_) HLoadClass(
- type_index, IsOutermostCompilingClass(type_index), dex_pc);
+ type_index,
+ *dex_compilation_unit_->GetDexFile(),
+ IsOutermostCompilingClass(type_index),
+ dex_pc);
current_block_->AddInstruction(cls);
// The class needs a temporary before being used by the type check.
Temporaries temps(graph_);
@@ -1976,7 +1980,8 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32
? kQuickAllocObjectWithAccessCheck
: kQuickAllocObject;
- current_block_->AddInstruction(new (arena_) HNewInstance(dex_pc, type_index, entrypoint));
+ current_block_->AddInstruction(new (arena_) HNewInstance(
+ dex_pc, type_index, *dex_compilation_unit_->GetDexFile(), entrypoint));
UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction());
}
break;
@@ -2161,8 +2166,11 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32
MaybeRecordStat(MethodCompilationStat::kNotCompiledCantAccesType);
return false;
}
- current_block_->AddInstruction(
- new (arena_) HLoadClass(type_index, IsOutermostCompilingClass(type_index), dex_pc));
+ current_block_->AddInstruction(new (arena_) HLoadClass(
+ type_index,
+ *dex_compilation_unit_->GetDexFile(),
+ IsOutermostCompilingClass(type_index),
+ dex_pc));
UpdateLocal(instruction.VRegA_21c(), current_block_->GetLastInstruction());
break;
}