[VM] Fix calculation of unchecked entrypoint offset
On arm64 Code.UncheckedEntryPoint() returned the wrong value because it
is based on the offset of the Label of FunctionEntryInstr.
That works on X64/ARM, but not on ARM64, because there the monomorphic
entry and frame setup is emitted in FlowGraphCompiler::CompileGraph().
Change-Id: I9c1b1be71997b83d76b385d5b811a665015c32b5
Reviewed-on: https://dart-review.googlesource.com/c/88708
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc
index cf9146c..c87bfc8 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc
@@ -318,6 +318,16 @@
}
intptr_t FlowGraphCompiler::UncheckedEntryOffset() const {
+ // On ARM64 we cannot use the position of the label bound in the
+ // FunctionEntryInstr, because `FunctionEntryInstr::EmitNativeCode` does not
+ // emit the monomorphic entry and frame entry (instead on ARM64 this is done
+ // in FlowGraphCompiler::CompileGraph()).
+ //
+ // See http://dartbug.com/34162
+#if defined(TARGET_ARCH_ARM64)
+ return 0;
+#endif
+
BlockEntryInstr* entry = flow_graph().graph_entry()->unchecked_entry();
if (entry == nullptr) {
entry = flow_graph().graph_entry()->normal_entry();