Index: runtime/vm/flow_graph_compiler_arm64.cc |
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc |
index 53429c8bda2bc2b539b327a3997b8030ee407e35..1dc370ce3b51bff3b333ddd137014be3e95456e4 100644 |
--- a/runtime/vm/flow_graph_compiler_arm64.cc |
+++ b/runtime/vm/flow_graph_compiler_arm64.cc |
@@ -1257,7 +1257,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor)); |
__ Comment("MegamorphicCall"); |
- __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize); |
+ __ LoadFromOffset(R1, SP, (argument_count - 1) * kWordSize); |
__ LoadObject(R5, cache); |
if (FLAG_use_megamorphic_stub) { |
__ BranchLink(*StubCode::MegamorphicLookup_entry()); |
@@ -1288,23 +1288,35 @@ void FlowGraphCompiler::EmitSwitchableInstanceCall( |
intptr_t token_pos, |
LocationSummary* locs) { |
__ Comment("SwitchableCall"); |
- __ LoadFromOffset(R0, SP, (argument_count - 1) * kWordSize); |
+ __ LoadFromOffset(R1, SP, (argument_count - 1) * kWordSize); |
if (ic_data.NumArgsTested() == 1) { |
__ LoadUniqueObject(R5, 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(R5, cache); |
- __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); |
+ |
+ if (name.raw() == Symbols::Plus().raw()) { |
+ __ LoadUniqueObject(R5, ic_data); |
+ __ BranchLinkPatchable(*StubCode::ICSmiAddLookup_entry()); |
+ } else if (name.raw() == Symbols::Minus().raw()) { |
+ __ LoadUniqueObject(R5, ic_data); |
+ __ BranchLinkPatchable(*StubCode::ICSmiSubLookup_entry()); |
+ } else if (name.raw() == Symbols::Equals().raw()) { |
+ __ LoadUniqueObject(R5, 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(R5, cache); |
+ __ BranchLinkPatchable(*StubCode::MegamorphicLookup_entry()); |
+ } |
} |
- __ blr(R1); |
+ __ blr(R1); // A fast Smi operation may return past this call. |
AddCurrentDescriptor(RawPcDescriptors::kOther, |
Thread::kNoDeoptId, token_pos); |