Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: runtime/vm/intermediate_language_x64.cc

Issue 306483005: - Use isolate where it is appropriate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 } 183 }
184 184
185 185
186 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, 186 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate,
187 bool opt) const { 187 bool opt) const {
188 const intptr_t kNumInputs = 0; 188 const intptr_t kNumInputs = 0;
189 const intptr_t stack_index = (local().index() < 0) 189 const intptr_t stack_index = (local().index() < 0)
190 ? kFirstLocalSlotFromFp - local().index() 190 ? kFirstLocalSlotFromFp - local().index()
191 : kParamEndSlotFromFp - local().index(); 191 : kParamEndSlotFromFp - local().index();
192 return LocationSummary::Make(kNumInputs, 192 return LocationSummary::Make(isolate,
193 kNumInputs,
193 Location::StackSlot(stack_index), 194 Location::StackSlot(stack_index),
194 LocationSummary::kNoCall); 195 LocationSummary::kNoCall);
195 } 196 }
196 197
197 198
198 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 199 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
199 ASSERT(!compiler->is_optimizing()); 200 ASSERT(!compiler->is_optimizing());
200 // Nothing to do. 201 // Nothing to do.
201 } 202 }
202 203
203 204
204 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, 205 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate,
205 bool opt) const { 206 bool opt) const {
206 const intptr_t kNumInputs = 1; 207 const intptr_t kNumInputs = 1;
207 return LocationSummary::Make(kNumInputs, 208 return LocationSummary::Make(isolate,
209 kNumInputs,
208 Location::SameAsFirstInput(), 210 Location::SameAsFirstInput(),
209 LocationSummary::kNoCall); 211 LocationSummary::kNoCall);
210 } 212 }
211 213
212 214
213 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 215 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
214 Register value = locs()->in(0).reg(); 216 Register value = locs()->in(0).reg();
215 Register result = locs()->out(0).reg(); 217 Register result = locs()->out(0).reg();
216 ASSERT(result == value); // Assert that register assignment is correct. 218 ASSERT(result == value); // Assert that register assignment is correct.
217 __ movq(Address(RBP, local().index() * kWordSize), value); 219 __ movq(Address(RBP, local().index() * kWordSize), value);
218 } 220 }
219 221
220 222
221 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, 223 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate,
222 bool opt) const { 224 bool opt) const {
223 const intptr_t kNumInputs = 0; 225 const intptr_t kNumInputs = 0;
224 return LocationSummary::Make(kNumInputs, 226 return LocationSummary::Make(isolate,
227 kNumInputs,
225 Location::RequiresRegister(), 228 Location::RequiresRegister(),
226 LocationSummary::kNoCall); 229 LocationSummary::kNoCall);
227 } 230 }
228 231
229 232
230 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 233 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
231 // The register allocator drops constant definitions that have no uses. 234 // The register allocator drops constant definitions that have no uses.
232 if (!locs()->out(0).IsInvalid()) { 235 if (!locs()->out(0).IsInvalid()) {
233 Register result = locs()->out(0).reg(); 236 Register result = locs()->out(0).reg();
234 __ LoadObject(result, value(), PP); 237 __ LoadObject(result, value(), PP);
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 const intptr_t data_offset = Instance::DataOffsetFor(cid); 758 const intptr_t data_offset = Instance::DataOffsetFor(cid);
756 const int64_t disp = smi_const.AsInt64Value() * scale + data_offset; 759 const int64_t disp = smi_const.AsInt64Value() * scale + data_offset;
757 return Utils::IsInt(32, disp); 760 return Utils::IsInt(32, disp);
758 } 761 }
759 762
760 763
761 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, 764 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate,
762 bool opt) const { 765 bool opt) const {
763 const intptr_t kNumInputs = 1; 766 const intptr_t kNumInputs = 1;
764 // TODO(fschneider): Allow immediate operands for the char code. 767 // TODO(fschneider): Allow immediate operands for the char code.
765 return LocationSummary::Make(kNumInputs, 768 return LocationSummary::Make(isolate,
769 kNumInputs,
766 Location::RequiresRegister(), 770 Location::RequiresRegister(),
767 LocationSummary::kNoCall); 771 LocationSummary::kNoCall);
768 } 772 }
769 773
770 774
771 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 775 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
772 Register char_code = locs()->in(0).reg(); 776 Register char_code = locs()->in(0).reg();
773 Register result = locs()->out(0).reg(); 777 Register result = locs()->out(0).reg();
774 __ LoadImmediate(result, 778 __ LoadImmediate(result,
775 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())), PP); 779 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())), PP);
776 __ movq(result, Address(result, 780 __ movq(result, Address(result,
777 char_code, 781 char_code,
778 TIMES_HALF_WORD_SIZE, // Char code is a smi. 782 TIMES_HALF_WORD_SIZE, // Char code is a smi.
779 Symbols::kNullCharCodeSymbolOffset * kWordSize)); 783 Symbols::kNullCharCodeSymbolOffset * kWordSize));
780 } 784 }
781 785
782 786
783 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, 787 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate,
784 bool opt) const { 788 bool opt) const {
785 const intptr_t kNumInputs = 1; 789 const intptr_t kNumInputs = 1;
786 return LocationSummary::Make(kNumInputs, 790 return LocationSummary::Make(isolate,
791 kNumInputs,
787 Location::RequiresRegister(), 792 Location::RequiresRegister(),
788 LocationSummary::kNoCall); 793 LocationSummary::kNoCall);
789 } 794 }
790 795
791 796
792 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 797 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
793 ASSERT(cid_ == kOneByteStringCid); 798 ASSERT(cid_ == kOneByteStringCid);
794 Register str = locs()->in(0).reg(); 799 Register str = locs()->in(0).reg();
795 Register result = locs()->out(0).reg(); 800 Register result = locs()->out(0).reg();
796 Label is_one, done; 801 Label is_one, done;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 kNumberOfArguments, 834 kNumberOfArguments,
830 kNoArgumentNames, 835 kNoArgumentNames,
831 locs()); 836 locs());
832 ASSERT(locs()->out(0).reg() == RAX); 837 ASSERT(locs()->out(0).reg() == RAX);
833 } 838 }
834 839
835 840
836 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, 841 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate,
837 bool opt) const { 842 bool opt) const {
838 const intptr_t kNumInputs = 1; 843 const intptr_t kNumInputs = 1;
839 return LocationSummary::Make(kNumInputs, 844 return LocationSummary::Make(isolate,
845 kNumInputs,
840 Location::RequiresRegister(), 846 Location::RequiresRegister(),
841 LocationSummary::kNoCall); 847 LocationSummary::kNoCall);
842 } 848 }
843 849
844 850
845 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 851 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
846 Register object = locs()->in(0).reg(); 852 Register object = locs()->in(0).reg();
847 Register result = locs()->out(0).reg(); 853 Register result = locs()->out(0).reg();
848 __ movq(result, FieldAddress(object, offset())); 854 __ movq(result, FieldAddress(object, offset()));
849 } 855 }
850 856
851 857
852 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, 858 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate,
853 bool opt) const { 859 bool opt) const {
854 const intptr_t kNumInputs = 1; 860 const intptr_t kNumInputs = 1;
855 return LocationSummary::Make(kNumInputs, 861 return LocationSummary::Make(isolate,
862 kNumInputs,
856 Location::RequiresRegister(), 863 Location::RequiresRegister(),
857 LocationSummary::kNoCall); 864 LocationSummary::kNoCall);
858 } 865 }
859 866
860 867
861 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 868 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
862 Register object = locs()->in(0).reg(); 869 Register object = locs()->in(0).reg();
863 Register result = locs()->out(0).reg(); 870 Register result = locs()->out(0).reg();
864 Label load, done; 871 Label load, done;
865 __ testq(object, Immediate(kSmiTagMask)); 872 __ testq(object, Immediate(kSmiTagMask));
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 public: 1649 public:
1643 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction, 1650 StoreInstanceFieldSlowPath(StoreInstanceFieldInstr* instruction,
1644 const Class& cls) 1651 const Class& cls)
1645 : instruction_(instruction), cls_(cls) { } 1652 : instruction_(instruction), cls_(cls) { }
1646 1653
1647 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 1654 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
1648 __ Comment("StoreInstanceFieldSlowPath"); 1655 __ Comment("StoreInstanceFieldSlowPath");
1649 __ Bind(entry_label()); 1656 __ Bind(entry_label());
1650 const Code& stub = 1657 const Code& stub =
1651 Code::Handle(StubCode::GetAllocationStubForClass(cls_)); 1658 Code::Handle(StubCode::GetAllocationStubForClass(cls_));
1652 const ExternalLabel label(cls_.ToCString(), stub.EntryPoint()); 1659 const ExternalLabel label(stub.EntryPoint());
1653 1660
1654 LocationSummary* locs = instruction_->locs(); 1661 LocationSummary* locs = instruction_->locs();
1655 locs->live_registers()->Remove(locs->out(0)); 1662 locs->live_registers()->Remove(locs->out(0));
1656 1663
1657 compiler->SaveLiveRegisters(locs); 1664 compiler->SaveLiveRegisters(locs);
1658 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 1665 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
1659 &label, 1666 &label,
1660 PcDescriptors::kOther, 1667 PcDescriptors::kOther,
1661 locs); 1668 locs);
1662 __ MoveRegister(locs->temp(0).reg(), RAX); 1669 __ MoveRegister(locs->temp(0).reg(), RAX);
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 public: 2132 public:
2126 explicit BoxDoubleSlowPath(Instruction* instruction) 2133 explicit BoxDoubleSlowPath(Instruction* instruction)
2127 : instruction_(instruction) { } 2134 : instruction_(instruction) { }
2128 2135
2129 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2136 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2130 __ Comment("BoxDoubleSlowPath"); 2137 __ Comment("BoxDoubleSlowPath");
2131 __ Bind(entry_label()); 2138 __ Bind(entry_label());
2132 const Class& double_class = compiler->double_class(); 2139 const Class& double_class = compiler->double_class();
2133 const Code& stub = 2140 const Code& stub =
2134 Code::Handle(StubCode::GetAllocationStubForClass(double_class)); 2141 Code::Handle(StubCode::GetAllocationStubForClass(double_class));
2135 const ExternalLabel label(double_class.ToCString(), stub.EntryPoint()); 2142 const ExternalLabel label(stub.EntryPoint());
2136 2143
2137 LocationSummary* locs = instruction_->locs(); 2144 LocationSummary* locs = instruction_->locs();
2138 locs->live_registers()->Remove(locs->out(0)); 2145 locs->live_registers()->Remove(locs->out(0));
2139 2146
2140 compiler->SaveLiveRegisters(locs); 2147 compiler->SaveLiveRegisters(locs);
2141 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 2148 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
2142 &label, 2149 &label,
2143 PcDescriptors::kOther, 2150 PcDescriptors::kOther,
2144 locs); 2151 locs);
2145 __ MoveRegister(locs->out(0).reg(), RAX); 2152 __ MoveRegister(locs->out(0).reg(), RAX);
(...skipping 11 matching lines...) Expand all
2157 public: 2164 public:
2158 explicit BoxFloat32x4SlowPath(Instruction* instruction) 2165 explicit BoxFloat32x4SlowPath(Instruction* instruction)
2159 : instruction_(instruction) { } 2166 : instruction_(instruction) { }
2160 2167
2161 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2168 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2162 __ Comment("BoxFloat32x4SlowPath"); 2169 __ Comment("BoxFloat32x4SlowPath");
2163 __ Bind(entry_label()); 2170 __ Bind(entry_label());
2164 const Class& float32x4_class = compiler->float32x4_class(); 2171 const Class& float32x4_class = compiler->float32x4_class();
2165 const Code& stub = 2172 const Code& stub =
2166 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class)); 2173 Code::Handle(StubCode::GetAllocationStubForClass(float32x4_class));
2167 const ExternalLabel label(float32x4_class.ToCString(), stub.EntryPoint()); 2174 const ExternalLabel label(stub.EntryPoint());
2168 2175
2169 LocationSummary* locs = instruction_->locs(); 2176 LocationSummary* locs = instruction_->locs();
2170 locs->live_registers()->Remove(locs->out(0)); 2177 locs->live_registers()->Remove(locs->out(0));
2171 2178
2172 compiler->SaveLiveRegisters(locs); 2179 compiler->SaveLiveRegisters(locs);
2173 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 2180 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
2174 &label, 2181 &label,
2175 PcDescriptors::kOther, 2182 PcDescriptors::kOther,
2176 locs); 2183 locs);
2177 __ MoveRegister(locs->out(0).reg(), RAX); 2184 __ MoveRegister(locs->out(0).reg(), RAX);
(...skipping 11 matching lines...) Expand all
2189 public: 2196 public:
2190 explicit BoxFloat64x2SlowPath(Instruction* instruction) 2197 explicit BoxFloat64x2SlowPath(Instruction* instruction)
2191 : instruction_(instruction) { } 2198 : instruction_(instruction) { }
2192 2199
2193 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2200 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2194 __ Comment("BoxFloat64x2SlowPath"); 2201 __ Comment("BoxFloat64x2SlowPath");
2195 __ Bind(entry_label()); 2202 __ Bind(entry_label());
2196 const Class& float64x2_class = compiler->float64x2_class(); 2203 const Class& float64x2_class = compiler->float64x2_class();
2197 const Code& stub = 2204 const Code& stub =
2198 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class)); 2205 Code::Handle(StubCode::GetAllocationStubForClass(float64x2_class));
2199 const ExternalLabel label(float64x2_class.ToCString(), stub.EntryPoint()); 2206 const ExternalLabel label(stub.EntryPoint());
2200 2207
2201 LocationSummary* locs = instruction_->locs(); 2208 LocationSummary* locs = instruction_->locs();
2202 locs->live_registers()->Remove(locs->out(0)); 2209 locs->live_registers()->Remove(locs->out(0));
2203 2210
2204 compiler->SaveLiveRegisters(locs); 2211 compiler->SaveLiveRegisters(locs);
2205 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 2212 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
2206 &label, 2213 &label,
2207 PcDescriptors::kOther, 2214 PcDescriptors::kOther,
2208 locs); 2215 locs);
2209 __ MoveRegister(locs->out(0).reg(), RAX); 2216 __ MoveRegister(locs->out(0).reg(), RAX);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 locs->set_out(0, Location::RegisterLocation(RAX)); 2482 locs->set_out(0, Location::RegisterLocation(RAX));
2476 return locs; 2483 return locs;
2477 } 2484 }
2478 2485
2479 2486
2480 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2487 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2481 ASSERT(locs()->temp(0).reg() == R10); 2488 ASSERT(locs()->temp(0).reg() == R10);
2482 ASSERT(locs()->out(0).reg() == RAX); 2489 ASSERT(locs()->out(0).reg() == RAX);
2483 2490
2484 __ LoadImmediate(R10, Immediate(num_context_variables()), PP); 2491 __ LoadImmediate(R10, Immediate(num_context_variables()), PP);
2485 const ExternalLabel label("alloc_context", 2492 const ExternalLabel label(StubCode::AllocateContextEntryPoint());
2486 StubCode::AllocateContextEntryPoint());
2487 compiler->GenerateCall(token_pos(), 2493 compiler->GenerateCall(token_pos(),
2488 &label, 2494 &label,
2489 PcDescriptors::kOther, 2495 PcDescriptors::kOther,
2490 locs()); 2496 locs());
2491 } 2497 }
2492 2498
2493 2499
2494 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2500 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate,
2495 bool opt) const { 2501 bool opt) const {
2496 const intptr_t kNumInputs = 1; 2502 const intptr_t kNumInputs = 1;
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
3412 out_reg, 3418 out_reg,
3413 PP); 3419 PP);
3414 __ Bind(slow_path->exit_label()); 3420 __ Bind(slow_path->exit_label());
3415 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value); 3421 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value);
3416 } 3422 }
3417 3423
3418 3424
3419 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(Isolate* isolate, 3425 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(Isolate* isolate,
3420 bool opt) const { 3426 bool opt) const {
3421 const intptr_t kNumInputs = 1; 3427 const intptr_t kNumInputs = 1;
3422 return LocationSummary::Make(kNumInputs, 3428 return LocationSummary::Make(isolate,
3429 kNumInputs,
3423 Location::RequiresFpuRegister(), 3430 Location::RequiresFpuRegister(),
3424 LocationSummary::kNoCall); 3431 LocationSummary::kNoCall);
3425 } 3432 }
3426 3433
3427 3434
3428 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3435 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3429 const intptr_t value_cid = value()->Type()->ToCid(); 3436 const intptr_t value_cid = value()->Type()->ToCid();
3430 const Register value = locs()->in(0).reg(); 3437 const Register value = locs()->in(0).reg();
3431 const XmmRegister result = locs()->out(0).fpu_reg(); 3438 const XmmRegister result = locs()->out(0).fpu_reg();
3432 3439
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3519 public: 3526 public:
3520 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction) 3527 explicit BoxInt32x4SlowPath(BoxInt32x4Instr* instruction)
3521 : instruction_(instruction) { } 3528 : instruction_(instruction) { }
3522 3529
3523 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 3530 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
3524 __ Comment("BoxInt32x4SlowPath"); 3531 __ Comment("BoxInt32x4SlowPath");
3525 __ Bind(entry_label()); 3532 __ Bind(entry_label());
3526 const Class& int32x4_class = compiler->int32x4_class(); 3533 const Class& int32x4_class = compiler->int32x4_class();
3527 const Code& stub = 3534 const Code& stub =
3528 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class)); 3535 Code::Handle(StubCode::GetAllocationStubForClass(int32x4_class));
3529 const ExternalLabel label(int32x4_class.ToCString(), stub.EntryPoint()); 3536 const ExternalLabel label(stub.EntryPoint());
3530 3537
3531 LocationSummary* locs = instruction_->locs(); 3538 LocationSummary* locs = instruction_->locs();
3532 locs->live_registers()->Remove(locs->out(0)); 3539 locs->live_registers()->Remove(locs->out(0));
3533 3540
3534 compiler->SaveLiveRegisters(locs); 3541 compiler->SaveLiveRegisters(locs);
3535 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position. 3542 compiler->GenerateCall(Scanner::kNoSourcePos, // No token position.
3536 &label, 3543 &label,
3537 PcDescriptors::kOther, 3544 PcDescriptors::kOther,
3538 locs); 3545 locs);
3539 __ MoveRegister(locs->out(0).reg(), RAX); 3546 __ MoveRegister(locs->out(0).reg(), RAX);
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
4672 __ movaps(locs()->out(0).fpu_reg(), XMM0); 4679 __ movaps(locs()->out(0).fpu_reg(), XMM0);
4673 // Restore RSP. 4680 // Restore RSP.
4674 __ movq(RSP, locs()->temp(0).reg()); 4681 __ movq(RSP, locs()->temp(0).reg());
4675 } 4682 }
4676 } 4683 }
4677 4684
4678 4685
4679 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, 4686 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate,
4680 bool opt) const { 4687 bool opt) const {
4681 const intptr_t kNumInputs = 1; 4688 const intptr_t kNumInputs = 1;
4682 return LocationSummary::Make(kNumInputs, 4689 return LocationSummary::Make(isolate,
4690 kNumInputs,
4683 Location::SameAsFirstInput(), 4691 Location::SameAsFirstInput(),
4684 LocationSummary::kNoCall); 4692 LocationSummary::kNoCall);
4685 } 4693 }
4686 4694
4687 4695
4688 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4696 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4689 Register value = locs()->in(0).reg(); 4697 Register value = locs()->in(0).reg();
4690 ASSERT(value == locs()->out(0).reg()); 4698 ASSERT(value == locs()->out(0).reg());
4691 switch (op_kind()) { 4699 switch (op_kind()) {
4692 case Token::kNEGATE: { 4700 case Token::kNEGATE: {
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
5726 // We can fall through if the successor is the next block in the list. 5734 // We can fall through if the successor is the next block in the list.
5727 // Otherwise, we need a jump. 5735 // Otherwise, we need a jump.
5728 if (!compiler->CanFallThroughTo(successor())) { 5736 if (!compiler->CanFallThroughTo(successor())) {
5729 __ jmp(compiler->GetJumpLabel(successor())); 5737 __ jmp(compiler->GetJumpLabel(successor()));
5730 } 5738 }
5731 } 5739 }
5732 5740
5733 5741
5734 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, 5742 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate,
5735 bool opt) const { 5743 bool opt) const {
5736 return LocationSummary::Make(0, 5744 return LocationSummary::Make(isolate,
5745 0,
5737 Location::RequiresRegister(), 5746 Location::RequiresRegister(),
5738 LocationSummary::kNoCall); 5747 LocationSummary::kNoCall);
5739 } 5748 }
5740 5749
5741 5750
5742 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5751 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5743 __ MoveRegister(locs()->out(0).reg(), CTX); 5752 __ MoveRegister(locs()->out(0).reg(), CTX);
5744 } 5753 }
5745 5754
5746 5755
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5872 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, 5881 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt,
5873 deopt_id_after, 5882 deopt_id_after,
5874 token_pos()); 5883 token_pos());
5875 } 5884 }
5876 __ Drop(argument_count); 5885 __ Drop(argument_count);
5877 } 5886 }
5878 5887
5879 5888
5880 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, 5889 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate,
5881 bool opt) const { 5890 bool opt) const {
5882 return LocationSummary::Make(1, 5891 return LocationSummary::Make(isolate,
5892 1,
5883 Location::RequiresRegister(), 5893 Location::RequiresRegister(),
5884 LocationSummary::kNoCall); 5894 LocationSummary::kNoCall);
5885 } 5895 }
5886 5896
5887 5897
5888 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5898 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5889 Register value = locs()->in(0).reg(); 5899 Register value = locs()->in(0).reg();
5890 Register result = locs()->out(0).reg(); 5900 Register result = locs()->out(0).reg();
5891 5901
5892 Label done; 5902 Label done;
5893 __ LoadObject(result, Bool::True(), PP); 5903 __ LoadObject(result, Bool::True(), PP);
5894 __ CompareRegisters(result, value); 5904 __ CompareRegisters(result, value);
5895 __ j(NOT_EQUAL, &done, Assembler::kNearJump); 5905 __ j(NOT_EQUAL, &done, Assembler::kNearJump);
5896 __ LoadObject(result, Bool::False(), PP); 5906 __ LoadObject(result, Bool::False(), PP);
5897 __ Bind(&done); 5907 __ Bind(&done);
5898 } 5908 }
5899 5909
5900 5910
5901 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, 5911 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate,
5902 bool opt) const { 5912 bool opt) const {
5903 return MakeCallSummary(); 5913 return MakeCallSummary();
5904 } 5914 }
5905 5915
5906 5916
5907 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5917 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5908 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); 5918 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls()));
5909 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); 5919 const ExternalLabel label(stub.EntryPoint());
5910 compiler->GenerateCall(token_pos(), 5920 compiler->GenerateCall(token_pos(),
5911 &label, 5921 &label,
5912 PcDescriptors::kOther, 5922 PcDescriptors::kOther,
5913 locs()); 5923 locs());
5914 __ Drop(ArgumentCount()); // Discard arguments. 5924 __ Drop(ArgumentCount()); // Discard arguments.
5915 } 5925 }
5916 5926
5917 } // namespace dart 5927 } // namespace dart
5918 5928
5919 #undef __ 5929 #undef __
5920 5930
5921 #endif // defined TARGET_ARCH_X64 5931 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698