| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4815 } | 4815 } |
| 4816 | 4816 |
| 4817 | 4817 |
| 4818 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 4818 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
| 4819 Isolate* isolate, bool opt) const { | 4819 Isolate* isolate, bool opt) const { |
| 4820 return MakeCallSummary(); | 4820 return MakeCallSummary(); |
| 4821 } | 4821 } |
| 4822 | 4822 |
| 4823 | 4823 |
| 4824 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4824 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4825 Label* deopt = compiler->AddDeoptStub( | |
| 4826 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | |
| 4827 if (ic_data().NumberOfChecks() == 0) { | |
| 4828 __ b(deopt); | |
| 4829 return; | |
| 4830 } | |
| 4831 ASSERT(ic_data().NumArgsTested() == 1); | 4825 ASSERT(ic_data().NumArgsTested() == 1); |
| 4832 if (!with_checks()) { | 4826 if (!with_checks()) { |
| 4833 ASSERT(ic_data().HasOneTarget()); | 4827 ASSERT(ic_data().HasOneTarget()); |
| 4834 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 4828 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
| 4835 compiler->GenerateStaticCall(deopt_id(), | 4829 compiler->GenerateStaticCall(deopt_id(), |
| 4836 instance_call()->token_pos(), | 4830 instance_call()->token_pos(), |
| 4837 target, | 4831 target, |
| 4838 instance_call()->ArgumentCount(), | 4832 instance_call()->ArgumentCount(), |
| 4839 instance_call()->argument_names(), | 4833 instance_call()->argument_names(), |
| 4840 locs(), | 4834 locs(), |
| 4841 ICData::Handle()); | 4835 ICData::Handle()); |
| 4842 return; | 4836 return; |
| 4843 } | 4837 } |
| 4844 | 4838 |
| 4845 // Load receiver into R0. | 4839 // Load receiver into R0. |
| 4846 __ LoadFromOffset( | 4840 __ LoadFromOffset( |
| 4847 R0, SP, (instance_call()->ArgumentCount() - 1) * kWordSize, PP); | 4841 R0, SP, (instance_call()->ArgumentCount() - 1) * kWordSize, PP); |
| 4848 | 4842 |
| 4843 Label* deopt = compiler->AddDeoptStub( |
| 4844 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
| 4849 LoadValueCid(compiler, R2, R0, | 4845 LoadValueCid(compiler, R2, R0, |
| 4850 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); | 4846 (ic_data().GetReceiverClassIdAt(0) == kSmiCid) ? NULL : deopt); |
| 4851 | 4847 |
| 4852 compiler->EmitTestAndCall(ic_data(), | 4848 compiler->EmitTestAndCall(ic_data(), |
| 4853 R2, // Class id register. | 4849 R2, // Class id register. |
| 4854 instance_call()->ArgumentCount(), | 4850 instance_call()->ArgumentCount(), |
| 4855 instance_call()->argument_names(), | 4851 instance_call()->argument_names(), |
| 4856 deopt, | 4852 deopt, |
| 4857 deopt_id(), | 4853 deopt_id(), |
| 4858 instance_call()->token_pos(), | 4854 instance_call()->token_pos(), |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5481 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5477 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 5482 #if defined(DEBUG) | 5478 #if defined(DEBUG) |
| 5483 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5479 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
| 5484 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5480 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
| 5485 #endif | 5481 #endif |
| 5486 } | 5482 } |
| 5487 | 5483 |
| 5488 } // namespace dart | 5484 } // namespace dart |
| 5489 | 5485 |
| 5490 #endif // defined TARGET_ARCH_ARM64 | 5486 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |