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

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 1418863003: Precompilation: Generate instance calls as IC calls that can switch to Megamoprhic calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index 14e99afcf9448a6f34a69897476a936273882244..448b70a8f7dedf6c9e203b9d22c24566c2c796f3 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -1276,21 +1276,57 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
- __ Comment("MegamorphicInstanceCall");
- const Register receiverR = T0;
- const Register cacheR = T1;
- const Register targetR = T1;
- __ lw(receiverR, Address(SP, (argument_count - 1) * kWordSize));
- __ LoadObject(cacheR, cache);
+ __ Comment("MegamorphicCall");
+ __ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
+ __ LoadObject(S5, cache);
if (FLAG_use_megamorphic_stub) {
__ BranchLink(*StubCode::MegamorphicLookup_entry());
} else {
- StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
+ StubCode::EmitMegamorphicLookup(assembler());
}
- __ LoadObject(S5, ic_data);
- __ LoadObject(S4, arguments_descriptor);
- __ jalr(targetR);
+ __ jalr(T1);
+
+ AddCurrentDescriptor(RawPcDescriptors::kOther,
+ Thread::kNoDeoptId, token_pos);
+ RecordSafepoint(locs);
+ const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
+ if (is_optimizing()) {
+ AddDeoptIndexAtCall(deopt_id_after, token_pos);
+ } else {
+ // Add deoptimization continuation point after the call and before the
+ // arguments are removed.
+ AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos);
+ }
+ __ Drop(argument_count);
+}
+
+
+void FlowGraphCompiler::EmitSwitchableInstanceCall(
+ const ICData& ic_data,
+ intptr_t argument_count,
+ intptr_t deopt_id,
+ intptr_t token_pos,
+ LocationSummary* locs) {
+ __ Comment("SwitchableCall");
+ __ lw(T0, Address(SP, (argument_count - 1) * kWordSize));
+ if (ic_data.NumArgsTested() == 1) {
+ __ LoadUniqueObject(S5, ic_data);
+ __ BranchLink(*StubCode::ICLookup_entry());
+ } else {
+ const String& name = String::Handle(zone(), ic_data.target_name());
+ const Array& arguments_descriptor =
+ Array::ZoneHandle(zone(), ic_data.arguments_descriptor());
+ ASSERT(!arguments_descriptor.IsNull() &&
+ (arguments_descriptor.Length() > 0));
+ const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+ MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
+
+ __ LoadUniqueObject(S5, cache);
+ __ BranchLink(*StubCode::MegamorphicLookup_entry());
+ }
+ __ jalr(T1);
+
AddCurrentDescriptor(RawPcDescriptors::kOther,
Thread::kNoDeoptId, token_pos);
RecordSafepoint(locs);
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698