summaryrefslogtreecommitdiff
path: root/compiler/optimizing/sharpening.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-09-17 17:34:34 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2020-09-24 08:26:53 +0000
commit25b9c7da44cd4652aa2ba26aa105509a6d035632 (patch)
treeb11d09d13e3d3c29d9782ab9b7f8521bc58747e8 /compiler/optimizing/sharpening.cc
parent6d69b52f331f788cbd1f21ffd5b87cb3b39965e4 (diff)
Don't store copied methods in BSS.
Otherwise, we can end up in a state where the method on the stack is unrelated to the receiver. Also fix a comment related to GetCanonicalMethod and StackVisitor::ValidateFrame. Test: 810-checker-invoke-super-default Change-Id: I3030e4af6059f7a4a7a1f046f2aabae8ce9057da
Diffstat (limited to 'compiler/optimizing/sharpening.cc')
-rw-r--r--compiler/optimizing/sharpening.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc
index 67cd200679..393369dcb6 100644
--- a/compiler/optimizing/sharpening.cc
+++ b/compiler/optimizing/sharpening.cc
@@ -99,6 +99,7 @@ HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenInvokeStaticOrDirect(
} else if (!has_method_id) {
method_load_kind = MethodLoadKind::kRuntimeCall;
} else {
+ DCHECK(!callee->IsCopied());
// Use PC-relative access to the .bss methods array.
method_load_kind = MethodLoadKind::kBssEntry;
}
@@ -124,6 +125,7 @@ HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenInvokeStaticOrDirect(
method_load_kind = MethodLoadKind::kRuntimeCall;
code_ptr_location = CodePtrLocation::kCallArtMethod;
} else {
+ DCHECK(!callee->IsCopied());
// Use PC-relative access to the .bss methods array.
method_load_kind = MethodLoadKind::kBssEntry;
code_ptr_location = CodePtrLocation::kCallArtMethod;