Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 2226893002: Optimize AOT's switchable calls for the monomorphic case. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/instructions_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index 4c60d209b6c83a739fa5104329bb978085df6a25..9118bb12d6e5b3b0ccbd968d7ba376858e670b7c 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1339,8 +1339,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
__ Comment("Slow case: megamorphic call");
}
__ LoadObject(RBX, cache);
- __ call(Address(THR, Thread::megamorphic_lookup_entry_point_offset()));
- __ call(RCX);
+ __ call(Address(THR, Thread::megamorphic_lookup_checked_entry_offset()));
__ Bind(&done);
RecordSafepoint(locs, slow_path_argument_count);
@@ -1377,11 +1376,15 @@ void FlowGraphCompiler::EmitSwitchableInstanceCall(
intptr_t deopt_id,
TokenPosition token_pos,
LocationSummary* locs) {
+ ASSERT(ic_data.NumArgsTested() == 1);
+ const Code& initial_stub = Code::ZoneHandle(
+ StubCode::ICLookupThroughFunction_entry()->code());
+
__ Comment("SwitchableCall");
__ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize));
- ASSERT(ic_data.NumArgsTested() == 1);
__ LoadUniqueObject(RBX, ic_data);
- __ CallPatchable(*StubCode::ICLookupThroughFunction_entry());
+ __ LoadUniqueObject(CODE_REG, initial_stub);
+ __ movq(RCX, FieldAddress(CODE_REG, Code::checked_entry_point_offset()));
__ call(RCX);
AddCurrentDescriptor(RawPcDescriptors::kOther,
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | runtime/vm/instructions_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698