| Index: runtime/vm/flow_graph_compiler_ia32.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
|
| index 72dda0a3e1799782712e27a8014fbc6d52037d24..3cd8342e0d2f89c11024962fda6c629bb6ae784c 100644
|
| --- a/runtime/vm/flow_graph_compiler_ia32.cc
|
| +++ b/runtime/vm/flow_graph_compiler_ia32.cc
|
| @@ -1285,21 +1285,57 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall(
|
| ASSERT(!arguments_descriptor.IsNull() && (arguments_descriptor.Length() > 0));
|
| const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
|
| MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
|
| - const Register receiverR = ECX;
|
| - const Register cacheR = EBX;
|
| - const Register targetR = EBX;
|
| - __ movl(receiverR, Address(ESP, (argument_count - 1) * kWordSize));
|
| - __ LoadObject(cacheR, cache);
|
|
|
| + __ Comment("MegamorphicCall");
|
| + __ movl(EBX, Address(ESP, (argument_count - 1) * kWordSize));
|
| + __ LoadObject(ECX, cache);
|
| if (FLAG_use_megamorphic_stub) {
|
| __ Call(*StubCode::MegamorphicLookup_entry());
|
| } else {
|
| - StubCode::EmitMegamorphicLookup(assembler(), receiverR, cacheR, targetR);
|
| + StubCode::EmitMegamorphicLookup(assembler());
|
| }
|
| + __ call(EBX);
|
| +
|
| + 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");
|
| + __ movl(EBX, Address(ESP, (argument_count - 1) * kWordSize));
|
| + if (ic_data.NumArgsTested() == 1) {
|
| + __ LoadObject(ECX, ic_data);
|
| + __ Call(*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));
|
| +
|
| + __ LoadObject(ECX, cache);
|
| + __ Call(*StubCode::MegamorphicLookup_entry());
|
| + }
|
| + __ call(EBX);
|
|
|
| - __ LoadObject(ECX, ic_data);
|
| - __ LoadObject(EDX, arguments_descriptor);
|
| - __ call(targetR);
|
| AddCurrentDescriptor(RawPcDescriptors::kOther,
|
| Thread::kNoDeoptId, token_pos);
|
| RecordSafepoint(locs);
|
|
|