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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 __ movl(EDI, ESP); | 91 __ movl(EDI, ESP); |
92 __ subl(EDI, EBP); | 92 __ subl(EDI, EBP); |
93 __ cmpl(EDI, Immediate(fp_sp_dist)); | 93 __ cmpl(EDI, Immediate(fp_sp_dist)); |
94 __ j(EQUAL, &done, Assembler::kNearJump); | 94 __ j(EQUAL, &done, Assembler::kNearJump); |
95 __ int3(); | 95 __ int3(); |
96 __ Bind(&done); | 96 __ Bind(&done); |
97 } | 97 } |
98 #endif | 98 #endif |
99 __ LeaveFrame(); | 99 __ LeaveFrame(); |
100 __ ret(); | 100 __ ret(); |
101 | |
102 // Generate 1 byte NOP so that the debugger can patch the | |
103 // return pattern with a call to the debug stub. | |
104 __ nop(1); | |
105 compiler->AddCurrentDescriptor(PcDescriptors::kReturn, | |
106 Isolate::kNoDeoptId, | |
107 token_pos()); | |
108 } | 101 } |
109 | 102 |
110 | 103 |
111 LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const { | 104 LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const { |
112 const intptr_t kNumInputs = 0; | 105 const intptr_t kNumInputs = 0; |
113 return LocationSummary::Make(kNumInputs, | 106 return LocationSummary::Make(kNumInputs, |
114 Location::RequiresRegister(), | 107 Location::RequiresRegister(), |
115 LocationSummary::kNoCall); | 108 LocationSummary::kNoCall); |
116 } | 109 } |
117 | 110 |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : | 694 (is_bootstrap_native()) ? &StubCode::CallBootstrapCFunctionLabel() : |
702 &StubCode::CallNativeCFunctionLabel(); | 695 &StubCode::CallNativeCFunctionLabel(); |
703 compiler->GenerateCall(token_pos(), | 696 compiler->GenerateCall(token_pos(), |
704 stub_entry, | 697 stub_entry, |
705 PcDescriptors::kOther, | 698 PcDescriptors::kOther, |
706 locs()); | 699 locs()); |
707 __ popl(result); | 700 __ popl(result); |
708 } | 701 } |
709 | 702 |
710 | 703 |
| 704 LocationSummary* DebugStepCheckInstr::MakeLocationSummary(bool opt) const { |
| 705 const intptr_t kNumInputs = 0; |
| 706 const intptr_t kNumTemps = 0; |
| 707 LocationSummary* locs = |
| 708 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 709 return locs; |
| 710 } |
| 711 |
| 712 |
| 713 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 714 if (!compiler->is_optimizing()) { |
| 715 const ExternalLabel label("debug_step_check", |
| 716 StubCode::DebugStepCheckEntryPoint()); |
| 717 compiler->GenerateCall(token_pos(), |
| 718 &label, |
| 719 PcDescriptors::kReturn, |
| 720 locs()); |
| 721 } |
| 722 } |
| 723 |
| 724 |
| 725 Instruction* DebugStepCheckInstr::Canonicalize(FlowGraph* flow_graph) { |
| 726 if (compiler->is_optimizing()) { |
| 727 return NULL; |
| 728 } |
| 729 } |
| 730 |
| 731 |
711 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { | 732 static bool CanBeImmediateIndex(Value* value, intptr_t cid) { |
712 ConstantInstr* constant = value->definition()->AsConstant(); | 733 ConstantInstr* constant = value->definition()->AsConstant(); |
713 if ((constant == NULL) || !Assembler::IsSafeSmi(constant->value())) { | 734 if ((constant == NULL) || !Assembler::IsSafeSmi(constant->value())) { |
714 return false; | 735 return false; |
715 } | 736 } |
716 const int64_t index = Smi::Cast(constant->value()).AsInt64Value(); | 737 const int64_t index = Smi::Cast(constant->value()).AsInt64Value(); |
717 const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); | 738 const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); |
718 const intptr_t offset = FlowGraphCompiler::DataOffsetFor(cid); | 739 const intptr_t offset = FlowGraphCompiler::DataOffsetFor(cid); |
719 const int64_t displacement = index * scale + offset; | 740 const int64_t displacement = index * scale + offset; |
720 return Utils::IsInt(32, displacement); | 741 return Utils::IsInt(32, displacement); |
(...skipping 4523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5244 PcDescriptors::kOther, | 5265 PcDescriptors::kOther, |
5245 locs()); | 5266 locs()); |
5246 __ Drop(2); // Discard type arguments and receiver. | 5267 __ Drop(2); // Discard type arguments and receiver. |
5247 } | 5268 } |
5248 | 5269 |
5249 } // namespace dart | 5270 } // namespace dart |
5250 | 5271 |
5251 #undef __ | 5272 #undef __ |
5252 | 5273 |
5253 #endif // defined TARGET_ARCH_IA32 | 5274 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |