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 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 : instruction_(instruction), cls_(cls) { } | 1707 : instruction_(instruction), cls_(cls) { } |
1708 | 1708 |
1709 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 1709 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
1710 __ Comment("StoreInstanceFieldSlowPath"); | 1710 __ Comment("StoreInstanceFieldSlowPath"); |
1711 __ Bind(entry_label()); | 1711 __ Bind(entry_label()); |
1712 const Code& stub = | 1712 const Code& stub = |
1713 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); | 1713 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); |
1714 const ExternalLabel label(stub.EntryPoint()); | 1714 const ExternalLabel label(stub.EntryPoint()); |
1715 | 1715 |
1716 LocationSummary* locs = instruction_->locs(); | 1716 LocationSummary* locs = instruction_->locs(); |
1717 locs->live_registers()->Remove(locs->out(0)); | 1717 locs->live_registers()->Remove(locs->temp(0)); |
| 1718 |
1718 compiler->SaveLiveRegisters(locs); | 1719 compiler->SaveLiveRegisters(locs); |
1719 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1720 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
1720 &label, | 1721 &label, |
1721 RawPcDescriptors::kOther, | 1722 RawPcDescriptors::kOther, |
1722 locs); | 1723 locs); |
1723 __ MoveRegister(locs->temp(0).reg(), EAX); | 1724 __ MoveRegister(locs->temp(0).reg(), EAX); |
1724 compiler->RestoreLiveRegisters(locs); | 1725 compiler->RestoreLiveRegisters(locs); |
1725 __ jmp(exit_label()); | 1726 __ jmp(exit_label()); |
1726 } | 1727 } |
1727 | 1728 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 | 2200 |
2200 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2201 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2201 __ Comment("BoxDoubleSlowPath"); | 2202 __ Comment("BoxDoubleSlowPath"); |
2202 __ Bind(entry_label()); | 2203 __ Bind(entry_label()); |
2203 const Class& double_class = compiler->double_class(); | 2204 const Class& double_class = compiler->double_class(); |
2204 const Code& stub = | 2205 const Code& stub = |
2205 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 2206 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
2206 const ExternalLabel label(stub.EntryPoint()); | 2207 const ExternalLabel label(stub.EntryPoint()); |
2207 | 2208 |
2208 LocationSummary* locs = instruction_->locs(); | 2209 LocationSummary* locs = instruction_->locs(); |
2209 locs->live_registers()->Remove(locs->out(0)); | 2210 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
2210 | |
2211 compiler->SaveLiveRegisters(locs); | 2211 compiler->SaveLiveRegisters(locs); |
2212 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2212 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2213 &label, | 2213 &label, |
2214 RawPcDescriptors::kOther, | 2214 RawPcDescriptors::kOther, |
2215 locs); | 2215 locs); |
2216 __ MoveRegister(locs->out(0).reg(), EAX); | 2216 __ MoveRegister(locs->out(0).reg(), EAX); |
2217 compiler->RestoreLiveRegisters(locs); | 2217 compiler->RestoreLiveRegisters(locs); |
2218 | 2218 |
2219 __ jmp(exit_label()); | 2219 __ jmp(exit_label()); |
2220 } | 2220 } |
(...skipping 10 matching lines...) Expand all Loading... |
2231 | 2231 |
2232 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2232 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2233 __ Comment("BoxFloat32x4SlowPath"); | 2233 __ Comment("BoxFloat32x4SlowPath"); |
2234 __ Bind(entry_label()); | 2234 __ Bind(entry_label()); |
2235 const Class& float32x4_class = compiler->float32x4_class(); | 2235 const Class& float32x4_class = compiler->float32x4_class(); |
2236 const Code& stub = | 2236 const Code& stub = |
2237 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); | 2237 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); |
2238 const ExternalLabel label(stub.EntryPoint()); | 2238 const ExternalLabel label(stub.EntryPoint()); |
2239 | 2239 |
2240 LocationSummary* locs = instruction_->locs(); | 2240 LocationSummary* locs = instruction_->locs(); |
2241 locs->live_registers()->Remove(locs->out(0)); | 2241 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
2242 | 2242 |
2243 compiler->SaveLiveRegisters(locs); | 2243 compiler->SaveLiveRegisters(locs); |
2244 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2244 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2245 &label, | 2245 &label, |
2246 RawPcDescriptors::kOther, | 2246 RawPcDescriptors::kOther, |
2247 locs); | 2247 locs); |
2248 __ MoveRegister(locs->out(0).reg(), EAX); | 2248 __ MoveRegister(locs->out(0).reg(), EAX); |
2249 compiler->RestoreLiveRegisters(locs); | 2249 compiler->RestoreLiveRegisters(locs); |
2250 | 2250 |
2251 __ jmp(exit_label()); | 2251 __ jmp(exit_label()); |
(...skipping 11 matching lines...) Expand all Loading... |
2263 | 2263 |
2264 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2264 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2265 __ Comment("BoxFloat64x2SlowPath"); | 2265 __ Comment("BoxFloat64x2SlowPath"); |
2266 __ Bind(entry_label()); | 2266 __ Bind(entry_label()); |
2267 const Class& float64x2_class = compiler->float64x2_class(); | 2267 const Class& float64x2_class = compiler->float64x2_class(); |
2268 const Code& stub = | 2268 const Code& stub = |
2269 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); | 2269 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); |
2270 const ExternalLabel label(stub.EntryPoint()); | 2270 const ExternalLabel label(stub.EntryPoint()); |
2271 | 2271 |
2272 LocationSummary* locs = instruction_->locs(); | 2272 LocationSummary* locs = instruction_->locs(); |
2273 locs->live_registers()->Remove(locs->out(0)); | 2273 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
2274 | 2274 |
2275 compiler->SaveLiveRegisters(locs); | 2275 compiler->SaveLiveRegisters(locs); |
2276 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 2276 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
2277 &label, | 2277 &label, |
2278 RawPcDescriptors::kOther, | 2278 RawPcDescriptors::kOther, |
2279 locs); | 2279 locs); |
2280 __ MoveRegister(locs->out(0).reg(), EAX); | 2280 __ MoveRegister(locs->out(0).reg(), EAX); |
2281 compiler->RestoreLiveRegisters(locs); | 2281 compiler->RestoreLiveRegisters(locs); |
2282 | 2282 |
2283 __ jmp(exit_label()); | 2283 __ jmp(exit_label()); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 class AllocateContextSlowPath : public SlowPathCode { | 2566 class AllocateContextSlowPath : public SlowPathCode { |
2567 public: | 2567 public: |
2568 explicit AllocateContextSlowPath(AllocateContextInstr* instruction) | 2568 explicit AllocateContextSlowPath(AllocateContextInstr* instruction) |
2569 : instruction_(instruction) { } | 2569 : instruction_(instruction) { } |
2570 | 2570 |
2571 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2571 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
2572 __ Comment("AllocateContextSlowPath"); | 2572 __ Comment("AllocateContextSlowPath"); |
2573 __ Bind(entry_label()); | 2573 __ Bind(entry_label()); |
2574 | 2574 |
2575 LocationSummary* locs = instruction_->locs(); | 2575 LocationSummary* locs = instruction_->locs(); |
2576 locs->live_registers()->Remove(locs->out(0)); | 2576 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
2577 | 2577 |
2578 compiler->SaveLiveRegisters(locs); | 2578 compiler->SaveLiveRegisters(locs); |
2579 | 2579 |
2580 __ movl(EDX, Immediate(instruction_->num_context_variables())); | 2580 __ movl(EDX, Immediate(instruction_->num_context_variables())); |
2581 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); | 2581 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); |
2582 compiler->GenerateCall(instruction_->token_pos(), | 2582 compiler->GenerateCall(instruction_->token_pos(), |
2583 &label, | 2583 &label, |
2584 RawPcDescriptors::kOther, | 2584 RawPcDescriptors::kOther, |
2585 locs); | 2585 locs); |
2586 ASSERT(instruction_->locs()->out(0).reg() == EAX); | 2586 ASSERT(instruction_->locs()->out(0).reg() == EAX); |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3606 | 3606 |
3607 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 3607 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
3608 __ Comment("BoxInt32x4SlowPath"); | 3608 __ Comment("BoxInt32x4SlowPath"); |
3609 __ Bind(entry_label()); | 3609 __ Bind(entry_label()); |
3610 const Class& int32x4_class = compiler->int32x4_class(); | 3610 const Class& int32x4_class = compiler->int32x4_class(); |
3611 const Code& stub = | 3611 const Code& stub = |
3612 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); | 3612 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); |
3613 const ExternalLabel label(stub.EntryPoint()); | 3613 const ExternalLabel label(stub.EntryPoint()); |
3614 | 3614 |
3615 LocationSummary* locs = instruction_->locs(); | 3615 LocationSummary* locs = instruction_->locs(); |
3616 locs->live_registers()->Remove(locs->out(0)); | 3616 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
3617 | 3617 |
3618 compiler->SaveLiveRegisters(locs); | 3618 compiler->SaveLiveRegisters(locs); |
3619 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 3619 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
3620 &label, | 3620 &label, |
3621 RawPcDescriptors::kOther, | 3621 RawPcDescriptors::kOther, |
3622 locs); | 3622 locs); |
3623 __ MoveRegister(locs->out(0).reg(), EAX); | 3623 __ MoveRegister(locs->out(0).reg(), EAX); |
3624 compiler->RestoreLiveRegisters(locs); | 3624 compiler->RestoreLiveRegisters(locs); |
3625 | 3625 |
3626 __ jmp(exit_label()); | 3626 __ jmp(exit_label()); |
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5688 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 5688 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
5689 __ Comment("BoxIntegerSlowPath"); | 5689 __ Comment("BoxIntegerSlowPath"); |
5690 __ Bind(entry_label()); | 5690 __ Bind(entry_label()); |
5691 const Class& mint_class = | 5691 const Class& mint_class = |
5692 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()); | 5692 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()); |
5693 const Code& stub = | 5693 const Code& stub = |
5694 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); | 5694 Code::Handle(StubCode::GetAllocationStubForClass(mint_class)); |
5695 const ExternalLabel label(stub.EntryPoint()); | 5695 const ExternalLabel label(stub.EntryPoint()); |
5696 | 5696 |
5697 LocationSummary* locs = instruction_->locs(); | 5697 LocationSummary* locs = instruction_->locs(); |
5698 locs->live_registers()->Remove(locs->out(0)); | 5698 ASSERT(!locs->live_registers()->Contains(locs->out(0))); |
5699 | 5699 |
5700 compiler->SaveLiveRegisters(locs); | 5700 compiler->SaveLiveRegisters(locs); |
5701 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 5701 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
5702 &label, | 5702 &label, |
5703 RawPcDescriptors::kOther, | 5703 RawPcDescriptors::kOther, |
5704 locs); | 5704 locs); |
5705 __ MoveRegister(locs->out(0).reg(), EAX); | 5705 __ MoveRegister(locs->out(0).reg(), EAX); |
5706 compiler->RestoreLiveRegisters(locs); | 5706 compiler->RestoreLiveRegisters(locs); |
5707 | 5707 |
5708 __ jmp(exit_label()); | 5708 __ jmp(exit_label()); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6335 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6335 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6336 __ movl(EDX, Immediate(kInvalidObjectPointer)); | 6336 __ movl(EDX, Immediate(kInvalidObjectPointer)); |
6337 #endif | 6337 #endif |
6338 } | 6338 } |
6339 | 6339 |
6340 } // namespace dart | 6340 } // namespace dart |
6341 | 6341 |
6342 #undef __ | 6342 #undef __ |
6343 | 6343 |
6344 #endif // defined TARGET_ARCH_IA32 | 6344 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |