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 11 matching lines...) Expand all Loading... | |
22 | 22 |
23 DECLARE_FLAG(int, optimization_counter_threshold); | 23 DECLARE_FLAG(int, optimization_counter_threshold); |
24 DECLARE_FLAG(bool, propagate_ic_data); | 24 DECLARE_FLAG(bool, propagate_ic_data); |
25 DECLARE_FLAG(bool, use_osr); | 25 DECLARE_FLAG(bool, use_osr); |
26 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 26 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
27 DECLARE_FLAG(bool, use_slow_path); | 27 DECLARE_FLAG(bool, use_slow_path); |
28 | 28 |
29 // Generic summary for call instructions that have all arguments pushed | 29 // Generic summary for call instructions that have all arguments pushed |
30 // on the stack and return the result in a fixed register EAX. | 30 // on the stack and return the result in a fixed register EAX. |
31 LocationSummary* Instruction::MakeCallSummary() { | 31 LocationSummary* Instruction::MakeCallSummary() { |
32 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 32 Isolate* isolate = Isolate::Current(); |
33 LocationSummary* result = new(isolate) LocationSummary( | |
34 isolate,0, 0, LocationSummary::kCall); | |
33 result->set_out(0, Location::RegisterLocation(EAX)); | 35 result->set_out(0, Location::RegisterLocation(EAX)); |
34 return result; | 36 return result; |
35 } | 37 } |
36 | 38 |
37 | 39 |
38 LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const { | 40 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate, |
41 bool opt) const { | |
39 const intptr_t kNumInputs = 1; | 42 const intptr_t kNumInputs = 1; |
40 const intptr_t kNumTemps= 0; | 43 const intptr_t kNumTemps= 0; |
41 LocationSummary* locs = | 44 LocationSummary* locs = new (isolate) LocationSummary(isolate, |
42 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 45 kNumInputs, kNumTemps, LocationSummary::kNoCall); |
43 locs->set_in(0, Location::AnyOrConstant(value())); | 46 locs->set_in(0, Location::AnyOrConstant(value())); |
44 return locs; | 47 return locs; |
45 } | 48 } |
46 | 49 |
47 | 50 |
48 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 51 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
49 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 52 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
50 // where PushArgument is handled by BindInstr::EmitNativeCode. | 53 // where PushArgument is handled by BindInstr::EmitNativeCode. |
51 if (compiler->is_optimizing()) { | 54 if (compiler->is_optimizing()) { |
52 Location value = locs()->in(0); | 55 Location value = locs()->in(0); |
53 if (value.IsRegister()) { | 56 if (value.IsRegister()) { |
54 __ pushl(value.reg()); | 57 __ pushl(value.reg()); |
55 } else if (value.IsConstant()) { | 58 } else if (value.IsConstant()) { |
56 __ PushObject(value.constant()); | 59 __ PushObject(value.constant()); |
57 } else { | 60 } else { |
58 ASSERT(value.IsStackSlot()); | 61 ASSERT(value.IsStackSlot()); |
59 __ pushl(value.ToStackSlotAddress()); | 62 __ pushl(value.ToStackSlotAddress()); |
60 } | 63 } |
61 } | 64 } |
62 } | 65 } |
63 | 66 |
64 | 67 |
65 LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const { | 68 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate, |
69 bool opt) const { | |
66 const intptr_t kNumInputs = 1; | 70 const intptr_t kNumInputs = 1; |
67 const intptr_t kNumTemps = 0; | 71 const intptr_t kNumTemps = 0; |
68 LocationSummary* locs = | 72 LocationSummary* locs = |
69 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 73 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
70 locs->set_in(0, Location::RegisterLocation(EAX)); | 74 locs->set_in(0, Location::RegisterLocation(EAX)); |
71 return locs; | 75 return locs; |
72 } | 76 } |
73 | 77 |
74 | 78 |
75 // Attempt optimized compilation at return instruction instead of at the entry. | 79 // Attempt optimized compilation at return instruction instead of at the entry. |
76 // The entry needs to be patchable, no inlined objects are allowed in the area | 80 // The entry needs to be patchable, no inlined objects are allowed in the area |
77 // that will be overwritten by the patch instruction: a jump). | 81 // that will be overwritten by the patch instruction: a jump). |
78 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 82 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
79 Register result = locs()->in(0).reg(); | 83 Register result = locs()->in(0).reg(); |
80 ASSERT(result == EAX); | 84 ASSERT(result == EAX); |
81 #if defined(DEBUG) | 85 #if defined(DEBUG) |
82 __ Comment("Stack Check"); | 86 __ Comment("Stack Check"); |
83 Label done; | 87 Label done; |
84 const intptr_t fp_sp_dist = | 88 const intptr_t fp_sp_dist = |
85 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; | 89 (kFirstLocalSlotFromFp + 1 - compiler->StackSize()) * kWordSize; |
86 ASSERT(fp_sp_dist <= 0); | 90 ASSERT(fp_sp_dist <= 0); |
87 __ movl(EDI, ESP); | 91 __ movl(EDI, ESP); |
88 __ subl(EDI, EBP); | 92 __ subl(EDI, EBP); |
89 __ cmpl(EDI, Immediate(fp_sp_dist)); | 93 __ cmpl(EDI, Immediate(fp_sp_dist)); |
90 __ j(EQUAL, &done, Assembler::kNearJump); | 94 __ j(EQUAL, &done, Assembler::kNearJump); |
91 __ int3(); | 95 __ int3(); |
92 __ Bind(&done); | 96 __ Bind(&done); |
93 #endif | 97 #endif |
94 __ LeaveFrame(); | 98 __ LeaveFrame(); |
95 __ ret(); | 99 __ ret(); |
96 } | 100 } |
97 | 101 |
98 | 102 |
99 LocationSummary* LoadLocalInstr::MakeLocationSummary(bool opt) const { | 103 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, |
104 bool opt) const { | |
100 const intptr_t kNumInputs = 0; | 105 const intptr_t kNumInputs = 0; |
101 const intptr_t stack_index = (local().index() < 0) | 106 const intptr_t stack_index = (local().index() < 0) |
102 ? kFirstLocalSlotFromFp - local().index() | 107 ? kFirstLocalSlotFromFp - local().index() |
103 : kParamEndSlotFromFp - local().index(); | 108 : kParamEndSlotFromFp - local().index(); |
104 return LocationSummary::Make(kNumInputs, | 109 return LocationSummary::Make(kNumInputs, |
105 Location::StackSlot(stack_index), | 110 Location::StackSlot(stack_index), |
106 LocationSummary::kNoCall); | 111 LocationSummary::kNoCall); |
107 } | 112 } |
108 | 113 |
109 | 114 |
110 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 115 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
111 ASSERT(!compiler->is_optimizing()); | 116 ASSERT(!compiler->is_optimizing()); |
112 // Nothing to do. | 117 // Nothing to do. |
113 } | 118 } |
114 | 119 |
115 | 120 |
116 LocationSummary* StoreLocalInstr::MakeLocationSummary(bool opt) const { | 121 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, |
122 bool opt) const { | |
117 const intptr_t kNumInputs = 1; | 123 const intptr_t kNumInputs = 1; |
118 return LocationSummary::Make(kNumInputs, | 124 return LocationSummary::Make(kNumInputs, |
119 Location::SameAsFirstInput(), | 125 Location::SameAsFirstInput(), |
120 LocationSummary::kNoCall); | 126 LocationSummary::kNoCall); |
121 } | 127 } |
122 | 128 |
123 | 129 |
124 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 130 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
125 Register value = locs()->in(0).reg(); | 131 Register value = locs()->in(0).reg(); |
126 Register result = locs()->out(0).reg(); | 132 Register result = locs()->out(0).reg(); |
127 ASSERT(result == value); // Assert that register assignment is correct. | 133 ASSERT(result == value); // Assert that register assignment is correct. |
128 __ movl(Address(EBP, local().index() * kWordSize), value); | 134 __ movl(Address(EBP, local().index() * kWordSize), value); |
129 } | 135 } |
130 | 136 |
131 | 137 |
132 LocationSummary* ConstantInstr::MakeLocationSummary(bool opt) const { | 138 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, |
139 bool opt) const { | |
133 const intptr_t kNumInputs = 0; | 140 const intptr_t kNumInputs = 0; |
134 return LocationSummary::Make(kNumInputs, | 141 return LocationSummary::Make(kNumInputs, |
135 Location::RequiresRegister(), | 142 Location::RequiresRegister(), |
136 LocationSummary::kNoCall); | 143 LocationSummary::kNoCall); |
137 } | 144 } |
138 | 145 |
139 | 146 |
140 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 147 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
141 // The register allocator drops constant definitions that have no uses. | 148 // The register allocator drops constant definitions that have no uses. |
142 if (!locs()->out(0).IsInvalid()) { | 149 if (!locs()->out(0).IsInvalid()) { |
143 Register result = locs()->out(0).reg(); | 150 Register result = locs()->out(0).reg(); |
144 __ LoadObjectSafely(result, value()); | 151 __ LoadObjectSafely(result, value()); |
145 } | 152 } |
146 } | 153 } |
147 | 154 |
148 | 155 |
149 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { | 156 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, |
157 bool opt) const { | |
150 const intptr_t kNumInputs = 0; | 158 const intptr_t kNumInputs = 0; |
151 const intptr_t kNumTemps = (constant_address() == 0) ? 1 : 0; | 159 const intptr_t kNumTemps = (constant_address() == 0) ? 1 : 0; |
152 LocationSummary* locs = | 160 LocationSummary* locs = |
153 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 161 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
154 locs->set_out(0, Location::RequiresFpuRegister()); | 162 locs->set_out(0, Location::RequiresFpuRegister()); |
155 if (kNumTemps == 1) { | 163 if (kNumTemps == 1) { |
156 locs->set_temp(0, Location::RequiresRegister()); | 164 locs->set_temp(0, Location::RequiresRegister()); |
157 } | 165 } |
158 return locs; | 166 return locs; |
159 } | 167 } |
160 | 168 |
161 | 169 |
162 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 170 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
163 // The register allocator drops constant definitions that have no uses. | 171 // The register allocator drops constant definitions that have no uses. |
164 if (!locs()->out(0).IsInvalid()) { | 172 if (!locs()->out(0).IsInvalid()) { |
165 XmmRegister result = locs()->out(0).fpu_reg(); | 173 XmmRegister result = locs()->out(0).fpu_reg(); |
166 if (constant_address() == 0) { | 174 if (constant_address() == 0) { |
167 Register boxed = locs()->temp(0).reg(); | 175 Register boxed = locs()->temp(0).reg(); |
168 __ LoadObjectSafely(boxed, value()); | 176 __ LoadObjectSafely(boxed, value()); |
169 __ movsd(result, FieldAddress(boxed, Double::value_offset())); | 177 __ movsd(result, FieldAddress(boxed, Double::value_offset())); |
170 } else if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) { | 178 } else if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) { |
171 __ xorps(result, result); | 179 __ xorps(result, result); |
172 } else { | 180 } else { |
173 __ movsd(result, Address::Absolute(constant_address())); | 181 __ movsd(result, Address::Absolute(constant_address())); |
174 } | 182 } |
175 } | 183 } |
176 } | 184 } |
177 | 185 |
178 | 186 |
179 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { | 187 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate, |
188 bool opt) const { | |
180 const intptr_t kNumInputs = 3; | 189 const intptr_t kNumInputs = 3; |
181 const intptr_t kNumTemps = 0; | 190 const intptr_t kNumTemps = 0; |
182 LocationSummary* summary = | 191 LocationSummary* summary = |
183 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 192 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
srdjan
2014/05/22 17:25:08
Here and elsewhere: 80 char limit.
| |
184 summary->set_in(0, Location::RegisterLocation(EAX)); // Value. | 193 summary->set_in(0, Location::RegisterLocation(EAX)); // Value. |
185 summary->set_in(1, Location::RegisterLocation(ECX)); // Instantiator. | 194 summary->set_in(1, Location::RegisterLocation(ECX)); // Instantiator. |
186 summary->set_in(2, Location::RegisterLocation(EDX)); // Type arguments. | 195 summary->set_in(2, Location::RegisterLocation(EDX)); // Type arguments. |
187 summary->set_out(0, Location::RegisterLocation(EAX)); | 196 summary->set_out(0, Location::RegisterLocation(EAX)); |
188 return summary; | 197 return summary; |
189 } | 198 } |
190 | 199 |
191 | 200 |
192 LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const { | 201 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate, |
202 bool opt) const { | |
193 const intptr_t kNumInputs = 1; | 203 const intptr_t kNumInputs = 1; |
194 const intptr_t kNumTemps = 0; | 204 const intptr_t kNumTemps = 0; |
195 LocationSummary* locs = | 205 LocationSummary* locs = |
196 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 206 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
197 locs->set_in(0, Location::RegisterLocation(EAX)); | 207 locs->set_in(0, Location::RegisterLocation(EAX)); |
198 locs->set_out(0, Location::RegisterLocation(EAX)); | 208 locs->set_out(0, Location::RegisterLocation(EAX)); |
199 return locs; | 209 return locs; |
200 } | 210 } |
201 | 211 |
202 | 212 |
203 static void EmitAssertBoolean(Register reg, | 213 static void EmitAssertBoolean(Register reg, |
204 intptr_t token_pos, | 214 intptr_t token_pos, |
205 intptr_t deopt_id, | 215 intptr_t deopt_id, |
206 LocationSummary* locs, | 216 LocationSummary* locs, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
243 case Token::kGT: return GREATER; | 253 case Token::kGT: return GREATER; |
244 case Token::kLTE: return LESS_EQUAL; | 254 case Token::kLTE: return LESS_EQUAL; |
245 case Token::kGTE: return GREATER_EQUAL; | 255 case Token::kGTE: return GREATER_EQUAL; |
246 default: | 256 default: |
247 UNREACHABLE(); | 257 UNREACHABLE(); |
248 return OVERFLOW; | 258 return OVERFLOW; |
249 } | 259 } |
250 } | 260 } |
251 | 261 |
252 | 262 |
253 LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const { | 263 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate, |
264 bool opt) const { | |
254 const intptr_t kNumInputs = 2; | 265 const intptr_t kNumInputs = 2; |
255 if (operation_cid() == kMintCid) { | 266 if (operation_cid() == kMintCid) { |
256 const intptr_t kNumTemps = 0; | 267 const intptr_t kNumTemps = 0; |
257 LocationSummary* locs = | 268 LocationSummary* locs = |
258 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 269 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
259 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 270 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
260 Location::RequiresRegister())); | 271 Location::RequiresRegister())); |
261 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 272 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
262 Location::RequiresRegister())); | 273 Location::RequiresRegister())); |
263 locs->set_out(0, Location::RequiresRegister()); | 274 locs->set_out(0, Location::RequiresRegister()); |
264 return locs; | 275 return locs; |
265 } | 276 } |
266 if (operation_cid() == kDoubleCid) { | 277 if (operation_cid() == kDoubleCid) { |
267 const intptr_t kNumTemps = 0; | 278 const intptr_t kNumTemps = 0; |
268 LocationSummary* locs = | 279 LocationSummary* locs = |
269 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 280 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
270 locs->set_in(0, Location::RequiresFpuRegister()); | 281 locs->set_in(0, Location::RequiresFpuRegister()); |
271 locs->set_in(1, Location::RequiresFpuRegister()); | 282 locs->set_in(1, Location::RequiresFpuRegister()); |
272 locs->set_out(0, Location::RequiresRegister()); | 283 locs->set_out(0, Location::RequiresRegister()); |
273 return locs; | 284 return locs; |
274 } | 285 } |
275 if (operation_cid() == kSmiCid) { | 286 if (operation_cid() == kSmiCid) { |
276 const intptr_t kNumTemps = 0; | 287 const intptr_t kNumTemps = 0; |
277 LocationSummary* locs = | 288 LocationSummary* locs = |
278 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 289 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
279 locs->set_in(0, Location::RegisterOrConstant(left())); | 290 locs->set_in(0, Location::RegisterOrConstant(left())); |
280 // Only one input can be a constant operand. The case of two constant | 291 // Only one input can be a constant operand. The case of two constant |
281 // operands should be handled by constant propagation. | 292 // operands should be handled by constant propagation. |
282 // Only right can be a stack slot. | 293 // Only right can be a stack slot. |
283 locs->set_in(1, locs->in(0).IsConstant() | 294 locs->set_in(1, locs->in(0).IsConstant() |
284 ? Location::RequiresRegister() | 295 ? Location::RequiresRegister() |
285 : Location::RegisterOrConstant(right())); | 296 : Location::RegisterOrConstant(right())); |
286 locs->set_out(0, Location::RequiresRegister()); | 297 locs->set_out(0, Location::RequiresRegister()); |
287 return locs; | 298 return locs; |
288 } | 299 } |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
562 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 573 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
563 BranchInstr* branch) { | 574 BranchInstr* branch) { |
564 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); | 575 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); |
565 | 576 |
566 BranchLabels labels = compiler->CreateBranchLabels(branch); | 577 BranchLabels labels = compiler->CreateBranchLabels(branch); |
567 Condition true_condition = EmitComparisonCode(compiler, labels); | 578 Condition true_condition = EmitComparisonCode(compiler, labels); |
568 EmitBranchOnCondition(compiler, true_condition, labels); | 579 EmitBranchOnCondition(compiler, true_condition, labels); |
569 } | 580 } |
570 | 581 |
571 | 582 |
572 LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const { | 583 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate, |
584 bool opt) const { | |
573 const intptr_t kNumInputs = 2; | 585 const intptr_t kNumInputs = 2; |
574 const intptr_t kNumTemps = 0; | 586 const intptr_t kNumTemps = 0; |
575 LocationSummary* locs = | 587 LocationSummary* locs = |
576 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 588 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
577 locs->set_in(0, Location::RequiresRegister()); | 589 locs->set_in(0, Location::RequiresRegister()); |
578 // Only one input can be a constant operand. The case of two constant | 590 // Only one input can be a constant operand. The case of two constant |
579 // operands should be handled by constant propagation. | 591 // operands should be handled by constant propagation. |
580 locs->set_in(1, Location::RegisterOrConstant(right())); | 592 locs->set_in(1, Location::RegisterOrConstant(right())); |
581 return locs; | 593 return locs; |
582 } | 594 } |
583 | 595 |
584 | 596 |
585 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 597 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
586 BranchLabels labels) { | 598 BranchLabels labels) { |
(...skipping 20 matching lines...) Expand all Loading... | |
607 | 619 |
608 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 620 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
609 BranchInstr* branch) { | 621 BranchInstr* branch) { |
610 BranchLabels labels = compiler->CreateBranchLabels(branch); | 622 BranchLabels labels = compiler->CreateBranchLabels(branch); |
611 Condition true_condition = EmitComparisonCode(compiler, labels); | 623 Condition true_condition = EmitComparisonCode(compiler, labels); |
612 EmitBranchOnCondition(compiler, true_condition, labels); | 624 EmitBranchOnCondition(compiler, true_condition, labels); |
613 } | 625 } |
614 | 626 |
615 | 627 |
616 | 628 |
617 LocationSummary* TestCidsInstr::MakeLocationSummary(bool opt) const { | 629 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate, |
630 bool opt) const { | |
618 const intptr_t kNumInputs = 1; | 631 const intptr_t kNumInputs = 1; |
619 const intptr_t kNumTemps = 1; | 632 const intptr_t kNumTemps = 1; |
620 LocationSummary* locs = | 633 LocationSummary* locs = |
621 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 634 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
622 locs->set_in(0, Location::RequiresRegister()); | 635 locs->set_in(0, Location::RequiresRegister()); |
623 locs->set_temp(0, Location::RequiresRegister()); | 636 locs->set_temp(0, Location::RequiresRegister()); |
624 locs->set_out(0, Location::RequiresRegister()); | 637 locs->set_out(0, Location::RequiresRegister()); |
625 return locs; | 638 return locs; |
626 } | 639 } |
627 | 640 |
628 | 641 |
629 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 642 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
630 BranchLabels labels) { | 643 BranchLabels labels) { |
631 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 644 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
678 EmitComparisonCode(compiler, labels); | 691 EmitComparisonCode(compiler, labels); |
679 __ Bind(&is_false); | 692 __ Bind(&is_false); |
680 __ LoadObject(result_reg, Bool::False()); | 693 __ LoadObject(result_reg, Bool::False()); |
681 __ jmp(&done, Assembler::kNearJump); | 694 __ jmp(&done, Assembler::kNearJump); |
682 __ Bind(&is_true); | 695 __ Bind(&is_true); |
683 __ LoadObject(result_reg, Bool::True()); | 696 __ LoadObject(result_reg, Bool::True()); |
684 __ Bind(&done); | 697 __ Bind(&done); |
685 } | 698 } |
686 | 699 |
687 | 700 |
688 LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const { | 701 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate, |
702 bool opt) const { | |
689 const intptr_t kNumInputs = 2; | 703 const intptr_t kNumInputs = 2; |
690 const intptr_t kNumTemps = 0; | 704 const intptr_t kNumTemps = 0; |
691 if (operation_cid() == kMintCid) { | 705 if (operation_cid() == kMintCid) { |
692 const intptr_t kNumTemps = 0; | 706 const intptr_t kNumTemps = 0; |
693 LocationSummary* locs = | 707 LocationSummary* locs = |
694 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 708 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
695 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 709 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
696 Location::RequiresRegister())); | 710 Location::RequiresRegister())); |
697 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 711 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
698 Location::RequiresRegister())); | 712 Location::RequiresRegister())); |
699 locs->set_out(0, Location::RequiresRegister()); | 713 locs->set_out(0, Location::RequiresRegister()); |
700 return locs; | 714 return locs; |
701 } | 715 } |
702 if (operation_cid() == kDoubleCid) { | 716 if (operation_cid() == kDoubleCid) { |
703 LocationSummary* summary = | 717 LocationSummary* summary = |
704 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 718 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
705 summary->set_in(0, Location::RequiresFpuRegister()); | 719 summary->set_in(0, Location::RequiresFpuRegister()); |
706 summary->set_in(1, Location::RequiresFpuRegister()); | 720 summary->set_in(1, Location::RequiresFpuRegister()); |
707 summary->set_out(0, Location::RequiresRegister()); | 721 summary->set_out(0, Location::RequiresRegister()); |
708 return summary; | 722 return summary; |
709 } | 723 } |
710 ASSERT(operation_cid() == kSmiCid); | 724 ASSERT(operation_cid() == kSmiCid); |
711 LocationSummary* summary = | 725 LocationSummary* summary = |
712 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 726 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
713 summary->set_in(0, Location::RegisterOrConstant(left())); | 727 summary->set_in(0, Location::RegisterOrConstant(left())); |
714 // Only one input can be a constant operand. The case of two constant | 728 // Only one input can be a constant operand. The case of two constant |
715 // operands should be handled by constant propagation. | 729 // operands should be handled by constant propagation. |
716 summary->set_in(1, summary->in(0).IsConstant() | 730 summary->set_in(1, summary->in(0).IsConstant() |
717 ? Location::RequiresRegister() | 731 ? Location::RequiresRegister() |
718 : Location::RegisterOrConstant(right())); | 732 : Location::RegisterOrConstant(right())); |
719 summary->set_out(0, Location::RequiresRegister()); | 733 summary->set_out(0, Location::RequiresRegister()); |
720 return summary; | 734 return summary; |
721 } | 735 } |
722 | 736 |
(...skipping 29 matching lines...) Expand all Loading... | |
752 | 766 |
753 | 767 |
754 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 768 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
755 BranchInstr* branch) { | 769 BranchInstr* branch) { |
756 BranchLabels labels = compiler->CreateBranchLabels(branch); | 770 BranchLabels labels = compiler->CreateBranchLabels(branch); |
757 Condition true_condition = EmitComparisonCode(compiler, labels); | 771 Condition true_condition = EmitComparisonCode(compiler, labels); |
758 EmitBranchOnCondition(compiler, true_condition, labels); | 772 EmitBranchOnCondition(compiler, true_condition, labels); |
759 } | 773 } |
760 | 774 |
761 | 775 |
762 LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const { | 776 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate, |
777 bool opt) const { | |
763 const intptr_t kNumInputs = 0; | 778 const intptr_t kNumInputs = 0; |
764 const intptr_t kNumTemps = 3; | 779 const intptr_t kNumTemps = 3; |
765 LocationSummary* locs = | 780 LocationSummary* locs = |
766 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 781 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
767 locs->set_temp(0, Location::RegisterLocation(EAX)); | 782 locs->set_temp(0, Location::RegisterLocation(EAX)); |
768 locs->set_temp(1, Location::RegisterLocation(ECX)); | 783 locs->set_temp(1, Location::RegisterLocation(ECX)); |
769 locs->set_temp(2, Location::RegisterLocation(EDX)); | 784 locs->set_temp(2, Location::RegisterLocation(EDX)); |
770 locs->set_out(0, Location::RegisterLocation(EAX)); | 785 locs->set_out(0, Location::RegisterLocation(EAX)); |
771 return locs; | 786 return locs; |
772 } | 787 } |
773 | 788 |
774 | 789 |
775 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 790 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
776 ASSERT(locs()->temp(0).reg() == EAX); | 791 ASSERT(locs()->temp(0).reg() == EAX); |
(...skipping 29 matching lines...) Expand all Loading... | |
806 return false; | 821 return false; |
807 } | 822 } |
808 const int64_t index = Smi::Cast(constant->value()).AsInt64Value(); | 823 const int64_t index = Smi::Cast(constant->value()).AsInt64Value(); |
809 const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); | 824 const intptr_t scale = FlowGraphCompiler::ElementSizeFor(cid); |
810 const intptr_t offset = FlowGraphCompiler::DataOffsetFor(cid); | 825 const intptr_t offset = FlowGraphCompiler::DataOffsetFor(cid); |
811 const int64_t displacement = index * scale + offset; | 826 const int64_t displacement = index * scale + offset; |
812 return Utils::IsInt(32, displacement); | 827 return Utils::IsInt(32, displacement); |
813 } | 828 } |
814 | 829 |
815 | 830 |
816 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(bool opt) const { | 831 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
832 bool opt) const { | |
817 const intptr_t kNumInputs = 1; | 833 const intptr_t kNumInputs = 1; |
818 // TODO(fschneider): Allow immediate operands for the char code. | 834 // TODO(fschneider): Allow immediate operands for the char code. |
819 return LocationSummary::Make(kNumInputs, | 835 return LocationSummary::Make(kNumInputs, |
820 Location::RequiresRegister(), | 836 Location::RequiresRegister(), |
821 LocationSummary::kNoCall); | 837 LocationSummary::kNoCall); |
822 } | 838 } |
823 | 839 |
824 | 840 |
825 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 841 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
826 Register char_code = locs()->in(0).reg(); | 842 Register char_code = locs()->in(0).reg(); |
827 Register result = locs()->out(0).reg(); | 843 Register result = locs()->out(0).reg(); |
828 __ movl(result, | 844 __ movl(result, |
829 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); | 845 Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress()))); |
830 __ movl(result, Address(result, | 846 __ movl(result, Address(result, |
831 char_code, | 847 char_code, |
832 TIMES_HALF_WORD_SIZE, // Char code is a smi. | 848 TIMES_HALF_WORD_SIZE, // Char code is a smi. |
833 Symbols::kNullCharCodeSymbolOffset * kWordSize)); | 849 Symbols::kNullCharCodeSymbolOffset * kWordSize)); |
834 } | 850 } |
835 | 851 |
836 | 852 |
837 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(bool opt) const { | 853 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, |
854 bool opt) const { | |
838 const intptr_t kNumInputs = 1; | 855 const intptr_t kNumInputs = 1; |
839 return LocationSummary::Make(kNumInputs, | 856 return LocationSummary::Make(kNumInputs, |
840 Location::RequiresRegister(), | 857 Location::RequiresRegister(), |
841 LocationSummary::kNoCall); | 858 LocationSummary::kNoCall); |
842 } | 859 } |
843 | 860 |
844 | 861 |
845 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 862 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
846 ASSERT(cid_ == kOneByteStringCid); | 863 ASSERT(cid_ == kOneByteStringCid); |
847 Register str = locs()->in(0).reg(); | 864 Register str = locs()->in(0).reg(); |
848 Register result = locs()->out(0).reg(); | 865 Register result = locs()->out(0).reg(); |
849 Label is_one, done; | 866 Label is_one, done; |
850 __ movl(result, FieldAddress(str, String::length_offset())); | 867 __ movl(result, FieldAddress(str, String::length_offset())); |
851 __ cmpl(result, Immediate(Smi::RawValue(1))); | 868 __ cmpl(result, Immediate(Smi::RawValue(1))); |
852 __ j(EQUAL, &is_one, Assembler::kNearJump); | 869 __ j(EQUAL, &is_one, Assembler::kNearJump); |
853 __ movl(result, Immediate(Smi::RawValue(-1))); | 870 __ movl(result, Immediate(Smi::RawValue(-1))); |
854 __ jmp(&done); | 871 __ jmp(&done); |
855 __ Bind(&is_one); | 872 __ Bind(&is_one); |
856 __ movzxb(result, FieldAddress(str, OneByteString::data_offset())); | 873 __ movzxb(result, FieldAddress(str, OneByteString::data_offset())); |
857 __ SmiTag(result); | 874 __ SmiTag(result); |
858 __ Bind(&done); | 875 __ Bind(&done); |
859 } | 876 } |
860 | 877 |
861 | 878 |
862 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { | 879 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate, |
880 bool opt) const { | |
863 const intptr_t kNumInputs = 1; | 881 const intptr_t kNumInputs = 1; |
864 const intptr_t kNumTemps = 0; | 882 const intptr_t kNumTemps = 0; |
865 LocationSummary* summary = | 883 LocationSummary* summary = |
866 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 884 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
867 summary->set_in(0, Location::RegisterLocation(EAX)); | 885 summary->set_in(0, Location::RegisterLocation(EAX)); |
868 summary->set_out(0, Location::RegisterLocation(EAX)); | 886 summary->set_out(0, Location::RegisterLocation(EAX)); |
869 return summary; | 887 return summary; |
870 } | 888 } |
871 | 889 |
872 | 890 |
873 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 891 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
874 Register array = locs()->in(0).reg(); | 892 Register array = locs()->in(0).reg(); |
875 __ pushl(array); | 893 __ pushl(array); |
876 const int kNumberOfArguments = 1; | 894 const int kNumberOfArguments = 1; |
877 const Array& kNoArgumentNames = Object::null_array(); | 895 const Array& kNoArgumentNames = Object::null_array(); |
878 compiler->GenerateStaticCall(deopt_id(), | 896 compiler->GenerateStaticCall(deopt_id(), |
879 token_pos(), | 897 token_pos(), |
880 CallFunction(), | 898 CallFunction(), |
881 kNumberOfArguments, | 899 kNumberOfArguments, |
882 kNoArgumentNames, | 900 kNoArgumentNames, |
883 locs()); | 901 locs()); |
884 ASSERT(locs()->out(0).reg() == EAX); | 902 ASSERT(locs()->out(0).reg() == EAX); |
885 } | 903 } |
886 | 904 |
887 | 905 |
888 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(bool opt) const { | 906 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, |
907 bool opt) const { | |
889 const intptr_t kNumInputs = 1; | 908 const intptr_t kNumInputs = 1; |
890 return LocationSummary::Make(kNumInputs, | 909 return LocationSummary::Make(kNumInputs, |
891 Location::RequiresRegister(), | 910 Location::RequiresRegister(), |
892 LocationSummary::kNoCall); | 911 LocationSummary::kNoCall); |
893 } | 912 } |
894 | 913 |
895 | 914 |
896 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 915 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
897 Register object = locs()->in(0).reg(); | 916 Register object = locs()->in(0).reg(); |
898 Register result = locs()->out(0).reg(); | 917 Register result = locs()->out(0).reg(); |
899 __ movl(result, FieldAddress(object, offset())); | 918 __ movl(result, FieldAddress(object, offset())); |
900 } | 919 } |
901 | 920 |
902 | 921 |
903 LocationSummary* LoadClassIdInstr::MakeLocationSummary(bool opt) const { | 922 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, |
923 bool opt) const { | |
904 const intptr_t kNumInputs = 1; | 924 const intptr_t kNumInputs = 1; |
905 return LocationSummary::Make(kNumInputs, | 925 return LocationSummary::Make(kNumInputs, |
906 Location::RequiresRegister(), | 926 Location::RequiresRegister(), |
907 LocationSummary::kNoCall); | 927 LocationSummary::kNoCall); |
908 } | 928 } |
909 | 929 |
910 | 930 |
911 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 931 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
912 Register object = locs()->in(0).reg(); | 932 Register object = locs()->in(0).reg(); |
913 Register result = locs()->out(0).reg(); | 933 Register result = locs()->out(0).reg(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
993 return kUnboxedInt32x4; | 1013 return kUnboxedInt32x4; |
994 case kTypedDataFloat64x2ArrayCid: | 1014 case kTypedDataFloat64x2ArrayCid: |
995 return kUnboxedFloat64x2; | 1015 return kUnboxedFloat64x2; |
996 default: | 1016 default: |
997 UNIMPLEMENTED(); | 1017 UNIMPLEMENTED(); |
998 return kTagged; | 1018 return kTagged; |
999 } | 1019 } |
1000 } | 1020 } |
1001 | 1021 |
1002 | 1022 |
1003 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { | 1023 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, |
1024 bool opt) const { | |
1004 const intptr_t kNumInputs = 2; | 1025 const intptr_t kNumInputs = 2; |
1005 const intptr_t kNumTemps = 0; | 1026 const intptr_t kNumTemps = 0; |
1006 LocationSummary* locs = | 1027 LocationSummary* locs = |
1007 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1028 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
1008 locs->set_in(0, Location::RequiresRegister()); | 1029 locs->set_in(0, Location::RequiresRegister()); |
1009 if (CanBeImmediateIndex(index(), class_id())) { | 1030 if (CanBeImmediateIndex(index(), class_id())) { |
1010 // CanBeImmediateIndex must return false for unsafe smis. | 1031 // CanBeImmediateIndex must return false for unsafe smis. |
1011 locs->set_in(1, Location::Constant(index()->BoundConstant())); | 1032 locs->set_in(1, Location::Constant(index()->BoundConstant())); |
1012 } else { | 1033 } else { |
1013 // The index is either untagged (element size == 1) or a smi (for all | 1034 // The index is either untagged (element size == 1) or a smi (for all |
1014 // element sizes > 1). | 1035 // element sizes > 1). |
1015 locs->set_in(1, (index_scale() == 1) | 1036 locs->set_in(1, (index_scale() == 1) |
1016 ? Location::WritableRegister() | 1037 ? Location::WritableRegister() |
1017 : Location::RequiresRegister()); | 1038 : Location::RequiresRegister()); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1197 return kUnboxedInt32x4; | 1218 return kUnboxedInt32x4; |
1198 case kTypedDataFloat64x2ArrayCid: | 1219 case kTypedDataFloat64x2ArrayCid: |
1199 return kUnboxedFloat64x2; | 1220 return kUnboxedFloat64x2; |
1200 default: | 1221 default: |
1201 UNIMPLEMENTED(); | 1222 UNIMPLEMENTED(); |
1202 return kTagged; | 1223 return kTagged; |
1203 } | 1224 } |
1204 } | 1225 } |
1205 | 1226 |
1206 | 1227 |
1207 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { | 1228 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, |
1229 bool opt) const { | |
1208 const intptr_t kNumInputs = 3; | 1230 const intptr_t kNumInputs = 3; |
1209 const intptr_t kNumTemps = 0; | 1231 const intptr_t kNumTemps = 0; |
1210 LocationSummary* locs = | 1232 LocationSummary* locs = |
1211 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1233 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
1212 locs->set_in(0, Location::RequiresRegister()); | 1234 locs->set_in(0, Location::RequiresRegister()); |
1213 if (CanBeImmediateIndex(index(), class_id())) { | 1235 if (CanBeImmediateIndex(index(), class_id())) { |
1214 // CanBeImmediateIndex must return false for unsafe smis. | 1236 // CanBeImmediateIndex must return false for unsafe smis. |
1215 locs->set_in(1, Location::Constant(index()->BoundConstant())); | 1237 locs->set_in(1, Location::Constant(index()->BoundConstant())); |
1216 } else { | 1238 } else { |
1217 // The index is either untagged (element size == 1) or a smi (for all | 1239 // The index is either untagged (element size == 1) or a smi (for all |
1218 // element sizes > 1). | 1240 // element sizes > 1). |
1219 locs->set_in(1, (index_scale() == 1) | 1241 locs->set_in(1, (index_scale() == 1) |
1220 ? Location::WritableRegister() | 1242 ? Location::WritableRegister() |
1221 : Location::RequiresRegister()); | 1243 : Location::RequiresRegister()); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1384 case kTypedDataFloat32x4ArrayCid: | 1406 case kTypedDataFloat32x4ArrayCid: |
1385 case kTypedDataFloat64x2ArrayCid: | 1407 case kTypedDataFloat64x2ArrayCid: |
1386 __ movups(element_address, locs()->in(2).fpu_reg()); | 1408 __ movups(element_address, locs()->in(2).fpu_reg()); |
1387 break; | 1409 break; |
1388 default: | 1410 default: |
1389 UNREACHABLE(); | 1411 UNREACHABLE(); |
1390 } | 1412 } |
1391 } | 1413 } |
1392 | 1414 |
1393 | 1415 |
1394 LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const { | 1416 LocationSummary* GuardFieldInstr::MakeLocationSummary(Isolate* isolate, |
1417 bool opt) const { | |
1395 const intptr_t kNumInputs = 1; | 1418 const intptr_t kNumInputs = 1; |
1396 LocationSummary* summary = | 1419 LocationSummary* summary = |
1397 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 1420 new (isolate) LocationSummary(isolate, kNumInputs, 0, LocationSummary::kNo Call); |
1398 summary->set_in(0, Location::RequiresRegister()); | 1421 summary->set_in(0, Location::RequiresRegister()); |
1399 const bool field_has_length = field().needs_length_check(); | 1422 const bool field_has_length = field().needs_length_check(); |
1400 const bool need_value_temp_reg = | 1423 const bool need_value_temp_reg = |
1401 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) && | 1424 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) && |
1402 (field().guarded_cid() != kSmiCid))); | 1425 (field().guarded_cid() != kSmiCid))); |
1403 if (need_value_temp_reg) { | 1426 if (need_value_temp_reg) { |
1404 summary->AddTemp(Location::RequiresRegister()); | 1427 summary->AddTemp(Location::RequiresRegister()); |
1405 } | 1428 } |
1406 const bool need_field_temp_reg = | 1429 const bool need_field_temp_reg = |
1407 field_has_length || (field().guarded_cid() == kIllegalCid); | 1430 field_has_length || (field().guarded_cid() == kIllegalCid); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1758 compiler->RestoreLiveRegisters(locs); | 1781 compiler->RestoreLiveRegisters(locs); |
1759 __ jmp(exit_label()); | 1782 __ jmp(exit_label()); |
1760 } | 1783 } |
1761 | 1784 |
1762 private: | 1785 private: |
1763 StoreInstanceFieldInstr* instruction_; | 1786 StoreInstanceFieldInstr* instruction_; |
1764 const Class& cls_; | 1787 const Class& cls_; |
1765 }; | 1788 }; |
1766 | 1789 |
1767 | 1790 |
1768 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const { | 1791 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate, |
1792 bool opt) const { | |
1769 const intptr_t kNumInputs = 2; | 1793 const intptr_t kNumInputs = 2; |
1770 const intptr_t kNumTemps = 0; | 1794 const intptr_t kNumTemps = 0; |
1771 LocationSummary* summary = | 1795 LocationSummary* summary = |
1772 new LocationSummary(kNumInputs, kNumTemps, | 1796 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, |
1773 !field().IsNull() && | 1797 !field().IsNull() && |
1774 ((field().guarded_cid() == kIllegalCid) || is_initialization_) | 1798 ((field().guarded_cid() == kIllegalCid) || is_initialization_) |
1775 ? LocationSummary::kCallOnSlowPath | 1799 ? LocationSummary::kCallOnSlowPath |
1776 : LocationSummary::kNoCall); | 1800 : LocationSummary::kNoCall); |
1777 | 1801 |
1778 summary->set_in(0, Location::RequiresRegister()); | 1802 summary->set_in(0, Location::RequiresRegister()); |
1779 if (IsUnboxedStore() && opt) { | 1803 if (IsUnboxedStore() && opt) { |
1780 summary->set_in(1, Location::RequiresFpuRegister()); | 1804 summary->set_in(1, Location::RequiresFpuRegister()); |
1781 summary->AddTemp(Location::RequiresRegister()); | 1805 summary->AddTemp(Location::RequiresRegister()); |
1782 summary->AddTemp(Location::RequiresRegister()); | 1806 summary->AddTemp(Location::RequiresRegister()); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2013 } else { | 2037 } else { |
2014 Register value_reg = locs()->in(1).reg(); | 2038 Register value_reg = locs()->in(1).reg(); |
2015 __ StoreIntoObjectNoBarrier(instance_reg, | 2039 __ StoreIntoObjectNoBarrier(instance_reg, |
2016 FieldAddress(instance_reg, offset_in_bytes_), value_reg); | 2040 FieldAddress(instance_reg, offset_in_bytes_), value_reg); |
2017 } | 2041 } |
2018 } | 2042 } |
2019 __ Bind(&skip_store); | 2043 __ Bind(&skip_store); |
2020 } | 2044 } |
2021 | 2045 |
2022 | 2046 |
2023 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const { | 2047 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, |
2048 bool opt) const { | |
2024 const intptr_t kNumInputs = 1; | 2049 const intptr_t kNumInputs = 1; |
2025 const intptr_t kNumTemps = 0; | 2050 const intptr_t kNumTemps = 0; |
2026 LocationSummary* summary = | 2051 LocationSummary* summary = |
2027 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2052 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
2028 summary->set_in(0, Location::RequiresRegister()); | 2053 summary->set_in(0, Location::RequiresRegister()); |
2029 // By specifying same register as input, our simple register allocator can | 2054 // By specifying same register as input, our simple register allocator can |
2030 // generate better code. | 2055 // generate better code. |
2031 summary->set_out(0, Location::SameAsFirstInput()); | 2056 summary->set_out(0, Location::SameAsFirstInput()); |
2032 return summary; | 2057 return summary; |
2033 } | 2058 } |
2034 | 2059 |
2035 | 2060 |
2036 // When the parser is building an implicit static getter for optimization, | 2061 // When the parser is building an implicit static getter for optimization, |
2037 // it can generate a function body where deoptimization ids do not line up | 2062 // it can generate a function body where deoptimization ids do not line up |
2038 // with the unoptimized code. | 2063 // with the unoptimized code. |
2039 // | 2064 // |
2040 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 2065 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
2041 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2066 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2042 Register field = locs()->in(0).reg(); | 2067 Register field = locs()->in(0).reg(); |
2043 Register result = locs()->out(0).reg(); | 2068 Register result = locs()->out(0).reg(); |
2044 __ movl(result, FieldAddress(field, Field::value_offset())); | 2069 __ movl(result, FieldAddress(field, Field::value_offset())); |
2045 } | 2070 } |
2046 | 2071 |
2047 | 2072 |
2048 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const { | 2073 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate, |
2049 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); | 2074 bool opt) const { |
2075 LocationSummary* locs = new (isolate) LocationSummary(isolate, 1, 1, LocationS ummary::kNoCall); | |
2050 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 2076 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
2051 : Location::RequiresRegister()); | 2077 : Location::RequiresRegister()); |
2052 locs->set_temp(0, Location::RequiresRegister()); | 2078 locs->set_temp(0, Location::RequiresRegister()); |
2053 return locs; | 2079 return locs; |
2054 } | 2080 } |
2055 | 2081 |
2056 | 2082 |
2057 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2083 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2058 Register value = locs()->in(0).reg(); | 2084 Register value = locs()->in(0).reg(); |
2059 Register temp = locs()->temp(0).reg(); | 2085 Register temp = locs()->temp(0).reg(); |
2060 | 2086 |
2061 __ LoadObject(temp, field()); | 2087 __ LoadObject(temp, field()); |
2062 if (this->value()->NeedsStoreBuffer()) { | 2088 if (this->value()->NeedsStoreBuffer()) { |
2063 __ StoreIntoObject(temp, | 2089 __ StoreIntoObject(temp, |
2064 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 2090 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); |
2065 } else { | 2091 } else { |
2066 __ StoreIntoObjectNoBarrier( | 2092 __ StoreIntoObjectNoBarrier( |
2067 temp, FieldAddress(temp, Field::value_offset()), value); | 2093 temp, FieldAddress(temp, Field::value_offset()), value); |
2068 } | 2094 } |
2069 } | 2095 } |
2070 | 2096 |
2071 | 2097 |
2072 LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const { | 2098 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate, |
2099 bool opt) const { | |
2073 const intptr_t kNumInputs = 3; | 2100 const intptr_t kNumInputs = 3; |
2074 const intptr_t kNumTemps = 0; | 2101 const intptr_t kNumTemps = 0; |
2075 LocationSummary* summary = | 2102 LocationSummary* summary = |
2076 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2103 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2077 summary->set_in(0, Location::RegisterLocation(EAX)); | 2104 summary->set_in(0, Location::RegisterLocation(EAX)); |
2078 summary->set_in(1, Location::RegisterLocation(ECX)); | 2105 summary->set_in(1, Location::RegisterLocation(ECX)); |
2079 summary->set_in(2, Location::RegisterLocation(EDX)); | 2106 summary->set_in(2, Location::RegisterLocation(EDX)); |
2080 summary->set_out(0, Location::RegisterLocation(EAX)); | 2107 summary->set_out(0, Location::RegisterLocation(EAX)); |
2081 return summary; | 2108 return summary; |
2082 } | 2109 } |
2083 | 2110 |
2084 | 2111 |
2085 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2112 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2086 ASSERT(locs()->in(0).reg() == EAX); // Value. | 2113 ASSERT(locs()->in(0).reg() == EAX); // Value. |
2087 ASSERT(locs()->in(1).reg() == ECX); // Instantiator. | 2114 ASSERT(locs()->in(1).reg() == ECX); // Instantiator. |
2088 ASSERT(locs()->in(2).reg() == EDX); // Instantiator type arguments. | 2115 ASSERT(locs()->in(2).reg() == EDX); // Instantiator type arguments. |
2089 | 2116 |
2090 compiler->GenerateInstanceOf(token_pos(), | 2117 compiler->GenerateInstanceOf(token_pos(), |
2091 deopt_id(), | 2118 deopt_id(), |
2092 type(), | 2119 type(), |
2093 negate_result(), | 2120 negate_result(), |
2094 locs()); | 2121 locs()); |
2095 ASSERT(locs()->out(0).reg() == EAX); | 2122 ASSERT(locs()->out(0).reg() == EAX); |
2096 } | 2123 } |
2097 | 2124 |
2098 | 2125 |
2099 // TODO(srdjan): In case of constant inputs make CreateArray kNoCall and | 2126 // TODO(srdjan): In case of constant inputs make CreateArray kNoCall and |
2100 // use slow path stub. | 2127 // use slow path stub. |
2101 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { | 2128 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate, |
2129 bool opt) const { | |
2102 const intptr_t kNumInputs = 2; | 2130 const intptr_t kNumInputs = 2; |
2103 const intptr_t kNumTemps = 0; | 2131 const intptr_t kNumTemps = 0; |
2104 LocationSummary* locs = | 2132 LocationSummary* locs = |
2105 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2133 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2106 locs->set_in(0, Location::RegisterLocation(ECX)); | 2134 locs->set_in(0, Location::RegisterLocation(ECX)); |
2107 locs->set_in(1, Location::RegisterLocation(EDX)); | 2135 locs->set_in(1, Location::RegisterLocation(EDX)); |
2108 locs->set_out(0, Location::RegisterLocation(EAX)); | 2136 locs->set_out(0, Location::RegisterLocation(EAX)); |
2109 return locs; | 2137 return locs; |
2110 } | 2138 } |
2111 | 2139 |
2112 | 2140 |
2113 // Inlines array allocation for known constant values. | 2141 // Inlines array allocation for known constant values. |
2114 static void InlineArrayAllocation(FlowGraphCompiler* compiler, | 2142 static void InlineArrayAllocation(FlowGraphCompiler* compiler, |
2115 intptr_t num_elements, | 2143 intptr_t num_elements, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2306 compiler->RestoreLiveRegisters(locs); | 2334 compiler->RestoreLiveRegisters(locs); |
2307 | 2335 |
2308 __ jmp(exit_label()); | 2336 __ jmp(exit_label()); |
2309 } | 2337 } |
2310 | 2338 |
2311 private: | 2339 private: |
2312 Instruction* instruction_; | 2340 Instruction* instruction_; |
2313 }; | 2341 }; |
2314 | 2342 |
2315 | 2343 |
2316 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { | 2344 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate, |
2345 bool opt) const { | |
2317 const intptr_t kNumInputs = 1; | 2346 const intptr_t kNumInputs = 1; |
2318 const intptr_t kNumTemps = 0; | 2347 const intptr_t kNumTemps = 0; |
2319 LocationSummary* locs = | 2348 LocationSummary* locs = |
2320 new LocationSummary( | 2349 new (isolate) LocationSummary(isolate, |
2321 kNumInputs, kNumTemps, | 2350 kNumInputs, kNumTemps, |
2322 (opt && !IsPotentialUnboxedLoad()) | 2351 (opt && !IsPotentialUnboxedLoad()) |
2323 ? LocationSummary::kNoCall | 2352 ? LocationSummary::kNoCall |
2324 : LocationSummary::kCallOnSlowPath); | 2353 : LocationSummary::kCallOnSlowPath); |
2325 | 2354 |
2326 locs->set_in(0, Location::RequiresRegister()); | 2355 locs->set_in(0, Location::RequiresRegister()); |
2327 | 2356 |
2328 if (IsUnboxedLoad() && opt) { | 2357 if (IsUnboxedLoad() && opt) { |
2329 locs->AddTemp(Location::RequiresRegister()); | 2358 locs->AddTemp(Location::RequiresRegister()); |
2330 } else if (IsPotentialUnboxedLoad()) { | 2359 } else if (IsPotentialUnboxedLoad()) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2452 __ jmp(&done); | 2481 __ jmp(&done); |
2453 } | 2482 } |
2454 | 2483 |
2455 __ Bind(&load_pointer); | 2484 __ Bind(&load_pointer); |
2456 } | 2485 } |
2457 __ movl(result, FieldAddress(instance_reg, offset_in_bytes())); | 2486 __ movl(result, FieldAddress(instance_reg, offset_in_bytes())); |
2458 __ Bind(&done); | 2487 __ Bind(&done); |
2459 } | 2488 } |
2460 | 2489 |
2461 | 2490 |
2462 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const { | 2491 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate, |
2492 bool opt) const { | |
2463 const intptr_t kNumInputs = 1; | 2493 const intptr_t kNumInputs = 1; |
2464 const intptr_t kNumTemps = 0; | 2494 const intptr_t kNumTemps = 0; |
2465 LocationSummary* locs = | 2495 LocationSummary* locs = |
2466 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2496 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2467 locs->set_in(0, Location::RegisterLocation(EAX)); | 2497 locs->set_in(0, Location::RegisterLocation(EAX)); |
2468 locs->set_out(0, Location::RegisterLocation(EAX)); | 2498 locs->set_out(0, Location::RegisterLocation(EAX)); |
2469 return locs; | 2499 return locs; |
2470 } | 2500 } |
2471 | 2501 |
2472 | 2502 |
2473 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2503 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2474 Register instantiator_reg = locs()->in(0).reg(); | 2504 Register instantiator_reg = locs()->in(0).reg(); |
2475 Register result_reg = locs()->out(0).reg(); | 2505 Register result_reg = locs()->out(0).reg(); |
2476 | 2506 |
2477 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2507 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
2478 // A runtime call to instantiate the type is required. | 2508 // A runtime call to instantiate the type is required. |
2479 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2509 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
2480 __ PushObject(type()); | 2510 __ PushObject(type()); |
2481 __ pushl(instantiator_reg); // Push instantiator type arguments. | 2511 __ pushl(instantiator_reg); // Push instantiator type arguments. |
2482 compiler->GenerateRuntimeCall(token_pos(), | 2512 compiler->GenerateRuntimeCall(token_pos(), |
2483 deopt_id(), | 2513 deopt_id(), |
2484 kInstantiateTypeRuntimeEntry, | 2514 kInstantiateTypeRuntimeEntry, |
2485 2, | 2515 2, |
2486 locs()); | 2516 locs()); |
2487 __ Drop(2); // Drop instantiator and uninstantiated type. | 2517 __ Drop(2); // Drop instantiator and uninstantiated type. |
2488 __ popl(result_reg); // Pop instantiated type. | 2518 __ popl(result_reg); // Pop instantiated type. |
2489 ASSERT(instantiator_reg == result_reg); | 2519 ASSERT(instantiator_reg == result_reg); |
2490 } | 2520 } |
2491 | 2521 |
2492 | 2522 |
2493 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( | 2523 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( |
2494 bool opt) const { | 2524 Isolate* isolate, bool opt) const { |
2495 const intptr_t kNumInputs = 1; | 2525 const intptr_t kNumInputs = 1; |
2496 const intptr_t kNumTemps = 0; | 2526 const intptr_t kNumTemps = 0; |
2497 LocationSummary* locs = | 2527 LocationSummary* locs = |
2498 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2528 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2499 locs->set_in(0, Location::RegisterLocation(EAX)); | 2529 locs->set_in(0, Location::RegisterLocation(EAX)); |
2500 locs->set_out(0, Location::RegisterLocation(EAX)); | 2530 locs->set_out(0, Location::RegisterLocation(EAX)); |
2501 return locs; | 2531 return locs; |
2502 } | 2532 } |
2503 | 2533 |
2504 | 2534 |
2505 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 2535 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
2506 FlowGraphCompiler* compiler) { | 2536 FlowGraphCompiler* compiler) { |
2507 Register instantiator_reg = locs()->in(0).reg(); | 2537 Register instantiator_reg = locs()->in(0).reg(); |
2508 Register result_reg = locs()->out(0).reg(); | 2538 Register result_reg = locs()->out(0).reg(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2555 deopt_id(), | 2585 deopt_id(), |
2556 kInstantiateTypeArgumentsRuntimeEntry, | 2586 kInstantiateTypeArgumentsRuntimeEntry, |
2557 2, | 2587 2, |
2558 locs()); | 2588 locs()); |
2559 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | 2589 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
2560 __ popl(result_reg); // Pop instantiated type arguments. | 2590 __ popl(result_reg); // Pop instantiated type arguments. |
2561 __ Bind(&type_arguments_instantiated); | 2591 __ Bind(&type_arguments_instantiated); |
2562 } | 2592 } |
2563 | 2593 |
2564 | 2594 |
2565 LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const { | 2595 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate, |
2596 bool opt) const { | |
2566 if (opt) { | 2597 if (opt) { |
2567 const intptr_t kNumInputs = 0; | 2598 const intptr_t kNumInputs = 0; |
2568 const intptr_t kNumTemps = 2; | 2599 const intptr_t kNumTemps = 2; |
2569 LocationSummary* locs = new LocationSummary( | 2600 LocationSummary* locs = new (isolate) LocationSummary(isolate, |
2570 kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 2601 kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
2571 locs->set_temp(0, Location::RegisterLocation(ECX)); | 2602 locs->set_temp(0, Location::RegisterLocation(ECX)); |
2572 locs->set_temp(1, Location::RegisterLocation(EBX)); | 2603 locs->set_temp(1, Location::RegisterLocation(EBX)); |
2573 locs->set_out(0, Location::RegisterLocation(EAX)); | 2604 locs->set_out(0, Location::RegisterLocation(EAX)); |
2574 return locs; | 2605 return locs; |
2575 } | 2606 } |
2576 const intptr_t kNumInputs = 0; | 2607 const intptr_t kNumInputs = 0; |
2577 const intptr_t kNumTemps = 1; | 2608 const intptr_t kNumTemps = 1; |
2578 LocationSummary* locs = | 2609 LocationSummary* locs = |
2579 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2610 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2580 locs->set_temp(0, Location::RegisterLocation(EDX)); | 2611 locs->set_temp(0, Location::RegisterLocation(EDX)); |
2581 locs->set_out(0, Location::RegisterLocation(EAX)); | 2612 locs->set_out(0, Location::RegisterLocation(EAX)); |
2582 return locs; | 2613 return locs; |
2583 } | 2614 } |
2584 | 2615 |
2585 | 2616 |
2586 class AllocateContextSlowPath : public SlowPathCode { | 2617 class AllocateContextSlowPath : public SlowPathCode { |
2587 public: | 2618 public: |
2588 explicit AllocateContextSlowPath(AllocateContextInstr* instruction) | 2619 explicit AllocateContextSlowPath(AllocateContextInstr* instruction) |
2589 : instruction_(instruction) { } | 2620 : instruction_(instruction) { } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2691 __ movl(EDX, Immediate(num_context_variables())); | 2722 __ movl(EDX, Immediate(num_context_variables())); |
2692 const ExternalLabel label("alloc_context", | 2723 const ExternalLabel label("alloc_context", |
2693 StubCode::AllocateContextEntryPoint()); | 2724 StubCode::AllocateContextEntryPoint()); |
2694 compiler->GenerateCall(token_pos(), | 2725 compiler->GenerateCall(token_pos(), |
2695 &label, | 2726 &label, |
2696 PcDescriptors::kOther, | 2727 PcDescriptors::kOther, |
2697 locs()); | 2728 locs()); |
2698 } | 2729 } |
2699 | 2730 |
2700 | 2731 |
2701 LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const { | 2732 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, |
2733 bool opt) const { | |
2702 const intptr_t kNumInputs = 1; | 2734 const intptr_t kNumInputs = 1; |
2703 const intptr_t kNumTemps = 0; | 2735 const intptr_t kNumTemps = 0; |
2704 LocationSummary* locs = | 2736 LocationSummary* locs = |
2705 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2737 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
2706 locs->set_in(0, Location::RegisterLocation(EAX)); | 2738 locs->set_in(0, Location::RegisterLocation(EAX)); |
2707 locs->set_out(0, Location::RegisterLocation(EAX)); | 2739 locs->set_out(0, Location::RegisterLocation(EAX)); |
2708 return locs; | 2740 return locs; |
2709 } | 2741 } |
2710 | 2742 |
2711 | 2743 |
2712 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2744 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2713 Register context_value = locs()->in(0).reg(); | 2745 Register context_value = locs()->in(0).reg(); |
2714 Register result = locs()->out(0).reg(); | 2746 Register result = locs()->out(0).reg(); |
2715 | 2747 |
2716 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 2748 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
2717 __ pushl(context_value); | 2749 __ pushl(context_value); |
2718 compiler->GenerateRuntimeCall(token_pos(), | 2750 compiler->GenerateRuntimeCall(token_pos(), |
2719 deopt_id(), | 2751 deopt_id(), |
2720 kCloneContextRuntimeEntry, | 2752 kCloneContextRuntimeEntry, |
2721 1, | 2753 1, |
2722 locs()); | 2754 locs()); |
2723 __ popl(result); // Remove argument. | 2755 __ popl(result); // Remove argument. |
2724 __ popl(result); // Get result (cloned context). | 2756 __ popl(result); // Get result (cloned context). |
2725 } | 2757 } |
2726 | 2758 |
2727 | 2759 |
2728 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(bool opt) const { | 2760 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate, |
2761 bool opt) const { | |
2729 UNREACHABLE(); | 2762 UNREACHABLE(); |
2730 return NULL; | 2763 return NULL; |
2731 } | 2764 } |
2732 | 2765 |
2733 | 2766 |
2734 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2767 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2735 __ Bind(compiler->GetJumpLabel(this)); | 2768 __ Bind(compiler->GetJumpLabel(this)); |
2736 compiler->AddExceptionHandler(catch_try_index(), | 2769 compiler->AddExceptionHandler(catch_try_index(), |
2737 try_index(), | 2770 try_index(), |
2738 compiler->assembler()->CodeSize(), | 2771 compiler->assembler()->CodeSize(), |
(...skipping 12 matching lines...) Expand all Loading... | |
2751 | 2784 |
2752 // Restore stack and initialize the two exception variables: | 2785 // Restore stack and initialize the two exception variables: |
2753 // exception and stack trace variables. | 2786 // exception and stack trace variables. |
2754 __ movl(Address(EBP, exception_var().index() * kWordSize), | 2787 __ movl(Address(EBP, exception_var().index() * kWordSize), |
2755 kExceptionObjectReg); | 2788 kExceptionObjectReg); |
2756 __ movl(Address(EBP, stacktrace_var().index() * kWordSize), | 2789 __ movl(Address(EBP, stacktrace_var().index() * kWordSize), |
2757 kStackTraceObjectReg); | 2790 kStackTraceObjectReg); |
2758 } | 2791 } |
2759 | 2792 |
2760 | 2793 |
2761 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const { | 2794 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate, |
2795 bool opt) const { | |
2762 const intptr_t kNumInputs = 0; | 2796 const intptr_t kNumInputs = 0; |
2763 const intptr_t kNumTemps = 0; | 2797 const intptr_t kNumTemps = 0; |
2764 LocationSummary* summary = | 2798 LocationSummary* summary = |
2765 new LocationSummary(kNumInputs, | 2799 new (isolate) LocationSummary(isolate, kNumInputs, |
2766 kNumTemps, | 2800 kNumTemps, |
2767 LocationSummary::kCallOnSlowPath); | 2801 LocationSummary::kCallOnSlowPath); |
2768 return summary; | 2802 return summary; |
2769 } | 2803 } |
2770 | 2804 |
2771 | 2805 |
2772 class CheckStackOverflowSlowPath : public SlowPathCode { | 2806 class CheckStackOverflowSlowPath : public SlowPathCode { |
2773 public: | 2807 public: |
2774 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2808 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
2775 : instruction_(instruction) { } | 2809 : instruction_(instruction) { } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2960 __ shll(left, right); | 2994 __ shll(left, right); |
2961 __ sarl(left, right); | 2995 __ sarl(left, right); |
2962 __ cmpl(left, temp); | 2996 __ cmpl(left, temp); |
2963 __ j(NOT_EQUAL, deopt); // Overflow. | 2997 __ j(NOT_EQUAL, deopt); // Overflow. |
2964 // Shift for result now we know there is no overflow. | 2998 // Shift for result now we know there is no overflow. |
2965 __ shll(left, right); | 2999 __ shll(left, right); |
2966 } | 3000 } |
2967 } | 3001 } |
2968 | 3002 |
2969 | 3003 |
2970 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const { | 3004 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate, |
3005 bool opt) const { | |
2971 const intptr_t kNumInputs = 2; | 3006 const intptr_t kNumInputs = 2; |
2972 if (op_kind() == Token::kTRUNCDIV) { | 3007 if (op_kind() == Token::kTRUNCDIV) { |
2973 const intptr_t kNumTemps = 1; | 3008 const intptr_t kNumTemps = 1; |
2974 LocationSummary* summary = | 3009 LocationSummary* summary = |
2975 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3010 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
2976 if (RightIsPowerOfTwoConstant()) { | 3011 if (RightIsPowerOfTwoConstant()) { |
2977 summary->set_in(0, Location::RequiresRegister()); | 3012 summary->set_in(0, Location::RequiresRegister()); |
2978 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 3013 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
2979 // The programmer only controls one bit, so the constant is safe. | 3014 // The programmer only controls one bit, so the constant is safe. |
2980 summary->set_in(1, Location::Constant(right_constant->value())); | 3015 summary->set_in(1, Location::Constant(right_constant->value())); |
2981 summary->set_temp(0, Location::RequiresRegister()); | 3016 summary->set_temp(0, Location::RequiresRegister()); |
2982 summary->set_out(0, Location::SameAsFirstInput()); | 3017 summary->set_out(0, Location::SameAsFirstInput()); |
2983 } else { | 3018 } else { |
2984 // Both inputs must be writable because they will be untagged. | 3019 // Both inputs must be writable because they will be untagged. |
2985 summary->set_in(0, Location::RegisterLocation(EAX)); | 3020 summary->set_in(0, Location::RegisterLocation(EAX)); |
2986 summary->set_in(1, Location::WritableRegister()); | 3021 summary->set_in(1, Location::WritableRegister()); |
2987 summary->set_out(0, Location::SameAsFirstInput()); | 3022 summary->set_out(0, Location::SameAsFirstInput()); |
2988 // Will be used for sign extension and division. | 3023 // Will be used for sign extension and division. |
2989 summary->set_temp(0, Location::RegisterLocation(EDX)); | 3024 summary->set_temp(0, Location::RegisterLocation(EDX)); |
2990 } | 3025 } |
2991 return summary; | 3026 return summary; |
2992 } else if (op_kind() == Token::kMOD) { | 3027 } else if (op_kind() == Token::kMOD) { |
2993 const intptr_t kNumTemps = 1; | 3028 const intptr_t kNumTemps = 1; |
2994 LocationSummary* summary = | 3029 LocationSummary* summary = |
2995 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3030 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
2996 // Both inputs must be writable because they will be untagged. | 3031 // Both inputs must be writable because they will be untagged. |
2997 summary->set_in(0, Location::RegisterLocation(EDX)); | 3032 summary->set_in(0, Location::RegisterLocation(EDX)); |
2998 summary->set_in(1, Location::WritableRegister()); | 3033 summary->set_in(1, Location::WritableRegister()); |
2999 summary->set_out(0, Location::SameAsFirstInput()); | 3034 summary->set_out(0, Location::SameAsFirstInput()); |
3000 // Will be used for sign extension and division. | 3035 // Will be used for sign extension and division. |
3001 summary->set_temp(0, Location::RegisterLocation(EAX)); | 3036 summary->set_temp(0, Location::RegisterLocation(EAX)); |
3002 return summary; | 3037 return summary; |
3003 } else if (op_kind() == Token::kSHR) { | 3038 } else if (op_kind() == Token::kSHR) { |
3004 const intptr_t kNumTemps = 0; | 3039 const intptr_t kNumTemps = 0; |
3005 LocationSummary* summary = | 3040 LocationSummary* summary = |
3006 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3041 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
3007 summary->set_in(0, Location::RequiresRegister()); | 3042 summary->set_in(0, Location::RequiresRegister()); |
3008 summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX)); | 3043 summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX)); |
3009 summary->set_out(0, Location::SameAsFirstInput()); | 3044 summary->set_out(0, Location::SameAsFirstInput()); |
3010 return summary; | 3045 return summary; |
3011 } else if (op_kind() == Token::kSHL) { | 3046 } else if (op_kind() == Token::kSHL) { |
3012 const intptr_t kNumTemps = 0; | 3047 const intptr_t kNumTemps = 0; |
3013 LocationSummary* summary = | 3048 LocationSummary* summary = |
3014 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3049 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
3015 summary->set_in(0, Location::RequiresRegister()); | 3050 summary->set_in(0, Location::RequiresRegister()); |
3016 summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX)); | 3051 summary->set_in(1, Location::FixedRegisterOrSmiConstant(right(), ECX)); |
3017 if (!is_truncating()) { | 3052 if (!is_truncating()) { |
3018 summary->AddTemp(Location::RequiresRegister()); | 3053 summary->AddTemp(Location::RequiresRegister()); |
3019 } | 3054 } |
3020 summary->set_out(0, Location::SameAsFirstInput()); | 3055 summary->set_out(0, Location::SameAsFirstInput()); |
3021 return summary; | 3056 return summary; |
3022 } else { | 3057 } else { |
3023 const intptr_t kNumTemps = 0; | 3058 const intptr_t kNumTemps = 0; |
3024 LocationSummary* summary = | 3059 LocationSummary* summary = |
3025 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3060 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
3026 summary->set_in(0, Location::RequiresRegister()); | 3061 summary->set_in(0, Location::RequiresRegister()); |
3027 ConstantInstr* constant = right()->definition()->AsConstant(); | 3062 ConstantInstr* constant = right()->definition()->AsConstant(); |
3028 if (constant != NULL) { | 3063 if (constant != NULL) { |
3029 summary->set_in(1, Location::RegisterOrSmiConstant(right())); | 3064 summary->set_in(1, Location::RegisterOrSmiConstant(right())); |
3030 } else { | 3065 } else { |
3031 summary->set_in(1, Location::PrefersRegister()); | 3066 summary->set_in(1, Location::PrefersRegister()); |
3032 } | 3067 } |
3033 summary->set_out(0, Location::SameAsFirstInput()); | 3068 summary->set_out(0, Location::SameAsFirstInput()); |
3034 return summary; | 3069 return summary; |
3035 } | 3070 } |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3335 UNREACHABLE(); | 3370 UNREACHABLE(); |
3336 break; | 3371 break; |
3337 } | 3372 } |
3338 default: | 3373 default: |
3339 UNREACHABLE(); | 3374 UNREACHABLE(); |
3340 break; | 3375 break; |
3341 } | 3376 } |
3342 } | 3377 } |
3343 | 3378 |
3344 | 3379 |
3345 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const { | 3380 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, |
3381 bool opt) const { | |
3346 intptr_t left_cid = left()->Type()->ToCid(); | 3382 intptr_t left_cid = left()->Type()->ToCid(); |
3347 intptr_t right_cid = right()->Type()->ToCid(); | 3383 intptr_t right_cid = right()->Type()->ToCid(); |
3348 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3384 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
3349 const intptr_t kNumInputs = 2; | 3385 const intptr_t kNumInputs = 2; |
3350 const bool need_temp = (left()->definition() != right()->definition()) | 3386 const bool need_temp = (left()->definition() != right()->definition()) |
3351 &&(left_cid != kSmiCid) | 3387 &&(left_cid != kSmiCid) |
3352 && (right_cid != kSmiCid); | 3388 && (right_cid != kSmiCid); |
3353 const intptr_t kNumTemps = need_temp ? 1 : 0; | 3389 const intptr_t kNumTemps = need_temp ? 1 : 0; |
3354 LocationSummary* summary = | 3390 LocationSummary* summary = |
3355 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3391 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSummar y::kNoCall); |
3356 summary->set_in(0, Location::RequiresRegister()); | 3392 summary->set_in(0, Location::RequiresRegister()); |
3357 summary->set_in(1, Location::RequiresRegister()); | 3393 summary->set_in(1, Location::RequiresRegister()); |
3358 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); | 3394 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); |
3359 return summary; | 3395 return summary; |
3360 } | 3396 } |
3361 | 3397 |
3362 | 3398 |
3363 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3399 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3364 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3400 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
3365 ICData::kDeoptBinaryDoubleOp); | 3401 ICData::kDeoptBinaryDoubleOp); |
(...skipping 13 matching lines...) Expand all Loading... | |
3379 __ orl(temp, right); | 3415 __ orl(temp, right); |
3380 __ testl(temp, Immediate(kSmiTagMask)); | 3416 __ testl(temp, Immediate(kSmiTagMask)); |
3381 } | 3417 } |
3382 __ j(ZERO, deopt); | 3418 __ j(ZERO, deopt); |
3383 } | 3419 } |
3384 | 3420 |
3385 | 3421 |
3386 | 3422 |
3387 | 3423 |
3388 | 3424 |
3389 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 3425 LocationSummary* BoxDoubleInstr::MakeLocationSummary(Isolate* isolate, |
3426 bool opt) const { | |
3390 const intptr_t kNumInputs = 1; | 3427 const intptr_t kNumInputs = 1; |
3391 const intptr_t kNumTemps = 0; | 3428 const intptr_t kNumTemps = 0; |
3392 LocationSummary* summary = | 3429 LocationSummary* summary = |
3393 new LocationSummary(kNumInputs, | 3430 new (isolate) LocationSummary(isolate, kNumInputs, |
3394 kNumTemps, | 3431 kNumTemps, |
3395 LocationSummary::kCallOnSlowPath); | 3432 LocationSummary::kCallOnSlowPath); |
3396 summary->set_in(0, Location::RequiresFpuRegister()); | 3433 summary->set_in(0, Location::RequiresFpuRegister()); |
3397 summary->set_out(0, Location::RequiresRegister()); | 3434 summary->set_out(0, Location::RequiresRegister()); |
3398 return summary; | 3435 return summary; |
3399 } | 3436 } |
3400 | 3437 |
3401 | 3438 |
3402 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3439 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3403 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 3440 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
3404 compiler->AddSlowPathCode(slow_path); | 3441 compiler->AddSlowPathCode(slow_path); |
3405 | 3442 |
3406 Register out_reg = locs()->out(0).reg(); | 3443 Register out_reg = locs()->out(0).reg(); |
3407 XmmRegister value = locs()->in(0).fpu_reg(); | 3444 XmmRegister value = locs()->in(0).fpu_reg(); |
3408 | 3445 |
3409 __ TryAllocate(compiler->double_class(), | 3446 __ TryAllocate(compiler->double_class(), |
3410 slow_path->entry_label(), | 3447 slow_path->entry_label(), |
3411 Assembler::kFarJump, | 3448 Assembler::kFarJump, |
3412 out_reg, | 3449 out_reg, |
3413 kNoRegister); | 3450 kNoRegister); |
3414 __ Bind(slow_path->exit_label()); | 3451 __ Bind(slow_path->exit_label()); |
3415 __ movsd(FieldAddress(out_reg, Double::value_offset()), value); | 3452 __ movsd(FieldAddress(out_reg, Double::value_offset()), value); |
3416 } | 3453 } |
3417 | 3454 |
3418 | 3455 |
3419 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 3456 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(Isolate* isolate, |
3457 bool opt) const { | |
3420 const intptr_t kNumInputs = 1; | 3458 const intptr_t kNumInputs = 1; |
3421 const intptr_t value_cid = value()->Type()->ToCid(); | 3459 const intptr_t value_cid = value()->Type()->ToCid(); |
3422 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 3460 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
3423 const bool needs_writable_input = (value_cid == kSmiCid); | 3461 const bool needs_writable_input = (value_cid == kSmiCid); |
3424 const intptr_t kNumTemps = needs_temp ? 1 : 0; | 3462 const intptr_t kNumTemps = needs_temp ? 1 : 0; |
3425 LocationSummary* summary = | 3463 LocationSummary* summary = |
3426 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3464 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3427 summary->set_in(0, needs_writable_input | 3465 summary->set_in(0, needs_writable_input |
3428 ? Location::WritableRegister() | 3466 ? Location::WritableRegister() |
3429 : Location::RequiresRegister()); | 3467 : Location::RequiresRegister()); |
3430 if (needs_temp) summary->set_temp(0, Location::RequiresRegister()); | 3468 if (needs_temp) summary->set_temp(0, Location::RequiresRegister()); |
3431 summary->set_out(0, Location::RequiresFpuRegister()); | 3469 summary->set_out(0, Location::RequiresFpuRegister()); |
3432 return summary; | 3470 return summary; |
3433 } | 3471 } |
3434 | 3472 |
3435 | 3473 |
3436 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3474 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 30 matching lines...) Expand all Loading... | |
3467 __ Bind(&is_smi); | 3505 __ Bind(&is_smi); |
3468 __ movl(temp, value); | 3506 __ movl(temp, value); |
3469 __ SmiUntag(temp); | 3507 __ SmiUntag(temp); |
3470 __ cvtsi2sd(result, temp); | 3508 __ cvtsi2sd(result, temp); |
3471 __ Bind(&done); | 3509 __ Bind(&done); |
3472 } | 3510 } |
3473 } | 3511 } |
3474 } | 3512 } |
3475 | 3513 |
3476 | 3514 |
3477 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 3515 LocationSummary* BoxFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
3516 bool opt) const { | |
3478 const intptr_t kNumInputs = 1; | 3517 const intptr_t kNumInputs = 1; |
3479 const intptr_t kNumTemps = 0; | 3518 const intptr_t kNumTemps = 0; |
3480 LocationSummary* summary = | 3519 LocationSummary* summary = |
3481 new LocationSummary(kNumInputs, | 3520 new (isolate) LocationSummary(isolate, kNumInputs, |
3482 kNumTemps, | 3521 kNumTemps, |
3483 LocationSummary::kCallOnSlowPath); | 3522 LocationSummary::kCallOnSlowPath); |
3484 summary->set_in(0, Location::RequiresFpuRegister()); | 3523 summary->set_in(0, Location::RequiresFpuRegister()); |
3485 summary->set_out(0, Location::RequiresRegister()); | 3524 summary->set_out(0, Location::RequiresRegister()); |
3486 return summary; | 3525 return summary; |
3487 } | 3526 } |
3488 | 3527 |
3489 | 3528 |
3490 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3529 void BoxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3491 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); | 3530 BoxFloat32x4SlowPath* slow_path = new BoxFloat32x4SlowPath(this); |
3492 compiler->AddSlowPathCode(slow_path); | 3531 compiler->AddSlowPathCode(slow_path); |
3493 | 3532 |
3494 Register out_reg = locs()->out(0).reg(); | 3533 Register out_reg = locs()->out(0).reg(); |
3495 XmmRegister value = locs()->in(0).fpu_reg(); | 3534 XmmRegister value = locs()->in(0).fpu_reg(); |
3496 | 3535 |
3497 __ TryAllocate(compiler->float32x4_class(), | 3536 __ TryAllocate(compiler->float32x4_class(), |
3498 slow_path->entry_label(), | 3537 slow_path->entry_label(), |
3499 Assembler::kFarJump, | 3538 Assembler::kFarJump, |
3500 out_reg, | 3539 out_reg, |
3501 kNoRegister); | 3540 kNoRegister); |
3502 __ Bind(slow_path->exit_label()); | 3541 __ Bind(slow_path->exit_label()); |
3503 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value); | 3542 __ movups(FieldAddress(out_reg, Float32x4::value_offset()), value); |
3504 } | 3543 } |
3505 | 3544 |
3506 | 3545 |
3507 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(bool opt) const { | 3546 LocationSummary* UnboxFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
3547 bool opt) const { | |
3508 const intptr_t value_cid = value()->Type()->ToCid(); | 3548 const intptr_t value_cid = value()->Type()->ToCid(); |
3509 const intptr_t kNumInputs = 1; | 3549 const intptr_t kNumInputs = 1; |
3510 const intptr_t kNumTemps = value_cid == kFloat32x4Cid ? 0 : 1; | 3550 const intptr_t kNumTemps = value_cid == kFloat32x4Cid ? 0 : 1; |
3511 LocationSummary* summary = | 3551 LocationSummary* summary = |
3512 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3552 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3513 summary->set_in(0, Location::RequiresRegister()); | 3553 summary->set_in(0, Location::RequiresRegister()); |
3514 if (kNumTemps > 0) { | 3554 if (kNumTemps > 0) { |
3515 ASSERT(kNumTemps == 1); | 3555 ASSERT(kNumTemps == 1); |
3516 summary->set_temp(0, Location::RequiresRegister()); | 3556 summary->set_temp(0, Location::RequiresRegister()); |
3517 } | 3557 } |
3518 summary->set_out(0, Location::RequiresFpuRegister()); | 3558 summary->set_out(0, Location::RequiresFpuRegister()); |
3519 return summary; | 3559 return summary; |
3520 } | 3560 } |
3521 | 3561 |
3522 | 3562 |
3523 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3563 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3524 const intptr_t value_cid = value()->Type()->ToCid(); | 3564 const intptr_t value_cid = value()->Type()->ToCid(); |
3525 const Register value = locs()->in(0).reg(); | 3565 const Register value = locs()->in(0).reg(); |
3526 const XmmRegister result = locs()->out(0).fpu_reg(); | 3566 const XmmRegister result = locs()->out(0).fpu_reg(); |
3527 | 3567 |
3528 if (value_cid != kFloat32x4Cid) { | 3568 if (value_cid != kFloat32x4Cid) { |
3529 const Register temp = locs()->temp(0).reg(); | 3569 const Register temp = locs()->temp(0).reg(); |
3530 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); | 3570 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); |
3531 __ testl(value, Immediate(kSmiTagMask)); | 3571 __ testl(value, Immediate(kSmiTagMask)); |
3532 __ j(ZERO, deopt); | 3572 __ j(ZERO, deopt); |
3533 __ CompareClassId(value, kFloat32x4Cid, temp); | 3573 __ CompareClassId(value, kFloat32x4Cid, temp); |
3534 __ j(NOT_EQUAL, deopt); | 3574 __ j(NOT_EQUAL, deopt); |
3535 } | 3575 } |
3536 __ movups(result, FieldAddress(value, Float32x4::value_offset())); | 3576 __ movups(result, FieldAddress(value, Float32x4::value_offset())); |
3537 } | 3577 } |
3538 | 3578 |
3539 | 3579 |
3540 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(bool opt) const { | 3580 LocationSummary* BoxFloat64x2Instr::MakeLocationSummary(Isolate* isolate, |
3581 bool opt) const { | |
3541 const intptr_t kNumInputs = 1; | 3582 const intptr_t kNumInputs = 1; |
3542 const intptr_t kNumTemps = 0; | 3583 const intptr_t kNumTemps = 0; |
3543 LocationSummary* summary = | 3584 LocationSummary* summary = |
3544 new LocationSummary(kNumInputs, | 3585 new (isolate) LocationSummary(isolate, kNumInputs, |
3545 kNumTemps, | 3586 kNumTemps, |
3546 LocationSummary::kCallOnSlowPath); | 3587 LocationSummary::kCallOnSlowPath); |
3547 summary->set_in(0, Location::RequiresFpuRegister()); | 3588 summary->set_in(0, Location::RequiresFpuRegister()); |
3548 summary->set_out(0, Location::RequiresRegister()); | 3589 summary->set_out(0, Location::RequiresRegister()); |
3549 return summary; | 3590 return summary; |
3550 } | 3591 } |
3551 | 3592 |
3552 | 3593 |
3553 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3594 void BoxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3554 BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); | 3595 BoxFloat64x2SlowPath* slow_path = new BoxFloat64x2SlowPath(this); |
3555 compiler->AddSlowPathCode(slow_path); | 3596 compiler->AddSlowPathCode(slow_path); |
3556 | 3597 |
3557 Register out_reg = locs()->out(0).reg(); | 3598 Register out_reg = locs()->out(0).reg(); |
3558 XmmRegister value = locs()->in(0).fpu_reg(); | 3599 XmmRegister value = locs()->in(0).fpu_reg(); |
3559 | 3600 |
3560 __ TryAllocate(compiler->float64x2_class(), | 3601 __ TryAllocate(compiler->float64x2_class(), |
3561 slow_path->entry_label(), | 3602 slow_path->entry_label(), |
3562 Assembler::kFarJump, | 3603 Assembler::kFarJump, |
3563 out_reg, | 3604 out_reg, |
3564 kNoRegister); | 3605 kNoRegister); |
3565 __ Bind(slow_path->exit_label()); | 3606 __ Bind(slow_path->exit_label()); |
3566 __ movups(FieldAddress(out_reg, Float64x2::value_offset()), value); | 3607 __ movups(FieldAddress(out_reg, Float64x2::value_offset()), value); |
3567 } | 3608 } |
3568 | 3609 |
3569 | 3610 |
3570 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(bool opt) const { | 3611 LocationSummary* UnboxFloat64x2Instr::MakeLocationSummary(Isolate* isolate, |
3612 bool opt) const { | |
3571 const intptr_t value_cid = value()->Type()->ToCid(); | 3613 const intptr_t value_cid = value()->Type()->ToCid(); |
3572 const intptr_t kNumInputs = 1; | 3614 const intptr_t kNumInputs = 1; |
3573 const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; | 3615 const intptr_t kNumTemps = value_cid == kFloat64x2Cid ? 0 : 1; |
3574 LocationSummary* summary = | 3616 LocationSummary* summary = |
3575 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3617 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3576 summary->set_in(0, Location::RequiresRegister()); | 3618 summary->set_in(0, Location::RequiresRegister()); |
3577 if (kNumTemps > 0) { | 3619 if (kNumTemps > 0) { |
3578 ASSERT(kNumTemps == 1); | 3620 ASSERT(kNumTemps == 1); |
3579 summary->set_temp(0, Location::RequiresRegister()); | 3621 summary->set_temp(0, Location::RequiresRegister()); |
3580 } | 3622 } |
3581 summary->set_out(0, Location::RequiresFpuRegister()); | 3623 summary->set_out(0, Location::RequiresFpuRegister()); |
3582 return summary; | 3624 return summary; |
3583 } | 3625 } |
3584 | 3626 |
3585 | 3627 |
3586 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3628 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3587 const intptr_t value_cid = value()->Type()->ToCid(); | 3629 const intptr_t value_cid = value()->Type()->ToCid(); |
3588 const Register value = locs()->in(0).reg(); | 3630 const Register value = locs()->in(0).reg(); |
3589 const XmmRegister result = locs()->out(0).fpu_reg(); | 3631 const XmmRegister result = locs()->out(0).fpu_reg(); |
3590 | 3632 |
3591 if (value_cid != kFloat64x2Cid) { | 3633 if (value_cid != kFloat64x2Cid) { |
3592 const Register temp = locs()->temp(0).reg(); | 3634 const Register temp = locs()->temp(0).reg(); |
3593 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); | 3635 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); |
3594 __ testl(value, Immediate(kSmiTagMask)); | 3636 __ testl(value, Immediate(kSmiTagMask)); |
3595 __ j(ZERO, deopt); | 3637 __ j(ZERO, deopt); |
3596 __ CompareClassId(value, kFloat64x2Cid, temp); | 3638 __ CompareClassId(value, kFloat64x2Cid, temp); |
3597 __ j(NOT_EQUAL, deopt); | 3639 __ j(NOT_EQUAL, deopt); |
3598 } | 3640 } |
3599 __ movups(result, FieldAddress(value, Float64x2::value_offset())); | 3641 __ movups(result, FieldAddress(value, Float64x2::value_offset())); |
3600 } | 3642 } |
3601 | 3643 |
3602 | 3644 |
3603 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3645 LocationSummary* BoxInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
3646 bool opt) const { | |
3604 const intptr_t kNumInputs = 1; | 3647 const intptr_t kNumInputs = 1; |
3605 const intptr_t kNumTemps = 0; | 3648 const intptr_t kNumTemps = 0; |
3606 LocationSummary* summary = | 3649 LocationSummary* summary = |
3607 new LocationSummary(kNumInputs, | 3650 new (isolate) LocationSummary(isolate, kNumInputs, |
3608 kNumTemps, | 3651 kNumTemps, |
3609 LocationSummary::kCallOnSlowPath); | 3652 LocationSummary::kCallOnSlowPath); |
3610 summary->set_in(0, Location::RequiresFpuRegister()); | 3653 summary->set_in(0, Location::RequiresFpuRegister()); |
3611 summary->set_out(0, Location::RequiresRegister()); | 3654 summary->set_out(0, Location::RequiresRegister()); |
3612 return summary; | 3655 return summary; |
3613 } | 3656 } |
3614 | 3657 |
3615 | 3658 |
3616 class BoxInt32x4SlowPath : public SlowPathCode { | 3659 class BoxInt32x4SlowPath : public SlowPathCode { |
3617 public: | 3660 public: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3655 __ TryAllocate(compiler->int32x4_class(), | 3698 __ TryAllocate(compiler->int32x4_class(), |
3656 slow_path->entry_label(), | 3699 slow_path->entry_label(), |
3657 Assembler::kFarJump, | 3700 Assembler::kFarJump, |
3658 out_reg, | 3701 out_reg, |
3659 kNoRegister); | 3702 kNoRegister); |
3660 __ Bind(slow_path->exit_label()); | 3703 __ Bind(slow_path->exit_label()); |
3661 __ movups(FieldAddress(out_reg, Int32x4::value_offset()), value); | 3704 __ movups(FieldAddress(out_reg, Int32x4::value_offset()), value); |
3662 } | 3705 } |
3663 | 3706 |
3664 | 3707 |
3665 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(bool opt) const { | 3708 LocationSummary* UnboxInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
3709 bool opt) const { | |
3666 const intptr_t value_cid = value()->Type()->ToCid(); | 3710 const intptr_t value_cid = value()->Type()->ToCid(); |
3667 const intptr_t kNumInputs = 1; | 3711 const intptr_t kNumInputs = 1; |
3668 const intptr_t kNumTemps = value_cid == kInt32x4Cid ? 0 : 1; | 3712 const intptr_t kNumTemps = value_cid == kInt32x4Cid ? 0 : 1; |
3669 LocationSummary* summary = | 3713 LocationSummary* summary = |
3670 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3714 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3671 summary->set_in(0, Location::RequiresRegister()); | 3715 summary->set_in(0, Location::RequiresRegister()); |
3672 if (kNumTemps > 0) { | 3716 if (kNumTemps > 0) { |
3673 ASSERT(kNumTemps == 1); | 3717 ASSERT(kNumTemps == 1); |
3674 summary->set_temp(0, Location::RequiresRegister()); | 3718 summary->set_temp(0, Location::RequiresRegister()); |
3675 } | 3719 } |
3676 summary->set_out(0, Location::RequiresFpuRegister()); | 3720 summary->set_out(0, Location::RequiresFpuRegister()); |
3677 return summary; | 3721 return summary; |
3678 } | 3722 } |
3679 | 3723 |
3680 | 3724 |
3681 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3725 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3682 const intptr_t value_cid = value()->Type()->ToCid(); | 3726 const intptr_t value_cid = value()->Type()->ToCid(); |
3683 const Register value = locs()->in(0).reg(); | 3727 const Register value = locs()->in(0).reg(); |
3684 const XmmRegister result = locs()->out(0).fpu_reg(); | 3728 const XmmRegister result = locs()->out(0).fpu_reg(); |
3685 | 3729 |
3686 if (value_cid != kInt32x4Cid) { | 3730 if (value_cid != kInt32x4Cid) { |
3687 const Register temp = locs()->temp(0).reg(); | 3731 const Register temp = locs()->temp(0).reg(); |
3688 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); | 3732 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); |
3689 __ testl(value, Immediate(kSmiTagMask)); | 3733 __ testl(value, Immediate(kSmiTagMask)); |
3690 __ j(ZERO, deopt); | 3734 __ j(ZERO, deopt); |
3691 __ CompareClassId(value, kInt32x4Cid, temp); | 3735 __ CompareClassId(value, kInt32x4Cid, temp); |
3692 __ j(NOT_EQUAL, deopt); | 3736 __ j(NOT_EQUAL, deopt); |
3693 } | 3737 } |
3694 __ movups(result, FieldAddress(value, Int32x4::value_offset())); | 3738 __ movups(result, FieldAddress(value, Int32x4::value_offset())); |
3695 } | 3739 } |
3696 | 3740 |
3697 | 3741 |
3698 | 3742 |
3699 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 3743 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, |
3744 bool opt) const { | |
3700 const intptr_t kNumInputs = 2; | 3745 const intptr_t kNumInputs = 2; |
3701 const intptr_t kNumTemps = 0; | 3746 const intptr_t kNumTemps = 0; |
3702 LocationSummary* summary = | 3747 LocationSummary* summary = |
3703 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3748 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3704 summary->set_in(0, Location::RequiresFpuRegister()); | 3749 summary->set_in(0, Location::RequiresFpuRegister()); |
3705 summary->set_in(1, Location::RequiresFpuRegister()); | 3750 summary->set_in(1, Location::RequiresFpuRegister()); |
3706 summary->set_out(0, Location::SameAsFirstInput()); | 3751 summary->set_out(0, Location::SameAsFirstInput()); |
3707 return summary; | 3752 return summary; |
3708 } | 3753 } |
3709 | 3754 |
3710 | 3755 |
3711 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3756 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3712 XmmRegister left = locs()->in(0).fpu_reg(); | 3757 XmmRegister left = locs()->in(0).fpu_reg(); |
3713 XmmRegister right = locs()->in(1).fpu_reg(); | 3758 XmmRegister right = locs()->in(1).fpu_reg(); |
3714 | 3759 |
3715 ASSERT(locs()->out(0).fpu_reg() == left); | 3760 ASSERT(locs()->out(0).fpu_reg() == left); |
3716 | 3761 |
3717 switch (op_kind()) { | 3762 switch (op_kind()) { |
3718 case Token::kADD: __ addsd(left, right); break; | 3763 case Token::kADD: __ addsd(left, right); break; |
3719 case Token::kSUB: __ subsd(left, right); break; | 3764 case Token::kSUB: __ subsd(left, right); break; |
3720 case Token::kMUL: __ mulsd(left, right); break; | 3765 case Token::kMUL: __ mulsd(left, right); break; |
3721 case Token::kDIV: __ divsd(left, right); break; | 3766 case Token::kDIV: __ divsd(left, right); break; |
3722 default: UNREACHABLE(); | 3767 default: UNREACHABLE(); |
3723 } | 3768 } |
3724 } | 3769 } |
3725 | 3770 |
3726 | 3771 |
3727 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(bool opt) const { | 3772 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate, |
3773 bool opt) const { | |
3728 const intptr_t kNumInputs = 2; | 3774 const intptr_t kNumInputs = 2; |
3729 const intptr_t kNumTemps = 0; | 3775 const intptr_t kNumTemps = 0; |
3730 LocationSummary* summary = | 3776 LocationSummary* summary = |
3731 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3777 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3732 summary->set_in(0, Location::RequiresFpuRegister()); | 3778 summary->set_in(0, Location::RequiresFpuRegister()); |
3733 summary->set_in(1, Location::RequiresFpuRegister()); | 3779 summary->set_in(1, Location::RequiresFpuRegister()); |
3734 summary->set_out(0, Location::SameAsFirstInput()); | 3780 summary->set_out(0, Location::SameAsFirstInput()); |
3735 return summary; | 3781 return summary; |
3736 } | 3782 } |
3737 | 3783 |
3738 | 3784 |
3739 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3785 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3740 XmmRegister left = locs()->in(0).fpu_reg(); | 3786 XmmRegister left = locs()->in(0).fpu_reg(); |
3741 XmmRegister right = locs()->in(1).fpu_reg(); | 3787 XmmRegister right = locs()->in(1).fpu_reg(); |
3742 | 3788 |
3743 ASSERT(locs()->out(0).fpu_reg() == left); | 3789 ASSERT(locs()->out(0).fpu_reg() == left); |
3744 | 3790 |
3745 switch (op_kind()) { | 3791 switch (op_kind()) { |
3746 case Token::kADD: __ addps(left, right); break; | 3792 case Token::kADD: __ addps(left, right); break; |
3747 case Token::kSUB: __ subps(left, right); break; | 3793 case Token::kSUB: __ subps(left, right); break; |
3748 case Token::kMUL: __ mulps(left, right); break; | 3794 case Token::kMUL: __ mulps(left, right); break; |
3749 case Token::kDIV: __ divps(left, right); break; | 3795 case Token::kDIV: __ divps(left, right); break; |
3750 default: UNREACHABLE(); | 3796 default: UNREACHABLE(); |
3751 } | 3797 } |
3752 } | 3798 } |
3753 | 3799 |
3754 | 3800 |
3755 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(bool opt) const { | 3801 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate, |
3802 bool opt) const { | |
3756 const intptr_t kNumInputs = 2; | 3803 const intptr_t kNumInputs = 2; |
3757 const intptr_t kNumTemps = 0; | 3804 const intptr_t kNumTemps = 0; |
3758 LocationSummary* summary = | 3805 LocationSummary* summary = |
3759 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3806 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3760 summary->set_in(0, Location::RequiresFpuRegister()); | 3807 summary->set_in(0, Location::RequiresFpuRegister()); |
3761 summary->set_in(1, Location::RequiresFpuRegister()); | 3808 summary->set_in(1, Location::RequiresFpuRegister()); |
3762 summary->set_out(0, Location::SameAsFirstInput()); | 3809 summary->set_out(0, Location::SameAsFirstInput()); |
3763 return summary; | 3810 return summary; |
3764 } | 3811 } |
3765 | 3812 |
3766 | 3813 |
3767 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3814 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3768 XmmRegister left = locs()->in(0).fpu_reg(); | 3815 XmmRegister left = locs()->in(0).fpu_reg(); |
3769 XmmRegister right = locs()->in(1).fpu_reg(); | 3816 XmmRegister right = locs()->in(1).fpu_reg(); |
3770 | 3817 |
3771 ASSERT(locs()->out(0).fpu_reg() == left); | 3818 ASSERT(locs()->out(0).fpu_reg() == left); |
3772 | 3819 |
3773 switch (op_kind()) { | 3820 switch (op_kind()) { |
3774 case Token::kADD: __ addpd(left, right); break; | 3821 case Token::kADD: __ addpd(left, right); break; |
3775 case Token::kSUB: __ subpd(left, right); break; | 3822 case Token::kSUB: __ subpd(left, right); break; |
3776 case Token::kMUL: __ mulpd(left, right); break; | 3823 case Token::kMUL: __ mulpd(left, right); break; |
3777 case Token::kDIV: __ divpd(left, right); break; | 3824 case Token::kDIV: __ divpd(left, right); break; |
3778 default: UNREACHABLE(); | 3825 default: UNREACHABLE(); |
3779 } | 3826 } |
3780 } | 3827 } |
3781 | 3828 |
3782 | 3829 |
3783 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(bool opt) const { | 3830 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate, |
3831 bool opt) const { | |
3784 const intptr_t kNumInputs = 1; | 3832 const intptr_t kNumInputs = 1; |
3785 const intptr_t kNumTemps = 0; | 3833 const intptr_t kNumTemps = 0; |
3786 LocationSummary* summary = | 3834 LocationSummary* summary = |
3787 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3835 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3788 summary->set_in(0, Location::RequiresFpuRegister()); | 3836 summary->set_in(0, Location::RequiresFpuRegister()); |
3789 summary->set_out(0, Location::SameAsFirstInput()); | 3837 summary->set_out(0, Location::SameAsFirstInput()); |
3790 return summary; | 3838 return summary; |
3791 } | 3839 } |
3792 | 3840 |
3793 | 3841 |
3794 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3842 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3795 XmmRegister value = locs()->in(0).fpu_reg(); | 3843 XmmRegister value = locs()->in(0).fpu_reg(); |
3796 | 3844 |
3797 ASSERT(locs()->out(0).fpu_reg() == value); | 3845 ASSERT(locs()->out(0).fpu_reg() == value); |
(...skipping 17 matching lines...) Expand all Loading... | |
3815 break; | 3863 break; |
3816 case MethodRecognizer::kFloat32x4Shuffle: | 3864 case MethodRecognizer::kFloat32x4Shuffle: |
3817 case MethodRecognizer::kInt32x4Shuffle: | 3865 case MethodRecognizer::kInt32x4Shuffle: |
3818 __ shufps(value, value, Immediate(mask_)); | 3866 __ shufps(value, value, Immediate(mask_)); |
3819 break; | 3867 break; |
3820 default: UNREACHABLE(); | 3868 default: UNREACHABLE(); |
3821 } | 3869 } |
3822 } | 3870 } |
3823 | 3871 |
3824 | 3872 |
3825 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(bool opt) const { | 3873 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate, |
3874 bool opt) const { | |
3826 const intptr_t kNumInputs = 2; | 3875 const intptr_t kNumInputs = 2; |
3827 const intptr_t kNumTemps = 0; | 3876 const intptr_t kNumTemps = 0; |
3828 LocationSummary* summary = | 3877 LocationSummary* summary = |
3829 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3878 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3830 summary->set_in(0, Location::RequiresFpuRegister()); | 3879 summary->set_in(0, Location::RequiresFpuRegister()); |
3831 summary->set_in(1, Location::RequiresFpuRegister()); | 3880 summary->set_in(1, Location::RequiresFpuRegister()); |
3832 summary->set_out(0, Location::SameAsFirstInput()); | 3881 summary->set_out(0, Location::SameAsFirstInput()); |
3833 return summary; | 3882 return summary; |
3834 } | 3883 } |
3835 | 3884 |
3836 | 3885 |
3837 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3886 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3838 XmmRegister left = locs()->in(0).fpu_reg(); | 3887 XmmRegister left = locs()->in(0).fpu_reg(); |
3839 XmmRegister right = locs()->in(1).fpu_reg(); | 3888 XmmRegister right = locs()->in(1).fpu_reg(); |
3840 | 3889 |
3841 ASSERT(locs()->out(0).fpu_reg() == left); | 3890 ASSERT(locs()->out(0).fpu_reg() == left); |
3842 switch (op_kind()) { | 3891 switch (op_kind()) { |
3843 case MethodRecognizer::kFloat32x4ShuffleMix: | 3892 case MethodRecognizer::kFloat32x4ShuffleMix: |
3844 case MethodRecognizer::kInt32x4ShuffleMix: | 3893 case MethodRecognizer::kInt32x4ShuffleMix: |
3845 __ shufps(left, right, Immediate(mask_)); | 3894 __ shufps(left, right, Immediate(mask_)); |
3846 break; | 3895 break; |
3847 default: UNREACHABLE(); | 3896 default: UNREACHABLE(); |
3848 } | 3897 } |
3849 } | 3898 } |
3850 | 3899 |
3851 | 3900 |
3852 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(bool opt) const { | 3901 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate, |
3902 bool opt) const { | |
3853 const intptr_t kNumInputs = 1; | 3903 const intptr_t kNumInputs = 1; |
3854 const intptr_t kNumTemps = 0; | 3904 const intptr_t kNumTemps = 0; |
3855 LocationSummary* summary = | 3905 LocationSummary* summary = |
3856 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3906 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3857 summary->set_in(0, Location::RequiresFpuRegister()); | 3907 summary->set_in(0, Location::RequiresFpuRegister()); |
3858 summary->set_out(0, Location::RequiresRegister()); | 3908 summary->set_out(0, Location::RequiresRegister()); |
3859 return summary; | 3909 return summary; |
3860 } | 3910 } |
3861 | 3911 |
3862 | 3912 |
3863 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3913 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3864 XmmRegister value = locs()->in(0).fpu_reg(); | 3914 XmmRegister value = locs()->in(0).fpu_reg(); |
3865 Register out = locs()->out(0).reg(); | 3915 Register out = locs()->out(0).reg(); |
3866 | 3916 |
3867 __ movmskps(out, value); | 3917 __ movmskps(out, value); |
3868 __ SmiTag(out); | 3918 __ SmiTag(out); |
3869 } | 3919 } |
3870 | 3920 |
3871 | 3921 |
3872 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( | 3922 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( |
3873 bool opt) const { | 3923 Isolate* isolate, bool opt) const { |
3874 const intptr_t kNumInputs = 4; | 3924 const intptr_t kNumInputs = 4; |
3875 const intptr_t kNumTemps = 0; | 3925 const intptr_t kNumTemps = 0; |
3876 LocationSummary* summary = | 3926 LocationSummary* summary = |
3877 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3927 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3878 summary->set_in(0, Location::RequiresFpuRegister()); | 3928 summary->set_in(0, Location::RequiresFpuRegister()); |
3879 summary->set_in(1, Location::RequiresFpuRegister()); | 3929 summary->set_in(1, Location::RequiresFpuRegister()); |
3880 summary->set_in(2, Location::RequiresFpuRegister()); | 3930 summary->set_in(2, Location::RequiresFpuRegister()); |
3881 summary->set_in(3, Location::RequiresFpuRegister()); | 3931 summary->set_in(3, Location::RequiresFpuRegister()); |
3882 summary->set_out(0, Location::SameAsFirstInput()); | 3932 summary->set_out(0, Location::SameAsFirstInput()); |
3883 return summary; | 3933 return summary; |
3884 } | 3934 } |
3885 | 3935 |
3886 | 3936 |
3887 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3937 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 12 matching lines...) Expand all Loading... | |
3900 __ cvtsd2ss(v0, v0); | 3950 __ cvtsd2ss(v0, v0); |
3901 __ movss(Address(ESP, 8), v0); | 3951 __ movss(Address(ESP, 8), v0); |
3902 __ movsd(v0, v3); | 3952 __ movsd(v0, v3); |
3903 __ cvtsd2ss(v0, v0); | 3953 __ cvtsd2ss(v0, v0); |
3904 __ movss(Address(ESP, 12), v0); | 3954 __ movss(Address(ESP, 12), v0); |
3905 __ movups(v0, Address(ESP, 0)); | 3955 __ movups(v0, Address(ESP, 0)); |
3906 __ addl(ESP, Immediate(16)); | 3956 __ addl(ESP, Immediate(16)); |
3907 } | 3957 } |
3908 | 3958 |
3909 | 3959 |
3910 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(bool opt) const { | 3960 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate, |
3961 bool opt) const { | |
3911 const intptr_t kNumInputs = 0; | 3962 const intptr_t kNumInputs = 0; |
3912 const intptr_t kNumTemps = 0; | 3963 const intptr_t kNumTemps = 0; |
3913 LocationSummary* summary = | 3964 LocationSummary* summary = |
3914 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3965 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3915 summary->set_out(0, Location::RequiresFpuRegister()); | 3966 summary->set_out(0, Location::RequiresFpuRegister()); |
3916 return summary; | 3967 return summary; |
3917 } | 3968 } |
3918 | 3969 |
3919 | 3970 |
3920 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3971 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3921 XmmRegister value = locs()->out(0).fpu_reg(); | 3972 XmmRegister value = locs()->out(0).fpu_reg(); |
3922 __ xorps(value, value); | 3973 __ xorps(value, value); |
3923 } | 3974 } |
3924 | 3975 |
3925 | 3976 |
3926 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(bool opt) const { | 3977 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate, |
3978 bool opt) const { | |
3927 const intptr_t kNumInputs = 1; | 3979 const intptr_t kNumInputs = 1; |
3928 const intptr_t kNumTemps = 0; | 3980 const intptr_t kNumTemps = 0; |
3929 LocationSummary* summary = | 3981 LocationSummary* summary = |
3930 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3982 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3931 summary->set_in(0, Location::RequiresFpuRegister()); | 3983 summary->set_in(0, Location::RequiresFpuRegister()); |
3932 summary->set_out(0, Location::SameAsFirstInput()); | 3984 summary->set_out(0, Location::SameAsFirstInput()); |
3933 return summary; | 3985 return summary; |
3934 } | 3986 } |
3935 | 3987 |
3936 | 3988 |
3937 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3989 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3938 XmmRegister value = locs()->out(0).fpu_reg(); | 3990 XmmRegister value = locs()->out(0).fpu_reg(); |
3939 ASSERT(locs()->in(0).fpu_reg() == locs()->out(0).fpu_reg()); | 3991 ASSERT(locs()->in(0).fpu_reg() == locs()->out(0).fpu_reg()); |
3940 // Convert to Float32. | 3992 // Convert to Float32. |
3941 __ cvtsd2ss(value, value); | 3993 __ cvtsd2ss(value, value); |
3942 // Splat across all lanes. | 3994 // Splat across all lanes. |
3943 __ shufps(value, value, Immediate(0x00)); | 3995 __ shufps(value, value, Immediate(0x00)); |
3944 } | 3996 } |
3945 | 3997 |
3946 | 3998 |
3947 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(bool opt) const { | 3999 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate, |
4000 bool opt) const { | |
3948 const intptr_t kNumInputs = 2; | 4001 const intptr_t kNumInputs = 2; |
3949 const intptr_t kNumTemps = 0; | 4002 const intptr_t kNumTemps = 0; |
3950 LocationSummary* summary = | 4003 LocationSummary* summary = |
3951 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4004 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3952 summary->set_in(0, Location::RequiresFpuRegister()); | 4005 summary->set_in(0, Location::RequiresFpuRegister()); |
3953 summary->set_in(1, Location::RequiresFpuRegister()); | 4006 summary->set_in(1, Location::RequiresFpuRegister()); |
3954 summary->set_out(0, Location::SameAsFirstInput()); | 4007 summary->set_out(0, Location::SameAsFirstInput()); |
3955 return summary; | 4008 return summary; |
3956 } | 4009 } |
3957 | 4010 |
3958 | 4011 |
3959 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4012 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3960 XmmRegister left = locs()->in(0).fpu_reg(); | 4013 XmmRegister left = locs()->in(0).fpu_reg(); |
3961 XmmRegister right = locs()->in(1).fpu_reg(); | 4014 XmmRegister right = locs()->in(1).fpu_reg(); |
(...skipping 18 matching lines...) Expand all Loading... | |
3980 break; | 4033 break; |
3981 case MethodRecognizer::kFloat32x4LessThanOrEqual: | 4034 case MethodRecognizer::kFloat32x4LessThanOrEqual: |
3982 __ cmppsle(left, right); | 4035 __ cmppsle(left, right); |
3983 break; | 4036 break; |
3984 | 4037 |
3985 default: UNREACHABLE(); | 4038 default: UNREACHABLE(); |
3986 } | 4039 } |
3987 } | 4040 } |
3988 | 4041 |
3989 | 4042 |
3990 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(bool opt) const { | 4043 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Isolate* isolate, |
4044 bool opt) const { | |
3991 const intptr_t kNumInputs = 2; | 4045 const intptr_t kNumInputs = 2; |
3992 const intptr_t kNumTemps = 0; | 4046 const intptr_t kNumTemps = 0; |
3993 LocationSummary* summary = | 4047 LocationSummary* summary = |
3994 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4048 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
3995 summary->set_in(0, Location::RequiresFpuRegister()); | 4049 summary->set_in(0, Location::RequiresFpuRegister()); |
3996 summary->set_in(1, Location::RequiresFpuRegister()); | 4050 summary->set_in(1, Location::RequiresFpuRegister()); |
3997 summary->set_out(0, Location::SameAsFirstInput()); | 4051 summary->set_out(0, Location::SameAsFirstInput()); |
3998 return summary; | 4052 return summary; |
3999 } | 4053 } |
4000 | 4054 |
4001 | 4055 |
4002 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4056 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4003 XmmRegister left = locs()->in(0).fpu_reg(); | 4057 XmmRegister left = locs()->in(0).fpu_reg(); |
4004 XmmRegister right = locs()->in(1).fpu_reg(); | 4058 XmmRegister right = locs()->in(1).fpu_reg(); |
4005 | 4059 |
4006 ASSERT(locs()->out(0).fpu_reg() == left); | 4060 ASSERT(locs()->out(0).fpu_reg() == left); |
4007 | 4061 |
4008 switch (op_kind()) { | 4062 switch (op_kind()) { |
4009 case MethodRecognizer::kFloat32x4Min: | 4063 case MethodRecognizer::kFloat32x4Min: |
4010 __ minps(left, right); | 4064 __ minps(left, right); |
4011 break; | 4065 break; |
4012 case MethodRecognizer::kFloat32x4Max: | 4066 case MethodRecognizer::kFloat32x4Max: |
4013 __ maxps(left, right); | 4067 __ maxps(left, right); |
4014 break; | 4068 break; |
4015 default: UNREACHABLE(); | 4069 default: UNREACHABLE(); |
4016 } | 4070 } |
4017 } | 4071 } |
4018 | 4072 |
4019 | 4073 |
4020 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(bool opt) const { | 4074 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate, |
4075 bool opt) const { | |
4021 const intptr_t kNumInputs = 2; | 4076 const intptr_t kNumInputs = 2; |
4022 const intptr_t kNumTemps = 0; | 4077 const intptr_t kNumTemps = 0; |
4023 LocationSummary* summary = | 4078 LocationSummary* summary = |
4024 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4079 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4025 summary->set_in(0, Location::RequiresFpuRegister()); | 4080 summary->set_in(0, Location::RequiresFpuRegister()); |
4026 summary->set_in(1, Location::RequiresFpuRegister()); | 4081 summary->set_in(1, Location::RequiresFpuRegister()); |
4027 summary->set_out(0, Location::SameAsFirstInput()); | 4082 summary->set_out(0, Location::SameAsFirstInput()); |
4028 return summary; | 4083 return summary; |
4029 } | 4084 } |
4030 | 4085 |
4031 | 4086 |
4032 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4087 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4033 XmmRegister left = locs()->in(0).fpu_reg(); | 4088 XmmRegister left = locs()->in(0).fpu_reg(); |
4034 XmmRegister right = locs()->in(1).fpu_reg(); | 4089 XmmRegister right = locs()->in(1).fpu_reg(); |
4035 | 4090 |
4036 ASSERT(locs()->out(0).fpu_reg() == left); | 4091 ASSERT(locs()->out(0).fpu_reg() == left); |
4037 | 4092 |
4038 switch (op_kind()) { | 4093 switch (op_kind()) { |
4039 case MethodRecognizer::kFloat32x4Scale: | 4094 case MethodRecognizer::kFloat32x4Scale: |
4040 __ cvtsd2ss(left, left); | 4095 __ cvtsd2ss(left, left); |
4041 __ shufps(left, left, Immediate(0x00)); | 4096 __ shufps(left, left, Immediate(0x00)); |
4042 __ mulps(left, right); | 4097 __ mulps(left, right); |
4043 break; | 4098 break; |
4044 default: UNREACHABLE(); | 4099 default: UNREACHABLE(); |
4045 } | 4100 } |
4046 } | 4101 } |
4047 | 4102 |
4048 | 4103 |
4049 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(bool opt) const { | 4104 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate, |
4105 bool opt) const { | |
4050 const intptr_t kNumInputs = 1; | 4106 const intptr_t kNumInputs = 1; |
4051 const intptr_t kNumTemps = 0; | 4107 const intptr_t kNumTemps = 0; |
4052 LocationSummary* summary = | 4108 LocationSummary* summary = |
4053 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4109 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4054 summary->set_in(0, Location::RequiresFpuRegister()); | 4110 summary->set_in(0, Location::RequiresFpuRegister()); |
4055 summary->set_out(0, Location::SameAsFirstInput()); | 4111 summary->set_out(0, Location::SameAsFirstInput()); |
4056 return summary; | 4112 return summary; |
4057 } | 4113 } |
4058 | 4114 |
4059 | 4115 |
4060 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4116 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4061 XmmRegister left = locs()->in(0).fpu_reg(); | 4117 XmmRegister left = locs()->in(0).fpu_reg(); |
4062 | 4118 |
4063 ASSERT(locs()->out(0).fpu_reg() == left); | 4119 ASSERT(locs()->out(0).fpu_reg() == left); |
4064 | 4120 |
4065 switch (op_kind()) { | 4121 switch (op_kind()) { |
4066 case MethodRecognizer::kFloat32x4Sqrt: | 4122 case MethodRecognizer::kFloat32x4Sqrt: |
4067 __ sqrtps(left); | 4123 __ sqrtps(left); |
4068 break; | 4124 break; |
4069 case MethodRecognizer::kFloat32x4Reciprocal: | 4125 case MethodRecognizer::kFloat32x4Reciprocal: |
4070 __ reciprocalps(left); | 4126 __ reciprocalps(left); |
4071 break; | 4127 break; |
4072 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | 4128 case MethodRecognizer::kFloat32x4ReciprocalSqrt: |
4073 __ rsqrtps(left); | 4129 __ rsqrtps(left); |
4074 break; | 4130 break; |
4075 default: UNREACHABLE(); | 4131 default: UNREACHABLE(); |
4076 } | 4132 } |
4077 } | 4133 } |
4078 | 4134 |
4079 | 4135 |
4080 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(bool opt) const { | 4136 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate, |
4137 bool opt) const { | |
4081 const intptr_t kNumInputs = 1; | 4138 const intptr_t kNumInputs = 1; |
4082 const intptr_t kNumTemps = 0; | 4139 const intptr_t kNumTemps = 0; |
4083 LocationSummary* summary = | 4140 LocationSummary* summary = |
4084 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4141 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4085 summary->set_in(0, Location::RequiresFpuRegister()); | 4142 summary->set_in(0, Location::RequiresFpuRegister()); |
4086 summary->set_out(0, Location::SameAsFirstInput()); | 4143 summary->set_out(0, Location::SameAsFirstInput()); |
4087 return summary; | 4144 return summary; |
4088 } | 4145 } |
4089 | 4146 |
4090 | 4147 |
4091 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4148 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4092 XmmRegister left = locs()->in(0).fpu_reg(); | 4149 XmmRegister left = locs()->in(0).fpu_reg(); |
4093 | 4150 |
4094 ASSERT(locs()->out(0).fpu_reg() == left); | 4151 ASSERT(locs()->out(0).fpu_reg() == left); |
4095 switch (op_kind()) { | 4152 switch (op_kind()) { |
4096 case MethodRecognizer::kFloat32x4Negate: | 4153 case MethodRecognizer::kFloat32x4Negate: |
4097 __ negateps(left); | 4154 __ negateps(left); |
4098 break; | 4155 break; |
4099 case MethodRecognizer::kFloat32x4Absolute: | 4156 case MethodRecognizer::kFloat32x4Absolute: |
4100 __ absps(left); | 4157 __ absps(left); |
4101 break; | 4158 break; |
4102 default: UNREACHABLE(); | 4159 default: UNREACHABLE(); |
4103 } | 4160 } |
4104 } | 4161 } |
4105 | 4162 |
4106 | 4163 |
4107 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(bool opt) const { | 4164 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate, |
4165 bool opt) const { | |
4108 const intptr_t kNumInputs = 3; | 4166 const intptr_t kNumInputs = 3; |
4109 const intptr_t kNumTemps = 0; | 4167 const intptr_t kNumTemps = 0; |
4110 LocationSummary* summary = | 4168 LocationSummary* summary = |
4111 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4169 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4112 summary->set_in(0, Location::RequiresFpuRegister()); | 4170 summary->set_in(0, Location::RequiresFpuRegister()); |
4113 summary->set_in(1, Location::RequiresFpuRegister()); | 4171 summary->set_in(1, Location::RequiresFpuRegister()); |
4114 summary->set_in(2, Location::RequiresFpuRegister()); | 4172 summary->set_in(2, Location::RequiresFpuRegister()); |
4115 summary->set_out(0, Location::SameAsFirstInput()); | 4173 summary->set_out(0, Location::SameAsFirstInput()); |
4116 return summary; | 4174 return summary; |
4117 } | 4175 } |
4118 | 4176 |
4119 | 4177 |
4120 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4178 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4121 XmmRegister left = locs()->in(0).fpu_reg(); | 4179 XmmRegister left = locs()->in(0).fpu_reg(); |
4122 XmmRegister lower = locs()->in(1).fpu_reg(); | 4180 XmmRegister lower = locs()->in(1).fpu_reg(); |
4123 XmmRegister upper = locs()->in(2).fpu_reg(); | 4181 XmmRegister upper = locs()->in(2).fpu_reg(); |
4124 ASSERT(locs()->out(0).fpu_reg() == left); | 4182 ASSERT(locs()->out(0).fpu_reg() == left); |
4125 __ minps(left, upper); | 4183 __ minps(left, upper); |
4126 __ maxps(left, lower); | 4184 __ maxps(left, lower); |
4127 } | 4185 } |
4128 | 4186 |
4129 | 4187 |
4130 LocationSummary* Float32x4WithInstr::MakeLocationSummary(bool opt) const { | 4188 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate, |
4189 bool opt) const { | |
4131 const intptr_t kNumInputs = 2; | 4190 const intptr_t kNumInputs = 2; |
4132 const intptr_t kNumTemps = 0; | 4191 const intptr_t kNumTemps = 0; |
4133 LocationSummary* summary = | 4192 LocationSummary* summary = |
4134 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4193 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4135 summary->set_in(0, Location::RequiresFpuRegister()); | 4194 summary->set_in(0, Location::RequiresFpuRegister()); |
4136 summary->set_in(1, Location::RequiresFpuRegister()); | 4195 summary->set_in(1, Location::RequiresFpuRegister()); |
4137 summary->set_out(0, Location::SameAsFirstInput()); | 4196 summary->set_out(0, Location::SameAsFirstInput()); |
4138 return summary; | 4197 return summary; |
4139 } | 4198 } |
4140 | 4199 |
4141 | 4200 |
4142 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4201 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4143 XmmRegister replacement = locs()->in(0).fpu_reg(); | 4202 XmmRegister replacement = locs()->in(0).fpu_reg(); |
4144 XmmRegister value = locs()->in(1).fpu_reg(); | 4203 XmmRegister value = locs()->in(1).fpu_reg(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4188 __ movss(Address(ESP, 12), replacement); | 4247 __ movss(Address(ESP, 12), replacement); |
4189 // Move updated value into output register. | 4248 // Move updated value into output register. |
4190 __ movups(replacement, Address(ESP, 0)); | 4249 __ movups(replacement, Address(ESP, 0)); |
4191 __ addl(ESP, Immediate(16)); | 4250 __ addl(ESP, Immediate(16)); |
4192 break; | 4251 break; |
4193 default: UNREACHABLE(); | 4252 default: UNREACHABLE(); |
4194 } | 4253 } |
4195 } | 4254 } |
4196 | 4255 |
4197 | 4256 |
4198 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(bool opt) const { | 4257 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate, |
4258 bool opt) const { | |
4199 const intptr_t kNumInputs = 1; | 4259 const intptr_t kNumInputs = 1; |
4200 const intptr_t kNumTemps = 0; | 4260 const intptr_t kNumTemps = 0; |
4201 LocationSummary* summary = | 4261 LocationSummary* summary = |
4202 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4262 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4203 summary->set_in(0, Location::RequiresFpuRegister()); | 4263 summary->set_in(0, Location::RequiresFpuRegister()); |
4204 summary->set_out(0, Location::SameAsFirstInput()); | 4264 summary->set_out(0, Location::SameAsFirstInput()); |
4205 return summary; | 4265 return summary; |
4206 } | 4266 } |
4207 | 4267 |
4208 | 4268 |
4209 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4269 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4210 // NOP. | 4270 // NOP. |
4211 } | 4271 } |
4212 | 4272 |
4213 | 4273 |
4214 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(bool opt) const { | 4274 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate, |
4275 bool opt) const { | |
4215 const intptr_t kNumInputs = 1; | 4276 const intptr_t kNumInputs = 1; |
4216 const intptr_t kNumTemps = 0; | 4277 const intptr_t kNumTemps = 0; |
4217 LocationSummary* summary = | 4278 LocationSummary* summary = |
4218 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4279 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4219 summary->set_in(0, Location::RequiresFpuRegister()); | 4280 summary->set_in(0, Location::RequiresFpuRegister()); |
4220 summary->set_out(0, Location::SameAsFirstInput()); | 4281 summary->set_out(0, Location::SameAsFirstInput()); |
4221 return summary; | 4282 return summary; |
4222 } | 4283 } |
4223 | 4284 |
4224 | 4285 |
4225 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4286 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4226 XmmRegister value = locs()->in(0).fpu_reg(); | 4287 XmmRegister value = locs()->in(0).fpu_reg(); |
4227 | 4288 |
4228 ASSERT(locs()->out(0).fpu_reg() == value); | 4289 ASSERT(locs()->out(0).fpu_reg() == value); |
4229 | 4290 |
4230 switch (op_kind()) { | 4291 switch (op_kind()) { |
4231 case MethodRecognizer::kFloat64x2GetX: | 4292 case MethodRecognizer::kFloat64x2GetX: |
4232 // nop. | 4293 // nop. |
4233 break; | 4294 break; |
4234 case MethodRecognizer::kFloat64x2GetY: | 4295 case MethodRecognizer::kFloat64x2GetY: |
4235 __ shufpd(value, value, Immediate(0x33)); | 4296 __ shufpd(value, value, Immediate(0x33)); |
4236 break; | 4297 break; |
4237 default: UNREACHABLE(); | 4298 default: UNREACHABLE(); |
4238 } | 4299 } |
4239 } | 4300 } |
4240 | 4301 |
4241 | 4302 |
4242 | 4303 |
4243 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(bool opt) const { | 4304 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate, |
4305 bool opt) const { | |
4244 const intptr_t kNumInputs = 0; | 4306 const intptr_t kNumInputs = 0; |
4245 const intptr_t kNumTemps = 0; | 4307 const intptr_t kNumTemps = 0; |
4246 LocationSummary* summary = | 4308 LocationSummary* summary = |
4247 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4309 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4248 summary->set_out(0, Location::RequiresFpuRegister()); | 4310 summary->set_out(0, Location::RequiresFpuRegister()); |
4249 return summary; | 4311 return summary; |
4250 } | 4312 } |
4251 | 4313 |
4252 | 4314 |
4253 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4315 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4254 XmmRegister value = locs()->out(0).fpu_reg(); | 4316 XmmRegister value = locs()->out(0).fpu_reg(); |
4255 __ xorpd(value, value); | 4317 __ xorpd(value, value); |
4256 } | 4318 } |
4257 | 4319 |
4258 | 4320 |
4259 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(bool opt) const { | 4321 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate, |
4322 bool opt) const { | |
4260 const intptr_t kNumInputs = 1; | 4323 const intptr_t kNumInputs = 1; |
4261 const intptr_t kNumTemps = 0; | 4324 const intptr_t kNumTemps = 0; |
4262 LocationSummary* summary = | 4325 LocationSummary* summary = |
4263 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4326 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4264 summary->set_in(0, Location::RequiresFpuRegister()); | 4327 summary->set_in(0, Location::RequiresFpuRegister()); |
4265 summary->set_out(0, Location::SameAsFirstInput()); | 4328 summary->set_out(0, Location::SameAsFirstInput()); |
4266 return summary; | 4329 return summary; |
4267 } | 4330 } |
4268 | 4331 |
4269 | 4332 |
4270 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4333 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4271 XmmRegister value = locs()->out(0).fpu_reg(); | 4334 XmmRegister value = locs()->out(0).fpu_reg(); |
4272 __ shufpd(value, value, Immediate(0x0)); | 4335 __ shufpd(value, value, Immediate(0x0)); |
4273 } | 4336 } |
4274 | 4337 |
4275 | 4338 |
4276 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( | 4339 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( |
4277 bool opt) const { | 4340 Isolate* isolate, bool opt) const { |
4278 const intptr_t kNumInputs = 2; | 4341 const intptr_t kNumInputs = 2; |
4279 const intptr_t kNumTemps = 0; | 4342 const intptr_t kNumTemps = 0; |
4280 LocationSummary* summary = | 4343 LocationSummary* summary = |
4281 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4344 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4282 summary->set_in(0, Location::RequiresFpuRegister()); | 4345 summary->set_in(0, Location::RequiresFpuRegister()); |
4283 summary->set_in(1, Location::RequiresFpuRegister()); | 4346 summary->set_in(1, Location::RequiresFpuRegister()); |
4284 summary->set_out(0, Location::SameAsFirstInput()); | 4347 summary->set_out(0, Location::SameAsFirstInput()); |
4285 return summary; | 4348 return summary; |
4286 } | 4349 } |
4287 | 4350 |
4288 | 4351 |
4289 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4352 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4290 XmmRegister v0 = locs()->in(0).fpu_reg(); | 4353 XmmRegister v0 = locs()->in(0).fpu_reg(); |
4291 XmmRegister v1 = locs()->in(1).fpu_reg(); | 4354 XmmRegister v1 = locs()->in(1).fpu_reg(); |
4292 ASSERT(v0 == locs()->out(0).fpu_reg()); | 4355 ASSERT(v0 == locs()->out(0).fpu_reg()); |
4293 __ subl(ESP, Immediate(16)); | 4356 __ subl(ESP, Immediate(16)); |
4294 __ movsd(Address(ESP, 0), v0); | 4357 __ movsd(Address(ESP, 0), v0); |
4295 __ movsd(Address(ESP, 8), v1); | 4358 __ movsd(Address(ESP, 8), v1); |
4296 __ movups(v0, Address(ESP, 0)); | 4359 __ movups(v0, Address(ESP, 0)); |
4297 __ addl(ESP, Immediate(16)); | 4360 __ addl(ESP, Immediate(16)); |
4298 } | 4361 } |
4299 | 4362 |
4300 | 4363 |
4301 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( | 4364 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( |
4302 bool opt) const { | 4365 Isolate* isolate, bool opt) const { |
4303 const intptr_t kNumInputs = 1; | 4366 const intptr_t kNumInputs = 1; |
4304 const intptr_t kNumTemps = 0; | 4367 const intptr_t kNumTemps = 0; |
4305 LocationSummary* summary = | 4368 LocationSummary* summary = |
4306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4369 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4307 summary->set_in(0, Location::RequiresFpuRegister()); | 4370 summary->set_in(0, Location::RequiresFpuRegister()); |
4308 summary->set_out(0, Location::SameAsFirstInput()); | 4371 summary->set_out(0, Location::SameAsFirstInput()); |
4309 return summary; | 4372 return summary; |
4310 } | 4373 } |
4311 | 4374 |
4312 | 4375 |
4313 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4376 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4314 XmmRegister value = locs()->out(0).fpu_reg(); | 4377 XmmRegister value = locs()->out(0).fpu_reg(); |
4315 __ cvtpd2ps(value, value); | 4378 __ cvtpd2ps(value, value); |
4316 } | 4379 } |
4317 | 4380 |
4318 | 4381 |
4319 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( | 4382 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( |
4320 bool opt) const { | 4383 Isolate* isolate, bool opt) const { |
4321 const intptr_t kNumInputs = 1; | 4384 const intptr_t kNumInputs = 1; |
4322 const intptr_t kNumTemps = 0; | 4385 const intptr_t kNumTemps = 0; |
4323 LocationSummary* summary = | 4386 LocationSummary* summary = |
4324 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4387 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4325 summary->set_in(0, Location::RequiresFpuRegister()); | 4388 summary->set_in(0, Location::RequiresFpuRegister()); |
4326 summary->set_out(0, Location::SameAsFirstInput()); | 4389 summary->set_out(0, Location::SameAsFirstInput()); |
4327 return summary; | 4390 return summary; |
4328 } | 4391 } |
4329 | 4392 |
4330 | 4393 |
4331 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4394 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4332 XmmRegister value = locs()->out(0).fpu_reg(); | 4395 XmmRegister value = locs()->out(0).fpu_reg(); |
4333 __ cvtps2pd(value, value); | 4396 __ cvtps2pd(value, value); |
4334 } | 4397 } |
4335 | 4398 |
4336 | 4399 |
4337 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(bool opt) const { | 4400 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate, |
4401 bool opt) const { | |
4338 const intptr_t kNumInputs = 1; | 4402 const intptr_t kNumInputs = 1; |
4339 const intptr_t kNumTemps = 0; | 4403 const intptr_t kNumTemps = 0; |
4340 LocationSummary* summary = | 4404 LocationSummary* summary = |
4341 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4405 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4342 summary->set_in(0, Location::RequiresFpuRegister()); | 4406 summary->set_in(0, Location::RequiresFpuRegister()); |
4343 if (representation() == kTagged) { | 4407 if (representation() == kTagged) { |
4344 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); | 4408 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); |
4345 summary->set_out(0, Location::RequiresRegister()); | 4409 summary->set_out(0, Location::RequiresRegister()); |
4346 } else { | 4410 } else { |
4347 ASSERT(representation() == kUnboxedFloat64x2); | 4411 ASSERT(representation() == kUnboxedFloat64x2); |
4348 summary->set_out(0, Location::SameAsFirstInput()); | 4412 summary->set_out(0, Location::SameAsFirstInput()); |
4349 } | 4413 } |
4350 return summary; | 4414 return summary; |
4351 } | 4415 } |
(...skipping 17 matching lines...) Expand all Loading... | |
4369 break; | 4433 break; |
4370 case MethodRecognizer::kFloat64x2GetSignMask: | 4434 case MethodRecognizer::kFloat64x2GetSignMask: |
4371 __ movmskpd(locs()->out(0).reg(), left); | 4435 __ movmskpd(locs()->out(0).reg(), left); |
4372 __ SmiTag(locs()->out(0).reg()); | 4436 __ SmiTag(locs()->out(0).reg()); |
4373 break; | 4437 break; |
4374 default: UNREACHABLE(); | 4438 default: UNREACHABLE(); |
4375 } | 4439 } |
4376 } | 4440 } |
4377 | 4441 |
4378 | 4442 |
4379 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(bool opt) const { | 4443 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate, |
4444 bool opt) const { | |
4380 const intptr_t kNumInputs = 2; | 4445 const intptr_t kNumInputs = 2; |
4381 const intptr_t kNumTemps = 0; | 4446 const intptr_t kNumTemps = 0; |
4382 LocationSummary* summary = | 4447 LocationSummary* summary = |
4383 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4448 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4384 summary->set_in(0, Location::RequiresFpuRegister()); | 4449 summary->set_in(0, Location::RequiresFpuRegister()); |
4385 summary->set_in(1, Location::RequiresFpuRegister()); | 4450 summary->set_in(1, Location::RequiresFpuRegister()); |
4386 summary->set_out(0, Location::SameAsFirstInput()); | 4451 summary->set_out(0, Location::SameAsFirstInput()); |
4387 return summary; | 4452 return summary; |
4388 } | 4453 } |
4389 | 4454 |
4390 | 4455 |
4391 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4456 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4392 XmmRegister left = locs()->in(0).fpu_reg(); | 4457 XmmRegister left = locs()->in(0).fpu_reg(); |
4393 XmmRegister right = locs()->in(1).fpu_reg(); | 4458 XmmRegister right = locs()->in(1).fpu_reg(); |
(...skipping 29 matching lines...) Expand all Loading... | |
4423 break; | 4488 break; |
4424 case MethodRecognizer::kFloat64x2Max: | 4489 case MethodRecognizer::kFloat64x2Max: |
4425 __ maxpd(left, right); | 4490 __ maxpd(left, right); |
4426 break; | 4491 break; |
4427 default: UNREACHABLE(); | 4492 default: UNREACHABLE(); |
4428 } | 4493 } |
4429 } | 4494 } |
4430 | 4495 |
4431 | 4496 |
4432 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 4497 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
4433 bool opt) const { | 4498 Isolate* isolate, bool opt) const { |
4434 const intptr_t kNumInputs = 4; | 4499 const intptr_t kNumInputs = 4; |
4435 const intptr_t kNumTemps = 0; | 4500 const intptr_t kNumTemps = 0; |
4436 LocationSummary* summary = | 4501 LocationSummary* summary = |
4437 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4502 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4438 summary->set_in(0, Location::RequiresRegister()); | 4503 summary->set_in(0, Location::RequiresRegister()); |
4439 summary->set_in(1, Location::RequiresRegister()); | 4504 summary->set_in(1, Location::RequiresRegister()); |
4440 summary->set_in(2, Location::RequiresRegister()); | 4505 summary->set_in(2, Location::RequiresRegister()); |
4441 summary->set_in(3, Location::RequiresRegister()); | 4506 summary->set_in(3, Location::RequiresRegister()); |
4442 summary->set_out(0, Location::RequiresFpuRegister()); | 4507 summary->set_out(0, Location::RequiresFpuRegister()); |
4443 return summary; | 4508 return summary; |
4444 } | 4509 } |
4445 | 4510 |
4446 | 4511 |
4447 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4512 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4485 __ jmp(&w_done); | 4550 __ jmp(&w_done); |
4486 __ Bind(&w_false); | 4551 __ Bind(&w_false); |
4487 __ movl(Address(ESP, 12), Immediate(0x0)); | 4552 __ movl(Address(ESP, 12), Immediate(0x0)); |
4488 __ Bind(&w_done); | 4553 __ Bind(&w_done); |
4489 | 4554 |
4490 __ movups(result, Address(ESP, 0)); | 4555 __ movups(result, Address(ESP, 0)); |
4491 __ addl(ESP, Immediate(16)); | 4556 __ addl(ESP, Immediate(16)); |
4492 } | 4557 } |
4493 | 4558 |
4494 | 4559 |
4495 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(bool opt) const { | 4560 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate, |
4561 bool opt) const { | |
4496 const intptr_t kNumInputs = 1; | 4562 const intptr_t kNumInputs = 1; |
4497 const intptr_t kNumTemps = 0; | 4563 const intptr_t kNumTemps = 0; |
4498 LocationSummary* summary = | 4564 LocationSummary* summary = |
4499 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4565 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4500 summary->set_in(0, Location::RequiresFpuRegister()); | 4566 summary->set_in(0, Location::RequiresFpuRegister()); |
4501 summary->set_out(0, Location::RequiresRegister()); | 4567 summary->set_out(0, Location::RequiresRegister()); |
4502 return summary; | 4568 return summary; |
4503 } | 4569 } |
4504 | 4570 |
4505 | 4571 |
4506 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4572 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4507 XmmRegister value = locs()->in(0).fpu_reg(); | 4573 XmmRegister value = locs()->in(0).fpu_reg(); |
4508 Register result = locs()->out(0).reg(); | 4574 Register result = locs()->out(0).reg(); |
4509 Label done; | 4575 Label done; |
(...skipping 20 matching lines...) Expand all Loading... | |
4530 __ testl(result, result); | 4596 __ testl(result, result); |
4531 __ j(NOT_ZERO, &non_zero, Assembler::kNearJump); | 4597 __ j(NOT_ZERO, &non_zero, Assembler::kNearJump); |
4532 __ LoadObject(result, Bool::False()); | 4598 __ LoadObject(result, Bool::False()); |
4533 __ jmp(&done); | 4599 __ jmp(&done); |
4534 __ Bind(&non_zero); | 4600 __ Bind(&non_zero); |
4535 __ LoadObject(result, Bool::True()); | 4601 __ LoadObject(result, Bool::True()); |
4536 __ Bind(&done); | 4602 __ Bind(&done); |
4537 } | 4603 } |
4538 | 4604 |
4539 | 4605 |
4540 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(bool opt) const { | 4606 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate, |
4607 bool opt) const { | |
4541 const intptr_t kNumInputs = 3; | 4608 const intptr_t kNumInputs = 3; |
4542 const intptr_t kNumTemps = 1; | 4609 const intptr_t kNumTemps = 1; |
4543 LocationSummary* summary = | 4610 LocationSummary* summary = |
4544 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4611 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4545 summary->set_in(0, Location::RequiresFpuRegister()); | 4612 summary->set_in(0, Location::RequiresFpuRegister()); |
4546 summary->set_in(1, Location::RequiresFpuRegister()); | 4613 summary->set_in(1, Location::RequiresFpuRegister()); |
4547 summary->set_in(2, Location::RequiresFpuRegister()); | 4614 summary->set_in(2, Location::RequiresFpuRegister()); |
4548 summary->set_temp(0, Location::RequiresFpuRegister()); | 4615 summary->set_temp(0, Location::RequiresFpuRegister()); |
4549 summary->set_out(0, Location::SameAsFirstInput()); | 4616 summary->set_out(0, Location::SameAsFirstInput()); |
4550 return summary; | 4617 return summary; |
4551 } | 4618 } |
4552 | 4619 |
4553 | 4620 |
4554 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4621 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4555 XmmRegister mask = locs()->in(0).fpu_reg(); | 4622 XmmRegister mask = locs()->in(0).fpu_reg(); |
4556 XmmRegister trueValue = locs()->in(1).fpu_reg(); | 4623 XmmRegister trueValue = locs()->in(1).fpu_reg(); |
4557 XmmRegister falseValue = locs()->in(2).fpu_reg(); | 4624 XmmRegister falseValue = locs()->in(2).fpu_reg(); |
4558 XmmRegister out = locs()->out(0).fpu_reg(); | 4625 XmmRegister out = locs()->out(0).fpu_reg(); |
4559 XmmRegister temp = locs()->temp(0).fpu_reg(); | 4626 XmmRegister temp = locs()->temp(0).fpu_reg(); |
4560 ASSERT(out == mask); | 4627 ASSERT(out == mask); |
4561 // Copy mask. | 4628 // Copy mask. |
4562 __ movaps(temp, mask); | 4629 __ movaps(temp, mask); |
4563 // Invert it. | 4630 // Invert it. |
4564 __ notps(temp); | 4631 __ notps(temp); |
4565 // mask = mask & trueValue. | 4632 // mask = mask & trueValue. |
4566 __ andps(mask, trueValue); | 4633 __ andps(mask, trueValue); |
4567 // temp = temp & falseValue. | 4634 // temp = temp & falseValue. |
4568 __ andps(temp, falseValue); | 4635 __ andps(temp, falseValue); |
4569 // out = mask | temp. | 4636 // out = mask | temp. |
4570 __ orps(mask, temp); | 4637 __ orps(mask, temp); |
4571 } | 4638 } |
4572 | 4639 |
4573 | 4640 |
4574 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(bool opt) const { | 4641 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate, |
4642 bool opt) const { | |
4575 const intptr_t kNumInputs = 2; | 4643 const intptr_t kNumInputs = 2; |
4576 const intptr_t kNumTemps = 0; | 4644 const intptr_t kNumTemps = 0; |
4577 LocationSummary* summary = | 4645 LocationSummary* summary = |
4578 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4646 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4579 summary->set_in(0, Location::RequiresFpuRegister()); | 4647 summary->set_in(0, Location::RequiresFpuRegister()); |
4580 summary->set_in(1, Location::RequiresRegister()); | 4648 summary->set_in(1, Location::RequiresRegister()); |
4581 summary->set_out(0, Location::SameAsFirstInput()); | 4649 summary->set_out(0, Location::SameAsFirstInput()); |
4582 return summary; | 4650 return summary; |
4583 } | 4651 } |
4584 | 4652 |
4585 | 4653 |
4586 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4654 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4587 XmmRegister mask = locs()->in(0).fpu_reg(); | 4655 XmmRegister mask = locs()->in(0).fpu_reg(); |
4588 Register flag = locs()->in(1).reg(); | 4656 Register flag = locs()->in(1).reg(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4620 break; | 4688 break; |
4621 default: UNREACHABLE(); | 4689 default: UNREACHABLE(); |
4622 } | 4690 } |
4623 __ Bind(&exitPath); | 4691 __ Bind(&exitPath); |
4624 // Copy mask back to register. | 4692 // Copy mask back to register. |
4625 __ movups(mask, Address(ESP, 0)); | 4693 __ movups(mask, Address(ESP, 0)); |
4626 __ addl(ESP, Immediate(16)); | 4694 __ addl(ESP, Immediate(16)); |
4627 } | 4695 } |
4628 | 4696 |
4629 | 4697 |
4630 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(bool opt) const { | 4698 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate, |
4699 bool opt) const { | |
4631 const intptr_t kNumInputs = 1; | 4700 const intptr_t kNumInputs = 1; |
4632 const intptr_t kNumTemps = 0; | 4701 const intptr_t kNumTemps = 0; |
4633 LocationSummary* summary = | 4702 LocationSummary* summary = |
4634 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4703 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4635 summary->set_in(0, Location::RequiresFpuRegister()); | 4704 summary->set_in(0, Location::RequiresFpuRegister()); |
4636 summary->set_out(0, Location::SameAsFirstInput()); | 4705 summary->set_out(0, Location::SameAsFirstInput()); |
4637 return summary; | 4706 return summary; |
4638 } | 4707 } |
4639 | 4708 |
4640 | 4709 |
4641 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4710 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4642 // NOP. | 4711 // NOP. |
4643 } | 4712 } |
4644 | 4713 |
4645 | 4714 |
4646 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(bool opt) const { | 4715 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate, |
4716 bool opt) const { | |
4647 const intptr_t kNumInputs = 2; | 4717 const intptr_t kNumInputs = 2; |
4648 const intptr_t kNumTemps = 0; | 4718 const intptr_t kNumTemps = 0; |
4649 LocationSummary* summary = | 4719 LocationSummary* summary = |
4650 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4720 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4651 summary->set_in(0, Location::RequiresFpuRegister()); | 4721 summary->set_in(0, Location::RequiresFpuRegister()); |
4652 summary->set_in(1, Location::RequiresFpuRegister()); | 4722 summary->set_in(1, Location::RequiresFpuRegister()); |
4653 summary->set_out(0, Location::SameAsFirstInput()); | 4723 summary->set_out(0, Location::SameAsFirstInput()); |
4654 return summary; | 4724 return summary; |
4655 } | 4725 } |
4656 | 4726 |
4657 | 4727 |
4658 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4728 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4659 XmmRegister left = locs()->in(0).fpu_reg(); | 4729 XmmRegister left = locs()->in(0).fpu_reg(); |
4660 XmmRegister right = locs()->in(1).fpu_reg(); | 4730 XmmRegister right = locs()->in(1).fpu_reg(); |
(...skipping 15 matching lines...) Expand all Loading... | |
4676 __ addpl(left, right); | 4746 __ addpl(left, right); |
4677 break; | 4747 break; |
4678 case Token::kSUB: | 4748 case Token::kSUB: |
4679 __ subpl(left, right); | 4749 __ subpl(left, right); |
4680 break; | 4750 break; |
4681 default: UNREACHABLE(); | 4751 default: UNREACHABLE(); |
4682 } | 4752 } |
4683 } | 4753 } |
4684 | 4754 |
4685 | 4755 |
4686 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { | 4756 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate, |
4757 bool opt) const { | |
4687 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { | 4758 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { |
4688 const intptr_t kNumInputs = 1; | 4759 const intptr_t kNumInputs = 1; |
4689 const intptr_t kNumTemps = 1; | 4760 const intptr_t kNumTemps = 1; |
4690 LocationSummary* summary = | 4761 LocationSummary* summary = |
4691 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 4762 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kCall); |
4692 summary->set_in(0, Location::FpuRegisterLocation(XMM1)); | 4763 summary->set_in(0, Location::FpuRegisterLocation(XMM1)); |
4693 // EDI is chosen because it is callee saved so we do not need to back it | 4764 // EDI is chosen because it is callee saved so we do not need to back it |
4694 // up before calling into the runtime. | 4765 // up before calling into the runtime. |
4695 summary->set_temp(0, Location::RegisterLocation(EDI)); | 4766 summary->set_temp(0, Location::RegisterLocation(EDI)); |
4696 summary->set_out(0, Location::FpuRegisterLocation(XMM1)); | 4767 summary->set_out(0, Location::FpuRegisterLocation(XMM1)); |
4697 return summary; | 4768 return summary; |
4698 } | 4769 } |
4699 ASSERT((kind() == MathUnaryInstr::kSqrt) || | 4770 ASSERT((kind() == MathUnaryInstr::kSqrt) || |
4700 (kind() == MathUnaryInstr::kDoubleSquare)); | 4771 (kind() == MathUnaryInstr::kDoubleSquare)); |
4701 const intptr_t kNumInputs = 1; | 4772 const intptr_t kNumInputs = 1; |
4702 const intptr_t kNumTemps = 0; | 4773 const intptr_t kNumTemps = 0; |
4703 LocationSummary* summary = | 4774 LocationSummary* summary = |
4704 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4775 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4705 summary->set_in(0, Location::RequiresFpuRegister()); | 4776 summary->set_in(0, Location::RequiresFpuRegister()); |
4706 if (kind() == MathUnaryInstr::kDoubleSquare) { | 4777 if (kind() == MathUnaryInstr::kDoubleSquare) { |
4707 summary->set_out(0, Location::SameAsFirstInput()); | 4778 summary->set_out(0, Location::SameAsFirstInput()); |
4708 } else { | 4779 } else { |
4709 summary->set_out(0, Location::RequiresFpuRegister()); | 4780 summary->set_out(0, Location::RequiresFpuRegister()); |
4710 } | 4781 } |
4711 return summary; | 4782 return summary; |
4712 } | 4783 } |
4713 | 4784 |
4714 | 4785 |
(...skipping 13 matching lines...) Expand all Loading... | |
4728 __ movsd(Address(ESP, 0), locs()->in(0).fpu_reg()); | 4799 __ movsd(Address(ESP, 0), locs()->in(0).fpu_reg()); |
4729 __ CallRuntime(TargetFunction(), InputCount()); | 4800 __ CallRuntime(TargetFunction(), InputCount()); |
4730 __ fstpl(Address(ESP, 0)); | 4801 __ fstpl(Address(ESP, 0)); |
4731 __ movsd(locs()->out(0).fpu_reg(), Address(ESP, 0)); | 4802 __ movsd(locs()->out(0).fpu_reg(), Address(ESP, 0)); |
4732 // Restore ESP. | 4803 // Restore ESP. |
4733 __ movl(ESP, locs()->temp(0).reg()); | 4804 __ movl(ESP, locs()->temp(0).reg()); |
4734 } | 4805 } |
4735 } | 4806 } |
4736 | 4807 |
4737 | 4808 |
4738 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { | 4809 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, |
4810 bool opt) const { | |
4739 if (result_cid() == kDoubleCid) { | 4811 if (result_cid() == kDoubleCid) { |
4740 const intptr_t kNumInputs = 2; | 4812 const intptr_t kNumInputs = 2; |
4741 const intptr_t kNumTemps = 1; | 4813 const intptr_t kNumTemps = 1; |
4742 LocationSummary* summary = | 4814 LocationSummary* summary = |
4743 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4815 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
4744 summary->set_in(0, Location::RequiresFpuRegister()); | 4816 summary->set_in(0, Location::RequiresFpuRegister()); |
4745 summary->set_in(1, Location::RequiresFpuRegister()); | 4817 summary->set_in(1, Location::RequiresFpuRegister()); |
4746 // Reuse the left register so that code can be made shorter. | 4818 // Reuse the left register so that code can be made shorter. |
4747 summary->set_out(0, Location::SameAsFirstInput()); | 4819 summary->set_out(0, Location::SameAsFirstInput()); |
4748 summary->set_temp(0, Location::RequiresRegister()); | 4820 summary->set_temp(0, Location::RequiresRegister()); |
4749 return summary; | 4821 return summary; |
4750 } | 4822 } |
4751 | 4823 |
4752 ASSERT(result_cid() == kSmiCid); | 4824 ASSERT(result_cid() == kSmiCid); |
4753 const intptr_t kNumInputs = 2; | 4825 const intptr_t kNumInputs = 2; |
4754 const intptr_t kNumTemps = 0; | 4826 const intptr_t kNumTemps = 0; |
4755 LocationSummary* summary = | 4827 LocationSummary* summary = |
4756 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4828 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4757 summary->set_in(0, Location::RequiresRegister()); | 4829 summary->set_in(0, Location::RequiresRegister()); |
4758 summary->set_in(1, Location::RequiresRegister()); | 4830 summary->set_in(1, Location::RequiresRegister()); |
4759 // Reuse the left register so that code can be made shorter. | 4831 // Reuse the left register so that code can be made shorter. |
4760 summary->set_out(0, Location::SameAsFirstInput()); | 4832 summary->set_out(0, Location::SameAsFirstInput()); |
4761 return summary; | 4833 return summary; |
4762 } | 4834 } |
4763 | 4835 |
4764 | 4836 |
4765 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4837 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4766 ASSERT((op_kind() == MethodRecognizer::kMathMin) || | 4838 ASSERT((op_kind() == MethodRecognizer::kMathMin) || |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4816 __ cmpl(left, right); | 4888 __ cmpl(left, right); |
4817 ASSERT(result == left); | 4889 ASSERT(result == left); |
4818 if (is_min) { | 4890 if (is_min) { |
4819 __ cmovgel(result, right); | 4891 __ cmovgel(result, right); |
4820 } else { | 4892 } else { |
4821 __ cmovlessl(result, right); | 4893 __ cmovlessl(result, right); |
4822 } | 4894 } |
4823 } | 4895 } |
4824 | 4896 |
4825 | 4897 |
4826 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const { | 4898 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, |
4899 bool opt) const { | |
4827 const intptr_t kNumInputs = 1; | 4900 const intptr_t kNumInputs = 1; |
4828 return LocationSummary::Make(kNumInputs, | 4901 return LocationSummary::Make(kNumInputs, |
4829 Location::SameAsFirstInput(), | 4902 Location::SameAsFirstInput(), |
4830 LocationSummary::kNoCall); | 4903 LocationSummary::kNoCall); |
4831 } | 4904 } |
4832 | 4905 |
4833 | 4906 |
4834 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4907 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4835 Register value = locs()->in(0).reg(); | 4908 Register value = locs()->in(0).reg(); |
4836 ASSERT(value == locs()->out(0).reg()); | 4909 ASSERT(value == locs()->out(0).reg()); |
4837 switch (op_kind()) { | 4910 switch (op_kind()) { |
4838 case Token::kNEGATE: { | 4911 case Token::kNEGATE: { |
4839 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); | 4912 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); |
4840 __ negl(value); | 4913 __ negl(value); |
4841 __ j(OVERFLOW, deopt); | 4914 __ j(OVERFLOW, deopt); |
4842 break; | 4915 break; |
4843 } | 4916 } |
4844 case Token::kBIT_NOT: | 4917 case Token::kBIT_NOT: |
4845 __ notl(value); | 4918 __ notl(value); |
4846 __ andl(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. | 4919 __ andl(value, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. |
4847 break; | 4920 break; |
4848 default: | 4921 default: |
4849 UNREACHABLE(); | 4922 UNREACHABLE(); |
4850 } | 4923 } |
4851 } | 4924 } |
4852 | 4925 |
4853 | 4926 |
4854 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 4927 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, |
4928 bool opt) const { | |
4855 const intptr_t kNumInputs = 1; | 4929 const intptr_t kNumInputs = 1; |
4856 const intptr_t kNumTemps = 0; | 4930 const intptr_t kNumTemps = 0; |
4857 LocationSummary* summary = | 4931 LocationSummary* summary = |
4858 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4932 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4859 summary->set_in(0, Location::RequiresFpuRegister()); | 4933 summary->set_in(0, Location::RequiresFpuRegister()); |
4860 summary->set_out(0, Location::SameAsFirstInput()); | 4934 summary->set_out(0, Location::SameAsFirstInput()); |
4861 return summary; | 4935 return summary; |
4862 } | 4936 } |
4863 | 4937 |
4864 | 4938 |
4865 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4939 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4866 XmmRegister value = locs()->in(0).fpu_reg(); | 4940 XmmRegister value = locs()->in(0).fpu_reg(); |
4867 ASSERT(locs()->out(0).fpu_reg() == value); | 4941 ASSERT(locs()->out(0).fpu_reg() == value); |
4868 __ DoubleNegate(value); | 4942 __ DoubleNegate(value); |
4869 } | 4943 } |
4870 | 4944 |
4871 | 4945 |
4872 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const { | 4946 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
4947 bool opt) const { | |
4873 const intptr_t kNumInputs = 1; | 4948 const intptr_t kNumInputs = 1; |
4874 const intptr_t kNumTemps = 0; | 4949 const intptr_t kNumTemps = 0; |
4875 LocationSummary* result = | 4950 LocationSummary* result = |
4876 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4951 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4877 result->set_in(0, Location::WritableRegister()); | 4952 result->set_in(0, Location::WritableRegister()); |
4878 result->set_out(0, Location::RequiresFpuRegister()); | 4953 result->set_out(0, Location::RequiresFpuRegister()); |
4879 return result; | 4954 return result; |
4880 } | 4955 } |
4881 | 4956 |
4882 | 4957 |
4883 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4958 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4884 Register value = locs()->in(0).reg(); | 4959 Register value = locs()->in(0).reg(); |
4885 FpuRegister result = locs()->out(0).fpu_reg(); | 4960 FpuRegister result = locs()->out(0).fpu_reg(); |
4886 __ SmiUntag(value); | 4961 __ SmiUntag(value); |
4887 __ cvtsi2sd(result, value); | 4962 __ cvtsi2sd(result, value); |
4888 } | 4963 } |
4889 | 4964 |
4890 | 4965 |
4891 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const { | 4966 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate, |
4967 bool opt) const { | |
4892 const intptr_t kNumInputs = 1; | 4968 const intptr_t kNumInputs = 1; |
4893 const intptr_t kNumTemps = 0; | 4969 const intptr_t kNumTemps = 0; |
4894 LocationSummary* result = | 4970 LocationSummary* result = |
4895 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 4971 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
4896 result->set_in(0, Location::RegisterLocation(ECX)); | 4972 result->set_in(0, Location::RegisterLocation(ECX)); |
4897 result->set_out(0, Location::RegisterLocation(EAX)); | 4973 result->set_out(0, Location::RegisterLocation(EAX)); |
4898 return result; | 4974 return result; |
4899 } | 4975 } |
4900 | 4976 |
4901 | 4977 |
4902 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4978 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4903 Register result = locs()->out(0).reg(); | 4979 Register result = locs()->out(0).reg(); |
4904 Register value_obj = locs()->in(0).reg(); | 4980 Register value_obj = locs()->in(0).reg(); |
4905 XmmRegister value_double = XMM0; | 4981 XmmRegister value_double = XMM0; |
(...skipping 19 matching lines...) Expand all Loading... | |
4925 compiler->GenerateStaticCall(deopt_id(), | 5001 compiler->GenerateStaticCall(deopt_id(), |
4926 instance_call()->token_pos(), | 5002 instance_call()->token_pos(), |
4927 target, | 5003 target, |
4928 kNumberOfArguments, | 5004 kNumberOfArguments, |
4929 Object::null_array(), // No argument names., | 5005 Object::null_array(), // No argument names., |
4930 locs()); | 5006 locs()); |
4931 __ Bind(&done); | 5007 __ Bind(&done); |
4932 } | 5008 } |
4933 | 5009 |
4934 | 5010 |
4935 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const { | 5011 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate, |
5012 bool opt) const { | |
4936 const intptr_t kNumInputs = 1; | 5013 const intptr_t kNumInputs = 1; |
4937 const intptr_t kNumTemps = 0; | 5014 const intptr_t kNumTemps = 0; |
4938 LocationSummary* result = new LocationSummary( | 5015 LocationSummary* result = new (isolate) LocationSummary(isolate, |
4939 kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5016 kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4940 result->set_in(0, Location::RequiresFpuRegister()); | 5017 result->set_in(0, Location::RequiresFpuRegister()); |
4941 result->set_out(0, Location::RequiresRegister()); | 5018 result->set_out(0, Location::RequiresRegister()); |
4942 return result; | 5019 return result; |
4943 } | 5020 } |
4944 | 5021 |
4945 | 5022 |
4946 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5023 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4947 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); | 5024 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); |
4948 Register result = locs()->out(0).reg(); | 5025 Register result = locs()->out(0).reg(); |
4949 XmmRegister value = locs()->in(0).fpu_reg(); | 5026 XmmRegister value = locs()->in(0).fpu_reg(); |
4950 __ cvttsd2si(result, value); | 5027 __ cvttsd2si(result, value); |
4951 // Check for overflow and that it fits into Smi. | 5028 // Check for overflow and that it fits into Smi. |
4952 __ cmpl(result, Immediate(0xC0000000)); | 5029 __ cmpl(result, Immediate(0xC0000000)); |
4953 __ j(NEGATIVE, deopt); | 5030 __ j(NEGATIVE, deopt); |
4954 __ SmiTag(result); | 5031 __ SmiTag(result); |
4955 } | 5032 } |
4956 | 5033 |
4957 | 5034 |
4958 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(bool opt) const { | 5035 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
5036 bool opt) const { | |
4959 const intptr_t kNumInputs = 1; | 5037 const intptr_t kNumInputs = 1; |
4960 const intptr_t kNumTemps = 0; | 5038 const intptr_t kNumTemps = 0; |
4961 LocationSummary* result = | 5039 LocationSummary* result = |
4962 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5040 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4963 result->set_in(0, Location::RequiresFpuRegister()); | 5041 result->set_in(0, Location::RequiresFpuRegister()); |
4964 result->set_out(0, Location::RequiresFpuRegister()); | 5042 result->set_out(0, Location::RequiresFpuRegister()); |
4965 return result; | 5043 return result; |
4966 } | 5044 } |
4967 | 5045 |
4968 | 5046 |
4969 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5047 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4970 XmmRegister value = locs()->in(0).fpu_reg(); | 5048 XmmRegister value = locs()->in(0).fpu_reg(); |
4971 XmmRegister result = locs()->out(0).fpu_reg(); | 5049 XmmRegister result = locs()->out(0).fpu_reg(); |
4972 switch (recognized_kind()) { | 5050 switch (recognized_kind()) { |
4973 case MethodRecognizer::kDoubleTruncate: | 5051 case MethodRecognizer::kDoubleTruncate: |
4974 __ roundsd(result, value, Assembler::kRoundToZero); | 5052 __ roundsd(result, value, Assembler::kRoundToZero); |
4975 break; | 5053 break; |
4976 case MethodRecognizer::kDoubleFloor: | 5054 case MethodRecognizer::kDoubleFloor: |
4977 __ roundsd(result, value, Assembler::kRoundDown); | 5055 __ roundsd(result, value, Assembler::kRoundDown); |
4978 break; | 5056 break; |
4979 case MethodRecognizer::kDoubleCeil: | 5057 case MethodRecognizer::kDoubleCeil: |
4980 __ roundsd(result, value, Assembler::kRoundUp); | 5058 __ roundsd(result, value, Assembler::kRoundUp); |
4981 break; | 5059 break; |
4982 default: | 5060 default: |
4983 UNREACHABLE(); | 5061 UNREACHABLE(); |
4984 } | 5062 } |
4985 } | 5063 } |
4986 | 5064 |
4987 | 5065 |
4988 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const { | 5066 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate, |
5067 bool opt) const { | |
4989 const intptr_t kNumInputs = 1; | 5068 const intptr_t kNumInputs = 1; |
4990 const intptr_t kNumTemps = 0; | 5069 const intptr_t kNumTemps = 0; |
4991 LocationSummary* result = | 5070 LocationSummary* result = |
4992 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5071 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
4993 result->set_in(0, Location::RequiresFpuRegister()); | 5072 result->set_in(0, Location::RequiresFpuRegister()); |
4994 result->set_out(0, Location::SameAsFirstInput()); | 5073 result->set_out(0, Location::SameAsFirstInput()); |
4995 return result; | 5074 return result; |
4996 } | 5075 } |
4997 | 5076 |
4998 | 5077 |
4999 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5078 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5000 __ cvtsd2ss(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); | 5079 __ cvtsd2ss(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); |
5001 } | 5080 } |
5002 | 5081 |
5003 | 5082 |
5004 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const { | 5083 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate, |
5084 bool opt) const { | |
5005 const intptr_t kNumInputs = 1; | 5085 const intptr_t kNumInputs = 1; |
5006 const intptr_t kNumTemps = 0; | 5086 const intptr_t kNumTemps = 0; |
5007 LocationSummary* result = | 5087 LocationSummary* result = |
5008 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5088 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5009 result->set_in(0, Location::RequiresFpuRegister()); | 5089 result->set_in(0, Location::RequiresFpuRegister()); |
5010 result->set_out(0, Location::SameAsFirstInput()); | 5090 result->set_out(0, Location::SameAsFirstInput()); |
5011 return result; | 5091 return result; |
5012 } | 5092 } |
5013 | 5093 |
5014 | 5094 |
5015 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5095 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5016 __ cvtss2sd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); | 5096 __ cvtss2sd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); |
5017 } | 5097 } |
5018 | 5098 |
5019 | 5099 |
5020 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { | 5100 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate, |
5101 bool opt) const { | |
5021 ASSERT((InputCount() == 1) || (InputCount() == 2)); | 5102 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
5022 const intptr_t kNumTemps = 1; | 5103 const intptr_t kNumTemps = 1; |
5023 LocationSummary* result = | 5104 LocationSummary* result = |
5024 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); | 5105 new (isolate) LocationSummary(isolate, InputCount(), kNumTemps, LocationSu mmary::kCall); |
5025 // EDI is chosen because it is callee saved so we do not need to back it | 5106 // EDI is chosen because it is callee saved so we do not need to back it |
5026 // up before calling into the runtime. | 5107 // up before calling into the runtime. |
5027 result->set_temp(0, Location::RegisterLocation(EDI)); | 5108 result->set_temp(0, Location::RegisterLocation(EDI)); |
5028 result->set_in(0, Location::FpuRegisterLocation(XMM1)); | 5109 result->set_in(0, Location::FpuRegisterLocation(XMM1)); |
5029 if (InputCount() == 2) { | 5110 if (InputCount() == 2) { |
5030 result->set_in(1, Location::FpuRegisterLocation(XMM2)); | 5111 result->set_in(1, Location::FpuRegisterLocation(XMM2)); |
5031 } | 5112 } |
5032 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 5113 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
5033 // Temp index 1. | 5114 // Temp index 1. |
5034 result->AddTemp(Location::RegisterLocation(EAX)); | 5115 result->AddTemp(Location::RegisterLocation(EAX)); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5186 } | 5267 } |
5187 | 5268 |
5188 __ CallRuntime(TargetFunction(), InputCount()); | 5269 __ CallRuntime(TargetFunction(), InputCount()); |
5189 __ fstpl(Address(ESP, 0)); | 5270 __ fstpl(Address(ESP, 0)); |
5190 __ movsd(locs()->out(0).fpu_reg(), Address(ESP, 0)); | 5271 __ movsd(locs()->out(0).fpu_reg(), Address(ESP, 0)); |
5191 // Restore ESP. | 5272 // Restore ESP. |
5192 __ movl(ESP, locs()->temp(kSavedSpTempIndex).reg()); | 5273 __ movl(ESP, locs()->temp(kSavedSpTempIndex).reg()); |
5193 } | 5274 } |
5194 | 5275 |
5195 | 5276 |
5196 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(bool opt) const { | 5277 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate, |
5278 bool opt) const { | |
5197 // Only use this instruction in optimized code. | 5279 // Only use this instruction in optimized code. |
5198 ASSERT(opt); | 5280 ASSERT(opt); |
5199 const intptr_t kNumInputs = 1; | 5281 const intptr_t kNumInputs = 1; |
5200 LocationSummary* summary = | 5282 LocationSummary* summary = |
5201 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 5283 new (isolate) LocationSummary(isolate, kNumInputs, 0, LocationSummary::kNo Call); |
5202 if (representation() == kUnboxedDouble) { | 5284 if (representation() == kUnboxedDouble) { |
5203 if (index() == 0) { | 5285 if (index() == 0) { |
5204 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), | 5286 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), |
5205 Location::Any())); | 5287 Location::Any())); |
5206 } else { | 5288 } else { |
5207 ASSERT(index() == 1); | 5289 ASSERT(index() == 1); |
5208 summary->set_in(0, Location::Pair(Location::Any(), | 5290 summary->set_in(0, Location::Pair(Location::Any(), |
5209 Location::RequiresFpuRegister())); | 5291 Location::RequiresFpuRegister())); |
5210 } | 5292 } |
5211 summary->set_out(0, Location::RequiresFpuRegister()); | 5293 summary->set_out(0, Location::RequiresFpuRegister()); |
(...skipping 23 matching lines...) Expand all Loading... | |
5235 __ movaps(out, in); | 5317 __ movaps(out, in); |
5236 } else { | 5318 } else { |
5237 ASSERT(representation() == kTagged); | 5319 ASSERT(representation() == kTagged); |
5238 Register out = locs()->out(0).reg(); | 5320 Register out = locs()->out(0).reg(); |
5239 Register in = in_loc.reg(); | 5321 Register in = in_loc.reg(); |
5240 __ movl(out, in); | 5322 __ movl(out, in); |
5241 } | 5323 } |
5242 } | 5324 } |
5243 | 5325 |
5244 | 5326 |
5245 LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const { | 5327 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate, |
5328 bool opt) const { | |
5246 if (kind() == MergedMathInstr::kTruncDivMod) { | 5329 if (kind() == MergedMathInstr::kTruncDivMod) { |
5247 const intptr_t kNumInputs = 2; | 5330 const intptr_t kNumInputs = 2; |
5248 const intptr_t kNumTemps = 0; | 5331 const intptr_t kNumTemps = 0; |
5249 LocationSummary* summary = | 5332 LocationSummary* summary = |
5250 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5333 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
5251 // Both inputs must be writable because they will be untagged. | 5334 // Both inputs must be writable because they will be untagged. |
5252 summary->set_in(0, Location::RegisterLocation(EAX)); | 5335 summary->set_in(0, Location::RegisterLocation(EAX)); |
5253 summary->set_in(1, Location::WritableRegister()); | 5336 summary->set_in(1, Location::WritableRegister()); |
5254 // Output is a pair of registers. | 5337 // Output is a pair of registers. |
5255 summary->set_out(0, Location::Pair(Location::RegisterLocation(EAX), | 5338 summary->set_out(0, Location::Pair(Location::RegisterLocation(EAX), |
5256 Location::RegisterLocation(EDX))); | 5339 Location::RegisterLocation(EDX))); |
5257 return summary; | 5340 return summary; |
5258 } | 5341 } |
5259 if (kind() == MergedMathInstr::kSinCos) { | 5342 if (kind() == MergedMathInstr::kSinCos) { |
5260 const intptr_t kNumInputs = 1; | 5343 const intptr_t kNumInputs = 1; |
5261 const intptr_t kNumTemps = 0; | 5344 const intptr_t kNumTemps = 0; |
5262 LocationSummary* summary = | 5345 LocationSummary* summary = |
5263 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5346 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kNoCall); |
5264 summary->set_in(0, Location::RequiresFpuRegister()); | 5347 summary->set_in(0, Location::RequiresFpuRegister()); |
5265 summary->set_out(0, Location::Pair(Location::RequiresFpuRegister(), | 5348 summary->set_out(0, Location::Pair(Location::RequiresFpuRegister(), |
5266 Location::RequiresFpuRegister())); | 5349 Location::RequiresFpuRegister())); |
5267 return summary; | 5350 return summary; |
5268 } | 5351 } |
5269 UNIMPLEMENTED(); | 5352 UNIMPLEMENTED(); |
5270 return NULL; | 5353 return NULL; |
5271 } | 5354 } |
5272 | 5355 |
5273 | 5356 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5367 __ movsd(out2, Address(ESP, 0)); | 5450 __ movsd(out2, Address(ESP, 0)); |
5368 __ addl(ESP, Immediate(2 * kWordSize)); | 5451 __ addl(ESP, Immediate(2 * kWordSize)); |
5369 return; | 5452 return; |
5370 } | 5453 } |
5371 | 5454 |
5372 UNIMPLEMENTED(); | 5455 UNIMPLEMENTED(); |
5373 } | 5456 } |
5374 | 5457 |
5375 | 5458 |
5376 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5459 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
5377 bool opt) const { | 5460 Isolate* isolate, bool opt) const { |
5378 return MakeCallSummary(); | 5461 return MakeCallSummary(); |
5379 } | 5462 } |
5380 | 5463 |
5381 | 5464 |
5382 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5465 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5383 Label* deopt = compiler->AddDeoptStub( | 5466 Label* deopt = compiler->AddDeoptStub( |
5384 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); | 5467 deopt_id(), ICData::kDeoptPolymorphicInstanceCallTestFail); |
5385 if (ic_data().NumberOfChecks() == 0) { | 5468 if (ic_data().NumberOfChecks() == 0) { |
5386 __ jmp(deopt); | 5469 __ jmp(deopt); |
5387 return; | 5470 return; |
(...skipping 22 matching lines...) Expand all Loading... | |
5410 EDI, // Class id register. | 5493 EDI, // Class id register. |
5411 instance_call()->ArgumentCount(), | 5494 instance_call()->ArgumentCount(), |
5412 instance_call()->argument_names(), | 5495 instance_call()->argument_names(), |
5413 deopt, | 5496 deopt, |
5414 deopt_id(), | 5497 deopt_id(), |
5415 instance_call()->token_pos(), | 5498 instance_call()->token_pos(), |
5416 locs()); | 5499 locs()); |
5417 } | 5500 } |
5418 | 5501 |
5419 | 5502 |
5420 LocationSummary* BranchInstr::MakeLocationSummary(bool opt) const { | 5503 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate, |
5421 comparison()->InitializeLocationSummary(opt); | 5504 bool opt) const { |
5505 comparison()->InitializeLocationSummary(isolate, opt); | |
5422 // Branches don't produce a result. | 5506 // Branches don't produce a result. |
5423 comparison()->locs()->set_out(0, Location::NoLocation()); | 5507 comparison()->locs()->set_out(0, Location::NoLocation()); |
5424 return comparison()->locs(); | 5508 return comparison()->locs(); |
5425 } | 5509 } |
5426 | 5510 |
5427 | 5511 |
5428 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5512 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5429 comparison()->EmitBranchCode(compiler, this); | 5513 comparison()->EmitBranchCode(compiler, this); |
5430 } | 5514 } |
5431 | 5515 |
5432 | 5516 |
5433 LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const { | 5517 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, |
5518 bool opt) const { | |
5434 const intptr_t kNumInputs = 1; | 5519 const intptr_t kNumInputs = 1; |
5435 const intptr_t kNumTemps = 0; | 5520 const intptr_t kNumTemps = 0; |
5436 LocationSummary* summary = | 5521 LocationSummary* summary = |
5437 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5522 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5438 summary->set_in(0, Location::RequiresRegister()); | 5523 summary->set_in(0, Location::RequiresRegister()); |
5439 if (!IsNullCheck()) { | 5524 if (!IsNullCheck()) { |
5440 summary->AddTemp(Location::RequiresRegister()); | 5525 summary->AddTemp(Location::RequiresRegister()); |
5441 } | 5526 } |
5442 return summary; | 5527 return summary; |
5443 } | 5528 } |
5444 | 5529 |
5445 | 5530 |
5446 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5531 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5447 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? | 5532 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5483 __ j(EQUAL, &is_ok, Assembler::kNearJump); | 5568 __ j(EQUAL, &is_ok, Assembler::kNearJump); |
5484 } else { | 5569 } else { |
5485 __ j(EQUAL, &is_ok); | 5570 __ j(EQUAL, &is_ok); |
5486 } | 5571 } |
5487 } | 5572 } |
5488 } | 5573 } |
5489 __ Bind(&is_ok); | 5574 __ Bind(&is_ok); |
5490 } | 5575 } |
5491 | 5576 |
5492 | 5577 |
5493 LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const { | 5578 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate, |
5579 bool opt) const { | |
5494 const intptr_t kNumInputs = 1; | 5580 const intptr_t kNumInputs = 1; |
5495 const intptr_t kNumTemps = 0; | 5581 const intptr_t kNumTemps = 0; |
5496 LocationSummary* summary = | 5582 LocationSummary* summary = |
5497 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5583 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5498 summary->set_in(0, Location::RequiresRegister()); | 5584 summary->set_in(0, Location::RequiresRegister()); |
5499 return summary; | 5585 return summary; |
5500 } | 5586 } |
5501 | 5587 |
5502 | 5588 |
5503 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5589 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5504 Register value = locs()->in(0).reg(); | 5590 Register value = locs()->in(0).reg(); |
5505 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); | 5591 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); |
5506 __ testl(value, Immediate(kSmiTagMask)); | 5592 __ testl(value, Immediate(kSmiTagMask)); |
5507 __ j(NOT_ZERO, deopt); | 5593 __ j(NOT_ZERO, deopt); |
5508 } | 5594 } |
5509 | 5595 |
5510 | 5596 |
5511 // Length: register or constant. | 5597 // Length: register or constant. |
5512 // Index: register, constant or stack slot. | 5598 // Index: register, constant or stack slot. |
5513 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { | 5599 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, |
5600 bool opt) const { | |
5514 const intptr_t kNumInputs = 2; | 5601 const intptr_t kNumInputs = 2; |
5515 const intptr_t kNumTemps = 0; | 5602 const intptr_t kNumTemps = 0; |
5516 LocationSummary* locs = | 5603 LocationSummary* locs = |
5517 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5604 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5518 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 5605 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
5519 ConstantInstr* index_constant = index()->definition()->AsConstant(); | 5606 ConstantInstr* index_constant = index()->definition()->AsConstant(); |
5520 if (index_constant != NULL) { | 5607 if (index_constant != NULL) { |
5521 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 5608 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
5522 } else { | 5609 } else { |
5523 locs->set_in(kIndexPos, Location::PrefersRegister()); | 5610 locs->set_in(kIndexPos, Location::PrefersRegister()); |
5524 } | 5611 } |
5525 return locs; | 5612 return locs; |
5526 } | 5613 } |
5527 | 5614 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5565 __ j(BELOW_EQUAL, deopt); | 5652 __ j(BELOW_EQUAL, deopt); |
5566 } else { | 5653 } else { |
5567 Register length = length_loc.reg(); | 5654 Register length = length_loc.reg(); |
5568 Register index = index_loc.reg(); | 5655 Register index = index_loc.reg(); |
5569 __ cmpl(index, length); | 5656 __ cmpl(index, length); |
5570 __ j(ABOVE_EQUAL, deopt); | 5657 __ j(ABOVE_EQUAL, deopt); |
5571 } | 5658 } |
5572 } | 5659 } |
5573 | 5660 |
5574 | 5661 |
5575 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(bool opt) const { | 5662 LocationSummary* UnboxIntegerInstr::MakeLocationSummary(Isolate* isolate, |
5663 bool opt) const { | |
5576 const intptr_t kNumInputs = 1; | 5664 const intptr_t kNumInputs = 1; |
5577 const intptr_t kNumTemps = 0; | 5665 const intptr_t kNumTemps = 0; |
5578 LocationSummary* summary = | 5666 LocationSummary* summary = |
5579 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5667 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5580 summary->set_in(0, Location::RequiresRegister()); | 5668 summary->set_in(0, Location::RequiresRegister()); |
5581 summary->set_out(0, Location::Pair(Location::RegisterLocation(EAX), | 5669 summary->set_out(0, Location::Pair(Location::RegisterLocation(EAX), |
5582 Location::RegisterLocation(EDX))); | 5670 Location::RegisterLocation(EDX))); |
5583 return summary; | 5671 return summary; |
5584 } | 5672 } |
5585 | 5673 |
5586 | 5674 |
5587 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5675 void UnboxIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5588 const intptr_t value_cid = value()->Type()->ToCid(); | 5676 const intptr_t value_cid = value()->Type()->ToCid(); |
5589 const Register value = locs()->in(0).reg(); | 5677 const Register value = locs()->in(0).reg(); |
(...skipping 28 matching lines...) Expand all Loading... | |
5618 __ Bind(&is_smi); | 5706 __ Bind(&is_smi); |
5619 __ movl(result_lo, value); | 5707 __ movl(result_lo, value); |
5620 __ SmiUntag(result_lo); | 5708 __ SmiUntag(result_lo); |
5621 // Sign extend into result_hi. | 5709 // Sign extend into result_hi. |
5622 __ cdq(); | 5710 __ cdq(); |
5623 __ Bind(&done); | 5711 __ Bind(&done); |
5624 } | 5712 } |
5625 } | 5713 } |
5626 | 5714 |
5627 | 5715 |
5628 LocationSummary* BoxIntegerInstr::MakeLocationSummary(bool opt) const { | 5716 LocationSummary* BoxIntegerInstr::MakeLocationSummary(Isolate* isolate, |
5717 bool opt) const { | |
5629 const intptr_t kNumInputs = 1; | 5718 const intptr_t kNumInputs = 1; |
5630 const intptr_t kNumTemps = 1; | 5719 const intptr_t kNumTemps = 1; |
5631 LocationSummary* summary = | 5720 LocationSummary* summary = |
5632 new LocationSummary(kNumInputs, | 5721 new (isolate) LocationSummary(isolate, kNumInputs, |
5633 kNumTemps, | 5722 kNumTemps, |
5634 LocationSummary::kCallOnSlowPath); | 5723 LocationSummary::kCallOnSlowPath); |
5635 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5724 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
5636 Location::RequiresRegister())); | 5725 Location::RequiresRegister())); |
5637 summary->set_temp(0, Location::RequiresRegister()); | 5726 summary->set_temp(0, Location::RequiresRegister()); |
5638 summary->set_out(0, Location::RequiresRegister()); | 5727 summary->set_out(0, Location::RequiresRegister()); |
5639 return summary; | 5728 return summary; |
5640 } | 5729 } |
5641 | 5730 |
5642 | 5731 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5711 kNoRegister); | 5800 kNoRegister); |
5712 __ Bind(slow_path->exit_label()); | 5801 __ Bind(slow_path->exit_label()); |
5713 // 3. Restore lower half of input before using it. | 5802 // 3. Restore lower half of input before using it. |
5714 __ subl(value_lo, Immediate(0x40000000)); | 5803 __ subl(value_lo, Immediate(0x40000000)); |
5715 __ movl(FieldAddress(out_reg, Mint::value_offset()), value_lo); | 5804 __ movl(FieldAddress(out_reg, Mint::value_offset()), value_lo); |
5716 __ movl(FieldAddress(out_reg, Mint::value_offset() + kWordSize), value_hi); | 5805 __ movl(FieldAddress(out_reg, Mint::value_offset() + kWordSize), value_hi); |
5717 __ Bind(&done); | 5806 __ Bind(&done); |
5718 } | 5807 } |
5719 | 5808 |
5720 | 5809 |
5721 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(bool opt) const { | 5810 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate, |
5811 bool opt) const { | |
5722 const intptr_t kNumInputs = 2; | 5812 const intptr_t kNumInputs = 2; |
5723 switch (op_kind()) { | 5813 switch (op_kind()) { |
5724 case Token::kBIT_AND: | 5814 case Token::kBIT_AND: |
5725 case Token::kBIT_OR: | 5815 case Token::kBIT_OR: |
5726 case Token::kBIT_XOR: { | 5816 case Token::kBIT_XOR: { |
5727 const intptr_t kNumTemps = 0; | 5817 const intptr_t kNumTemps = 0; |
5728 LocationSummary* summary = | 5818 LocationSummary* summary = |
5729 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5819 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, Location Summary::kNoCall); |
5730 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5820 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
5731 Location::RequiresRegister())); | 5821 Location::RequiresRegister())); |
5732 summary->set_in(1, Location::Pair(Location::RequiresRegister(), | 5822 summary->set_in(1, Location::Pair(Location::RequiresRegister(), |
5733 Location::RequiresRegister())); | 5823 Location::RequiresRegister())); |
5734 summary->set_out(0, Location::SameAsFirstInput()); | 5824 summary->set_out(0, Location::SameAsFirstInput()); |
5735 return summary; | 5825 return summary; |
5736 } | 5826 } |
5737 case Token::kADD: | 5827 case Token::kADD: |
5738 case Token::kSUB: { | 5828 case Token::kSUB: { |
5739 const intptr_t kNumTemps = 0; | 5829 const intptr_t kNumTemps = 0; |
5740 LocationSummary* summary = | 5830 LocationSummary* summary = |
5741 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5831 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, Location Summary::kNoCall); |
5742 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5832 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
5743 Location::RequiresRegister())); | 5833 Location::RequiresRegister())); |
5744 summary->set_in(1, Location::Pair(Location::RequiresRegister(), | 5834 summary->set_in(1, Location::Pair(Location::RequiresRegister(), |
5745 Location::RequiresRegister())); | 5835 Location::RequiresRegister())); |
5746 summary->set_out(0, Location::SameAsFirstInput()); | 5836 summary->set_out(0, Location::SameAsFirstInput()); |
5747 return summary; | 5837 return summary; |
5748 } | 5838 } |
5749 default: | 5839 default: |
5750 UNREACHABLE(); | 5840 UNREACHABLE(); |
5751 return NULL; | 5841 return NULL; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5799 break; | 5889 break; |
5800 } | 5890 } |
5801 default: UNREACHABLE(); | 5891 default: UNREACHABLE(); |
5802 } | 5892 } |
5803 if (FLAG_throw_on_javascript_int_overflow) { | 5893 if (FLAG_throw_on_javascript_int_overflow) { |
5804 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); | 5894 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); |
5805 } | 5895 } |
5806 } | 5896 } |
5807 | 5897 |
5808 | 5898 |
5809 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(bool opt) const { | 5899 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate, |
5900 bool opt) const { | |
5810 const intptr_t kNumInputs = 2; | 5901 const intptr_t kNumInputs = 2; |
5811 const intptr_t kNumTemps = op_kind() == Token::kSHL ? 2 : 0; | 5902 const intptr_t kNumTemps = op_kind() == Token::kSHL ? 2 : 0; |
5812 LocationSummary* summary = | 5903 LocationSummary* summary = |
5813 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5904 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5814 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5905 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
5815 Location::RequiresRegister())); | 5906 Location::RequiresRegister())); |
5816 summary->set_in(1, Location::RegisterLocation(ECX)); | 5907 summary->set_in(1, Location::RegisterLocation(ECX)); |
5817 if (op_kind() == Token::kSHL) { | 5908 if (op_kind() == Token::kSHL) { |
5818 summary->set_temp(0, Location::RequiresRegister()); | 5909 summary->set_temp(0, Location::RequiresRegister()); |
5819 summary->set_temp(1, Location::RequiresRegister()); | 5910 summary->set_temp(1, Location::RequiresRegister()); |
5820 } | 5911 } |
5821 summary->set_out(0, Location::SameAsFirstInput()); | 5912 summary->set_out(0, Location::SameAsFirstInput()); |
5822 return summary; | 5913 return summary; |
5823 } | 5914 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5871 UNREACHABLE(); | 5962 UNREACHABLE(); |
5872 break; | 5963 break; |
5873 } | 5964 } |
5874 __ Bind(&done); | 5965 __ Bind(&done); |
5875 if (FLAG_throw_on_javascript_int_overflow) { | 5966 if (FLAG_throw_on_javascript_int_overflow) { |
5876 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); | 5967 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); |
5877 } | 5968 } |
5878 } | 5969 } |
5879 | 5970 |
5880 | 5971 |
5881 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(bool opt) const { | 5972 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate, |
5973 bool opt) const { | |
5882 const intptr_t kNumInputs = 1; | 5974 const intptr_t kNumInputs = 1; |
5883 const intptr_t kNumTemps = 0; | 5975 const intptr_t kNumTemps = 0; |
5884 LocationSummary* summary = | 5976 LocationSummary* summary = |
5885 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5977 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
5886 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 5978 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
5887 Location::RequiresRegister())); | 5979 Location::RequiresRegister())); |
5888 summary->set_out(0, Location::SameAsFirstInput()); | 5980 summary->set_out(0, Location::SameAsFirstInput()); |
5889 if (FLAG_throw_on_javascript_int_overflow) { | 5981 if (FLAG_throw_on_javascript_int_overflow) { |
5890 summary->set_temp(0, Location::RequiresRegister()); | 5982 summary->set_temp(0, Location::RequiresRegister()); |
5891 } | 5983 } |
5892 return summary; | 5984 return summary; |
5893 } | 5985 } |
5894 | 5986 |
5895 | 5987 |
(...skipping 15 matching lines...) Expand all Loading... | |
5911 | 6003 |
5912 __ notl(left_lo); | 6004 __ notl(left_lo); |
5913 __ notl(left_hi); | 6005 __ notl(left_hi); |
5914 | 6006 |
5915 if (FLAG_throw_on_javascript_int_overflow) { | 6007 if (FLAG_throw_on_javascript_int_overflow) { |
5916 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); | 6008 EmitJavascriptIntOverflowCheck(compiler, deopt, left_lo, left_hi); |
5917 } | 6009 } |
5918 } | 6010 } |
5919 | 6011 |
5920 | 6012 |
5921 LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const { | 6013 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, |
5922 return new LocationSummary(0, 0, LocationSummary::kCall); | 6014 bool opt) const { |
6015 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | |
5923 } | 6016 } |
5924 | 6017 |
5925 | 6018 |
5926 | 6019 |
5927 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6020 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5928 compiler->GenerateRuntimeCall(token_pos(), | 6021 compiler->GenerateRuntimeCall(token_pos(), |
5929 deopt_id(), | 6022 deopt_id(), |
5930 kThrowRuntimeEntry, | 6023 kThrowRuntimeEntry, |
5931 1, | 6024 1, |
5932 locs()); | 6025 locs()); |
5933 __ int3(); | 6026 __ int3(); |
5934 } | 6027 } |
5935 | 6028 |
5936 | 6029 |
5937 LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const { | 6030 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate, |
5938 return new LocationSummary(0, 0, LocationSummary::kCall); | 6031 bool opt) const { |
6032 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | |
5939 } | 6033 } |
5940 | 6034 |
5941 | 6035 |
5942 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6036 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5943 compiler->SetNeedsStacktrace(catch_try_index()); | 6037 compiler->SetNeedsStacktrace(catch_try_index()); |
5944 compiler->GenerateRuntimeCall(token_pos(), | 6038 compiler->GenerateRuntimeCall(token_pos(), |
5945 deopt_id(), | 6039 deopt_id(), |
5946 kReThrowRuntimeEntry, | 6040 kReThrowRuntimeEntry, |
5947 2, | 6041 2, |
5948 locs()); | 6042 locs()); |
(...skipping 18 matching lines...) Expand all Loading... | |
5967 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6061 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
5968 deopt_id_, | 6062 deopt_id_, |
5969 Scanner::kNoSourcePos); | 6063 Scanner::kNoSourcePos); |
5970 } | 6064 } |
5971 if (HasParallelMove()) { | 6065 if (HasParallelMove()) { |
5972 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6066 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
5973 } | 6067 } |
5974 } | 6068 } |
5975 | 6069 |
5976 | 6070 |
5977 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { | 6071 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, |
5978 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 6072 bool opt) const { |
6073 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | |
5979 } | 6074 } |
5980 | 6075 |
5981 | 6076 |
5982 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6077 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5983 if (!compiler->is_optimizing()) { | 6078 if (!compiler->is_optimizing()) { |
5984 compiler->EmitEdgeCounter(); | 6079 compiler->EmitEdgeCounter(); |
5985 // Add a deoptimization descriptor for deoptimizing instructions that | 6080 // Add a deoptimization descriptor for deoptimizing instructions that |
5986 // may be inserted before this instruction. This descriptor points | 6081 // may be inserted before this instruction. This descriptor points |
5987 // after the edge counter for uniformity with ARM and MIPS, where we can | 6082 // after the edge counter for uniformity with ARM and MIPS, where we can |
5988 // reuse pattern matching that matches backwards from the end of the | 6083 // reuse pattern matching that matches backwards from the end of the |
5989 // pattern. | 6084 // pattern. |
5990 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6085 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
5991 GetDeoptId(), | 6086 GetDeoptId(), |
5992 Scanner::kNoSourcePos); | 6087 Scanner::kNoSourcePos); |
5993 } | 6088 } |
5994 if (HasParallelMove()) { | 6089 if (HasParallelMove()) { |
5995 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6090 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
5996 } | 6091 } |
5997 | 6092 |
5998 // We can fall through if the successor is the next block in the list. | 6093 // We can fall through if the successor is the next block in the list. |
5999 // Otherwise, we need a jump. | 6094 // Otherwise, we need a jump. |
6000 if (!compiler->CanFallThroughTo(successor())) { | 6095 if (!compiler->CanFallThroughTo(successor())) { |
6001 __ jmp(compiler->GetJumpLabel(successor())); | 6096 __ jmp(compiler->GetJumpLabel(successor())); |
6002 } | 6097 } |
6003 } | 6098 } |
6004 | 6099 |
6005 | 6100 |
6006 LocationSummary* CurrentContextInstr::MakeLocationSummary(bool opt) const { | 6101 LocationSummary* CurrentContextInstr::MakeLocationSummary(Isolate* isolate, |
6102 bool opt) const { | |
6007 return LocationSummary::Make(0, | 6103 return LocationSummary::Make(0, |
6008 Location::RequiresRegister(), | 6104 Location::RequiresRegister(), |
6009 LocationSummary::kNoCall); | 6105 LocationSummary::kNoCall); |
6010 } | 6106 } |
6011 | 6107 |
6012 | 6108 |
6013 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6109 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6014 __ MoveRegister(locs()->out(0).reg(), CTX); | 6110 __ MoveRegister(locs()->out(0).reg(), CTX); |
6015 } | 6111 } |
6016 | 6112 |
6017 | 6113 |
6018 LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const { | 6114 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate, |
6115 bool opt) const { | |
6019 const intptr_t kNumInputs = 2; | 6116 const intptr_t kNumInputs = 2; |
6020 const intptr_t kNumTemps = 0; | 6117 const intptr_t kNumTemps = 0; |
6021 if (needs_number_check()) { | 6118 if (needs_number_check()) { |
6022 LocationSummary* locs = | 6119 LocationSummary* locs = |
6023 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 6120 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu mmary::kCall); |
6024 locs->set_in(0, Location::RegisterLocation(EAX)); | 6121 locs->set_in(0, Location::RegisterLocation(EAX)); |
6025 locs->set_in(1, Location::RegisterLocation(ECX)); | 6122 locs->set_in(1, Location::RegisterLocation(ECX)); |
6026 locs->set_out(0, Location::RegisterLocation(EAX)); | 6123 locs->set_out(0, Location::RegisterLocation(EAX)); |
6027 return locs; | 6124 return locs; |
6028 } | 6125 } |
6029 LocationSummary* locs = | 6126 LocationSummary* locs = |
6030 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6127 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kNoCall); |
6031 locs->set_in(0, Location::RegisterOrConstant(left())); | 6128 locs->set_in(0, Location::RegisterOrConstant(left())); |
6032 // Only one of the inputs can be a constant. Choose register if the first one | 6129 // Only one of the inputs can be a constant. Choose register if the first one |
6033 // is a constant. | 6130 // is a constant. |
6034 locs->set_in(1, locs->in(0).IsConstant() | 6131 locs->set_in(1, locs->in(0).IsConstant() |
6035 ? Location::RequiresRegister() | 6132 ? Location::RequiresRegister() |
6036 : Location::RegisterOrConstant(right())); | 6133 : Location::RegisterOrConstant(right())); |
6037 locs->set_out(0, Location::RequiresRegister()); | 6134 locs->set_out(0, Location::RequiresRegister()); |
6038 return locs; | 6135 return locs; |
6039 } | 6136 } |
6040 | 6137 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6094 } | 6191 } |
6095 | 6192 |
6096 | 6193 |
6097 // Detect pattern when one value is zero and another is a power of 2. | 6194 // Detect pattern when one value is zero and another is a power of 2. |
6098 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { | 6195 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { |
6099 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || | 6196 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || |
6100 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); | 6197 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); |
6101 } | 6198 } |
6102 | 6199 |
6103 | 6200 |
6104 LocationSummary* IfThenElseInstr::MakeLocationSummary(bool opt) const { | 6201 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate, |
6105 comparison()->InitializeLocationSummary(opt); | 6202 bool opt) const { |
6203 comparison()->InitializeLocationSummary(isolate, opt); | |
6106 // TODO(vegorov): support byte register constraints in the register allocator. | 6204 // TODO(vegorov): support byte register constraints in the register allocator. |
6107 comparison()->locs()->set_out(0, Location::RegisterLocation(EDX)); | 6205 comparison()->locs()->set_out(0, Location::RegisterLocation(EDX)); |
6108 return comparison()->locs(); | 6206 return comparison()->locs(); |
6109 } | 6207 } |
6110 | 6208 |
6111 | 6209 |
6112 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6210 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6113 ASSERT(locs()->out(0).reg() == EDX); | 6211 ASSERT(locs()->out(0).reg() == EDX); |
6114 | 6212 |
6115 // Clear upper part of the out register. We are going to use setcc on it | 6213 // Clear upper part of the out register. We are going to use setcc on it |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6151 __ decl(EDX); | 6249 __ decl(EDX); |
6152 __ andl(EDX, Immediate( | 6250 __ andl(EDX, Immediate( |
6153 Smi::RawValue(true_value) - Smi::RawValue(false_value))); | 6251 Smi::RawValue(true_value) - Smi::RawValue(false_value))); |
6154 if (false_value != 0) { | 6252 if (false_value != 0) { |
6155 __ addl(EDX, Immediate(Smi::RawValue(false_value))); | 6253 __ addl(EDX, Immediate(Smi::RawValue(false_value))); |
6156 } | 6254 } |
6157 } | 6255 } |
6158 } | 6256 } |
6159 | 6257 |
6160 | 6258 |
6161 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { | 6259 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate, |
6260 bool opt) const { | |
6162 const intptr_t kNumInputs = 1; | 6261 const intptr_t kNumInputs = 1; |
6163 const intptr_t kNumTemps = 0; | 6262 const intptr_t kNumTemps = 0; |
6164 LocationSummary* summary = | 6263 LocationSummary* summary = |
6165 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 6264 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm ary::kCall); |
6166 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. | 6265 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. |
6167 summary->set_out(0, Location::RegisterLocation(EAX)); | 6266 summary->set_out(0, Location::RegisterLocation(EAX)); |
6168 return summary; | 6267 return summary; |
6169 } | 6268 } |
6170 | 6269 |
6171 | 6270 |
6172 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6271 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6173 // Load arguments descriptors. | 6272 // Load arguments descriptors. |
6174 intptr_t argument_count = ArgumentCount(); | 6273 intptr_t argument_count = ArgumentCount(); |
6175 const Array& arguments_descriptor = | 6274 const Array& arguments_descriptor = |
(...skipping 25 matching lines...) Expand all Loading... | |
6201 // Add deoptimization continuation point after the call and before the | 6300 // Add deoptimization continuation point after the call and before the |
6202 // arguments are removed. | 6301 // arguments are removed. |
6203 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 6302 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
6204 deopt_id_after, | 6303 deopt_id_after, |
6205 token_pos()); | 6304 token_pos()); |
6206 } | 6305 } |
6207 __ Drop(argument_count); | 6306 __ Drop(argument_count); |
6208 } | 6307 } |
6209 | 6308 |
6210 | 6309 |
6211 LocationSummary* BooleanNegateInstr::MakeLocationSummary(bool opt) const { | 6310 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, |
6311 bool opt) const { | |
6212 return LocationSummary::Make(1, | 6312 return LocationSummary::Make(1, |
6213 Location::RequiresRegister(), | 6313 Location::RequiresRegister(), |
6214 LocationSummary::kNoCall); | 6314 LocationSummary::kNoCall); |
6215 } | 6315 } |
6216 | 6316 |
6217 | 6317 |
6218 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6318 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6219 Register value = locs()->in(0).reg(); | 6319 Register value = locs()->in(0).reg(); |
6220 Register result = locs()->out(0).reg(); | 6320 Register result = locs()->out(0).reg(); |
6221 | 6321 |
6222 Label done; | 6322 Label done; |
6223 __ LoadObject(result, Bool::True()); | 6323 __ LoadObject(result, Bool::True()); |
6224 __ CompareRegisters(result, value); | 6324 __ CompareRegisters(result, value); |
6225 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 6325 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
6226 __ LoadObject(result, Bool::False()); | 6326 __ LoadObject(result, Bool::False()); |
6227 __ Bind(&done); | 6327 __ Bind(&done); |
6228 } | 6328 } |
6229 | 6329 |
6230 | 6330 |
6231 LocationSummary* AllocateObjectInstr::MakeLocationSummary(bool opt) const { | 6331 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, |
6332 bool opt) const { | |
6232 return MakeCallSummary(); | 6333 return MakeCallSummary(); |
6233 } | 6334 } |
6234 | 6335 |
6235 | 6336 |
6236 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6337 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6237 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); | 6338 const Code& stub = Code::Handle(StubCode::GetAllocationStubForClass(cls())); |
6238 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); | 6339 const ExternalLabel label(cls().ToCString(), stub.EntryPoint()); |
6239 compiler->GenerateCall(token_pos(), | 6340 compiler->GenerateCall(token_pos(), |
6240 &label, | 6341 &label, |
6241 PcDescriptors::kOther, | 6342 PcDescriptors::kOther, |
6242 locs()); | 6343 locs()); |
6243 __ Drop(ArgumentCount()); // Discard arguments. | 6344 __ Drop(ArgumentCount()); // Discard arguments. |
6244 } | 6345 } |
6245 | 6346 |
6246 } // namespace dart | 6347 } // namespace dart |
6247 | 6348 |
6248 #undef __ | 6349 #undef __ |
6249 | 6350 |
6250 #endif // defined TARGET_ARCH_IA32 | 6351 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |