summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-11-23 12:17:52 +0000
committer android-build-merger <android-build-merger@google.com> 2015-11-23 12:17:52 +0000
commit00df6d2bc054021c7ea4a45ee440af1c9ba3099d (patch)
tree182079e5ab2802bd85470cd4fed614432c869df1 /compiler
parentbda98bfb15a5ecfec4128d8cc59eeda02ccce638 (diff)
parentc61ac2785c236a556fc4d70eca7b7e0fd83060f5 (diff)
Merge "Do not change to the access check entrypoint when inlined." am: 6d92d59fb0
am: c61ac2785c * commit 'c61ac2785c236a556fc4d70eca7b7e0fd83060f5': Do not change to the access check entrypoint when inlined.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/optimizing/nodes.h7
-rw-r--r--compiler/optimizing/prepare_for_register_allocation.cc4
2 files changed, 9 insertions, 2 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index a5ea15408c..3b5c384c84 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -1631,6 +1631,11 @@ class HEnvironment : public ArenaObject<kArenaAllocEnvironment> {
return holder_;
}
+
+ bool IsFromInlinedInvoke() const {
+ return GetParent() != nullptr;
+ }
+
private:
// Record instructions' use entries of this environment for constant-time removal.
// It should only be called by HInstruction when a new environment use is added.
@@ -3243,7 +3248,7 @@ class HInvoke : public HInstruction {
void SetIntrinsic(Intrinsics intrinsic, IntrinsicNeedsEnvironmentOrCache needs_env_or_cache);
bool IsFromInlinedInvoke() const {
- return GetEnvironment()->GetParent() != nullptr;
+ return GetEnvironment()->IsFromInlinedInvoke();
}
bool CanThrow() const OVERRIDE { return true; }
diff --git a/compiler/optimizing/prepare_for_register_allocation.cc b/compiler/optimizing/prepare_for_register_allocation.cc
index dd3965890b..d1770b75ab 100644
--- a/compiler/optimizing/prepare_for_register_allocation.cc
+++ b/compiler/optimizing/prepare_for_register_allocation.cc
@@ -114,7 +114,9 @@ void PrepareForRegisterAllocation::VisitNewInstance(HNewInstance* instruction) {
if (instruction->IsFinalizable() || has_only_one_use || load_class->NeedsAccessCheck()) {
instruction->SetEntrypoint(kQuickAllocObject);
instruction->ReplaceInput(GetGraph()->GetIntConstant(load_class->GetTypeIndex()), 0);
- if (has_only_one_use) {
+ // The allocation entry point that deals with access checks does not work with inlined
+ // methods, so we need to check whether this allocation comes from an inlined method.
+ if (has_only_one_use && !instruction->GetEnvironment()->IsFromInlinedInvoke()) {
// We can remove the load class from the graph. If it needed access checks, we delegate
// the access check to the allocation.
if (load_class->NeedsAccessCheck()) {