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

Unified Diff: runtime/vm/flow_graph_compiler_arm.cc

Issue 1429303005: Add fast Smi op version of switchable instance 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/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_arm.cc
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index a11916db9e64fb4dc09567874900d56c39d8a174..6c5667fc7d8b4de897eac5d033df1b1503c134c7 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -1267,7 +1267,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
__ Comment("MegamorphicCall");
- __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
+ __ LoadFromOffset(kWord, R1, SP, (argument_count - 1) * kWordSize);
__ LoadObject(R9, cache);
if (FLAG_use_megamorphic_stub) {
__ BranchLink(*StubCode::MegamorphicLookup_entry());
@@ -1298,23 +1298,35 @@ void FlowGraphCompiler::EmitSwitchableInstanceCall(
intptr_t token_pos,
LocationSummary* locs) {
__ Comment("SwitchableCall");
- __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize);
+ __ LoadFromOffset(kWord, R1, SP, (argument_count - 1) * kWordSize);
if (ic_data.NumArgsTested() == 1) {
__ LoadUniqueObject(R9, ic_data);
__ BranchLinkPatchable(*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(R9, cache);
- __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry());
+
+ if (name.raw() == Symbols::Plus().raw()) {
+ __ LoadUniqueObject(R9, ic_data);
+ __ BranchLinkPatchable(*StubCode::ICSmiAddLookup_entry());
+ } else if (name.raw() == Symbols::Minus().raw()) {
+ __ LoadUniqueObject(R9, ic_data);
+ __ BranchLinkPatchable(*StubCode::ICSmiSubLookup_entry());
+ } else if (name.raw() == Symbols::Equals().raw()) {
+ __ LoadUniqueObject(R9, ic_data);
+ __ BranchLinkPatchable(*StubCode::ICSmiEqualLookup_entry());
+ } else {
+ 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(R9, cache);
+ __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry());
+ }
}
- __ blx(R1);
+ __ blx(R1); // A fast Smi operation may return past this call.
AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
RecordSafepoint(locs);
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698