| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5350 } | 5350 } |
| 5351 | 5351 |
| 5352 | 5352 |
| 5353 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5353 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
| 5354 Isolate* isolate, bool opt) const { | 5354 Isolate* isolate, bool opt) const { |
| 5355 return MakeCallSummary(); | 5355 return MakeCallSummary(); |
| 5356 } | 5356 } |
| 5357 | 5357 |
| 5358 | 5358 |
| 5359 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5359 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5360 Label* deopt = compiler->AddDeoptStub( | |
| 5361 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | |
| 5362 if (ic_data().NumberOfUsedChecks() == 0) { | |
| 5363 __ jmp(deopt); | |
| 5364 return; | |
| 5365 } | |
| 5366 ASSERT(ic_data().NumArgsTested() == 1); | 5360 ASSERT(ic_data().NumArgsTested() == 1); |
| 5367 if (!with_checks()) { | 5361 if (!with_checks()) { |
| 5368 ASSERT(ic_data().HasOneTarget()); | 5362 ASSERT(ic_data().HasOneTarget()); |
| 5369 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 5363 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
| 5370 compiler->GenerateStaticCall(deopt_id(), | 5364 compiler->GenerateStaticCall(deopt_id(), |
| 5371 instance_call()->token_pos(), | 5365 instance_call()->token_pos(), |
| 5372 target, | 5366 target, |
| 5373 instance_call()->ArgumentCount(), | 5367 instance_call()->ArgumentCount(), |
| 5374 instance_call()->argument_names(), | 5368 instance_call()->argument_names(), |
| 5375 locs(), | 5369 locs(), |
| 5376 ICData::Handle()); | 5370 ICData::Handle()); |
| 5377 return; | 5371 return; |
| 5378 } | 5372 } |
| 5379 | 5373 |
| 5380 // Load receiver into EAX. | 5374 // Load receiver into EAX. |
| 5381 __ movl(EAX, | 5375 __ movl(EAX, |
| 5382 Address(ESP, (instance_call()->ArgumentCount() - 1) * kWordSize)); | 5376 Address(ESP, (instance_call()->ArgumentCount() - 1) * kWordSize)); |
| 5383 | 5377 |
| 5378 Label* deopt = compiler->AddDeoptStub( |
| 5379 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
| 5384 LoadValueCid(compiler, EDI, EAX, | 5380 LoadValueCid(compiler, EDI, EAX, |
| 5385 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); | 5381 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); |
| 5386 | 5382 |
| 5387 compiler->EmitTestAndCall(ic_data(), | 5383 compiler->EmitTestAndCall(ic_data(), |
| 5388 EDI, // Class id register. | 5384 EDI, // Class id register. |
| 5389 instance_call()->ArgumentCount(), | 5385 instance_call()->ArgumentCount(), |
| 5390 instance_call()->argument_names(), | 5386 instance_call()->argument_names(), |
| 5391 deopt, | 5387 deopt, |
| 5392 deopt_id(), | 5388 deopt_id(), |
| 5393 instance_call()->token_pos(), | 5389 instance_call()->token_pos(), |
| (...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6749 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6745 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6750 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6746 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
| 6751 #endif | 6747 #endif |
| 6752 } | 6748 } |
| 6753 | 6749 |
| 6754 } // namespace dart | 6750 } // namespace dart |
| 6755 | 6751 |
| 6756 #undef __ | 6752 #undef __ |
| 6757 | 6753 |
| 6758 #endif // defined TARGET_ARCH_IA32 | 6754 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |