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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 class BoxAllocationSlowPath : public SlowPathCode { | 1805 class BoxAllocationSlowPath : public SlowPathCode { |
1806 public: | 1806 public: |
1807 BoxAllocationSlowPath(Instruction* instruction, | 1807 BoxAllocationSlowPath(Instruction* instruction, |
1808 const Class& cls, | 1808 const Class& cls, |
1809 Register result) | 1809 Register result) |
1810 : instruction_(instruction), | 1810 : instruction_(instruction), |
1811 cls_(cls), | 1811 cls_(cls), |
1812 result_(result) { } | 1812 result_(result) { } |
1813 | 1813 |
1814 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 1814 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
1815 Isolate* isolate = compiler->isolate(); | |
1816 | |
1817 if (Assembler::EmittingComments()) { | 1815 if (Assembler::EmittingComments()) { |
1818 __ Comment("%s slow path allocation of %s", | 1816 __ Comment("%s slow path allocation of %s", |
1819 instruction_->DebugName(), | 1817 instruction_->DebugName(), |
1820 String::Handle(cls_.PrettyName()).ToCString()); | 1818 String::Handle(cls_.PrettyName()).ToCString()); |
1821 } | 1819 } |
1822 __ Bind(entry_label()); | 1820 __ Bind(entry_label()); |
1823 const Code& stub = | 1821 const Code& stub = Code::ZoneHandle( |
1824 Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_)); | 1822 compiler->zone(), StubCode::GetAllocationStubForClass(cls_)); |
1825 const StubEntry stub_entry(stub); | 1823 const StubEntry stub_entry(stub); |
1826 | 1824 |
1827 LocationSummary* locs = instruction_->locs(); | 1825 LocationSummary* locs = instruction_->locs(); |
1828 | 1826 |
1829 locs->live_registers()->Remove(Location::RegisterLocation(result_)); | 1827 locs->live_registers()->Remove(Location::RegisterLocation(result_)); |
1830 | 1828 |
1831 compiler->SaveLiveRegisters(locs); | 1829 compiler->SaveLiveRegisters(locs); |
1832 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1830 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
1833 stub_entry, | 1831 stub_entry, |
1834 RawPcDescriptors::kOther, | 1832 RawPcDescriptors::kOther, |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2387 deopt_id(), | 2385 deopt_id(), |
2388 kAllocateArrayRuntimeEntry, | 2386 kAllocateArrayRuntimeEntry, |
2389 2, | 2387 2, |
2390 locs()); | 2388 locs()); |
2391 __ Drop(2); | 2389 __ Drop(2); |
2392 __ Pop(kResultReg); | 2390 __ Pop(kResultReg); |
2393 __ Bind(&done); | 2391 __ Bind(&done); |
2394 return; | 2392 return; |
2395 } | 2393 } |
2396 } | 2394 } |
2397 const Code& stub = Code::Handle(compiler->isolate(), | 2395 const Code& stub = Code::ZoneHandle(compiler->zone(), |
2398 StubCode::AllocateArray_entry()->code()); | 2396 StubCode::AllocateArray_entry()->code()); |
2399 compiler->AddStubCallTarget(stub); | 2397 compiler->AddStubCallTarget(stub); |
2400 compiler->GenerateCall(token_pos(), | 2398 compiler->GenerateCall(token_pos(), |
2401 *StubCode::AllocateArray_entry(), | 2399 *StubCode::AllocateArray_entry(), |
2402 RawPcDescriptors::kOther, | 2400 RawPcDescriptors::kOther, |
2403 locs()); | 2401 locs()); |
2404 ASSERT(locs()->out(0).reg() == kResultReg); | 2402 ASSERT(locs()->out(0).reg() == kResultReg); |
2405 } | 2403 } |
2406 | 2404 |
2407 | 2405 |
2408 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone, | 2406 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone, |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2677 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2675 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2678 __ Comment("AllocateContextSlowPath"); | 2676 __ Comment("AllocateContextSlowPath"); |
2679 __ Bind(entry_label()); | 2677 __ Bind(entry_label()); |
2680 | 2678 |
2681 LocationSummary* locs = instruction_->locs(); | 2679 LocationSummary* locs = instruction_->locs(); |
2682 locs->live_registers()->Remove(locs->out(0)); | 2680 locs->live_registers()->Remove(locs->out(0)); |
2683 | 2681 |
2684 compiler->SaveLiveRegisters(locs); | 2682 compiler->SaveLiveRegisters(locs); |
2685 | 2683 |
2686 __ LoadImmediate(R1, instruction_->num_context_variables()); | 2684 __ LoadImmediate(R1, instruction_->num_context_variables()); |
2687 const Code& stub = Code::Handle(compiler->isolate(), | 2685 const Code& stub = Code::ZoneHandle( |
2688 StubCode::AllocateContext_entry()->code()); | 2686 compiler->zone(), StubCode::AllocateContext_entry()->code()); |
2689 compiler->AddStubCallTarget(stub); | 2687 compiler->AddStubCallTarget(stub); |
2690 compiler->GenerateCall(instruction_->token_pos(), | 2688 compiler->GenerateCall(instruction_->token_pos(), |
2691 *StubCode::AllocateContext_entry(), | 2689 *StubCode::AllocateContext_entry(), |
2692 RawPcDescriptors::kOther, | 2690 RawPcDescriptors::kOther, |
2693 locs); | 2691 locs); |
2694 ASSERT(instruction_->locs()->out(0).reg() == R0); | 2692 ASSERT(instruction_->locs()->out(0).reg() == R0); |
2695 compiler->RestoreLiveRegisters(instruction_->locs()); | 2693 compiler->RestoreLiveRegisters(instruction_->locs()); |
2696 __ b(exit_label()); | 2694 __ b(exit_label()); |
2697 } | 2695 } |
2698 | 2696 |
(...skipping 4106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6805 } | 6803 } |
6806 | 6804 |
6807 | 6805 |
6808 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, | 6806 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, |
6809 bool opt) const { | 6807 bool opt) const { |
6810 return MakeCallSummary(zone); | 6808 return MakeCallSummary(zone); |
6811 } | 6809 } |
6812 | 6810 |
6813 | 6811 |
6814 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6812 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6815 Isolate* isolate = compiler->isolate(); | 6813 const Code& stub = Code::ZoneHandle( |
6816 const Code& stub = Code::Handle(isolate, | 6814 compiler->zone(), StubCode::GetAllocationStubForClass(cls())); |
6817 StubCode::GetAllocationStubForClass(cls())); | |
6818 const StubEntry stub_entry(stub); | 6815 const StubEntry stub_entry(stub); |
6819 compiler->GenerateCall(token_pos(), | 6816 compiler->GenerateCall(token_pos(), |
6820 stub_entry, | 6817 stub_entry, |
6821 RawPcDescriptors::kOther, | 6818 RawPcDescriptors::kOther, |
6822 locs()); | 6819 locs()); |
6823 compiler->AddStubCallTarget(stub); | 6820 compiler->AddStubCallTarget(stub); |
6824 __ Drop(ArgumentCount()); // Discard arguments. | 6821 __ Drop(ArgumentCount()); // Discard arguments. |
6825 } | 6822 } |
6826 | 6823 |
6827 | 6824 |
(...skipping 27 matching lines...) Expand all Loading... |
6855 1, | 6852 1, |
6856 locs()); | 6853 locs()); |
6857 __ Drop(1); | 6854 __ Drop(1); |
6858 __ Pop(result); | 6855 __ Pop(result); |
6859 } | 6856 } |
6860 | 6857 |
6861 | 6858 |
6862 } // namespace dart | 6859 } // namespace dart |
6863 | 6860 |
6864 #endif // defined TARGET_ARCH_ARM | 6861 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |