| 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 } else { | 810 } else { |
| 811 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); | 811 __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize)); |
| 812 } | 812 } |
| 813 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); | 813 __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function()))); |
| 814 __ movl(EDX, Immediate(argc_tag)); | 814 __ movl(EDX, Immediate(argc_tag)); |
| 815 const ExternalLabel* stub_entry = (is_bootstrap_native() || is_leaf_call) ? | 815 const ExternalLabel* stub_entry = (is_bootstrap_native() || is_leaf_call) ? |
| 816 &StubCode::CallBootstrapCFunctionLabel() : | 816 &StubCode::CallBootstrapCFunctionLabel() : |
| 817 &StubCode::CallNativeCFunctionLabel(); | 817 &StubCode::CallNativeCFunctionLabel(); |
| 818 compiler->GenerateCall(token_pos(), | 818 compiler->GenerateCall(token_pos(), |
| 819 stub_entry, | 819 stub_entry, |
| 820 PcDescriptors::kOther, | 820 RawPcDescriptors::kOther, |
| 821 locs()); | 821 locs()); |
| 822 __ popl(result); | 822 __ popl(result); |
| 823 } | 823 } |
| 824 | 824 |
| 825 | 825 |
| 826 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { | 826 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { |
| 827 ConstantInstr* constant = value->definition()->AsConstant(); | 827 ConstantInstr* constant = value->definition()->AsConstant(); |
| 828 if ((constant == NULL) || !Assembler::IsSafeSmi(constant->value())) { | 828 if ((constant == NULL) || !Assembler::IsSafeSmi(constant->value())) { |
| 829 return false; | 829 return false; |
| 830 } | 830 } |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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->out(0)); |
| 1718 compiler->SaveLiveRegisters(locs); | 1718 compiler->SaveLiveRegisters(locs); |
| 1719 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. | 1719 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. |
| 1720 &label, | 1720 &label, |
| 1721 PcDescriptors::kOther, | 1721 RawPcDescriptors::kOther, |
| 1722 locs); | 1722 locs); |
| 1723 __ MoveRegister(locs->temp(0).reg(), EAX); | 1723 __ MoveRegister(locs->temp(0).reg(), EAX); |
| 1724 compiler->RestoreLiveRegisters(locs); | 1724 compiler->RestoreLiveRegisters(locs); |
| 1725 __ jmp(exit_label()); | 1725 __ jmp(exit_label()); |
| 1726 } | 1726 } |
| 1727 | 1727 |
| 1728 private: | 1728 private: |
| 1729 StoreInstanceFieldInstr* instruction_; | 1729 StoreInstanceFieldInstr* instruction_; |
| 1730 const Class& cls_; | 1730 const Class& cls_; |
| 1731 }; | 1731 }; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 __ Drop(2); | 2178 __ Drop(2); |
| 2179 __ popl(kResultReg); | 2179 __ popl(kResultReg); |
| 2180 __ Bind(&done); | 2180 __ Bind(&done); |
| 2181 return; | 2181 return; |
| 2182 } | 2182 } |
| 2183 } | 2183 } |
| 2184 | 2184 |
| 2185 __ Bind(&slow_path); | 2185 __ Bind(&slow_path); |
| 2186 compiler->GenerateCall(token_pos(), | 2186 compiler->GenerateCall(token_pos(), |
| 2187 &StubCode::AllocateArrayLabel(), | 2187 &StubCode::AllocateArrayLabel(), |
| 2188 PcDescriptors::kOther, | 2188 RawPcDescriptors::kOther, |
| 2189 locs()); | 2189 locs()); |
| 2190 __ Bind(&done); | 2190 __ Bind(&done); |
| 2191 ASSERT(locs()->out(0).reg() == kResultReg); | 2191 ASSERT(locs()->out(0).reg() == kResultReg); |
| 2192 } | 2192 } |
| 2193 | 2193 |
| 2194 | 2194 |
| 2195 class BoxDoubleSlowPath : public SlowPathCode { | 2195 class BoxDoubleSlowPath : public SlowPathCode { |
| 2196 public: | 2196 public: |
| 2197 explicit BoxDoubleSlowPath(Instruction* instruction) | 2197 explicit BoxDoubleSlowPath(Instruction* instruction) |
| 2198 : instruction_(instruction) { } | 2198 : instruction_(instruction) { } |
| 2199 | 2199 |
| 2200 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2200 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2201 __ Comment("BoxDoubleSlowPath"); | 2201 __ Comment("BoxDoubleSlowPath"); |
| 2202 __ Bind(entry_label()); | 2202 __ Bind(entry_label()); |
| 2203 const Class& double_class = compiler->double_class(); | 2203 const Class& double_class = compiler->double_class(); |
| 2204 const Code& stub = | 2204 const Code& stub = |
| 2205 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); | 2205 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); |
| 2206 const ExternalLabel label(stub.EntryPoint()); | 2206 const ExternalLabel label(stub.EntryPoint()); |
| 2207 | 2207 |
| 2208 LocationSummary* locs = instruction_->locs(); | 2208 LocationSummary* locs = instruction_->locs(); |
| 2209 locs->live_registers()->Remove(locs->out(0)); | 2209 locs->live_registers()->Remove(locs->out(0)); |
| 2210 | 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 PcDescriptors::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 } |
| 2221 | 2221 |
| 2222 private: | 2222 private: |
| 2223 Instruction* instruction_; | 2223 Instruction* instruction_; |
| 2224 }; | 2224 }; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 locs->live_registers()->Remove(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 PcDescriptors::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()); |
| 2252 } | 2252 } |
| 2253 | 2253 |
| 2254 private: | 2254 private: |
| 2255 Instruction* instruction_; | 2255 Instruction* instruction_; |
| 2256 }; | 2256 }; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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 locs->live_registers()->Remove(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 PcDescriptors::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()); |
| 2284 } | 2284 } |
| 2285 | 2285 |
| 2286 private: | 2286 private: |
| 2287 Instruction* instruction_; | 2287 Instruction* instruction_; |
| 2288 }; | 2288 }; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2574 | 2574 |
| 2575 LocationSummary* locs = instruction_->locs(); | 2575 LocationSummary* locs = instruction_->locs(); |
| 2576 locs->live_registers()->Remove(locs->out(0)); | 2576 locs->live_registers()->Remove(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 PcDescriptors::kOther, | 2584 RawPcDescriptors::kOther, |
| 2585 locs); | 2585 locs); |
| 2586 ASSERT(instruction_->locs()->out(0).reg() == EAX); | 2586 ASSERT(instruction_->locs()->out(0).reg() == EAX); |
| 2587 compiler->RestoreLiveRegisters(instruction_->locs()); | 2587 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2588 __ jmp(exit_label()); | 2588 __ jmp(exit_label()); |
| 2589 } | 2589 } |
| 2590 | 2590 |
| 2591 private: | 2591 private: |
| 2592 AllocateContextInstr* instruction_; | 2592 AllocateContextInstr* instruction_; |
| 2593 }; | 2593 }; |
| 2594 | 2594 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 return; | 2664 return; |
| 2665 } | 2665 } |
| 2666 | 2666 |
| 2667 ASSERT(locs()->temp(0).reg() == EDX); | 2667 ASSERT(locs()->temp(0).reg() == EDX); |
| 2668 ASSERT(locs()->out(0).reg() == EAX); | 2668 ASSERT(locs()->out(0).reg() == EAX); |
| 2669 | 2669 |
| 2670 __ movl(EDX, Immediate(num_context_variables())); | 2670 __ movl(EDX, Immediate(num_context_variables())); |
| 2671 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); | 2671 const ExternalLabel label(StubCode::AllocateContextEntryPoint()); |
| 2672 compiler->GenerateCall(token_pos(), | 2672 compiler->GenerateCall(token_pos(), |
| 2673 &label, | 2673 &label, |
| 2674 PcDescriptors::kOther, | 2674 RawPcDescriptors::kOther, |
| 2675 locs()); | 2675 locs()); |
| 2676 } | 2676 } |
| 2677 | 2677 |
| 2678 | 2678 |
| 2679 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2679 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
| 2680 bool opt) const { | 2680 bool opt) const { |
| 2681 const intptr_t kNumInputs = 1; | 2681 const intptr_t kNumInputs = 1; |
| 2682 const intptr_t kNumTemps = 0; | 2682 const intptr_t kNumTemps = 0; |
| 2683 LocationSummary* locs = new(isolate) LocationSummary( | 2683 LocationSummary* locs = new(isolate) LocationSummary( |
| 2684 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2684 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2772 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2772 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
| 2773 compiler->pending_deoptimization_env_ = env; | 2773 compiler->pending_deoptimization_env_ = env; |
| 2774 compiler->GenerateRuntimeCall(instruction_->token_pos(), | 2774 compiler->GenerateRuntimeCall(instruction_->token_pos(), |
| 2775 instruction_->deopt_id(), | 2775 instruction_->deopt_id(), |
| 2776 kStackOverflowRuntimeEntry, | 2776 kStackOverflowRuntimeEntry, |
| 2777 0, | 2777 0, |
| 2778 instruction_->locs()); | 2778 instruction_->locs()); |
| 2779 | 2779 |
| 2780 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2780 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { |
| 2781 // In unoptimized code, record loop stack checks as possible OSR entries. | 2781 // In unoptimized code, record loop stack checks as possible OSR entries. |
| 2782 compiler->AddCurrentDescriptor(PcDescriptors::kOsrEntry, | 2782 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
| 2783 instruction_->deopt_id(), | 2783 instruction_->deopt_id(), |
| 2784 0); // No token position. | 2784 0); // No token position. |
| 2785 } | 2785 } |
| 2786 compiler->pending_deoptimization_env_ = NULL; | 2786 compiler->pending_deoptimization_env_ = NULL; |
| 2787 compiler->RestoreLiveRegisters(instruction_->locs()); | 2787 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2788 __ jmp(exit_label()); | 2788 __ jmp(exit_label()); |
| 2789 } | 2789 } |
| 2790 | 2790 |
| 2791 Label* osr_entry_label() { | 2791 Label* osr_entry_label() { |
| 2792 ASSERT(FLAG_use_osr); | 2792 ASSERT(FLAG_use_osr); |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 locs->live_registers()->Remove(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 PcDescriptors::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()); |
| 3627 } | 3627 } |
| 3628 | 3628 |
| 3629 private: | 3629 private: |
| 3630 BoxInt32x4Instr* instruction_; | 3630 BoxInt32x4Instr* instruction_; |
| 3631 }; | 3631 }; |
| (...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 locs->live_registers()->Remove(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 PcDescriptors::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()); |
| 5709 } | 5709 } |
| 5710 | 5710 |
| 5711 private: | 5711 private: |
| 5712 BoxIntegerInstr* instruction_; | 5712 BoxIntegerInstr* instruction_; |
| 5713 }; | 5713 }; |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6028 | 6028 |
| 6029 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6029 void TargetEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6030 __ Bind(compiler->GetJumpLabel(this)); | 6030 __ Bind(compiler->GetJumpLabel(this)); |
| 6031 if (!compiler->is_optimizing()) { | 6031 if (!compiler->is_optimizing()) { |
| 6032 if (compiler->NeedsEdgeCounter(this)) { | 6032 if (compiler->NeedsEdgeCounter(this)) { |
| 6033 compiler->EmitEdgeCounter(); | 6033 compiler->EmitEdgeCounter(); |
| 6034 } | 6034 } |
| 6035 // The deoptimization descriptor points after the edge counter code for | 6035 // The deoptimization descriptor points after the edge counter code for |
| 6036 // uniformity with ARM and MIPS, where we can reuse pattern matching | 6036 // uniformity with ARM and MIPS, where we can reuse pattern matching |
| 6037 // code that matches backwards from the end of the pattern. | 6037 // code that matches backwards from the end of the pattern. |
| 6038 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6038 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 6039 deopt_id_, | 6039 deopt_id_, |
| 6040 Scanner::kNoSourcePos); | 6040 Scanner::kNoSourcePos); |
| 6041 } | 6041 } |
| 6042 if (HasParallelMove()) { | 6042 if (HasParallelMove()) { |
| 6043 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6043 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 6044 } | 6044 } |
| 6045 } | 6045 } |
| 6046 | 6046 |
| 6047 | 6047 |
| 6048 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, | 6048 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, |
| 6049 bool opt) const { | 6049 bool opt) const { |
| 6050 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | 6050 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); |
| 6051 } | 6051 } |
| 6052 | 6052 |
| 6053 | 6053 |
| 6054 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6054 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6055 if (!compiler->is_optimizing()) { | 6055 if (!compiler->is_optimizing()) { |
| 6056 if (FLAG_emit_edge_counters) { | 6056 if (FLAG_emit_edge_counters) { |
| 6057 compiler->EmitEdgeCounter(); | 6057 compiler->EmitEdgeCounter(); |
| 6058 } | 6058 } |
| 6059 // Add a deoptimization descriptor for deoptimizing instructions that | 6059 // Add a deoptimization descriptor for deoptimizing instructions that |
| 6060 // may be inserted before this instruction. This descriptor points | 6060 // may be inserted before this instruction. This descriptor points |
| 6061 // after the edge counter for uniformity with ARM and MIPS, where we can | 6061 // after the edge counter for uniformity with ARM and MIPS, where we can |
| 6062 // reuse pattern matching that matches backwards from the end of the | 6062 // reuse pattern matching that matches backwards from the end of the |
| 6063 // pattern. | 6063 // pattern. |
| 6064 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6064 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 6065 GetDeoptId(), | 6065 GetDeoptId(), |
| 6066 Scanner::kNoSourcePos); | 6066 Scanner::kNoSourcePos); |
| 6067 } | 6067 } |
| 6068 if (HasParallelMove()) { | 6068 if (HasParallelMove()) { |
| 6069 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6069 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 6070 } | 6070 } |
| 6071 | 6071 |
| 6072 // We can fall through if the successor is the next block in the list. | 6072 // We can fall through if the successor is the next block in the list. |
| 6073 // Otherwise, we need a jump. | 6073 // Otherwise, we need a jump. |
| 6074 if (!compiler->CanFallThroughTo(successor())) { | 6074 if (!compiler->CanFallThroughTo(successor())) { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6259 // EBX: Code (compiled code or lazy compile stub). | 6259 // EBX: Code (compiled code or lazy compile stub). |
| 6260 ASSERT(locs()->in(0).reg() == EAX); | 6260 ASSERT(locs()->in(0).reg() == EAX); |
| 6261 __ movl(EBX, FieldAddress(EAX, Function::instructions_offset())); | 6261 __ movl(EBX, FieldAddress(EAX, Function::instructions_offset())); |
| 6262 | 6262 |
| 6263 // EAX: Function. | 6263 // EAX: Function. |
| 6264 // EDX: Arguments descriptor array. | 6264 // EDX: Arguments descriptor array. |
| 6265 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 6265 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| 6266 __ xorl(ECX, ECX); | 6266 __ xorl(ECX, ECX); |
| 6267 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); | 6267 __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
| 6268 __ call(EBX); | 6268 __ call(EBX); |
| 6269 compiler->AddCurrentDescriptor(PcDescriptors::kClosureCall, | 6269 compiler->AddCurrentDescriptor(RawPcDescriptors::kClosureCall, |
| 6270 deopt_id(), | 6270 deopt_id(), |
| 6271 token_pos()); | 6271 token_pos()); |
| 6272 compiler->RecordSafepoint(locs()); | 6272 compiler->RecordSafepoint(locs()); |
| 6273 // Marks either the continuation point in unoptimized code or the | 6273 // Marks either the continuation point in unoptimized code or the |
| 6274 // deoptimization point in optimized code, after call. | 6274 // deoptimization point in optimized code, after call. |
| 6275 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); | 6275 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id()); |
| 6276 if (compiler->is_optimizing()) { | 6276 if (compiler->is_optimizing()) { |
| 6277 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); | 6277 compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos()); |
| 6278 } else { | 6278 } else { |
| 6279 // Add deoptimization continuation point after the call and before the | 6279 // Add deoptimization continuation point after the call and before the |
| 6280 // arguments are removed. | 6280 // arguments are removed. |
| 6281 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6281 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| 6282 deopt_id_after, | 6282 deopt_id_after, |
| 6283 token_pos()); | 6283 token_pos()); |
| 6284 } | 6284 } |
| 6285 __ Drop(argument_count); | 6285 __ Drop(argument_count); |
| 6286 } | 6286 } |
| 6287 | 6287 |
| 6288 | 6288 |
| 6289 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, | 6289 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, |
| 6290 bool opt) const { | 6290 bool opt) const { |
| 6291 return LocationSummary::Make(isolate, | 6291 return LocationSummary::Make(isolate, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 6312 bool opt) const { | 6312 bool opt) const { |
| 6313 return MakeCallSummary(); | 6313 return MakeCallSummary(); |
| 6314 } | 6314 } |
| 6315 | 6315 |
| 6316 | 6316 |
| 6317 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6317 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6318 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 6318 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
| 6319 const ExternalLabel label(stub.EntryPoint()); | 6319 const ExternalLabel label(stub.EntryPoint()); |
| 6320 compiler->GenerateCall(token_pos(), | 6320 compiler->GenerateCall(token_pos(), |
| 6321 &label, | 6321 &label, |
| 6322 PcDescriptors::kOther, | 6322 RawPcDescriptors::kOther, |
| 6323 locs()); | 6323 locs()); |
| 6324 __ Drop(ArgumentCount()); // Discard arguments. | 6324 __ Drop(ArgumentCount()); // Discard arguments. |
| 6325 } | 6325 } |
| 6326 | 6326 |
| 6327 | 6327 |
| 6328 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6328 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6329 ASSERT(!compiler->is_optimizing()); | 6329 ASSERT(!compiler->is_optimizing()); |
| 6330 const ExternalLabel label(StubCode::DebugStepCheckEntryPoint()); | 6330 const ExternalLabel label(StubCode::DebugStepCheckEntryPoint()); |
| 6331 __ movl(EDX, Immediate(0)); | 6331 __ movl(EDX, Immediate(0)); |
| 6332 __ movl(ECX, Immediate(0)); | 6332 __ movl(ECX, Immediate(0)); |
| 6333 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6333 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 6334 #if defined(DEBUG) | 6334 #if defined(DEBUG) |
| 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 |