summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/graph_visualizer.cc4
-rw-r--r--compiler/optimizing/instruction_builder.cc4
-rw-r--r--compiler/optimizing/sharpening.cc2
3 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index d5840fc7cf..3f6215a650 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -23,6 +23,7 @@
#include "android-base/stringprintf.h"
#include "art_method.h"
+#include "art_method-inl.h"
#include "base/intrusive_forward_list.h"
#include "bounds_check_elimination.h"
#include "builder.h"
@@ -470,6 +471,9 @@ class HGraphVisualizerPrinter : public HGraphDelegateVisitor {
StartAttributeStream("always_throws") << std::boolalpha
<< invoke->AlwaysThrows()
<< std::noboolalpha;
+ if (method != nullptr) {
+ StartAttributeStream("method_index") << method->GetMethodIndex();
+ }
}
void VisitInvokeUnresolved(HInvokeUnresolved* invoke) override {
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index ab28e4b86f..e9d1ee2e0b 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -964,7 +964,9 @@ static ArtMethod* ResolveMethod(uint16_t method_idx,
// could resolve the callee to the wrong method.
return nullptr;
}
- resolved_method = actual_method;
+ // Call GetCanonicalMethod in case the resolved method is a copy: for super calls, the encoding
+ // of ArtMethod in BSS relies on not having copies there.
+ resolved_method = actual_method->GetCanonicalMethod(class_linker->GetImagePointerSize());
}
if (*invoke_type == kInterface) {
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;