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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 DECLARE_FLAG(bool, emit_edge_counters); | 27 DECLARE_FLAG(bool, emit_edge_counters); |
28 DECLARE_FLAG(bool, enable_asserts); | 28 DECLARE_FLAG(bool, enable_asserts); |
29 DECLARE_FLAG(bool, enable_type_checks); | 29 DECLARE_FLAG(bool, enable_type_checks); |
30 DECLARE_FLAG(int, optimization_counter_threshold); | 30 DECLARE_FLAG(int, optimization_counter_threshold); |
31 DECLARE_FLAG(bool, propagate_ic_data); | 31 DECLARE_FLAG(bool, propagate_ic_data); |
32 DECLARE_FLAG(bool, use_osr); | 32 DECLARE_FLAG(bool, use_osr); |
33 | 33 |
34 // Generic summary for call instructions that have all arguments pushed | 34 // Generic summary for call instructions that have all arguments pushed |
35 // on the stack and return the result in a fixed register R0. | 35 // on the stack and return the result in a fixed register R0. |
36 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { | 36 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
37 LocationSummary* result = new(isolate) LocationSummary( | 37 LocationSummary* result = new(zone) LocationSummary( |
38 isolate, 0, 0, LocationSummary::kCall); | 38 zone, 0, 0, LocationSummary::kCall); |
39 result->set_out(0, Location::RegisterLocation(R0)); | 39 result->set_out(0, Location::RegisterLocation(R0)); |
40 return result; | 40 return result; |
41 } | 41 } |
42 | 42 |
43 | 43 |
44 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate, | 44 LocationSummary* PushArgumentInstr::MakeLocationSummary(Zone* zone, |
45 bool opt) const { | 45 bool opt) const { |
46 const intptr_t kNumInputs = 1; | 46 const intptr_t kNumInputs = 1; |
47 const intptr_t kNumTemps = 0; | 47 const intptr_t kNumTemps = 0; |
48 LocationSummary* locs = new(isolate) LocationSummary( | 48 LocationSummary* locs = new(zone) LocationSummary( |
49 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 49 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
50 locs->set_in(0, Location::AnyOrConstant(value())); | 50 locs->set_in(0, Location::AnyOrConstant(value())); |
51 return locs; | 51 return locs; |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 55 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
56 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 56 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
57 // where PushArgument is handled by BindInstr::EmitNativeCode. | 57 // where PushArgument is handled by BindInstr::EmitNativeCode. |
58 if (compiler->is_optimizing()) { | 58 if (compiler->is_optimizing()) { |
59 Location value = locs()->in(0); | 59 Location value = locs()->in(0); |
60 if (value.IsRegister()) { | 60 if (value.IsRegister()) { |
61 __ Push(value.reg()); | 61 __ Push(value.reg()); |
62 } else if (value.IsConstant()) { | 62 } else if (value.IsConstant()) { |
63 __ PushObject(value.constant()); | 63 __ PushObject(value.constant()); |
64 } else { | 64 } else { |
65 ASSERT(value.IsStackSlot()); | 65 ASSERT(value.IsStackSlot()); |
66 const intptr_t value_offset = value.ToStackSlotOffset(); | 66 const intptr_t value_offset = value.ToStackSlotOffset(); |
67 __ LoadFromOffset(kWord, IP, value.base_reg(), value_offset); | 67 __ LoadFromOffset(kWord, IP, value.base_reg(), value_offset); |
68 __ Push(IP); | 68 __ Push(IP); |
69 } | 69 } |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate, | 74 LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, |
75 bool opt) const { | 75 bool opt) const { |
76 const intptr_t kNumInputs = 1; | 76 const intptr_t kNumInputs = 1; |
77 const intptr_t kNumTemps = 0; | 77 const intptr_t kNumTemps = 0; |
78 LocationSummary* locs = new(isolate) LocationSummary( | 78 LocationSummary* locs = new(zone) LocationSummary( |
79 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 79 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
80 locs->set_in(0, Location::RegisterLocation(R0)); | 80 locs->set_in(0, Location::RegisterLocation(R0)); |
81 return locs; | 81 return locs; |
82 } | 82 } |
83 | 83 |
84 | 84 |
85 // Attempt optimized compilation at return instruction instead of at the entry. | 85 // Attempt optimized compilation at return instruction instead of at the entry. |
86 // The entry needs to be patchable, no inlined objects are allowed in the area | 86 // The entry needs to be patchable, no inlined objects are allowed in the area |
87 // that will be overwritten by the patch instructions: a branch macro sequence. | 87 // that will be overwritten by the patch instructions: a branch macro sequence. |
88 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 88 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
89 const Register result = locs()->in(0).reg(); | 89 const Register result = locs()->in(0).reg(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 } | 131 } |
132 | 132 |
133 | 133 |
134 // Detect pattern when one value is zero and another is a power of 2. | 134 // Detect pattern when one value is zero and another is a power of 2. |
135 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { | 135 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { |
136 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || | 136 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || |
137 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); | 137 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate, | 141 LocationSummary* IfThenElseInstr::MakeLocationSummary(Zone* zone, |
142 bool opt) const { | 142 bool opt) const { |
143 comparison()->InitializeLocationSummary(isolate, opt); | 143 comparison()->InitializeLocationSummary(zone, opt); |
144 return comparison()->locs(); | 144 return comparison()->locs(); |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 148 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
149 const Register result = locs()->out(0).reg(); | 149 const Register result = locs()->out(0).reg(); |
150 | 150 |
151 Location left = locs()->in(0); | 151 Location left = locs()->in(0); |
152 Location right = locs()->in(1); | 152 Location right = locs()->in(1); |
153 ASSERT(!left.IsConstant() || !right.IsConstant()); | 153 ASSERT(!left.IsConstant() || !right.IsConstant()); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 const int32_t val = | 191 const int32_t val = |
192 Smi::RawValue(true_value) - Smi::RawValue(false_value); | 192 Smi::RawValue(true_value) - Smi::RawValue(false_value); |
193 __ AndImmediate(result, result, val); | 193 __ AndImmediate(result, result, val); |
194 if (false_value != 0) { | 194 if (false_value != 0) { |
195 __ AddImmediate(result, Smi::RawValue(false_value)); | 195 __ AddImmediate(result, Smi::RawValue(false_value)); |
196 } | 196 } |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 | 200 |
201 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate, | 201 LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone, |
202 bool opt) const { | 202 bool opt) const { |
203 const intptr_t kNumInputs = 1; | 203 const intptr_t kNumInputs = 1; |
204 const intptr_t kNumTemps = 0; | 204 const intptr_t kNumTemps = 0; |
205 LocationSummary* summary = new(isolate) LocationSummary( | 205 LocationSummary* summary = new(zone) LocationSummary( |
206 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 206 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
207 summary->set_in(0, Location::RegisterLocation(R0)); // Function. | 207 summary->set_in(0, Location::RegisterLocation(R0)); // Function. |
208 summary->set_out(0, Location::RegisterLocation(R0)); | 208 summary->set_out(0, Location::RegisterLocation(R0)); |
209 return summary; | 209 return summary; |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 213 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
214 // Load arguments descriptor in R4. | 214 // Load arguments descriptor in R4. |
215 int argument_count = ArgumentCount(); | 215 int argument_count = ArgumentCount(); |
216 const Array& arguments_descriptor = | 216 const Array& arguments_descriptor = |
(...skipping 24 matching lines...) Expand all Loading... |
241 // Add deoptimization continuation point after the call and before the | 241 // Add deoptimization continuation point after the call and before the |
242 // arguments are removed. | 242 // arguments are removed. |
243 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 243 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
244 deopt_id_after, | 244 deopt_id_after, |
245 token_pos()); | 245 token_pos()); |
246 } | 246 } |
247 __ Drop(argument_count); | 247 __ Drop(argument_count); |
248 } | 248 } |
249 | 249 |
250 | 250 |
251 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, | 251 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone, |
252 bool opt) const { | 252 bool opt) const { |
253 return LocationSummary::Make(isolate, | 253 return LocationSummary::Make(zone, |
254 0, | 254 0, |
255 Location::RequiresRegister(), | 255 Location::RequiresRegister(), |
256 LocationSummary::kNoCall); | 256 LocationSummary::kNoCall); |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 260 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
261 const Register result = locs()->out(0).reg(); | 261 const Register result = locs()->out(0).reg(); |
262 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); | 262 __ LoadFromOffset(kWord, result, FP, local().index() * kWordSize); |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, | 266 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone, |
267 bool opt) const { | 267 bool opt) const { |
268 return LocationSummary::Make(isolate, | 268 return LocationSummary::Make(zone, |
269 1, | 269 1, |
270 Location::SameAsFirstInput(), | 270 Location::SameAsFirstInput(), |
271 LocationSummary::kNoCall); | 271 LocationSummary::kNoCall); |
272 } | 272 } |
273 | 273 |
274 | 274 |
275 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 275 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
276 const Register value = locs()->in(0).reg(); | 276 const Register value = locs()->in(0).reg(); |
277 const Register result = locs()->out(0).reg(); | 277 const Register result = locs()->out(0).reg(); |
278 ASSERT(result == value); // Assert that register assignment is correct. | 278 ASSERT(result == value); // Assert that register assignment is correct. |
279 __ StoreToOffset(kWord, value, FP, local().index() * kWordSize); | 279 __ StoreToOffset(kWord, value, FP, local().index() * kWordSize); |
280 } | 280 } |
281 | 281 |
282 | 282 |
283 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, | 283 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, |
284 bool opt) const { | 284 bool opt) const { |
285 return LocationSummary::Make(isolate, | 285 return LocationSummary::Make(zone, |
286 0, | 286 0, |
287 Location::RequiresRegister(), | 287 Location::RequiresRegister(), |
288 LocationSummary::kNoCall); | 288 LocationSummary::kNoCall); |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 292 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
293 // The register allocator drops constant definitions that have no uses. | 293 // The register allocator drops constant definitions that have no uses. |
294 if (!locs()->out(0).IsInvalid()) { | 294 if (!locs()->out(0).IsInvalid()) { |
295 const Register result = locs()->out(0).reg(); | 295 const Register result = locs()->out(0).reg(); |
296 __ LoadObject(result, value()); | 296 __ LoadObject(result, value()); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 | 300 |
301 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, | 301 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, |
302 bool opt) const { | 302 bool opt) const { |
303 const intptr_t kNumInputs = 0; | 303 const intptr_t kNumInputs = 0; |
304 const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1; | 304 const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1; |
305 LocationSummary* locs = new(isolate) LocationSummary( | 305 LocationSummary* locs = new(zone) LocationSummary( |
306 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 306 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
307 if (representation_ == kUnboxedInt32) { | 307 if (representation_ == kUnboxedInt32) { |
308 locs->set_out(0, Location::RequiresRegister()); | 308 locs->set_out(0, Location::RequiresRegister()); |
309 } else { | 309 } else { |
310 ASSERT(representation_ == kUnboxedDouble); | 310 ASSERT(representation_ == kUnboxedDouble); |
311 locs->set_out(0, Location::RequiresFpuRegister()); | 311 locs->set_out(0, Location::RequiresFpuRegister()); |
312 } | 312 } |
313 if (kNumTemps > 0) { | 313 if (kNumTemps > 0) { |
314 locs->set_temp(0, Location::RequiresRegister()); | 314 locs->set_temp(0, Location::RequiresRegister()); |
315 } | 315 } |
316 return locs; | 316 return locs; |
(...skipping 19 matching lines...) Expand all Loading... |
336 __ LoadImmediate(locs()->out(0).reg(), Smi::Cast(value()).Value()); | 336 __ LoadImmediate(locs()->out(0).reg(), Smi::Cast(value()).Value()); |
337 break; | 337 break; |
338 default: | 338 default: |
339 UNREACHABLE(); | 339 UNREACHABLE(); |
340 break; | 340 break; |
341 } | 341 } |
342 } | 342 } |
343 } | 343 } |
344 | 344 |
345 | 345 |
346 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate, | 346 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Zone* zone, |
347 bool opt) const { | 347 bool opt) const { |
348 const intptr_t kNumInputs = 3; | 348 const intptr_t kNumInputs = 3; |
349 const intptr_t kNumTemps = 0; | 349 const intptr_t kNumTemps = 0; |
350 LocationSummary* summary = new(isolate) LocationSummary( | 350 LocationSummary* summary = new(zone) LocationSummary( |
351 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 351 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
352 summary->set_in(0, Location::RegisterLocation(R0)); // Value. | 352 summary->set_in(0, Location::RegisterLocation(R0)); // Value. |
353 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. | 353 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. |
354 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. | 354 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. |
355 summary->set_out(0, Location::RegisterLocation(R0)); | 355 summary->set_out(0, Location::RegisterLocation(R0)); |
356 return summary; | 356 return summary; |
357 } | 357 } |
358 | 358 |
359 | 359 |
360 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate, | 360 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Zone* zone, |
361 bool opt) const { | 361 bool opt) const { |
362 const intptr_t kNumInputs = 1; | 362 const intptr_t kNumInputs = 1; |
363 const intptr_t kNumTemps = 0; | 363 const intptr_t kNumTemps = 0; |
364 LocationSummary* locs = new(isolate) LocationSummary( | 364 LocationSummary* locs = new(zone) LocationSummary( |
365 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 365 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
366 locs->set_in(0, Location::RegisterLocation(R0)); | 366 locs->set_in(0, Location::RegisterLocation(R0)); |
367 locs->set_out(0, Location::RegisterLocation(R0)); | 367 locs->set_out(0, Location::RegisterLocation(R0)); |
368 return locs; | 368 return locs; |
369 } | 369 } |
370 | 370 |
371 | 371 |
372 static void EmitAssertBoolean(Register reg, | 372 static void EmitAssertBoolean(Register reg, |
373 intptr_t token_pos, | 373 intptr_t token_pos, |
374 intptr_t deopt_id, | 374 intptr_t deopt_id, |
375 LocationSummary* locs, | 375 LocationSummary* locs, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 case Token::kGT: return GT; | 419 case Token::kGT: return GT; |
420 case Token::kLTE: return LE; | 420 case Token::kLTE: return LE; |
421 case Token::kGTE: return GE; | 421 case Token::kGTE: return GE; |
422 default: | 422 default: |
423 UNREACHABLE(); | 423 UNREACHABLE(); |
424 return VS; | 424 return VS; |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
428 | 428 |
429 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate, | 429 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone, |
430 bool opt) const { | 430 bool opt) const { |
431 const intptr_t kNumInputs = 2; | 431 const intptr_t kNumInputs = 2; |
432 if (operation_cid() == kMintCid) { | 432 if (operation_cid() == kMintCid) { |
433 const intptr_t kNumTemps = 0; | 433 const intptr_t kNumTemps = 0; |
434 LocationSummary* locs = new(isolate) LocationSummary( | 434 LocationSummary* locs = new(zone) LocationSummary( |
435 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 435 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
436 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 436 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
437 Location::RequiresRegister())); | 437 Location::RequiresRegister())); |
438 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 438 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
439 Location::RequiresRegister())); | 439 Location::RequiresRegister())); |
440 locs->set_out(0, Location::RequiresRegister()); | 440 locs->set_out(0, Location::RequiresRegister()); |
441 return locs; | 441 return locs; |
442 } | 442 } |
443 if (operation_cid() == kDoubleCid) { | 443 if (operation_cid() == kDoubleCid) { |
444 const intptr_t kNumTemps = 0; | 444 const intptr_t kNumTemps = 0; |
445 LocationSummary* locs = new(isolate) LocationSummary( | 445 LocationSummary* locs = new(zone) LocationSummary( |
446 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 446 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
447 locs->set_in(0, Location::RequiresFpuRegister()); | 447 locs->set_in(0, Location::RequiresFpuRegister()); |
448 locs->set_in(1, Location::RequiresFpuRegister()); | 448 locs->set_in(1, Location::RequiresFpuRegister()); |
449 locs->set_out(0, Location::RequiresRegister()); | 449 locs->set_out(0, Location::RequiresRegister()); |
450 return locs; | 450 return locs; |
451 } | 451 } |
452 if (operation_cid() == kSmiCid) { | 452 if (operation_cid() == kSmiCid) { |
453 const intptr_t kNumTemps = 0; | 453 const intptr_t kNumTemps = 0; |
454 LocationSummary* locs = new(isolate) LocationSummary( | 454 LocationSummary* locs = new(zone) LocationSummary( |
455 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 455 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
456 locs->set_in(0, Location::RegisterOrConstant(left())); | 456 locs->set_in(0, Location::RegisterOrConstant(left())); |
457 // Only one input can be a constant operand. The case of two constant | 457 // Only one input can be a constant operand. The case of two constant |
458 // operands should be handled by constant propagation. | 458 // operands should be handled by constant propagation. |
459 locs->set_in(1, locs->in(0).IsConstant() | 459 locs->set_in(1, locs->in(0).IsConstant() |
460 ? Location::RequiresRegister() | 460 ? Location::RequiresRegister() |
461 : Location::RegisterOrConstant(right())); | 461 : Location::RegisterOrConstant(right())); |
462 locs->set_out(0, Location::RequiresRegister()); | 462 locs->set_out(0, Location::RequiresRegister()); |
463 return locs; | 463 return locs; |
464 } | 464 } |
465 UNREACHABLE(); | 465 UNREACHABLE(); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 697 |
698 if (operation_cid() == kDoubleCid) { | 698 if (operation_cid() == kDoubleCid) { |
699 Label* nan_result = (true_condition == NE) ? | 699 Label* nan_result = (true_condition == NE) ? |
700 labels.true_label : labels.false_label; | 700 labels.true_label : labels.false_label; |
701 __ b(nan_result, VS); | 701 __ b(nan_result, VS); |
702 } | 702 } |
703 EmitBranchOnCondition(compiler, true_condition, labels); | 703 EmitBranchOnCondition(compiler, true_condition, labels); |
704 } | 704 } |
705 | 705 |
706 | 706 |
707 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate, | 707 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, |
708 bool opt) const { | 708 bool opt) const { |
709 const intptr_t kNumInputs = 2; | 709 const intptr_t kNumInputs = 2; |
710 const intptr_t kNumTemps = 0; | 710 const intptr_t kNumTemps = 0; |
711 LocationSummary* locs = new(isolate) LocationSummary( | 711 LocationSummary* locs = new(zone) LocationSummary( |
712 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 712 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
713 locs->set_in(0, Location::RequiresRegister()); | 713 locs->set_in(0, Location::RequiresRegister()); |
714 // Only one input can be a constant operand. The case of two constant | 714 // Only one input can be a constant operand. The case of two constant |
715 // operands should be handled by constant propagation. | 715 // operands should be handled by constant propagation. |
716 locs->set_in(1, Location::RegisterOrConstant(right())); | 716 locs->set_in(1, Location::RegisterOrConstant(right())); |
717 return locs; | 717 return locs; |
718 } | 718 } |
719 | 719 |
720 | 720 |
721 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 721 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
722 BranchLabels labels) { | 722 BranchLabels labels) { |
(...skipping 19 matching lines...) Expand all Loading... |
742 | 742 |
743 | 743 |
744 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 744 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
745 BranchInstr* branch) { | 745 BranchInstr* branch) { |
746 BranchLabels labels = compiler->CreateBranchLabels(branch); | 746 BranchLabels labels = compiler->CreateBranchLabels(branch); |
747 Condition true_condition = EmitComparisonCode(compiler, labels); | 747 Condition true_condition = EmitComparisonCode(compiler, labels); |
748 EmitBranchOnCondition(compiler, true_condition, labels); | 748 EmitBranchOnCondition(compiler, true_condition, labels); |
749 } | 749 } |
750 | 750 |
751 | 751 |
752 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate, | 752 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone, |
753 bool opt) const { | 753 bool opt) const { |
754 const intptr_t kNumInputs = 1; | 754 const intptr_t kNumInputs = 1; |
755 const intptr_t kNumTemps = 1; | 755 const intptr_t kNumTemps = 1; |
756 LocationSummary* locs = new(isolate) LocationSummary( | 756 LocationSummary* locs = new(zone) LocationSummary( |
757 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 757 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
758 locs->set_in(0, Location::RequiresRegister()); | 758 locs->set_in(0, Location::RequiresRegister()); |
759 locs->set_temp(0, Location::RequiresRegister()); | 759 locs->set_temp(0, Location::RequiresRegister()); |
760 locs->set_out(0, Location::RequiresRegister()); | 760 locs->set_out(0, Location::RequiresRegister()); |
761 return locs; | 761 return locs; |
762 } | 762 } |
763 | 763 |
764 | 764 |
765 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 765 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
766 BranchLabels labels) { | 766 BranchLabels labels) { |
767 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 767 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 EmitComparisonCode(compiler, labels); | 815 EmitComparisonCode(compiler, labels); |
816 __ Bind(&is_false); | 816 __ Bind(&is_false); |
817 __ LoadObject(result_reg, Bool::False()); | 817 __ LoadObject(result_reg, Bool::False()); |
818 __ b(&done); | 818 __ b(&done); |
819 __ Bind(&is_true); | 819 __ Bind(&is_true); |
820 __ LoadObject(result_reg, Bool::True()); | 820 __ LoadObject(result_reg, Bool::True()); |
821 __ Bind(&done); | 821 __ Bind(&done); |
822 } | 822 } |
823 | 823 |
824 | 824 |
825 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate, | 825 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone, |
826 bool opt) const { | 826 bool opt) const { |
827 const intptr_t kNumInputs = 2; | 827 const intptr_t kNumInputs = 2; |
828 const intptr_t kNumTemps = 0; | 828 const intptr_t kNumTemps = 0; |
829 if (operation_cid() == kMintCid) { | 829 if (operation_cid() == kMintCid) { |
830 const intptr_t kNumTemps = 0; | 830 const intptr_t kNumTemps = 0; |
831 LocationSummary* locs = new(isolate) LocationSummary( | 831 LocationSummary* locs = new(zone) LocationSummary( |
832 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 832 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
833 locs->set_in(0, Location::Pair(Location::RequiresRegister(), | 833 locs->set_in(0, Location::Pair(Location::RequiresRegister(), |
834 Location::RequiresRegister())); | 834 Location::RequiresRegister())); |
835 locs->set_in(1, Location::Pair(Location::RequiresRegister(), | 835 locs->set_in(1, Location::Pair(Location::RequiresRegister(), |
836 Location::RequiresRegister())); | 836 Location::RequiresRegister())); |
837 locs->set_out(0, Location::RequiresRegister()); | 837 locs->set_out(0, Location::RequiresRegister()); |
838 return locs; | 838 return locs; |
839 } | 839 } |
840 if (operation_cid() == kDoubleCid) { | 840 if (operation_cid() == kDoubleCid) { |
841 LocationSummary* summary = new(isolate) LocationSummary( | 841 LocationSummary* summary = new(zone) LocationSummary( |
842 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 842 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
843 summary->set_in(0, Location::RequiresFpuRegister()); | 843 summary->set_in(0, Location::RequiresFpuRegister()); |
844 summary->set_in(1, Location::RequiresFpuRegister()); | 844 summary->set_in(1, Location::RequiresFpuRegister()); |
845 summary->set_out(0, Location::RequiresRegister()); | 845 summary->set_out(0, Location::RequiresRegister()); |
846 return summary; | 846 return summary; |
847 } | 847 } |
848 ASSERT(operation_cid() == kSmiCid); | 848 ASSERT(operation_cid() == kSmiCid); |
849 LocationSummary* summary = new(isolate) LocationSummary( | 849 LocationSummary* summary = new(zone) LocationSummary( |
850 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 850 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
851 summary->set_in(0, Location::RegisterOrConstant(left())); | 851 summary->set_in(0, Location::RegisterOrConstant(left())); |
852 // Only one input can be a constant operand. The case of two constant | 852 // Only one input can be a constant operand. The case of two constant |
853 // operands should be handled by constant propagation. | 853 // operands should be handled by constant propagation. |
854 summary->set_in(1, summary->in(0).IsConstant() | 854 summary->set_in(1, summary->in(0).IsConstant() |
855 ? Location::RequiresRegister() | 855 ? Location::RequiresRegister() |
856 : Location::RegisterOrConstant(right())); | 856 : Location::RegisterOrConstant(right())); |
857 summary->set_out(0, Location::RequiresRegister()); | 857 summary->set_out(0, Location::RequiresRegister()); |
858 return summary; | 858 return summary; |
859 } | 859 } |
860 | 860 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
912 EmitBranchOnCondition(compiler, true_condition, labels); | 912 EmitBranchOnCondition(compiler, true_condition, labels); |
913 } else if (operation_cid() == kDoubleCid) { | 913 } else if (operation_cid() == kDoubleCid) { |
914 Label* nan_result = (true_condition == NE) ? | 914 Label* nan_result = (true_condition == NE) ? |
915 labels.true_label : labels.false_label; | 915 labels.true_label : labels.false_label; |
916 __ b(nan_result, VS); | 916 __ b(nan_result, VS); |
917 EmitBranchOnCondition(compiler, true_condition, labels); | 917 EmitBranchOnCondition(compiler, true_condition, labels); |
918 } | 918 } |
919 } | 919 } |
920 | 920 |
921 | 921 |
922 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate, | 922 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, |
923 bool opt) const { | 923 bool opt) const { |
924 return MakeCallSummary(isolate); | 924 return MakeCallSummary(zone); |
925 } | 925 } |
926 | 926 |
927 | 927 |
928 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 928 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
929 const Register result = locs()->out(0).reg(); | 929 const Register result = locs()->out(0).reg(); |
930 | 930 |
931 // Push the result place holder initialized to NULL. | 931 // Push the result place holder initialized to NULL. |
932 __ PushObject(Object::null_object()); | 932 __ PushObject(Object::null_object()); |
933 // Pass a pointer to the first argument in R2. | 933 // Pass a pointer to the first argument in R2. |
934 if (!function().HasOptionalParameters()) { | 934 if (!function().HasOptionalParameters()) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 __ LoadImmediate(R5, entry); | 967 __ LoadImmediate(R5, entry); |
968 __ LoadImmediate(R1, argc_tag); | 968 __ LoadImmediate(R1, argc_tag); |
969 compiler->GenerateCall(token_pos(), | 969 compiler->GenerateCall(token_pos(), |
970 stub_entry, | 970 stub_entry, |
971 RawPcDescriptors::kOther, | 971 RawPcDescriptors::kOther, |
972 locs()); | 972 locs()); |
973 __ Pop(result); | 973 __ Pop(result); |
974 } | 974 } |
975 | 975 |
976 | 976 |
977 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 977 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
978 bool opt) const { | 978 bool opt) const { |
979 const intptr_t kNumInputs = 1; | 979 const intptr_t kNumInputs = 1; |
980 // TODO(fschneider): Allow immediate operands for the char code. | 980 // TODO(fschneider): Allow immediate operands for the char code. |
981 return LocationSummary::Make(isolate, | 981 return LocationSummary::Make(zone, |
982 kNumInputs, | 982 kNumInputs, |
983 Location::RequiresRegister(), | 983 Location::RequiresRegister(), |
984 LocationSummary::kNoCall); | 984 LocationSummary::kNoCall); |
985 } | 985 } |
986 | 986 |
987 | 987 |
988 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 988 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
989 const Register char_code = locs()->in(0).reg(); | 989 const Register char_code = locs()->in(0).reg(); |
990 const Register result = locs()->out(0).reg(); | 990 const Register result = locs()->out(0).reg(); |
991 __ LoadImmediate(result, | 991 __ LoadImmediate(result, |
992 reinterpret_cast<uword>(Symbols::PredefinedAddress())); | 992 reinterpret_cast<uword>(Symbols::PredefinedAddress())); |
993 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); | 993 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); |
994 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. | 994 __ ldr(result, Address(result, char_code, LSL, 1)); // Char code is a smi. |
995 } | 995 } |
996 | 996 |
997 | 997 |
998 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 998 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, |
999 bool opt) const { | 999 bool opt) const { |
1000 const intptr_t kNumInputs = 1; | 1000 const intptr_t kNumInputs = 1; |
1001 return LocationSummary::Make(isolate, | 1001 return LocationSummary::Make(zone, |
1002 kNumInputs, | 1002 kNumInputs, |
1003 Location::RequiresRegister(), | 1003 Location::RequiresRegister(), |
1004 LocationSummary::kNoCall); | 1004 LocationSummary::kNoCall); |
1005 } | 1005 } |
1006 | 1006 |
1007 | 1007 |
1008 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1008 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1009 ASSERT(cid_ == kOneByteStringCid); | 1009 ASSERT(cid_ == kOneByteStringCid); |
1010 const Register str = locs()->in(0).reg(); | 1010 const Register str = locs()->in(0).reg(); |
1011 const Register result = locs()->out(0).reg(); | 1011 const Register result = locs()->out(0).reg(); |
1012 __ ldr(result, FieldAddress(str, String::length_offset())); | 1012 __ ldr(result, FieldAddress(str, String::length_offset())); |
1013 __ cmp(result, Operand(Smi::RawValue(1))); | 1013 __ cmp(result, Operand(Smi::RawValue(1))); |
1014 __ LoadImmediate(result, -1, NE); | 1014 __ LoadImmediate(result, -1, NE); |
1015 __ ldrb(result, FieldAddress(str, OneByteString::data_offset()), EQ); | 1015 __ ldrb(result, FieldAddress(str, OneByteString::data_offset()), EQ); |
1016 __ SmiTag(result); | 1016 __ SmiTag(result); |
1017 } | 1017 } |
1018 | 1018 |
1019 | 1019 |
1020 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate, | 1020 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Zone* zone, |
1021 bool opt) const { | 1021 bool opt) const { |
1022 const intptr_t kNumInputs = 1; | 1022 const intptr_t kNumInputs = 1; |
1023 const intptr_t kNumTemps = 0; | 1023 const intptr_t kNumTemps = 0; |
1024 LocationSummary* summary = new(isolate) LocationSummary( | 1024 LocationSummary* summary = new(zone) LocationSummary( |
1025 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 1025 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
1026 summary->set_in(0, Location::RegisterLocation(R0)); | 1026 summary->set_in(0, Location::RegisterLocation(R0)); |
1027 summary->set_out(0, Location::RegisterLocation(R0)); | 1027 summary->set_out(0, Location::RegisterLocation(R0)); |
1028 return summary; | 1028 return summary; |
1029 } | 1029 } |
1030 | 1030 |
1031 | 1031 |
1032 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1032 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1033 const Register array = locs()->in(0).reg(); | 1033 const Register array = locs()->in(0).reg(); |
1034 __ Push(array); | 1034 __ Push(array); |
1035 const int kNumberOfArguments = 1; | 1035 const int kNumberOfArguments = 1; |
1036 const Array& kNoArgumentNames = Object::null_array(); | 1036 const Array& kNoArgumentNames = Object::null_array(); |
1037 compiler->GenerateStaticCall(deopt_id(), | 1037 compiler->GenerateStaticCall(deopt_id(), |
1038 token_pos(), | 1038 token_pos(), |
1039 CallFunction(), | 1039 CallFunction(), |
1040 kNumberOfArguments, | 1040 kNumberOfArguments, |
1041 kNoArgumentNames, | 1041 kNoArgumentNames, |
1042 locs(), | 1042 locs(), |
1043 ICData::Handle()); | 1043 ICData::Handle()); |
1044 ASSERT(locs()->out(0).reg() == R0); | 1044 ASSERT(locs()->out(0).reg() == R0); |
1045 } | 1045 } |
1046 | 1046 |
1047 | 1047 |
1048 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, | 1048 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, |
1049 bool opt) const { | 1049 bool opt) const { |
1050 const intptr_t kNumInputs = 1; | 1050 const intptr_t kNumInputs = 1; |
1051 return LocationSummary::Make(isolate, | 1051 return LocationSummary::Make(zone, |
1052 kNumInputs, | 1052 kNumInputs, |
1053 Location::RequiresRegister(), | 1053 Location::RequiresRegister(), |
1054 LocationSummary::kNoCall); | 1054 LocationSummary::kNoCall); |
1055 } | 1055 } |
1056 | 1056 |
1057 | 1057 |
1058 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1058 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1059 const Register obj = locs()->in(0).reg(); | 1059 const Register obj = locs()->in(0).reg(); |
1060 const Register result = locs()->out(0).reg(); | 1060 const Register result = locs()->out(0).reg(); |
1061 if (object()->definition()->representation() == kUntagged) { | 1061 if (object()->definition()->representation() == kUntagged) { |
1062 __ LoadFromOffset(kWord, result, obj, offset()); | 1062 __ LoadFromOffset(kWord, result, obj, offset()); |
1063 } else { | 1063 } else { |
1064 ASSERT(object()->definition()->representation() == kTagged); | 1064 ASSERT(object()->definition()->representation() == kTagged); |
1065 __ LoadFieldFromOffset(kWord, result, obj, offset()); | 1065 __ LoadFieldFromOffset(kWord, result, obj, offset()); |
1066 } | 1066 } |
1067 } | 1067 } |
1068 | 1068 |
1069 | 1069 |
1070 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 1070 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone, |
1071 bool opt) const { | 1071 bool opt) const { |
1072 const intptr_t kNumInputs = 1; | 1072 const intptr_t kNumInputs = 1; |
1073 return LocationSummary::Make(isolate, | 1073 return LocationSummary::Make(zone, |
1074 kNumInputs, | 1074 kNumInputs, |
1075 Location::RequiresRegister(), | 1075 Location::RequiresRegister(), |
1076 LocationSummary::kNoCall); | 1076 LocationSummary::kNoCall); |
1077 } | 1077 } |
1078 | 1078 |
1079 | 1079 |
1080 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1080 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1081 const Register object = locs()->in(0).reg(); | 1081 const Register object = locs()->in(0).reg(); |
1082 const Register result = locs()->out(0).reg(); | 1082 const Register result = locs()->out(0).reg(); |
1083 __ LoadTaggedClassIdMayBeSmi(result, object); | 1083 __ LoadTaggedClassIdMayBeSmi(result, object); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 | 1187 |
1188 if (Address::CanHoldImmediateOffset(is_load, cid, offset - base_offset)) { | 1188 if (Address::CanHoldImmediateOffset(is_load, cid, offset - base_offset)) { |
1189 *needs_base = true; | 1189 *needs_base = true; |
1190 return true; | 1190 return true; |
1191 } | 1191 } |
1192 | 1192 |
1193 return false; | 1193 return false; |
1194 } | 1194 } |
1195 | 1195 |
1196 | 1196 |
1197 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1197 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, |
1198 bool opt) const { | 1198 bool opt) const { |
1199 const intptr_t kNumInputs = 2; | 1199 const intptr_t kNumInputs = 2; |
1200 const intptr_t kNumTemps = 0; | 1200 const intptr_t kNumTemps = 0; |
1201 LocationSummary* locs = new(isolate) LocationSummary( | 1201 LocationSummary* locs = new(zone) LocationSummary( |
1202 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1202 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1203 locs->set_in(0, Location::RequiresRegister()); | 1203 locs->set_in(0, Location::RequiresRegister()); |
1204 bool needs_base = false; | 1204 bool needs_base = false; |
1205 if (CanBeImmediateIndex(index(), class_id(), IsExternal(), | 1205 if (CanBeImmediateIndex(index(), class_id(), IsExternal(), |
1206 true, // Load. | 1206 true, // Load. |
1207 &needs_base)) { | 1207 &needs_base)) { |
1208 // CanBeImmediateIndex must return false for unsafe smis. | 1208 // CanBeImmediateIndex must return false for unsafe smis. |
1209 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1209 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
1210 } else { | 1210 } else { |
1211 locs->set_in(1, Location::RequiresRegister()); | 1211 locs->set_in(1, Location::RequiresRegister()); |
1212 } | 1212 } |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 return kUnboxedInt32x4; | 1366 return kUnboxedInt32x4; |
1367 case kTypedDataFloat64x2ArrayCid: | 1367 case kTypedDataFloat64x2ArrayCid: |
1368 return kUnboxedFloat64x2; | 1368 return kUnboxedFloat64x2; |
1369 default: | 1369 default: |
1370 UNREACHABLE(); | 1370 UNREACHABLE(); |
1371 return kTagged; | 1371 return kTagged; |
1372 } | 1372 } |
1373 } | 1373 } |
1374 | 1374 |
1375 | 1375 |
1376 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1376 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, |
1377 bool opt) const { | 1377 bool opt) const { |
1378 const intptr_t kNumInputs = 3; | 1378 const intptr_t kNumInputs = 3; |
1379 LocationSummary* locs; | 1379 LocationSummary* locs; |
1380 | 1380 |
1381 bool needs_base = false; | 1381 bool needs_base = false; |
1382 if (CanBeImmediateIndex(index(), class_id(), IsExternal(), | 1382 if (CanBeImmediateIndex(index(), class_id(), IsExternal(), |
1383 false, // Store. | 1383 false, // Store. |
1384 &needs_base)) { | 1384 &needs_base)) { |
1385 const intptr_t kNumTemps = needs_base ? 1 : 0; | 1385 const intptr_t kNumTemps = needs_base ? 1 : 0; |
1386 locs = new(isolate) LocationSummary( | 1386 locs = new(zone) LocationSummary( |
1387 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1387 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1388 | 1388 |
1389 // CanBeImmediateIndex must return false for unsafe smis. | 1389 // CanBeImmediateIndex must return false for unsafe smis. |
1390 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1390 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
1391 if (needs_base) { | 1391 if (needs_base) { |
1392 locs->set_temp(0, Location::RequiresRegister()); | 1392 locs->set_temp(0, Location::RequiresRegister()); |
1393 } | 1393 } |
1394 } else { | 1394 } else { |
1395 const intptr_t kNumTemps = 0; | 1395 const intptr_t kNumTemps = 0; |
1396 locs = new(isolate) LocationSummary( | 1396 locs = new(zone) LocationSummary( |
1397 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1397 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1398 | 1398 |
1399 locs->set_in(1, Location::WritableRegister()); | 1399 locs->set_in(1, Location::WritableRegister()); |
1400 } | 1400 } |
1401 locs->set_in(0, Location::RequiresRegister()); | 1401 locs->set_in(0, Location::RequiresRegister()); |
1402 | 1402 |
1403 switch (class_id()) { | 1403 switch (class_id()) { |
1404 case kArrayCid: | 1404 case kArrayCid: |
1405 locs->set_in(2, ShouldEmitStoreBarrier() | 1405 locs->set_in(2, ShouldEmitStoreBarrier() |
1406 ? Location::WritableRegister() | 1406 ? Location::WritableRegister() |
1407 : Location::RegisterOrConstant(value())); | 1407 : Location::RegisterOrConstant(value())); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 const DRegister value_reg = EvenDRegisterOf(locs()->in(2).fpu_reg()); | 1537 const DRegister value_reg = EvenDRegisterOf(locs()->in(2).fpu_reg()); |
1538 __ vstmd(IA, index.reg(), value_reg, 2); | 1538 __ vstmd(IA, index.reg(), value_reg, 2); |
1539 break; | 1539 break; |
1540 } | 1540 } |
1541 default: | 1541 default: |
1542 UNREACHABLE(); | 1542 UNREACHABLE(); |
1543 } | 1543 } |
1544 } | 1544 } |
1545 | 1545 |
1546 | 1546 |
1547 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Isolate* isolate, | 1547 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone, |
1548 bool opt) const { | 1548 bool opt) const { |
1549 const intptr_t kNumInputs = 1; | 1549 const intptr_t kNumInputs = 1; |
1550 | 1550 |
1551 const intptr_t value_cid = value()->Type()->ToCid(); | 1551 const intptr_t value_cid = value()->Type()->ToCid(); |
1552 const intptr_t field_cid = field().guarded_cid(); | 1552 const intptr_t field_cid = field().guarded_cid(); |
1553 | 1553 |
1554 const bool emit_full_guard = | 1554 const bool emit_full_guard = |
1555 !opt || (field_cid == kIllegalCid); | 1555 !opt || (field_cid == kIllegalCid); |
1556 | 1556 |
1557 const bool needs_value_cid_temp_reg = emit_full_guard || | 1557 const bool needs_value_cid_temp_reg = emit_full_guard || |
1558 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); | 1558 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); |
1559 | 1559 |
1560 const bool needs_field_temp_reg = emit_full_guard; | 1560 const bool needs_field_temp_reg = emit_full_guard; |
1561 | 1561 |
1562 intptr_t num_temps = 0; | 1562 intptr_t num_temps = 0; |
1563 if (needs_value_cid_temp_reg) { | 1563 if (needs_value_cid_temp_reg) { |
1564 num_temps++; | 1564 num_temps++; |
1565 } | 1565 } |
1566 if (needs_field_temp_reg) { | 1566 if (needs_field_temp_reg) { |
1567 num_temps++; | 1567 num_temps++; |
1568 } | 1568 } |
1569 | 1569 |
1570 LocationSummary* summary = new(isolate) LocationSummary( | 1570 LocationSummary* summary = new(zone) LocationSummary( |
1571 isolate, kNumInputs, num_temps, LocationSummary::kNoCall); | 1571 zone, kNumInputs, num_temps, LocationSummary::kNoCall); |
1572 summary->set_in(0, Location::RequiresRegister()); | 1572 summary->set_in(0, Location::RequiresRegister()); |
1573 | 1573 |
1574 for (intptr_t i = 0; i < num_temps; i++) { | 1574 for (intptr_t i = 0; i < num_temps; i++) { |
1575 summary->set_temp(i, Location::RequiresRegister()); | 1575 summary->set_temp(i, Location::RequiresRegister()); |
1576 } | 1576 } |
1577 | 1577 |
1578 return summary; | 1578 return summary; |
1579 } | 1579 } |
1580 | 1580 |
1581 | 1581 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 } else { | 1704 } else { |
1705 // Both value's and field's class id is known. | 1705 // Both value's and field's class id is known. |
1706 ASSERT((value_cid != field_cid) && (value_cid != nullability)); | 1706 ASSERT((value_cid != field_cid) && (value_cid != nullability)); |
1707 __ b(fail); | 1707 __ b(fail); |
1708 } | 1708 } |
1709 } | 1709 } |
1710 __ Bind(&ok); | 1710 __ Bind(&ok); |
1711 } | 1711 } |
1712 | 1712 |
1713 | 1713 |
1714 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Isolate* isolate, | 1714 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Zone* zone, |
1715 bool opt) const { | 1715 bool opt) const { |
1716 const intptr_t kNumInputs = 1; | 1716 const intptr_t kNumInputs = 1; |
1717 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) { | 1717 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) { |
1718 const intptr_t kNumTemps = 3; | 1718 const intptr_t kNumTemps = 3; |
1719 LocationSummary* summary = new(isolate) LocationSummary( | 1719 LocationSummary* summary = new(zone) LocationSummary( |
1720 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1720 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1721 summary->set_in(0, Location::RequiresRegister()); | 1721 summary->set_in(0, Location::RequiresRegister()); |
1722 // We need temporaries for field object, length offset and expected length. | 1722 // We need temporaries for field object, length offset and expected length. |
1723 summary->set_temp(0, Location::RequiresRegister()); | 1723 summary->set_temp(0, Location::RequiresRegister()); |
1724 summary->set_temp(1, Location::RequiresRegister()); | 1724 summary->set_temp(1, Location::RequiresRegister()); |
1725 summary->set_temp(2, Location::RequiresRegister()); | 1725 summary->set_temp(2, Location::RequiresRegister()); |
1726 return summary; | 1726 return summary; |
1727 } else { | 1727 } else { |
1728 // TODO(vegorov): can use TMP when length is small enough to fit into | 1728 // TODO(vegorov): can use TMP when length is small enough to fit into |
1729 // immediate. | 1729 // immediate. |
1730 const intptr_t kNumTemps = 1; | 1730 const intptr_t kNumTemps = 1; |
1731 LocationSummary* summary = new(isolate) LocationSummary( | 1731 LocationSummary* summary = new(zone) LocationSummary( |
1732 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1732 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1733 summary->set_in(0, Location::RequiresRegister()); | 1733 summary->set_in(0, Location::RequiresRegister()); |
1734 summary->set_temp(0, Location::RequiresRegister()); | 1734 summary->set_temp(0, Location::RequiresRegister()); |
1735 return summary; | 1735 return summary; |
1736 } | 1736 } |
1737 UNREACHABLE(); | 1737 UNREACHABLE(); |
1738 } | 1738 } |
1739 | 1739 |
1740 | 1740 |
1741 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1741 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1742 if (field().guarded_list_length() == Field::kNoFixedLength) { | 1742 if (field().guarded_list_length() == Field::kNoFixedLength) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 | 1866 |
1867 private: | 1867 private: |
1868 Instruction* instruction_; | 1868 Instruction* instruction_; |
1869 const Class& cls_; | 1869 const Class& cls_; |
1870 const Register result_; | 1870 const Register result_; |
1871 }; | 1871 }; |
1872 | 1872 |
1873 | 1873 |
1874 | 1874 |
1875 | 1875 |
1876 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate, | 1876 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, |
1877 bool opt) const { | 1877 bool opt) const { |
1878 const bool might_box = (representation() == kTagged) && !can_pack_into_smi(); | 1878 const bool might_box = (representation() == kTagged) && !can_pack_into_smi(); |
1879 const intptr_t kNumInputs = 2; | 1879 const intptr_t kNumInputs = 2; |
1880 const intptr_t kNumTemps = might_box ? 1 : 0; | 1880 const intptr_t kNumTemps = might_box ? 1 : 0; |
1881 LocationSummary* summary = new(isolate) LocationSummary( | 1881 LocationSummary* summary = new(zone) LocationSummary( |
1882 isolate, kNumInputs, kNumTemps, | 1882 zone, kNumInputs, kNumTemps, |
1883 might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall); | 1883 might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall); |
1884 summary->set_in(0, Location::RequiresRegister()); | 1884 summary->set_in(0, Location::RequiresRegister()); |
1885 summary->set_in(1, Location::RequiresRegister()); | 1885 summary->set_in(1, Location::RequiresRegister()); |
1886 | 1886 |
1887 if (might_box) { | 1887 if (might_box) { |
1888 summary->set_temp(0, Location::RequiresRegister()); | 1888 summary->set_temp(0, Location::RequiresRegister()); |
1889 } | 1889 } |
1890 | 1890 |
1891 if (representation() == kUnboxedMint) { | 1891 if (representation() == kUnboxedMint) { |
1892 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 1892 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1978 __ StoreToOffset(kWord, value, result, | 1978 __ StoreToOffset(kWord, value, result, |
1979 Mint::value_offset() - kHeapObjectTag); | 1979 Mint::value_offset() - kHeapObjectTag); |
1980 __ StoreToOffset(kWord, temp, result, | 1980 __ StoreToOffset(kWord, temp, result, |
1981 Mint::value_offset() - kHeapObjectTag + kWordSize); | 1981 Mint::value_offset() - kHeapObjectTag + kWordSize); |
1982 __ Bind(&done); | 1982 __ Bind(&done); |
1983 } | 1983 } |
1984 } | 1984 } |
1985 } | 1985 } |
1986 | 1986 |
1987 | 1987 |
1988 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate, | 1988 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone, |
1989 bool opt) const { | 1989 bool opt) const { |
1990 const intptr_t kNumInputs = 2; | 1990 const intptr_t kNumInputs = 2; |
1991 const intptr_t kNumTemps = | 1991 const intptr_t kNumTemps = |
1992 (IsUnboxedStore() && opt) ? 2 : | 1992 (IsUnboxedStore() && opt) ? 2 : |
1993 ((IsPotentialUnboxedStore()) ? 3 : 0); | 1993 ((IsPotentialUnboxedStore()) ? 3 : 0); |
1994 LocationSummary* summary = new(isolate) LocationSummary( | 1994 LocationSummary* summary = new(zone) LocationSummary( |
1995 isolate, kNumInputs, kNumTemps, | 1995 zone, kNumInputs, kNumTemps, |
1996 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || | 1996 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || |
1997 IsPotentialUnboxedStore()) | 1997 IsPotentialUnboxedStore()) |
1998 ? LocationSummary::kCallOnSlowPath | 1998 ? LocationSummary::kCallOnSlowPath |
1999 : LocationSummary::kNoCall); | 1999 : LocationSummary::kNoCall); |
2000 | 2000 |
2001 summary->set_in(0, Location::RequiresRegister()); | 2001 summary->set_in(0, Location::RequiresRegister()); |
2002 if (IsUnboxedStore() && opt) { | 2002 if (IsUnboxedStore() && opt) { |
2003 summary->set_in(1, Location::RequiresFpuRegister()); | 2003 summary->set_in(1, Location::RequiresFpuRegister()); |
2004 summary->set_temp(0, Location::RequiresRegister()); | 2004 summary->set_temp(0, Location::RequiresRegister()); |
2005 summary->set_temp(1, Location::RequiresRegister()); | 2005 summary->set_temp(1, Location::RequiresRegister()); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 const Register value_reg = locs()->in(1).reg(); | 2203 const Register value_reg = locs()->in(1).reg(); |
2204 __ StoreIntoObjectNoBarrierOffset(instance_reg, | 2204 __ StoreIntoObjectNoBarrierOffset(instance_reg, |
2205 offset_in_bytes_, | 2205 offset_in_bytes_, |
2206 value_reg); | 2206 value_reg); |
2207 } | 2207 } |
2208 } | 2208 } |
2209 __ Bind(&skip_store); | 2209 __ Bind(&skip_store); |
2210 } | 2210 } |
2211 | 2211 |
2212 | 2212 |
2213 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 2213 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone, |
2214 bool opt) const { | 2214 bool opt) const { |
2215 const intptr_t kNumInputs = 1; | 2215 const intptr_t kNumInputs = 1; |
2216 const intptr_t kNumTemps = 0; | 2216 const intptr_t kNumTemps = 0; |
2217 LocationSummary* summary = new(isolate) LocationSummary( | 2217 LocationSummary* summary = new(zone) LocationSummary( |
2218 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2218 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
2219 summary->set_in(0, Location::RequiresRegister()); | 2219 summary->set_in(0, Location::RequiresRegister()); |
2220 summary->set_out(0, Location::RequiresRegister()); | 2220 summary->set_out(0, Location::RequiresRegister()); |
2221 return summary; | 2221 return summary; |
2222 } | 2222 } |
2223 | 2223 |
2224 | 2224 |
2225 // When the parser is building an implicit static getter for optimization, | 2225 // When the parser is building an implicit static getter for optimization, |
2226 // it can generate a function body where deoptimization ids do not line up | 2226 // it can generate a function body where deoptimization ids do not line up |
2227 // with the unoptimized code. | 2227 // with the unoptimized code. |
2228 // | 2228 // |
2229 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 2229 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
2230 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2230 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2231 const Register field = locs()->in(0).reg(); | 2231 const Register field = locs()->in(0).reg(); |
2232 const Register result = locs()->out(0).reg(); | 2232 const Register result = locs()->out(0).reg(); |
2233 __ LoadFieldFromOffset(kWord, result, field, Field::value_offset()); | 2233 __ LoadFieldFromOffset(kWord, result, field, Field::value_offset()); |
2234 } | 2234 } |
2235 | 2235 |
2236 | 2236 |
2237 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 2237 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, |
2238 bool opt) const { | 2238 bool opt) const { |
2239 LocationSummary* locs = new(isolate) LocationSummary( | 2239 LocationSummary* locs = new(zone) LocationSummary( |
2240 isolate, 1, 1, LocationSummary::kNoCall); | 2240 zone, 1, 1, LocationSummary::kNoCall); |
2241 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 2241 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
2242 : Location::RequiresRegister()); | 2242 : Location::RequiresRegister()); |
2243 locs->set_temp(0, Location::RequiresRegister()); | 2243 locs->set_temp(0, Location::RequiresRegister()); |
2244 return locs; | 2244 return locs; |
2245 } | 2245 } |
2246 | 2246 |
2247 | 2247 |
2248 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2248 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2249 const Register value = locs()->in(0).reg(); | 2249 const Register value = locs()->in(0).reg(); |
2250 const Register temp = locs()->temp(0).reg(); | 2250 const Register temp = locs()->temp(0).reg(); |
2251 | 2251 |
2252 __ LoadObject(temp, field()); | 2252 __ LoadObject(temp, field()); |
2253 if (this->value()->NeedsStoreBuffer()) { | 2253 if (this->value()->NeedsStoreBuffer()) { |
2254 __ StoreIntoObject(temp, | 2254 __ StoreIntoObject(temp, |
2255 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 2255 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); |
2256 } else { | 2256 } else { |
2257 __ StoreIntoObjectNoBarrier( | 2257 __ StoreIntoObjectNoBarrier( |
2258 temp, FieldAddress(temp, Field::value_offset()), value); | 2258 temp, FieldAddress(temp, Field::value_offset()), value); |
2259 } | 2259 } |
2260 } | 2260 } |
2261 | 2261 |
2262 | 2262 |
2263 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate, | 2263 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, |
2264 bool opt) const { | 2264 bool opt) const { |
2265 const intptr_t kNumInputs = 3; | 2265 const intptr_t kNumInputs = 3; |
2266 const intptr_t kNumTemps = 0; | 2266 const intptr_t kNumTemps = 0; |
2267 LocationSummary* summary = new(isolate) LocationSummary( | 2267 LocationSummary* summary = new(zone) LocationSummary( |
2268 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2268 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2269 summary->set_in(0, Location::RegisterLocation(R0)); | 2269 summary->set_in(0, Location::RegisterLocation(R0)); |
2270 summary->set_in(1, Location::RegisterLocation(R2)); | 2270 summary->set_in(1, Location::RegisterLocation(R2)); |
2271 summary->set_in(2, Location::RegisterLocation(R1)); | 2271 summary->set_in(2, Location::RegisterLocation(R1)); |
2272 summary->set_out(0, Location::RegisterLocation(R0)); | 2272 summary->set_out(0, Location::RegisterLocation(R0)); |
2273 return summary; | 2273 return summary; |
2274 } | 2274 } |
2275 | 2275 |
2276 | 2276 |
2277 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2277 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2278 ASSERT(locs()->in(0).reg() == R0); // Value. | 2278 ASSERT(locs()->in(0).reg() == R0); // Value. |
2279 ASSERT(locs()->in(1).reg() == R2); // Instantiator. | 2279 ASSERT(locs()->in(1).reg() == R2); // Instantiator. |
2280 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. | 2280 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. |
2281 | 2281 |
2282 compiler->GenerateInstanceOf(token_pos(), | 2282 compiler->GenerateInstanceOf(token_pos(), |
2283 deopt_id(), | 2283 deopt_id(), |
2284 type(), | 2284 type(), |
2285 negate_result(), | 2285 negate_result(), |
2286 locs()); | 2286 locs()); |
2287 ASSERT(locs()->out(0).reg() == R0); | 2287 ASSERT(locs()->out(0).reg() == R0); |
2288 } | 2288 } |
2289 | 2289 |
2290 | 2290 |
2291 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate, | 2291 LocationSummary* CreateArrayInstr::MakeLocationSummary(Zone* zone, |
2292 bool opt) const { | 2292 bool opt) const { |
2293 const intptr_t kNumInputs = 2; | 2293 const intptr_t kNumInputs = 2; |
2294 const intptr_t kNumTemps = 0; | 2294 const intptr_t kNumTemps = 0; |
2295 LocationSummary* locs = new(isolate) LocationSummary( | 2295 LocationSummary* locs = new(zone) LocationSummary( |
2296 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2296 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2297 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); | 2297 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); |
2298 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); | 2298 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); |
2299 locs->set_out(0, Location::RegisterLocation(R0)); | 2299 locs->set_out(0, Location::RegisterLocation(R0)); |
2300 return locs; | 2300 return locs; |
2301 } | 2301 } |
2302 | 2302 |
2303 | 2303 |
2304 // Inlines array allocation for known constant values. | 2304 // Inlines array allocation for known constant values. |
2305 static void InlineArrayAllocation(FlowGraphCompiler* compiler, | 2305 static void InlineArrayAllocation(FlowGraphCompiler* compiler, |
2306 intptr_t num_elements, | 2306 intptr_t num_elements, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2393 const ExternalLabel label(stub.EntryPoint()); | 2393 const ExternalLabel label(stub.EntryPoint()); |
2394 compiler->GenerateCall(token_pos(), | 2394 compiler->GenerateCall(token_pos(), |
2395 &label, | 2395 &label, |
2396 RawPcDescriptors::kOther, | 2396 RawPcDescriptors::kOther, |
2397 locs()); | 2397 locs()); |
2398 compiler->AddStubCallTarget(stub); | 2398 compiler->AddStubCallTarget(stub); |
2399 ASSERT(locs()->out(0).reg() == kResultReg); | 2399 ASSERT(locs()->out(0).reg() == kResultReg); |
2400 } | 2400 } |
2401 | 2401 |
2402 | 2402 |
2403 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate, | 2403 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone, |
2404 bool opt) const { | 2404 bool opt) const { |
2405 const intptr_t kNumInputs = 1; | 2405 const intptr_t kNumInputs = 1; |
2406 const intptr_t kNumTemps = | 2406 const intptr_t kNumTemps = |
2407 (IsUnboxedLoad() && opt) ? 1 : | 2407 (IsUnboxedLoad() && opt) ? 1 : |
2408 ((IsPotentialUnboxedLoad()) ? 3 : 0); | 2408 ((IsPotentialUnboxedLoad()) ? 3 : 0); |
2409 | 2409 |
2410 LocationSummary* locs = new(isolate) LocationSummary( | 2410 LocationSummary* locs = new(zone) LocationSummary( |
2411 isolate, kNumInputs, kNumTemps, | 2411 zone, kNumInputs, kNumTemps, |
2412 (opt && !IsPotentialUnboxedLoad()) | 2412 (opt && !IsPotentialUnboxedLoad()) |
2413 ? LocationSummary::kNoCall | 2413 ? LocationSummary::kNoCall |
2414 : LocationSummary::kCallOnSlowPath); | 2414 : LocationSummary::kCallOnSlowPath); |
2415 | 2415 |
2416 locs->set_in(0, Location::RequiresRegister()); | 2416 locs->set_in(0, Location::RequiresRegister()); |
2417 | 2417 |
2418 if (IsUnboxedLoad() && opt) { | 2418 if (IsUnboxedLoad() && opt) { |
2419 locs->set_temp(0, Location::RequiresRegister()); | 2419 locs->set_temp(0, Location::RequiresRegister()); |
2420 } else if (IsPotentialUnboxedLoad()) { | 2420 } else if (IsPotentialUnboxedLoad()) { |
2421 locs->set_temp(0, opt ? Location::RequiresFpuRegister() | 2421 locs->set_temp(0, opt ? Location::RequiresFpuRegister() |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2537 __ b(&done); | 2537 __ b(&done); |
2538 } | 2538 } |
2539 | 2539 |
2540 __ Bind(&load_pointer); | 2540 __ Bind(&load_pointer); |
2541 } | 2541 } |
2542 __ LoadFieldFromOffset(kWord, result_reg, instance_reg, offset_in_bytes()); | 2542 __ LoadFieldFromOffset(kWord, result_reg, instance_reg, offset_in_bytes()); |
2543 __ Bind(&done); | 2543 __ Bind(&done); |
2544 } | 2544 } |
2545 | 2545 |
2546 | 2546 |
2547 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate, | 2547 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Zone* zone, |
2548 bool opt) const { | 2548 bool opt) const { |
2549 const intptr_t kNumInputs = 1; | 2549 const intptr_t kNumInputs = 1; |
2550 const intptr_t kNumTemps = 0; | 2550 const intptr_t kNumTemps = 0; |
2551 LocationSummary* locs = new(isolate) LocationSummary( | 2551 LocationSummary* locs = new(zone) LocationSummary( |
2552 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2552 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2553 locs->set_in(0, Location::RegisterLocation(R0)); | 2553 locs->set_in(0, Location::RegisterLocation(R0)); |
2554 locs->set_out(0, Location::RegisterLocation(R0)); | 2554 locs->set_out(0, Location::RegisterLocation(R0)); |
2555 return locs; | 2555 return locs; |
2556 } | 2556 } |
2557 | 2557 |
2558 | 2558 |
2559 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2559 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2560 const Register instantiator_reg = locs()->in(0).reg(); | 2560 const Register instantiator_reg = locs()->in(0).reg(); |
2561 const Register result_reg = locs()->out(0).reg(); | 2561 const Register result_reg = locs()->out(0).reg(); |
2562 | 2562 |
2563 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2563 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
2564 // A runtime call to instantiate the type is required. | 2564 // A runtime call to instantiate the type is required. |
2565 __ PushObject(Object::null_object()); // Make room for the result. | 2565 __ PushObject(Object::null_object()); // Make room for the result. |
2566 __ PushObject(type()); | 2566 __ PushObject(type()); |
2567 __ Push(instantiator_reg); // Push instantiator type arguments. | 2567 __ Push(instantiator_reg); // Push instantiator type arguments. |
2568 compiler->GenerateRuntimeCall(token_pos(), | 2568 compiler->GenerateRuntimeCall(token_pos(), |
2569 deopt_id(), | 2569 deopt_id(), |
2570 kInstantiateTypeRuntimeEntry, | 2570 kInstantiateTypeRuntimeEntry, |
2571 2, | 2571 2, |
2572 locs()); | 2572 locs()); |
2573 __ Drop(2); // Drop instantiator and uninstantiated type. | 2573 __ Drop(2); // Drop instantiator and uninstantiated type. |
2574 __ Pop(result_reg); // Pop instantiated type. | 2574 __ Pop(result_reg); // Pop instantiated type. |
2575 ASSERT(instantiator_reg == result_reg); | 2575 ASSERT(instantiator_reg == result_reg); |
2576 } | 2576 } |
2577 | 2577 |
2578 | 2578 |
2579 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( | 2579 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( |
2580 Isolate* isolate, bool opt) const { | 2580 Zone* zone, bool opt) const { |
2581 const intptr_t kNumInputs = 1; | 2581 const intptr_t kNumInputs = 1; |
2582 const intptr_t kNumTemps = 0; | 2582 const intptr_t kNumTemps = 0; |
2583 LocationSummary* locs = new(isolate) LocationSummary( | 2583 LocationSummary* locs = new(zone) LocationSummary( |
2584 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2584 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2585 locs->set_in(0, Location::RegisterLocation(R0)); | 2585 locs->set_in(0, Location::RegisterLocation(R0)); |
2586 locs->set_out(0, Location::RegisterLocation(R0)); | 2586 locs->set_out(0, Location::RegisterLocation(R0)); |
2587 return locs; | 2587 return locs; |
2588 } | 2588 } |
2589 | 2589 |
2590 | 2590 |
2591 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 2591 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
2592 FlowGraphCompiler* compiler) { | 2592 FlowGraphCompiler* compiler) { |
2593 const Register instantiator_reg = locs()->in(0).reg(); | 2593 const Register instantiator_reg = locs()->in(0).reg(); |
2594 const Register result_reg = locs()->out(0).reg(); | 2594 const Register result_reg = locs()->out(0).reg(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2639 kInstantiateTypeArgumentsRuntimeEntry, | 2639 kInstantiateTypeArgumentsRuntimeEntry, |
2640 2, | 2640 2, |
2641 locs()); | 2641 locs()); |
2642 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | 2642 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
2643 __ Pop(result_reg); // Pop instantiated type arguments. | 2643 __ Pop(result_reg); // Pop instantiated type arguments. |
2644 __ Bind(&type_arguments_instantiated); | 2644 __ Bind(&type_arguments_instantiated); |
2645 } | 2645 } |
2646 | 2646 |
2647 | 2647 |
2648 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary( | 2648 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary( |
2649 Isolate* isolate, | 2649 Zone* zone, |
2650 bool opt) const { | 2650 bool opt) const { |
2651 ASSERT(opt); | 2651 ASSERT(opt); |
2652 const intptr_t kNumInputs = 0; | 2652 const intptr_t kNumInputs = 0; |
2653 const intptr_t kNumTemps = 3; | 2653 const intptr_t kNumTemps = 3; |
2654 LocationSummary* locs = new(isolate) LocationSummary( | 2654 LocationSummary* locs = new(zone) LocationSummary( |
2655 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 2655 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
2656 locs->set_temp(0, Location::RegisterLocation(R1)); | 2656 locs->set_temp(0, Location::RegisterLocation(R1)); |
2657 locs->set_temp(1, Location::RegisterLocation(R2)); | 2657 locs->set_temp(1, Location::RegisterLocation(R2)); |
2658 locs->set_temp(2, Location::RegisterLocation(R3)); | 2658 locs->set_temp(2, Location::RegisterLocation(R3)); |
2659 locs->set_out(0, Location::RegisterLocation(R0)); | 2659 locs->set_out(0, Location::RegisterLocation(R0)); |
2660 return locs; | 2660 return locs; |
2661 } | 2661 } |
2662 | 2662 |
2663 | 2663 |
2664 class AllocateContextSlowPath : public SlowPathCode { | 2664 class AllocateContextSlowPath : public SlowPathCode { |
2665 public: | 2665 public: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 temp2); | 2711 temp2); |
2712 | 2712 |
2713 // Setup up number of context variables field. | 2713 // Setup up number of context variables field. |
2714 __ LoadImmediate(temp0, num_context_variables()); | 2714 __ LoadImmediate(temp0, num_context_variables()); |
2715 __ str(temp0, FieldAddress(result, Context::num_variables_offset())); | 2715 __ str(temp0, FieldAddress(result, Context::num_variables_offset())); |
2716 | 2716 |
2717 __ Bind(slow_path->exit_label()); | 2717 __ Bind(slow_path->exit_label()); |
2718 } | 2718 } |
2719 | 2719 |
2720 | 2720 |
2721 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate, | 2721 LocationSummary* AllocateContextInstr::MakeLocationSummary(Zone* zone, |
2722 bool opt) const { | 2722 bool opt) const { |
2723 const intptr_t kNumInputs = 0; | 2723 const intptr_t kNumInputs = 0; |
2724 const intptr_t kNumTemps = 1; | 2724 const intptr_t kNumTemps = 1; |
2725 LocationSummary* locs = new(isolate) LocationSummary( | 2725 LocationSummary* locs = new(zone) LocationSummary( |
2726 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2726 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2727 locs->set_temp(0, Location::RegisterLocation(R1)); | 2727 locs->set_temp(0, Location::RegisterLocation(R1)); |
2728 locs->set_out(0, Location::RegisterLocation(R0)); | 2728 locs->set_out(0, Location::RegisterLocation(R0)); |
2729 return locs; | 2729 return locs; |
2730 } | 2730 } |
2731 | 2731 |
2732 | 2732 |
2733 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2733 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2734 ASSERT(locs()->temp(0).reg() == R1); | 2734 ASSERT(locs()->temp(0).reg() == R1); |
2735 ASSERT(locs()->out(0).reg() == R0); | 2735 ASSERT(locs()->out(0).reg() == R0); |
2736 | 2736 |
2737 __ LoadImmediate(R1, num_context_variables()); | 2737 __ LoadImmediate(R1, num_context_variables()); |
2738 StubCode* stub_code = compiler->isolate()->stub_code(); | 2738 StubCode* stub_code = compiler->isolate()->stub_code(); |
2739 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); | 2739 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); |
2740 compiler->GenerateCall(token_pos(), | 2740 compiler->GenerateCall(token_pos(), |
2741 &label, | 2741 &label, |
2742 RawPcDescriptors::kOther, | 2742 RawPcDescriptors::kOther, |
2743 locs()); | 2743 locs()); |
2744 } | 2744 } |
2745 | 2745 |
2746 | 2746 |
2747 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 2747 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Zone* zone, |
2748 bool opt) const { | 2748 bool opt) const { |
2749 const intptr_t kNumInputs = 1; | 2749 const intptr_t kNumInputs = 1; |
2750 const intptr_t kNumTemps = 1; | 2750 const intptr_t kNumTemps = 1; |
2751 LocationSummary* locs = new(isolate) LocationSummary( | 2751 LocationSummary* locs = new(zone) LocationSummary( |
2752 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2752 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2753 locs->set_in(0, Location::RegisterLocation(R0)); | 2753 locs->set_in(0, Location::RegisterLocation(R0)); |
2754 locs->set_temp(0, Location::RegisterLocation(R1)); | 2754 locs->set_temp(0, Location::RegisterLocation(R1)); |
2755 return locs; | 2755 return locs; |
2756 } | 2756 } |
2757 | 2757 |
2758 | 2758 |
2759 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2759 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2760 Register field = locs()->in(0).reg(); | 2760 Register field = locs()->in(0).reg(); |
2761 Register temp = locs()->temp(0).reg(); | 2761 Register temp = locs()->temp(0).reg(); |
2762 Label call_runtime, no_call; | 2762 Label call_runtime, no_call; |
(...skipping 11 matching lines...) Expand all Loading... |
2774 compiler->GenerateRuntimeCall(token_pos(), | 2774 compiler->GenerateRuntimeCall(token_pos(), |
2775 deopt_id(), | 2775 deopt_id(), |
2776 kInitStaticFieldRuntimeEntry, | 2776 kInitStaticFieldRuntimeEntry, |
2777 1, | 2777 1, |
2778 locs()); | 2778 locs()); |
2779 __ Drop(2); // Remove argument and result placeholder. | 2779 __ Drop(2); // Remove argument and result placeholder. |
2780 __ Bind(&no_call); | 2780 __ Bind(&no_call); |
2781 } | 2781 } |
2782 | 2782 |
2783 | 2783 |
2784 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2784 LocationSummary* CloneContextInstr::MakeLocationSummary(Zone* zone, |
2785 bool opt) const { | 2785 bool opt) const { |
2786 const intptr_t kNumInputs = 1; | 2786 const intptr_t kNumInputs = 1; |
2787 const intptr_t kNumTemps = 0; | 2787 const intptr_t kNumTemps = 0; |
2788 LocationSummary* locs = new(isolate) LocationSummary( | 2788 LocationSummary* locs = new(zone) LocationSummary( |
2789 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2789 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2790 locs->set_in(0, Location::RegisterLocation(R0)); | 2790 locs->set_in(0, Location::RegisterLocation(R0)); |
2791 locs->set_out(0, Location::RegisterLocation(R0)); | 2791 locs->set_out(0, Location::RegisterLocation(R0)); |
2792 return locs; | 2792 return locs; |
2793 } | 2793 } |
2794 | 2794 |
2795 | 2795 |
2796 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2796 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2797 const Register context_value = locs()->in(0).reg(); | 2797 const Register context_value = locs()->in(0).reg(); |
2798 const Register result = locs()->out(0).reg(); | 2798 const Register result = locs()->out(0).reg(); |
2799 | 2799 |
2800 __ PushObject(Object::null_object()); // Make room for the result. | 2800 __ PushObject(Object::null_object()); // Make room for the result. |
2801 __ Push(context_value); | 2801 __ Push(context_value); |
2802 compiler->GenerateRuntimeCall(token_pos(), | 2802 compiler->GenerateRuntimeCall(token_pos(), |
2803 deopt_id(), | 2803 deopt_id(), |
2804 kCloneContextRuntimeEntry, | 2804 kCloneContextRuntimeEntry, |
2805 1, | 2805 1, |
2806 locs()); | 2806 locs()); |
2807 __ Drop(1); // Remove argument. | 2807 __ Drop(1); // Remove argument. |
2808 __ Pop(result); // Get result (cloned context). | 2808 __ Pop(result); // Get result (cloned context). |
2809 } | 2809 } |
2810 | 2810 |
2811 | 2811 |
2812 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate, | 2812 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Zone* zone, |
2813 bool opt) const { | 2813 bool opt) const { |
2814 UNREACHABLE(); | 2814 UNREACHABLE(); |
2815 return NULL; | 2815 return NULL; |
2816 } | 2816 } |
2817 | 2817 |
2818 | 2818 |
2819 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2819 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2820 __ Bind(compiler->GetJumpLabel(this)); | 2820 __ Bind(compiler->GetJumpLabel(this)); |
2821 compiler->AddExceptionHandler(catch_try_index(), | 2821 compiler->AddExceptionHandler(catch_try_index(), |
2822 try_index(), | 2822 try_index(), |
(...skipping 17 matching lines...) Expand all Loading... |
2840 | 2840 |
2841 // Restore stack and initialize the two exception variables: | 2841 // Restore stack and initialize the two exception variables: |
2842 // exception and stack trace variables. | 2842 // exception and stack trace variables. |
2843 __ StoreToOffset(kWord, kExceptionObjectReg, | 2843 __ StoreToOffset(kWord, kExceptionObjectReg, |
2844 FP, exception_var().index() * kWordSize); | 2844 FP, exception_var().index() * kWordSize); |
2845 __ StoreToOffset(kWord, kStackTraceObjectReg, | 2845 __ StoreToOffset(kWord, kStackTraceObjectReg, |
2846 FP, stacktrace_var().index() * kWordSize); | 2846 FP, stacktrace_var().index() * kWordSize); |
2847 } | 2847 } |
2848 | 2848 |
2849 | 2849 |
2850 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate, | 2850 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Zone* zone, |
2851 bool opt) const { | 2851 bool opt) const { |
2852 const intptr_t kNumInputs = 0; | 2852 const intptr_t kNumInputs = 0; |
2853 const intptr_t kNumTemps = 1; | 2853 const intptr_t kNumTemps = 1; |
2854 LocationSummary* summary = new(isolate) LocationSummary( | 2854 LocationSummary* summary = new(zone) LocationSummary( |
2855 isolate, kNumInputs, | 2855 zone, kNumInputs, |
2856 kNumTemps, | 2856 kNumTemps, |
2857 LocationSummary::kCallOnSlowPath); | 2857 LocationSummary::kCallOnSlowPath); |
2858 summary->set_temp(0, Location::RequiresRegister()); | 2858 summary->set_temp(0, Location::RequiresRegister()); |
2859 return summary; | 2859 return summary; |
2860 } | 2860 } |
2861 | 2861 |
2862 | 2862 |
2863 class CheckStackOverflowSlowPath : public SlowPathCode { | 2863 class CheckStackOverflowSlowPath : public SlowPathCode { |
2864 public: | 2864 public: |
2865 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2865 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3025 const Register temp = locs.temp(0).reg(); | 3025 const Register temp = locs.temp(0).reg(); |
3026 __ Lsl(temp, left, IP); | 3026 __ Lsl(temp, left, IP); |
3027 __ cmp(left, Operand(temp, ASR, IP)); | 3027 __ cmp(left, Operand(temp, ASR, IP)); |
3028 __ b(deopt, NE); // Overflow. | 3028 __ b(deopt, NE); // Overflow. |
3029 // Shift for result now we know there is no overflow. | 3029 // Shift for result now we know there is no overflow. |
3030 __ Lsl(result, left, IP); | 3030 __ Lsl(result, left, IP); |
3031 } | 3031 } |
3032 } | 3032 } |
3033 | 3033 |
3034 | 3034 |
3035 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate, | 3035 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone, |
3036 bool opt) const { | 3036 bool opt) const { |
3037 const intptr_t kNumInputs = 2; | 3037 const intptr_t kNumInputs = 2; |
3038 // Calculate number of temporaries. | 3038 // Calculate number of temporaries. |
3039 intptr_t num_temps = 0; | 3039 intptr_t num_temps = 0; |
3040 if (op_kind() == Token::kTRUNCDIV) { | 3040 if (op_kind() == Token::kTRUNCDIV) { |
3041 if (RightIsPowerOfTwoConstant()) { | 3041 if (RightIsPowerOfTwoConstant()) { |
3042 num_temps = 1; | 3042 num_temps = 1; |
3043 } else { | 3043 } else { |
3044 num_temps = 2; | 3044 num_temps = 2; |
3045 } | 3045 } |
3046 } else if (op_kind() == Token::kMOD) { | 3046 } else if (op_kind() == Token::kMOD) { |
3047 num_temps = 2; | 3047 num_temps = 2; |
3048 } else if (((op_kind() == Token::kSHL) && can_overflow()) || | 3048 } else if (((op_kind() == Token::kSHL) && can_overflow()) || |
3049 (op_kind() == Token::kSHR)) { | 3049 (op_kind() == Token::kSHR)) { |
3050 num_temps = 1; | 3050 num_temps = 1; |
3051 } else if ((op_kind() == Token::kMUL) && | 3051 } else if ((op_kind() == Token::kMUL) && |
3052 (TargetCPUFeatures::arm_version() != ARMv7)) { | 3052 (TargetCPUFeatures::arm_version() != ARMv7)) { |
3053 num_temps = 1; | 3053 num_temps = 1; |
3054 } | 3054 } |
3055 LocationSummary* summary = new(isolate) LocationSummary( | 3055 LocationSummary* summary = new(zone) LocationSummary( |
3056 isolate, kNumInputs, num_temps, LocationSummary::kNoCall); | 3056 zone, kNumInputs, num_temps, LocationSummary::kNoCall); |
3057 if (op_kind() == Token::kTRUNCDIV) { | 3057 if (op_kind() == Token::kTRUNCDIV) { |
3058 summary->set_in(0, Location::RequiresRegister()); | 3058 summary->set_in(0, Location::RequiresRegister()); |
3059 if (RightIsPowerOfTwoConstant()) { | 3059 if (RightIsPowerOfTwoConstant()) { |
3060 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 3060 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
3061 summary->set_in(1, Location::Constant(right_constant)); | 3061 summary->set_in(1, Location::Constant(right_constant)); |
3062 summary->set_temp(0, Location::RequiresRegister()); | 3062 summary->set_temp(0, Location::RequiresRegister()); |
3063 } else { | 3063 } else { |
3064 summary->set_in(1, Location::RequiresRegister()); | 3064 summary->set_in(1, Location::RequiresRegister()); |
3065 summary->set_temp(0, Location::RequiresRegister()); | 3065 summary->set_temp(0, Location::RequiresRegister()); |
3066 summary->set_temp(1, Location::RequiresFpuRegister()); | 3066 summary->set_temp(1, Location::RequiresFpuRegister()); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3411 // Check for overflow (preserve left). | 3411 // Check for overflow (preserve left). |
3412 __ Lsl(IP, left, Operand(value)); | 3412 __ Lsl(IP, left, Operand(value)); |
3413 __ cmp(left, Operand(IP, ASR, value)); | 3413 __ cmp(left, Operand(IP, ASR, value)); |
3414 __ b(deopt, NE); // Overflow. | 3414 __ b(deopt, NE); // Overflow. |
3415 } | 3415 } |
3416 // Shift for result now we know there is no overflow. | 3416 // Shift for result now we know there is no overflow. |
3417 __ Lsl(result, left, Operand(value)); | 3417 __ Lsl(result, left, Operand(value)); |
3418 } | 3418 } |
3419 | 3419 |
3420 | 3420 |
3421 LocationSummary* BinaryInt32OpInstr::MakeLocationSummary(Isolate* isolate, | 3421 LocationSummary* BinaryInt32OpInstr::MakeLocationSummary(Zone* zone, |
3422 bool opt) const { | 3422 bool opt) const { |
3423 const intptr_t kNumInputs = 2; | 3423 const intptr_t kNumInputs = 2; |
3424 // Calculate number of temporaries. | 3424 // Calculate number of temporaries. |
3425 intptr_t num_temps = 0; | 3425 intptr_t num_temps = 0; |
3426 if (((op_kind() == Token::kSHL) && can_overflow()) || | 3426 if (((op_kind() == Token::kSHL) && can_overflow()) || |
3427 (op_kind() == Token::kSHR)) { | 3427 (op_kind() == Token::kSHR)) { |
3428 num_temps = 1; | 3428 num_temps = 1; |
3429 } else if ((op_kind() == Token::kMUL) && | 3429 } else if ((op_kind() == Token::kMUL) && |
3430 (TargetCPUFeatures::arm_version() != ARMv7)) { | 3430 (TargetCPUFeatures::arm_version() != ARMv7)) { |
3431 num_temps = 1; | 3431 num_temps = 1; |
3432 } | 3432 } |
3433 LocationSummary* summary = new(isolate) LocationSummary( | 3433 LocationSummary* summary = new(zone) LocationSummary( |
3434 isolate, kNumInputs, num_temps, LocationSummary::kNoCall); | 3434 zone, kNumInputs, num_temps, LocationSummary::kNoCall); |
3435 summary->set_in(0, Location::RequiresRegister()); | 3435 summary->set_in(0, Location::RequiresRegister()); |
3436 summary->set_in(1, Location::RegisterOrSmiConstant(right())); | 3436 summary->set_in(1, Location::RegisterOrSmiConstant(right())); |
3437 if (((op_kind() == Token::kSHL) && can_overflow()) || | 3437 if (((op_kind() == Token::kSHL) && can_overflow()) || |
3438 (op_kind() == Token::kSHR)) { | 3438 (op_kind() == Token::kSHR)) { |
3439 summary->set_temp(0, Location::RequiresRegister()); | 3439 summary->set_temp(0, Location::RequiresRegister()); |
3440 } | 3440 } |
3441 if (op_kind() == Token::kMUL) { | 3441 if (op_kind() == Token::kMUL) { |
3442 if (TargetCPUFeatures::arm_version() != ARMv7) { | 3442 if (TargetCPUFeatures::arm_version() != ARMv7) { |
3443 summary->set_temp(0, Location::RequiresFpuRegister()); | 3443 summary->set_temp(0, Location::RequiresFpuRegister()); |
3444 } | 3444 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3621 __ eor(result, left, Operand(right)); | 3621 __ eor(result, left, Operand(right)); |
3622 break; | 3622 break; |
3623 } | 3623 } |
3624 default: | 3624 default: |
3625 UNREACHABLE(); | 3625 UNREACHABLE(); |
3626 break; | 3626 break; |
3627 } | 3627 } |
3628 } | 3628 } |
3629 | 3629 |
3630 | 3630 |
3631 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, | 3631 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone, |
3632 bool opt) const { | 3632 bool opt) const { |
3633 intptr_t left_cid = left()->Type()->ToCid(); | 3633 intptr_t left_cid = left()->Type()->ToCid(); |
3634 intptr_t right_cid = right()->Type()->ToCid(); | 3634 intptr_t right_cid = right()->Type()->ToCid(); |
3635 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3635 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
3636 const intptr_t kNumInputs = 2; | 3636 const intptr_t kNumInputs = 2; |
3637 const intptr_t kNumTemps = 0; | 3637 const intptr_t kNumTemps = 0; |
3638 LocationSummary* summary = new(isolate) LocationSummary( | 3638 LocationSummary* summary = new(zone) LocationSummary( |
3639 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3639 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3640 summary->set_in(0, Location::RequiresRegister()); | 3640 summary->set_in(0, Location::RequiresRegister()); |
3641 summary->set_in(1, Location::RequiresRegister()); | 3641 summary->set_in(1, Location::RequiresRegister()); |
3642 return summary; | 3642 return summary; |
3643 } | 3643 } |
3644 | 3644 |
3645 | 3645 |
3646 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3646 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3647 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3647 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
3648 ICData::kDeoptBinaryDoubleOp, | 3648 ICData::kDeoptBinaryDoubleOp, |
3649 licm_hoisted_ ? ICData::kHoisted : 0); | 3649 licm_hoisted_ ? ICData::kHoisted : 0); |
3650 intptr_t left_cid = left()->Type()->ToCid(); | 3650 intptr_t left_cid = left()->Type()->ToCid(); |
3651 intptr_t right_cid = right()->Type()->ToCid(); | 3651 intptr_t right_cid = right()->Type()->ToCid(); |
3652 const Register left = locs()->in(0).reg(); | 3652 const Register left = locs()->in(0).reg(); |
3653 const Register right = locs()->in(1).reg(); | 3653 const Register right = locs()->in(1).reg(); |
3654 if (this->left()->definition() == this->right()->definition()) { | 3654 if (this->left()->definition() == this->right()->definition()) { |
3655 __ tst(left, Operand(kSmiTagMask)); | 3655 __ tst(left, Operand(kSmiTagMask)); |
3656 } else if (left_cid == kSmiCid) { | 3656 } else if (left_cid == kSmiCid) { |
3657 __ tst(right, Operand(kSmiTagMask)); | 3657 __ tst(right, Operand(kSmiTagMask)); |
3658 } else if (right_cid == kSmiCid) { | 3658 } else if (right_cid == kSmiCid) { |
3659 __ tst(left, Operand(kSmiTagMask)); | 3659 __ tst(left, Operand(kSmiTagMask)); |
3660 } else { | 3660 } else { |
3661 __ orr(IP, left, Operand(right)); | 3661 __ orr(IP, left, Operand(right)); |
3662 __ tst(IP, Operand(kSmiTagMask)); | 3662 __ tst(IP, Operand(kSmiTagMask)); |
3663 } | 3663 } |
3664 __ b(deopt, EQ); | 3664 __ b(deopt, EQ); |
3665 } | 3665 } |
3666 | 3666 |
3667 | 3667 |
3668 LocationSummary* BoxInstr::MakeLocationSummary(Isolate* isolate, | 3668 LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, |
3669 bool opt) const { | 3669 bool opt) const { |
3670 const intptr_t kNumInputs = 1; | 3670 const intptr_t kNumInputs = 1; |
3671 const intptr_t kNumTemps = 1; | 3671 const intptr_t kNumTemps = 1; |
3672 LocationSummary* summary = new(isolate) LocationSummary( | 3672 LocationSummary* summary = new(zone) LocationSummary( |
3673 isolate, kNumInputs, | 3673 zone, kNumInputs, |
3674 kNumTemps, | 3674 kNumTemps, |
3675 LocationSummary::kCallOnSlowPath); | 3675 LocationSummary::kCallOnSlowPath); |
3676 summary->set_in(0, Location::RequiresFpuRegister()); | 3676 summary->set_in(0, Location::RequiresFpuRegister()); |
3677 summary->set_temp(0, Location::RequiresRegister()); | 3677 summary->set_temp(0, Location::RequiresRegister()); |
3678 summary->set_out(0, Location::RequiresRegister()); | 3678 summary->set_out(0, Location::RequiresRegister()); |
3679 return summary; | 3679 return summary; |
3680 } | 3680 } |
3681 | 3681 |
3682 | 3682 |
3683 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3683 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 18 matching lines...) Expand all Loading... |
3702 __ StoreMultipleDToOffset( | 3702 __ StoreMultipleDToOffset( |
3703 value, 2, out_reg, ValueOffset() - kHeapObjectTag); | 3703 value, 2, out_reg, ValueOffset() - kHeapObjectTag); |
3704 break; | 3704 break; |
3705 default: | 3705 default: |
3706 UNREACHABLE(); | 3706 UNREACHABLE(); |
3707 break; | 3707 break; |
3708 } | 3708 } |
3709 } | 3709 } |
3710 | 3710 |
3711 | 3711 |
3712 LocationSummary* UnboxInstr::MakeLocationSummary(Isolate* isolate, | 3712 LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, |
3713 bool opt) const { | 3713 bool opt) const { |
3714 const bool needs_temp = CanDeoptimize(); | 3714 const bool needs_temp = CanDeoptimize(); |
3715 const intptr_t kNumInputs = 1; | 3715 const intptr_t kNumInputs = 1; |
3716 const intptr_t kNumTemps = needs_temp ? 1 : 0; | 3716 const intptr_t kNumTemps = needs_temp ? 1 : 0; |
3717 LocationSummary* summary = new(isolate) LocationSummary( | 3717 LocationSummary* summary = new(zone) LocationSummary( |
3718 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3718 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3719 summary->set_in(0, Location::RequiresRegister()); | 3719 summary->set_in(0, Location::RequiresRegister()); |
3720 if (needs_temp) { | 3720 if (needs_temp) { |
3721 summary->set_temp(0, Location::RequiresRegister()); | 3721 summary->set_temp(0, Location::RequiresRegister()); |
3722 } | 3722 } |
3723 if (representation() == kUnboxedMint) { | 3723 if (representation() == kUnboxedMint) { |
3724 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 3724 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
3725 Location::RequiresRegister())); | 3725 Location::RequiresRegister())); |
3726 } else { | 3726 } else { |
3727 summary->set_out(0, Location::RequiresFpuRegister()); | 3727 summary->set_out(0, Location::RequiresFpuRegister()); |
3728 } | 3728 } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3828 Label done; | 3828 Label done; |
3829 __ b(&done); | 3829 __ b(&done); |
3830 __ Bind(&is_smi); | 3830 __ Bind(&is_smi); |
3831 EmitSmiConversion(compiler); | 3831 EmitSmiConversion(compiler); |
3832 __ Bind(&done); | 3832 __ Bind(&done); |
3833 } | 3833 } |
3834 } | 3834 } |
3835 } | 3835 } |
3836 | 3836 |
3837 | 3837 |
3838 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Isolate* isolate, | 3838 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone, |
3839 bool opt) const { | 3839 bool opt) const { |
3840 ASSERT((from_representation() == kUnboxedInt32) || | 3840 ASSERT((from_representation() == kUnboxedInt32) || |
3841 (from_representation() == kUnboxedUint32)); | 3841 (from_representation() == kUnboxedUint32)); |
3842 const intptr_t kNumInputs = 1; | 3842 const intptr_t kNumInputs = 1; |
3843 const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1; | 3843 const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1; |
3844 LocationSummary* summary = new(isolate) LocationSummary( | 3844 LocationSummary* summary = new(zone) LocationSummary( |
3845 isolate, | 3845 zone, |
3846 kNumInputs, | 3846 kNumInputs, |
3847 kNumTemps, | 3847 kNumTemps, |
3848 ValueFitsSmi() ? LocationSummary::kNoCall | 3848 ValueFitsSmi() ? LocationSummary::kNoCall |
3849 : LocationSummary::kCallOnSlowPath); | 3849 : LocationSummary::kCallOnSlowPath); |
3850 summary->set_in(0, Location::RequiresRegister()); | 3850 summary->set_in(0, Location::RequiresRegister()); |
3851 if (!ValueFitsSmi()) { | 3851 if (!ValueFitsSmi()) { |
3852 summary->set_temp(0, Location::RequiresRegister()); | 3852 summary->set_temp(0, Location::RequiresRegister()); |
3853 } | 3853 } |
3854 summary->set_out(0, Location::RequiresRegister()); | 3854 summary->set_out(0, Location::RequiresRegister()); |
3855 return summary; | 3855 return summary; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3892 Mint::value_offset() - kHeapObjectTag); | 3892 Mint::value_offset() - kHeapObjectTag); |
3893 __ StoreToOffset(kWord, | 3893 __ StoreToOffset(kWord, |
3894 temp, | 3894 temp, |
3895 out, | 3895 out, |
3896 Mint::value_offset() - kHeapObjectTag + kWordSize); | 3896 Mint::value_offset() - kHeapObjectTag + kWordSize); |
3897 __ Bind(&done); | 3897 __ Bind(&done); |
3898 } | 3898 } |
3899 } | 3899 } |
3900 | 3900 |
3901 | 3901 |
3902 LocationSummary* BoxInt64Instr::MakeLocationSummary(Isolate* isolate, | 3902 LocationSummary* BoxInt64Instr::MakeLocationSummary(Zone* zone, |
3903 bool opt) const { | 3903 bool opt) const { |
3904 const intptr_t kNumInputs = 1; | 3904 const intptr_t kNumInputs = 1; |
3905 const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1; | 3905 const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1; |
3906 LocationSummary* summary = new(isolate) LocationSummary( | 3906 LocationSummary* summary = new(zone) LocationSummary( |
3907 isolate, | 3907 zone, |
3908 kNumInputs, | 3908 kNumInputs, |
3909 kNumTemps, | 3909 kNumTemps, |
3910 ValueFitsSmi() ? LocationSummary::kNoCall | 3910 ValueFitsSmi() ? LocationSummary::kNoCall |
3911 : LocationSummary::kCallOnSlowPath); | 3911 : LocationSummary::kCallOnSlowPath); |
3912 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 3912 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
3913 Location::RequiresRegister())); | 3913 Location::RequiresRegister())); |
3914 if (!ValueFitsSmi()) { | 3914 if (!ValueFitsSmi()) { |
3915 summary->set_temp(0, Location::RequiresRegister()); | 3915 summary->set_temp(0, Location::RequiresRegister()); |
3916 } | 3916 } |
3917 summary->set_out(0, Location::RequiresRegister()); | 3917 summary->set_out(0, Location::RequiresRegister()); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3968 __ LoadFieldFromOffset(kWord, | 3968 __ LoadFieldFromOffset(kWord, |
3969 temp, | 3969 temp, |
3970 mint, | 3970 mint, |
3971 Mint::value_offset() + kWordSize); | 3971 Mint::value_offset() + kWordSize); |
3972 __ cmp(temp, Operand(result, ASR, kBitsPerWord - 1)); | 3972 __ cmp(temp, Operand(result, ASR, kBitsPerWord - 1)); |
3973 __ b(deopt, NE); | 3973 __ b(deopt, NE); |
3974 } | 3974 } |
3975 } | 3975 } |
3976 | 3976 |
3977 | 3977 |
3978 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Isolate* isolate, | 3978 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Zone* zone, |
3979 bool opt) const { | 3979 bool opt) const { |
3980 ASSERT((representation() == kUnboxedInt32) || | 3980 ASSERT((representation() == kUnboxedInt32) || |
3981 (representation() == kUnboxedUint32)); | 3981 (representation() == kUnboxedUint32)); |
3982 ASSERT((representation() != kUnboxedUint32) || is_truncating()); | 3982 ASSERT((representation() != kUnboxedUint32) || is_truncating()); |
3983 const intptr_t kNumInputs = 1; | 3983 const intptr_t kNumInputs = 1; |
3984 const intptr_t kNumTemps = CanDeoptimize() ? 1 : 0; | 3984 const intptr_t kNumTemps = CanDeoptimize() ? 1 : 0; |
3985 LocationSummary* summary = new(isolate) LocationSummary( | 3985 LocationSummary* summary = new(zone) LocationSummary( |
3986 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3986 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3987 summary->set_in(0, Location::RequiresRegister()); | 3987 summary->set_in(0, Location::RequiresRegister()); |
3988 if (kNumTemps > 0) { | 3988 if (kNumTemps > 0) { |
3989 summary->set_temp(0, Location::RequiresRegister()); | 3989 summary->set_temp(0, Location::RequiresRegister()); |
3990 } | 3990 } |
3991 summary->set_out(0, Location::RequiresRegister()); | 3991 summary->set_out(0, Location::RequiresRegister()); |
3992 return summary; | 3992 return summary; |
3993 } | 3993 } |
3994 | 3994 |
3995 | 3995 |
3996 void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3996 void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
(...skipping 19 matching lines...) Expand all Loading... |
4016 Label done; | 4016 Label done; |
4017 __ SmiUntag(out, value, &done); | 4017 __ SmiUntag(out, value, &done); |
4018 __ CompareClassId(value, kMintCid, temp); | 4018 __ CompareClassId(value, kMintCid, temp); |
4019 __ b(deopt, NE); | 4019 __ b(deopt, NE); |
4020 LoadInt32FromMint(compiler, value, out, temp, out_of_range); | 4020 LoadInt32FromMint(compiler, value, out, temp, out_of_range); |
4021 __ Bind(&done); | 4021 __ Bind(&done); |
4022 } | 4022 } |
4023 } | 4023 } |
4024 | 4024 |
4025 | 4025 |
4026 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, | 4026 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Zone* zone, |
4027 bool opt) const { | 4027 bool opt) const { |
4028 const intptr_t kNumInputs = 2; | 4028 const intptr_t kNumInputs = 2; |
4029 const intptr_t kNumTemps = 0; | 4029 const intptr_t kNumTemps = 0; |
4030 LocationSummary* summary = new(isolate) LocationSummary( | 4030 LocationSummary* summary = new(zone) LocationSummary( |
4031 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4031 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4032 summary->set_in(0, Location::RequiresFpuRegister()); | 4032 summary->set_in(0, Location::RequiresFpuRegister()); |
4033 summary->set_in(1, Location::RequiresFpuRegister()); | 4033 summary->set_in(1, Location::RequiresFpuRegister()); |
4034 summary->set_out(0, Location::RequiresFpuRegister()); | 4034 summary->set_out(0, Location::RequiresFpuRegister()); |
4035 return summary; | 4035 return summary; |
4036 } | 4036 } |
4037 | 4037 |
4038 | 4038 |
4039 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4039 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4040 const DRegister left = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 4040 const DRegister left = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
4041 const DRegister right = EvenDRegisterOf(locs()->in(1).fpu_reg()); | 4041 const DRegister right = EvenDRegisterOf(locs()->in(1).fpu_reg()); |
4042 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 4042 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
4043 switch (op_kind()) { | 4043 switch (op_kind()) { |
4044 case Token::kADD: __ vaddd(result, left, right); break; | 4044 case Token::kADD: __ vaddd(result, left, right); break; |
4045 case Token::kSUB: __ vsubd(result, left, right); break; | 4045 case Token::kSUB: __ vsubd(result, left, right); break; |
4046 case Token::kMUL: __ vmuld(result, left, right); break; | 4046 case Token::kMUL: __ vmuld(result, left, right); break; |
4047 case Token::kDIV: __ vdivd(result, left, right); break; | 4047 case Token::kDIV: __ vdivd(result, left, right); break; |
4048 default: UNREACHABLE(); | 4048 default: UNREACHABLE(); |
4049 } | 4049 } |
4050 } | 4050 } |
4051 | 4051 |
4052 | 4052 |
4053 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate, | 4053 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, |
4054 bool opt) const { | 4054 bool opt) const { |
4055 const intptr_t kNumInputs = 2; | 4055 const intptr_t kNumInputs = 2; |
4056 const intptr_t kNumTemps = 0; | 4056 const intptr_t kNumTemps = 0; |
4057 LocationSummary* summary = new(isolate) LocationSummary( | 4057 LocationSummary* summary = new(zone) LocationSummary( |
4058 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4058 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4059 summary->set_in(0, Location::RequiresFpuRegister()); | 4059 summary->set_in(0, Location::RequiresFpuRegister()); |
4060 summary->set_in(1, Location::RequiresFpuRegister()); | 4060 summary->set_in(1, Location::RequiresFpuRegister()); |
4061 summary->set_out(0, Location::RequiresFpuRegister()); | 4061 summary->set_out(0, Location::RequiresFpuRegister()); |
4062 return summary; | 4062 return summary; |
4063 } | 4063 } |
4064 | 4064 |
4065 | 4065 |
4066 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4066 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4067 const QRegister left = locs()->in(0).fpu_reg(); | 4067 const QRegister left = locs()->in(0).fpu_reg(); |
4068 const QRegister right = locs()->in(1).fpu_reg(); | 4068 const QRegister right = locs()->in(1).fpu_reg(); |
4069 const QRegister result = locs()->out(0).fpu_reg(); | 4069 const QRegister result = locs()->out(0).fpu_reg(); |
4070 | 4070 |
4071 switch (op_kind()) { | 4071 switch (op_kind()) { |
4072 case Token::kADD: __ vaddqs(result, left, right); break; | 4072 case Token::kADD: __ vaddqs(result, left, right); break; |
4073 case Token::kSUB: __ vsubqs(result, left, right); break; | 4073 case Token::kSUB: __ vsubqs(result, left, right); break; |
4074 case Token::kMUL: __ vmulqs(result, left, right); break; | 4074 case Token::kMUL: __ vmulqs(result, left, right); break; |
4075 case Token::kDIV: __ Vdivqs(result, left, right); break; | 4075 case Token::kDIV: __ Vdivqs(result, left, right); break; |
4076 default: UNREACHABLE(); | 4076 default: UNREACHABLE(); |
4077 } | 4077 } |
4078 } | 4078 } |
4079 | 4079 |
4080 | 4080 |
4081 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate, | 4081 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Zone* zone, |
4082 bool opt) const { | 4082 bool opt) const { |
4083 const intptr_t kNumInputs = 2; | 4083 const intptr_t kNumInputs = 2; |
4084 const intptr_t kNumTemps = 0; | 4084 const intptr_t kNumTemps = 0; |
4085 LocationSummary* summary = new(isolate) LocationSummary( | 4085 LocationSummary* summary = new(zone) LocationSummary( |
4086 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4086 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4087 summary->set_in(0, Location::RequiresFpuRegister()); | 4087 summary->set_in(0, Location::RequiresFpuRegister()); |
4088 summary->set_in(1, Location::RequiresFpuRegister()); | 4088 summary->set_in(1, Location::RequiresFpuRegister()); |
4089 summary->set_out(0, Location::RequiresFpuRegister()); | 4089 summary->set_out(0, Location::RequiresFpuRegister()); |
4090 return summary; | 4090 return summary; |
4091 } | 4091 } |
4092 | 4092 |
4093 | 4093 |
4094 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4094 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4095 const QRegister left = locs()->in(0).fpu_reg(); | 4095 const QRegister left = locs()->in(0).fpu_reg(); |
4096 const QRegister right = locs()->in(1).fpu_reg(); | 4096 const QRegister right = locs()->in(1).fpu_reg(); |
(...skipping 23 matching lines...) Expand all Loading... |
4120 break; | 4120 break; |
4121 case Token::kDIV: | 4121 case Token::kDIV: |
4122 __ vdivd(result0, left0, right0); | 4122 __ vdivd(result0, left0, right0); |
4123 __ vdivd(result1, left1, right1); | 4123 __ vdivd(result1, left1, right1); |
4124 break; | 4124 break; |
4125 default: UNREACHABLE(); | 4125 default: UNREACHABLE(); |
4126 } | 4126 } |
4127 } | 4127 } |
4128 | 4128 |
4129 | 4129 |
4130 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate, | 4130 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Zone* zone, |
4131 bool opt) const { | 4131 bool opt) const { |
4132 const intptr_t kNumInputs = 1; | 4132 const intptr_t kNumInputs = 1; |
4133 const intptr_t kNumTemps = 0; | 4133 const intptr_t kNumTemps = 0; |
4134 LocationSummary* summary = new(isolate) LocationSummary( | 4134 LocationSummary* summary = new(zone) LocationSummary( |
4135 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4135 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4136 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. | 4136 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. |
4137 summary->set_in(0, Location::FpuRegisterLocation(Q5)); | 4137 summary->set_in(0, Location::FpuRegisterLocation(Q5)); |
4138 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4138 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4139 return summary; | 4139 return summary; |
4140 } | 4140 } |
4141 | 4141 |
4142 | 4142 |
4143 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4143 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4144 const QRegister value = locs()->in(0).fpu_reg(); | 4144 const QRegister value = locs()->in(0).fpu_reg(); |
4145 const QRegister result = locs()->out(0).fpu_reg(); | 4145 const QRegister result = locs()->out(0).fpu_reg(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4201 __ vmovs(sresult1, svalues[(mask_ >> 2) & 0x3]); | 4201 __ vmovs(sresult1, svalues[(mask_ >> 2) & 0x3]); |
4202 __ vmovs(sresult2, svalues[(mask_ >> 4) & 0x3]); | 4202 __ vmovs(sresult2, svalues[(mask_ >> 4) & 0x3]); |
4203 __ vmovs(sresult3, svalues[(mask_ >> 6) & 0x3]); | 4203 __ vmovs(sresult3, svalues[(mask_ >> 6) & 0x3]); |
4204 } | 4204 } |
4205 break; | 4205 break; |
4206 default: UNREACHABLE(); | 4206 default: UNREACHABLE(); |
4207 } | 4207 } |
4208 } | 4208 } |
4209 | 4209 |
4210 | 4210 |
4211 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate, | 4211 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Zone* zone, |
4212 bool opt) const { | 4212 bool opt) const { |
4213 const intptr_t kNumInputs = 2; | 4213 const intptr_t kNumInputs = 2; |
4214 const intptr_t kNumTemps = 0; | 4214 const intptr_t kNumTemps = 0; |
4215 LocationSummary* summary = new(isolate) LocationSummary( | 4215 LocationSummary* summary = new(zone) LocationSummary( |
4216 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4216 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4217 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. | 4217 // Low (< Q7) Q registers are needed for the vcvtds and vmovs instructions. |
4218 summary->set_in(0, Location::FpuRegisterLocation(Q4)); | 4218 summary->set_in(0, Location::FpuRegisterLocation(Q4)); |
4219 summary->set_in(1, Location::FpuRegisterLocation(Q5)); | 4219 summary->set_in(1, Location::FpuRegisterLocation(Q5)); |
4220 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4220 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4221 return summary; | 4221 return summary; |
4222 } | 4222 } |
4223 | 4223 |
4224 | 4224 |
4225 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4225 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4226 const QRegister left = locs()->in(0).fpu_reg(); | 4226 const QRegister left = locs()->in(0).fpu_reg(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4258 __ vmovs(sresult0, left_svalues[mask_ & 0x3]); | 4258 __ vmovs(sresult0, left_svalues[mask_ & 0x3]); |
4259 __ vmovs(sresult1, left_svalues[(mask_ >> 2) & 0x3]); | 4259 __ vmovs(sresult1, left_svalues[(mask_ >> 2) & 0x3]); |
4260 __ vmovs(sresult2, right_svalues[(mask_ >> 4) & 0x3]); | 4260 __ vmovs(sresult2, right_svalues[(mask_ >> 4) & 0x3]); |
4261 __ vmovs(sresult3, right_svalues[(mask_ >> 6) & 0x3]); | 4261 __ vmovs(sresult3, right_svalues[(mask_ >> 6) & 0x3]); |
4262 break; | 4262 break; |
4263 default: UNREACHABLE(); | 4263 default: UNREACHABLE(); |
4264 } | 4264 } |
4265 } | 4265 } |
4266 | 4266 |
4267 | 4267 |
4268 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate, | 4268 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Zone* zone, |
4269 bool opt) const { | 4269 bool opt) const { |
4270 const intptr_t kNumInputs = 1; | 4270 const intptr_t kNumInputs = 1; |
4271 const intptr_t kNumTemps = 1; | 4271 const intptr_t kNumTemps = 1; |
4272 LocationSummary* summary = new(isolate) LocationSummary( | 4272 LocationSummary* summary = new(zone) LocationSummary( |
4273 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4273 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4274 summary->set_in(0, Location::FpuRegisterLocation(Q5)); | 4274 summary->set_in(0, Location::FpuRegisterLocation(Q5)); |
4275 summary->set_temp(0, Location::RequiresRegister()); | 4275 summary->set_temp(0, Location::RequiresRegister()); |
4276 summary->set_out(0, Location::RequiresRegister()); | 4276 summary->set_out(0, Location::RequiresRegister()); |
4277 return summary; | 4277 return summary; |
4278 } | 4278 } |
4279 | 4279 |
4280 | 4280 |
4281 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4281 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4282 const QRegister value = locs()->in(0).fpu_reg(); | 4282 const QRegister value = locs()->in(0).fpu_reg(); |
4283 const DRegister dvalue0 = EvenDRegisterOf(value); | 4283 const DRegister dvalue0 = EvenDRegisterOf(value); |
(...skipping 16 matching lines...) Expand all Loading... |
4300 // W lane. | 4300 // W lane. |
4301 __ vmovrs(temp, OddSRegisterOf(dvalue1)); | 4301 __ vmovrs(temp, OddSRegisterOf(dvalue1)); |
4302 __ Lsr(temp, temp, Operand(31)); | 4302 __ Lsr(temp, temp, Operand(31)); |
4303 __ orr(out, out, Operand(temp, LSL, 3)); | 4303 __ orr(out, out, Operand(temp, LSL, 3)); |
4304 // Tag. | 4304 // Tag. |
4305 __ SmiTag(out); | 4305 __ SmiTag(out); |
4306 } | 4306 } |
4307 | 4307 |
4308 | 4308 |
4309 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( | 4309 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( |
4310 Isolate* isolate, bool opt) const { | 4310 Zone* zone, bool opt) const { |
4311 const intptr_t kNumInputs = 4; | 4311 const intptr_t kNumInputs = 4; |
4312 const intptr_t kNumTemps = 0; | 4312 const intptr_t kNumTemps = 0; |
4313 LocationSummary* summary = new(isolate) LocationSummary( | 4313 LocationSummary* summary = new(zone) LocationSummary( |
4314 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4314 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4315 summary->set_in(0, Location::RequiresFpuRegister()); | 4315 summary->set_in(0, Location::RequiresFpuRegister()); |
4316 summary->set_in(1, Location::RequiresFpuRegister()); | 4316 summary->set_in(1, Location::RequiresFpuRegister()); |
4317 summary->set_in(2, Location::RequiresFpuRegister()); | 4317 summary->set_in(2, Location::RequiresFpuRegister()); |
4318 summary->set_in(3, Location::RequiresFpuRegister()); | 4318 summary->set_in(3, Location::RequiresFpuRegister()); |
4319 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4319 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
4320 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4320 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4321 return summary; | 4321 return summary; |
4322 } | 4322 } |
4323 | 4323 |
4324 | 4324 |
4325 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4325 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4326 const QRegister q0 = locs()->in(0).fpu_reg(); | 4326 const QRegister q0 = locs()->in(0).fpu_reg(); |
4327 const QRegister q1 = locs()->in(1).fpu_reg(); | 4327 const QRegister q1 = locs()->in(1).fpu_reg(); |
4328 const QRegister q2 = locs()->in(2).fpu_reg(); | 4328 const QRegister q2 = locs()->in(2).fpu_reg(); |
4329 const QRegister q3 = locs()->in(3).fpu_reg(); | 4329 const QRegister q3 = locs()->in(3).fpu_reg(); |
4330 const QRegister r = locs()->out(0).fpu_reg(); | 4330 const QRegister r = locs()->out(0).fpu_reg(); |
4331 | 4331 |
4332 const DRegister dr0 = EvenDRegisterOf(r); | 4332 const DRegister dr0 = EvenDRegisterOf(r); |
4333 const DRegister dr1 = OddDRegisterOf(r); | 4333 const DRegister dr1 = OddDRegisterOf(r); |
4334 | 4334 |
4335 __ vcvtsd(EvenSRegisterOf(dr0), EvenDRegisterOf(q0)); | 4335 __ vcvtsd(EvenSRegisterOf(dr0), EvenDRegisterOf(q0)); |
4336 __ vcvtsd(OddSRegisterOf(dr0), EvenDRegisterOf(q1)); | 4336 __ vcvtsd(OddSRegisterOf(dr0), EvenDRegisterOf(q1)); |
4337 __ vcvtsd(EvenSRegisterOf(dr1), EvenDRegisterOf(q2)); | 4337 __ vcvtsd(EvenSRegisterOf(dr1), EvenDRegisterOf(q2)); |
4338 __ vcvtsd(OddSRegisterOf(dr1), EvenDRegisterOf(q3)); | 4338 __ vcvtsd(OddSRegisterOf(dr1), EvenDRegisterOf(q3)); |
4339 } | 4339 } |
4340 | 4340 |
4341 | 4341 |
4342 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate, | 4342 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Zone* zone, |
4343 bool opt) const { | 4343 bool opt) const { |
4344 const intptr_t kNumInputs = 0; | 4344 const intptr_t kNumInputs = 0; |
4345 const intptr_t kNumTemps = 0; | 4345 const intptr_t kNumTemps = 0; |
4346 LocationSummary* summary = new(isolate) LocationSummary( | 4346 LocationSummary* summary = new(zone) LocationSummary( |
4347 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4347 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4348 summary->set_out(0, Location::RequiresFpuRegister()); | 4348 summary->set_out(0, Location::RequiresFpuRegister()); |
4349 return summary; | 4349 return summary; |
4350 } | 4350 } |
4351 | 4351 |
4352 | 4352 |
4353 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4353 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4354 const QRegister q = locs()->out(0).fpu_reg(); | 4354 const QRegister q = locs()->out(0).fpu_reg(); |
4355 __ veorq(q, q, q); | 4355 __ veorq(q, q, q); |
4356 } | 4356 } |
4357 | 4357 |
4358 | 4358 |
4359 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate, | 4359 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Zone* zone, |
4360 bool opt) const { | 4360 bool opt) const { |
4361 const intptr_t kNumInputs = 1; | 4361 const intptr_t kNumInputs = 1; |
4362 const intptr_t kNumTemps = 0; | 4362 const intptr_t kNumTemps = 0; |
4363 LocationSummary* summary = new(isolate) LocationSummary( | 4363 LocationSummary* summary = new(zone) LocationSummary( |
4364 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4364 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4365 summary->set_in(0, Location::RequiresFpuRegister()); | 4365 summary->set_in(0, Location::RequiresFpuRegister()); |
4366 summary->set_out(0, Location::RequiresFpuRegister()); | 4366 summary->set_out(0, Location::RequiresFpuRegister()); |
4367 return summary; | 4367 return summary; |
4368 } | 4368 } |
4369 | 4369 |
4370 | 4370 |
4371 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4371 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4372 const QRegister value = locs()->in(0).fpu_reg(); | 4372 const QRegister value = locs()->in(0).fpu_reg(); |
4373 const QRegister result = locs()->out(0).fpu_reg(); | 4373 const QRegister result = locs()->out(0).fpu_reg(); |
4374 | 4374 |
4375 const DRegister dvalue0 = EvenDRegisterOf(value); | 4375 const DRegister dvalue0 = EvenDRegisterOf(value); |
4376 | 4376 |
4377 // Convert to Float32. | 4377 // Convert to Float32. |
4378 __ vcvtsd(STMP, dvalue0); | 4378 __ vcvtsd(STMP, dvalue0); |
4379 | 4379 |
4380 // Splat across all lanes. | 4380 // Splat across all lanes. |
4381 __ vdup(kWord, result, DTMP, 0); | 4381 __ vdup(kWord, result, DTMP, 0); |
4382 } | 4382 } |
4383 | 4383 |
4384 | 4384 |
4385 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate, | 4385 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Zone* zone, |
4386 bool opt) const { | 4386 bool opt) const { |
4387 const intptr_t kNumInputs = 2; | 4387 const intptr_t kNumInputs = 2; |
4388 const intptr_t kNumTemps = 0; | 4388 const intptr_t kNumTemps = 0; |
4389 LocationSummary* summary = new(isolate) LocationSummary( | 4389 LocationSummary* summary = new(zone) LocationSummary( |
4390 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4390 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4391 summary->set_in(0, Location::RequiresFpuRegister()); | 4391 summary->set_in(0, Location::RequiresFpuRegister()); |
4392 summary->set_in(1, Location::RequiresFpuRegister()); | 4392 summary->set_in(1, Location::RequiresFpuRegister()); |
4393 summary->set_out(0, Location::RequiresFpuRegister()); | 4393 summary->set_out(0, Location::RequiresFpuRegister()); |
4394 return summary; | 4394 return summary; |
4395 } | 4395 } |
4396 | 4396 |
4397 | 4397 |
4398 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4398 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4399 const QRegister left = locs()->in(0).fpu_reg(); | 4399 const QRegister left = locs()->in(0).fpu_reg(); |
4400 const QRegister right = locs()->in(1).fpu_reg(); | 4400 const QRegister right = locs()->in(1).fpu_reg(); |
(...skipping 19 matching lines...) Expand all Loading... |
4420 break; | 4420 break; |
4421 case MethodRecognizer::kFloat32x4LessThanOrEqual: | 4421 case MethodRecognizer::kFloat32x4LessThanOrEqual: |
4422 __ vcgeqs(result, right, left); | 4422 __ vcgeqs(result, right, left); |
4423 break; | 4423 break; |
4424 | 4424 |
4425 default: UNREACHABLE(); | 4425 default: UNREACHABLE(); |
4426 } | 4426 } |
4427 } | 4427 } |
4428 | 4428 |
4429 | 4429 |
4430 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Isolate* isolate, | 4430 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Zone* zone, |
4431 bool opt) const { | 4431 bool opt) const { |
4432 const intptr_t kNumInputs = 2; | 4432 const intptr_t kNumInputs = 2; |
4433 const intptr_t kNumTemps = 0; | 4433 const intptr_t kNumTemps = 0; |
4434 LocationSummary* summary = new(isolate) LocationSummary( | 4434 LocationSummary* summary = new(zone) LocationSummary( |
4435 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4435 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4436 summary->set_in(0, Location::RequiresFpuRegister()); | 4436 summary->set_in(0, Location::RequiresFpuRegister()); |
4437 summary->set_in(1, Location::RequiresFpuRegister()); | 4437 summary->set_in(1, Location::RequiresFpuRegister()); |
4438 summary->set_out(0, Location::RequiresFpuRegister()); | 4438 summary->set_out(0, Location::RequiresFpuRegister()); |
4439 return summary; | 4439 return summary; |
4440 } | 4440 } |
4441 | 4441 |
4442 | 4442 |
4443 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4443 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4444 const QRegister left = locs()->in(0).fpu_reg(); | 4444 const QRegister left = locs()->in(0).fpu_reg(); |
4445 const QRegister right = locs()->in(1).fpu_reg(); | 4445 const QRegister right = locs()->in(1).fpu_reg(); |
4446 const QRegister result = locs()->out(0).fpu_reg(); | 4446 const QRegister result = locs()->out(0).fpu_reg(); |
4447 | 4447 |
4448 switch (op_kind()) { | 4448 switch (op_kind()) { |
4449 case MethodRecognizer::kFloat32x4Min: | 4449 case MethodRecognizer::kFloat32x4Min: |
4450 __ vminqs(result, left, right); | 4450 __ vminqs(result, left, right); |
4451 break; | 4451 break; |
4452 case MethodRecognizer::kFloat32x4Max: | 4452 case MethodRecognizer::kFloat32x4Max: |
4453 __ vmaxqs(result, left, right); | 4453 __ vmaxqs(result, left, right); |
4454 break; | 4454 break; |
4455 default: UNREACHABLE(); | 4455 default: UNREACHABLE(); |
4456 } | 4456 } |
4457 } | 4457 } |
4458 | 4458 |
4459 | 4459 |
4460 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate, | 4460 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Zone* zone, |
4461 bool opt) const { | 4461 bool opt) const { |
4462 const intptr_t kNumInputs = 1; | 4462 const intptr_t kNumInputs = 1; |
4463 const intptr_t kNumTemps = 1; | 4463 const intptr_t kNumTemps = 1; |
4464 LocationSummary* summary = new(isolate) LocationSummary( | 4464 LocationSummary* summary = new(zone) LocationSummary( |
4465 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4465 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4466 summary->set_in(0, Location::RequiresFpuRegister()); | 4466 summary->set_in(0, Location::RequiresFpuRegister()); |
4467 summary->set_out(0, Location::RequiresFpuRegister()); | 4467 summary->set_out(0, Location::RequiresFpuRegister()); |
4468 summary->set_temp(0, Location::RequiresFpuRegister()); | 4468 summary->set_temp(0, Location::RequiresFpuRegister()); |
4469 return summary; | 4469 return summary; |
4470 } | 4470 } |
4471 | 4471 |
4472 | 4472 |
4473 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4473 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4474 const QRegister left = locs()->in(0).fpu_reg(); | 4474 const QRegister left = locs()->in(0).fpu_reg(); |
4475 const QRegister result = locs()->out(0).fpu_reg(); | 4475 const QRegister result = locs()->out(0).fpu_reg(); |
4476 const QRegister temp = locs()->temp(0).fpu_reg(); | 4476 const QRegister temp = locs()->temp(0).fpu_reg(); |
4477 | 4477 |
4478 switch (op_kind()) { | 4478 switch (op_kind()) { |
4479 case MethodRecognizer::kFloat32x4Sqrt: | 4479 case MethodRecognizer::kFloat32x4Sqrt: |
4480 __ Vsqrtqs(result, left, temp); | 4480 __ Vsqrtqs(result, left, temp); |
4481 break; | 4481 break; |
4482 case MethodRecognizer::kFloat32x4Reciprocal: | 4482 case MethodRecognizer::kFloat32x4Reciprocal: |
4483 __ Vreciprocalqs(result, left); | 4483 __ Vreciprocalqs(result, left); |
4484 break; | 4484 break; |
4485 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | 4485 case MethodRecognizer::kFloat32x4ReciprocalSqrt: |
4486 __ VreciprocalSqrtqs(result, left); | 4486 __ VreciprocalSqrtqs(result, left); |
4487 break; | 4487 break; |
4488 default: UNREACHABLE(); | 4488 default: UNREACHABLE(); |
4489 } | 4489 } |
4490 } | 4490 } |
4491 | 4491 |
4492 | 4492 |
4493 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate, | 4493 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Zone* zone, |
4494 bool opt) const { | 4494 bool opt) const { |
4495 const intptr_t kNumInputs = 2; | 4495 const intptr_t kNumInputs = 2; |
4496 const intptr_t kNumTemps = 0; | 4496 const intptr_t kNumTemps = 0; |
4497 LocationSummary* summary = new(isolate) LocationSummary( | 4497 LocationSummary* summary = new(zone) LocationSummary( |
4498 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4498 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4499 summary->set_in(0, Location::RequiresFpuRegister()); | 4499 summary->set_in(0, Location::RequiresFpuRegister()); |
4500 summary->set_in(1, Location::RequiresFpuRegister()); | 4500 summary->set_in(1, Location::RequiresFpuRegister()); |
4501 summary->set_out(0, Location::RequiresFpuRegister()); | 4501 summary->set_out(0, Location::RequiresFpuRegister()); |
4502 return summary; | 4502 return summary; |
4503 } | 4503 } |
4504 | 4504 |
4505 | 4505 |
4506 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4506 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4507 const QRegister left = locs()->in(0).fpu_reg(); | 4507 const QRegister left = locs()->in(0).fpu_reg(); |
4508 const QRegister right = locs()->in(1).fpu_reg(); | 4508 const QRegister right = locs()->in(1).fpu_reg(); |
4509 const QRegister result = locs()->out(0).fpu_reg(); | 4509 const QRegister result = locs()->out(0).fpu_reg(); |
4510 | 4510 |
4511 switch (op_kind()) { | 4511 switch (op_kind()) { |
4512 case MethodRecognizer::kFloat32x4Scale: | 4512 case MethodRecognizer::kFloat32x4Scale: |
4513 __ vcvtsd(STMP, EvenDRegisterOf(left)); | 4513 __ vcvtsd(STMP, EvenDRegisterOf(left)); |
4514 __ vdup(kWord, result, DTMP, 0); | 4514 __ vdup(kWord, result, DTMP, 0); |
4515 __ vmulqs(result, result, right); | 4515 __ vmulqs(result, result, right); |
4516 break; | 4516 break; |
4517 default: UNREACHABLE(); | 4517 default: UNREACHABLE(); |
4518 } | 4518 } |
4519 } | 4519 } |
4520 | 4520 |
4521 | 4521 |
4522 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate, | 4522 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Zone* zone, |
4523 bool opt) const { | 4523 bool opt) const { |
4524 const intptr_t kNumInputs = 1; | 4524 const intptr_t kNumInputs = 1; |
4525 const intptr_t kNumTemps = 0; | 4525 const intptr_t kNumTemps = 0; |
4526 LocationSummary* summary = new(isolate) LocationSummary( | 4526 LocationSummary* summary = new(zone) LocationSummary( |
4527 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4527 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4528 summary->set_in(0, Location::RequiresFpuRegister()); | 4528 summary->set_in(0, Location::RequiresFpuRegister()); |
4529 summary->set_out(0, Location::RequiresFpuRegister()); | 4529 summary->set_out(0, Location::RequiresFpuRegister()); |
4530 return summary; | 4530 return summary; |
4531 } | 4531 } |
4532 | 4532 |
4533 | 4533 |
4534 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4534 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4535 const QRegister left = locs()->in(0).fpu_reg(); | 4535 const QRegister left = locs()->in(0).fpu_reg(); |
4536 const QRegister result = locs()->out(0).fpu_reg(); | 4536 const QRegister result = locs()->out(0).fpu_reg(); |
4537 | 4537 |
4538 switch (op_kind()) { | 4538 switch (op_kind()) { |
4539 case MethodRecognizer::kFloat32x4Negate: | 4539 case MethodRecognizer::kFloat32x4Negate: |
4540 __ vnegqs(result, left); | 4540 __ vnegqs(result, left); |
4541 break; | 4541 break; |
4542 case MethodRecognizer::kFloat32x4Absolute: | 4542 case MethodRecognizer::kFloat32x4Absolute: |
4543 __ vabsqs(result, left); | 4543 __ vabsqs(result, left); |
4544 break; | 4544 break; |
4545 default: UNREACHABLE(); | 4545 default: UNREACHABLE(); |
4546 } | 4546 } |
4547 } | 4547 } |
4548 | 4548 |
4549 | 4549 |
4550 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate, | 4550 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Zone* zone, |
4551 bool opt) const { | 4551 bool opt) const { |
4552 const intptr_t kNumInputs = 3; | 4552 const intptr_t kNumInputs = 3; |
4553 const intptr_t kNumTemps = 0; | 4553 const intptr_t kNumTemps = 0; |
4554 LocationSummary* summary = new(isolate) LocationSummary( | 4554 LocationSummary* summary = new(zone) LocationSummary( |
4555 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4555 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4556 summary->set_in(0, Location::RequiresFpuRegister()); | 4556 summary->set_in(0, Location::RequiresFpuRegister()); |
4557 summary->set_in(1, Location::RequiresFpuRegister()); | 4557 summary->set_in(1, Location::RequiresFpuRegister()); |
4558 summary->set_in(2, Location::RequiresFpuRegister()); | 4558 summary->set_in(2, Location::RequiresFpuRegister()); |
4559 summary->set_out(0, Location::RequiresFpuRegister()); | 4559 summary->set_out(0, Location::RequiresFpuRegister()); |
4560 return summary; | 4560 return summary; |
4561 } | 4561 } |
4562 | 4562 |
4563 | 4563 |
4564 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4564 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4565 const QRegister left = locs()->in(0).fpu_reg(); | 4565 const QRegister left = locs()->in(0).fpu_reg(); |
4566 const QRegister lower = locs()->in(1).fpu_reg(); | 4566 const QRegister lower = locs()->in(1).fpu_reg(); |
4567 const QRegister upper = locs()->in(2).fpu_reg(); | 4567 const QRegister upper = locs()->in(2).fpu_reg(); |
4568 const QRegister result = locs()->out(0).fpu_reg(); | 4568 const QRegister result = locs()->out(0).fpu_reg(); |
4569 __ vminqs(result, left, upper); | 4569 __ vminqs(result, left, upper); |
4570 __ vmaxqs(result, result, lower); | 4570 __ vmaxqs(result, result, lower); |
4571 } | 4571 } |
4572 | 4572 |
4573 | 4573 |
4574 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate, | 4574 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Zone* zone, |
4575 bool opt) const { | 4575 bool opt) const { |
4576 const intptr_t kNumInputs = 2; | 4576 const intptr_t kNumInputs = 2; |
4577 const intptr_t kNumTemps = 0; | 4577 const intptr_t kNumTemps = 0; |
4578 LocationSummary* summary = new(isolate) LocationSummary( | 4578 LocationSummary* summary = new(zone) LocationSummary( |
4579 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4579 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4580 summary->set_in(0, Location::RequiresFpuRegister()); | 4580 summary->set_in(0, Location::RequiresFpuRegister()); |
4581 summary->set_in(1, Location::RequiresFpuRegister()); | 4581 summary->set_in(1, Location::RequiresFpuRegister()); |
4582 // Low (< 7) Q registers are needed for the vmovs instruction. | 4582 // Low (< 7) Q registers are needed for the vmovs instruction. |
4583 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4583 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4584 return summary; | 4584 return summary; |
4585 } | 4585 } |
4586 | 4586 |
4587 | 4587 |
4588 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4588 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4589 const QRegister replacement = locs()->in(0).fpu_reg(); | 4589 const QRegister replacement = locs()->in(0).fpu_reg(); |
(...skipping 23 matching lines...) Expand all Loading... |
4613 __ vmovs(sresult2, STMP); | 4613 __ vmovs(sresult2, STMP); |
4614 break; | 4614 break; |
4615 case MethodRecognizer::kFloat32x4WithW: | 4615 case MethodRecognizer::kFloat32x4WithW: |
4616 __ vmovs(sresult3, STMP); | 4616 __ vmovs(sresult3, STMP); |
4617 break; | 4617 break; |
4618 default: UNREACHABLE(); | 4618 default: UNREACHABLE(); |
4619 } | 4619 } |
4620 } | 4620 } |
4621 | 4621 |
4622 | 4622 |
4623 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate, | 4623 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Zone* zone, |
4624 bool opt) const { | 4624 bool opt) const { |
4625 const intptr_t kNumInputs = 1; | 4625 const intptr_t kNumInputs = 1; |
4626 const intptr_t kNumTemps = 0; | 4626 const intptr_t kNumTemps = 0; |
4627 LocationSummary* summary = new(isolate) LocationSummary( | 4627 LocationSummary* summary = new(zone) LocationSummary( |
4628 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4628 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4629 summary->set_in(0, Location::RequiresFpuRegister()); | 4629 summary->set_in(0, Location::RequiresFpuRegister()); |
4630 summary->set_out(0, Location::RequiresFpuRegister()); | 4630 summary->set_out(0, Location::RequiresFpuRegister()); |
4631 return summary; | 4631 return summary; |
4632 } | 4632 } |
4633 | 4633 |
4634 | 4634 |
4635 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4635 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4636 const QRegister value = locs()->in(0).fpu_reg(); | 4636 const QRegister value = locs()->in(0).fpu_reg(); |
4637 const QRegister result = locs()->out(0).fpu_reg(); | 4637 const QRegister result = locs()->out(0).fpu_reg(); |
4638 | 4638 |
4639 if (value != result) { | 4639 if (value != result) { |
4640 __ vmovq(result, value); | 4640 __ vmovq(result, value); |
4641 } | 4641 } |
4642 } | 4642 } |
4643 | 4643 |
4644 | 4644 |
4645 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate, | 4645 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Zone* zone, |
4646 bool opt) const { | 4646 bool opt) const { |
4647 const intptr_t kNumInputs = 1; | 4647 const intptr_t kNumInputs = 1; |
4648 const intptr_t kNumTemps = 0; | 4648 const intptr_t kNumTemps = 0; |
4649 LocationSummary* summary = new(isolate) LocationSummary( | 4649 LocationSummary* summary = new(zone) LocationSummary( |
4650 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4650 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4651 summary->set_in(0, Location::RequiresFpuRegister()); | 4651 summary->set_in(0, Location::RequiresFpuRegister()); |
4652 summary->set_out(0, Location::RequiresFpuRegister()); | 4652 summary->set_out(0, Location::RequiresFpuRegister()); |
4653 return summary; | 4653 return summary; |
4654 } | 4654 } |
4655 | 4655 |
4656 | 4656 |
4657 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4657 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4658 const QRegister value = locs()->in(0).fpu_reg(); | 4658 const QRegister value = locs()->in(0).fpu_reg(); |
4659 | 4659 |
4660 const DRegister dvalue0 = EvenDRegisterOf(value); | 4660 const DRegister dvalue0 = EvenDRegisterOf(value); |
4661 const DRegister dvalue1 = OddDRegisterOf(value); | 4661 const DRegister dvalue1 = OddDRegisterOf(value); |
4662 | 4662 |
4663 const QRegister result = locs()->out(0).fpu_reg(); | 4663 const QRegister result = locs()->out(0).fpu_reg(); |
4664 | 4664 |
4665 const DRegister dresult0 = EvenDRegisterOf(result); | 4665 const DRegister dresult0 = EvenDRegisterOf(result); |
4666 | 4666 |
4667 switch (op_kind()) { | 4667 switch (op_kind()) { |
4668 case MethodRecognizer::kFloat64x2GetX: | 4668 case MethodRecognizer::kFloat64x2GetX: |
4669 __ vmovd(dresult0, dvalue0); | 4669 __ vmovd(dresult0, dvalue0); |
4670 break; | 4670 break; |
4671 case MethodRecognizer::kFloat64x2GetY: | 4671 case MethodRecognizer::kFloat64x2GetY: |
4672 __ vmovd(dresult0, dvalue1); | 4672 __ vmovd(dresult0, dvalue1); |
4673 break; | 4673 break; |
4674 default: UNREACHABLE(); | 4674 default: UNREACHABLE(); |
4675 } | 4675 } |
4676 } | 4676 } |
4677 | 4677 |
4678 | 4678 |
4679 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate, | 4679 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Zone* zone, |
4680 bool opt) const { | 4680 bool opt) const { |
4681 const intptr_t kNumInputs = 0; | 4681 const intptr_t kNumInputs = 0; |
4682 const intptr_t kNumTemps = 0; | 4682 const intptr_t kNumTemps = 0; |
4683 LocationSummary* summary = new(isolate) LocationSummary( | 4683 LocationSummary* summary = new(zone) LocationSummary( |
4684 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4684 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4685 summary->set_out(0, Location::RequiresFpuRegister()); | 4685 summary->set_out(0, Location::RequiresFpuRegister()); |
4686 return summary; | 4686 return summary; |
4687 } | 4687 } |
4688 | 4688 |
4689 | 4689 |
4690 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4690 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4691 const QRegister q = locs()->out(0).fpu_reg(); | 4691 const QRegister q = locs()->out(0).fpu_reg(); |
4692 __ veorq(q, q, q); | 4692 __ veorq(q, q, q); |
4693 } | 4693 } |
4694 | 4694 |
4695 | 4695 |
4696 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate, | 4696 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Zone* zone, |
4697 bool opt) const { | 4697 bool opt) const { |
4698 const intptr_t kNumInputs = 1; | 4698 const intptr_t kNumInputs = 1; |
4699 const intptr_t kNumTemps = 0; | 4699 const intptr_t kNumTemps = 0; |
4700 LocationSummary* summary = new(isolate) LocationSummary( | 4700 LocationSummary* summary = new(zone) LocationSummary( |
4701 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4701 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4702 summary->set_in(0, Location::RequiresFpuRegister()); | 4702 summary->set_in(0, Location::RequiresFpuRegister()); |
4703 summary->set_out(0, Location::RequiresFpuRegister()); | 4703 summary->set_out(0, Location::RequiresFpuRegister()); |
4704 return summary; | 4704 return summary; |
4705 } | 4705 } |
4706 | 4706 |
4707 | 4707 |
4708 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4708 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4709 const QRegister value = locs()->in(0).fpu_reg(); | 4709 const QRegister value = locs()->in(0).fpu_reg(); |
4710 | 4710 |
4711 const DRegister dvalue = EvenDRegisterOf(value); | 4711 const DRegister dvalue = EvenDRegisterOf(value); |
4712 | 4712 |
4713 const QRegister result = locs()->out(0).fpu_reg(); | 4713 const QRegister result = locs()->out(0).fpu_reg(); |
4714 | 4714 |
4715 const DRegister dresult0 = EvenDRegisterOf(result); | 4715 const DRegister dresult0 = EvenDRegisterOf(result); |
4716 const DRegister dresult1 = OddDRegisterOf(result); | 4716 const DRegister dresult1 = OddDRegisterOf(result); |
4717 | 4717 |
4718 // Splat across all lanes. | 4718 // Splat across all lanes. |
4719 __ vmovd(dresult0, dvalue); | 4719 __ vmovd(dresult0, dvalue); |
4720 __ vmovd(dresult1, dvalue); | 4720 __ vmovd(dresult1, dvalue); |
4721 } | 4721 } |
4722 | 4722 |
4723 | 4723 |
4724 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( | 4724 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( |
4725 Isolate* isolate, bool opt) const { | 4725 Zone* zone, bool opt) const { |
4726 const intptr_t kNumInputs = 2; | 4726 const intptr_t kNumInputs = 2; |
4727 const intptr_t kNumTemps = 0; | 4727 const intptr_t kNumTemps = 0; |
4728 LocationSummary* summary = new(isolate) LocationSummary( | 4728 LocationSummary* summary = new(zone) LocationSummary( |
4729 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4729 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4730 summary->set_in(0, Location::RequiresFpuRegister()); | 4730 summary->set_in(0, Location::RequiresFpuRegister()); |
4731 summary->set_in(1, Location::RequiresFpuRegister()); | 4731 summary->set_in(1, Location::RequiresFpuRegister()); |
4732 summary->set_out(0, Location::RequiresFpuRegister()); | 4732 summary->set_out(0, Location::RequiresFpuRegister()); |
4733 return summary; | 4733 return summary; |
4734 } | 4734 } |
4735 | 4735 |
4736 | 4736 |
4737 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4737 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4738 const QRegister q0 = locs()->in(0).fpu_reg(); | 4738 const QRegister q0 = locs()->in(0).fpu_reg(); |
4739 const QRegister q1 = locs()->in(1).fpu_reg(); | 4739 const QRegister q1 = locs()->in(1).fpu_reg(); |
4740 const QRegister r = locs()->out(0).fpu_reg(); | 4740 const QRegister r = locs()->out(0).fpu_reg(); |
4741 | 4741 |
4742 const DRegister d0 = EvenDRegisterOf(q0); | 4742 const DRegister d0 = EvenDRegisterOf(q0); |
4743 const DRegister d1 = EvenDRegisterOf(q1); | 4743 const DRegister d1 = EvenDRegisterOf(q1); |
4744 | 4744 |
4745 const DRegister dr0 = EvenDRegisterOf(r); | 4745 const DRegister dr0 = EvenDRegisterOf(r); |
4746 const DRegister dr1 = OddDRegisterOf(r); | 4746 const DRegister dr1 = OddDRegisterOf(r); |
4747 | 4747 |
4748 __ vmovd(dr0, d0); | 4748 __ vmovd(dr0, d0); |
4749 __ vmovd(dr1, d1); | 4749 __ vmovd(dr1, d1); |
4750 } | 4750 } |
4751 | 4751 |
4752 | 4752 |
4753 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( | 4753 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( |
4754 Isolate* isolate, bool opt) const { | 4754 Zone* zone, bool opt) const { |
4755 const intptr_t kNumInputs = 1; | 4755 const intptr_t kNumInputs = 1; |
4756 const intptr_t kNumTemps = 0; | 4756 const intptr_t kNumTemps = 0; |
4757 LocationSummary* summary = new(isolate) LocationSummary( | 4757 LocationSummary* summary = new(zone) LocationSummary( |
4758 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4758 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4759 summary->set_in(0, Location::RequiresFpuRegister()); | 4759 summary->set_in(0, Location::RequiresFpuRegister()); |
4760 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4760 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
4761 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4761 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4762 return summary; | 4762 return summary; |
4763 } | 4763 } |
4764 | 4764 |
4765 | 4765 |
4766 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4766 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4767 const QRegister q = locs()->in(0).fpu_reg(); | 4767 const QRegister q = locs()->in(0).fpu_reg(); |
4768 const QRegister r = locs()->out(0).fpu_reg(); | 4768 const QRegister r = locs()->out(0).fpu_reg(); |
4769 | 4769 |
4770 const DRegister dq0 = EvenDRegisterOf(q); | 4770 const DRegister dq0 = EvenDRegisterOf(q); |
4771 const DRegister dq1 = OddDRegisterOf(q); | 4771 const DRegister dq1 = OddDRegisterOf(q); |
4772 | 4772 |
4773 const DRegister dr0 = EvenDRegisterOf(r); | 4773 const DRegister dr0 = EvenDRegisterOf(r); |
4774 | 4774 |
4775 // Zero register. | 4775 // Zero register. |
4776 __ veorq(r, r, r); | 4776 __ veorq(r, r, r); |
4777 // Set X lane. | 4777 // Set X lane. |
4778 __ vcvtsd(EvenSRegisterOf(dr0), dq0); | 4778 __ vcvtsd(EvenSRegisterOf(dr0), dq0); |
4779 // Set Y lane. | 4779 // Set Y lane. |
4780 __ vcvtsd(OddSRegisterOf(dr0), dq1); | 4780 __ vcvtsd(OddSRegisterOf(dr0), dq1); |
4781 } | 4781 } |
4782 | 4782 |
4783 | 4783 |
4784 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( | 4784 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( |
4785 Isolate* isolate, bool opt) const { | 4785 Zone* zone, bool opt) const { |
4786 const intptr_t kNumInputs = 1; | 4786 const intptr_t kNumInputs = 1; |
4787 const intptr_t kNumTemps = 0; | 4787 const intptr_t kNumTemps = 0; |
4788 LocationSummary* summary = new(isolate) LocationSummary( | 4788 LocationSummary* summary = new(zone) LocationSummary( |
4789 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4789 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4790 summary->set_in(0, Location::RequiresFpuRegister()); | 4790 summary->set_in(0, Location::RequiresFpuRegister()); |
4791 // Low (< 7) Q registers are needed for the vcvtsd instruction. | 4791 // Low (< 7) Q registers are needed for the vcvtsd instruction. |
4792 summary->set_out(0, Location::FpuRegisterLocation(Q6)); | 4792 summary->set_out(0, Location::FpuRegisterLocation(Q6)); |
4793 return summary; | 4793 return summary; |
4794 } | 4794 } |
4795 | 4795 |
4796 | 4796 |
4797 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4797 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4798 const QRegister q = locs()->in(0).fpu_reg(); | 4798 const QRegister q = locs()->in(0).fpu_reg(); |
4799 const QRegister r = locs()->out(0).fpu_reg(); | 4799 const QRegister r = locs()->out(0).fpu_reg(); |
4800 | 4800 |
4801 const DRegister dq0 = EvenDRegisterOf(q); | 4801 const DRegister dq0 = EvenDRegisterOf(q); |
4802 | 4802 |
4803 const DRegister dr0 = EvenDRegisterOf(r); | 4803 const DRegister dr0 = EvenDRegisterOf(r); |
4804 const DRegister dr1 = OddDRegisterOf(r); | 4804 const DRegister dr1 = OddDRegisterOf(r); |
4805 | 4805 |
4806 // Set X. | 4806 // Set X. |
4807 __ vcvtds(dr0, EvenSRegisterOf(dq0)); | 4807 __ vcvtds(dr0, EvenSRegisterOf(dq0)); |
4808 // Set Y. | 4808 // Set Y. |
4809 __ vcvtds(dr1, OddSRegisterOf(dq0)); | 4809 __ vcvtds(dr1, OddSRegisterOf(dq0)); |
4810 } | 4810 } |
4811 | 4811 |
4812 | 4812 |
4813 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate, | 4813 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Zone* zone, |
4814 bool opt) const { | 4814 bool opt) const { |
4815 const intptr_t kNumInputs = 1; | 4815 const intptr_t kNumInputs = 1; |
4816 const intptr_t kNumTemps = 0; | 4816 const intptr_t kNumTemps = 0; |
4817 LocationSummary* summary = new(isolate) LocationSummary( | 4817 LocationSummary* summary = new(zone) LocationSummary( |
4818 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4818 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4819 | 4819 |
4820 if (representation() == kTagged) { | 4820 if (representation() == kTagged) { |
4821 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); | 4821 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); |
4822 // Grabbing the S components means we need a low (< 7) Q. | 4822 // Grabbing the S components means we need a low (< 7) Q. |
4823 summary->set_in(0, Location::FpuRegisterLocation(Q6)); | 4823 summary->set_in(0, Location::FpuRegisterLocation(Q6)); |
4824 summary->set_out(0, Location::RequiresRegister()); | 4824 summary->set_out(0, Location::RequiresRegister()); |
4825 } else { | 4825 } else { |
4826 summary->set_in(0, Location::RequiresFpuRegister()); | 4826 summary->set_in(0, Location::RequiresFpuRegister()); |
4827 summary->set_out(0, Location::RequiresFpuRegister()); | 4827 summary->set_out(0, Location::RequiresFpuRegister()); |
4828 } | 4828 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4869 break; | 4869 break; |
4870 case MethodRecognizer::kFloat64x2Sqrt: | 4870 case MethodRecognizer::kFloat64x2Sqrt: |
4871 __ vsqrtd(dresult0, dvalue0); | 4871 __ vsqrtd(dresult0, dvalue0); |
4872 __ vsqrtd(dresult1, dvalue1); | 4872 __ vsqrtd(dresult1, dvalue1); |
4873 break; | 4873 break; |
4874 default: UNREACHABLE(); | 4874 default: UNREACHABLE(); |
4875 } | 4875 } |
4876 } | 4876 } |
4877 | 4877 |
4878 | 4878 |
4879 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate, | 4879 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Zone* zone, |
4880 bool opt) const { | 4880 bool opt) const { |
4881 const intptr_t kNumInputs = 2; | 4881 const intptr_t kNumInputs = 2; |
4882 const intptr_t kNumTemps = 0; | 4882 const intptr_t kNumTemps = 0; |
4883 LocationSummary* summary = new(isolate) LocationSummary( | 4883 LocationSummary* summary = new(zone) LocationSummary( |
4884 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4884 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4885 summary->set_in(0, Location::RequiresFpuRegister()); | 4885 summary->set_in(0, Location::RequiresFpuRegister()); |
4886 summary->set_in(1, Location::RequiresFpuRegister()); | 4886 summary->set_in(1, Location::RequiresFpuRegister()); |
4887 summary->set_out(0, Location::SameAsFirstInput()); | 4887 summary->set_out(0, Location::SameAsFirstInput()); |
4888 return summary; | 4888 return summary; |
4889 } | 4889 } |
4890 | 4890 |
4891 | 4891 |
4892 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4892 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4893 const QRegister left = locs()->in(0).fpu_reg(); | 4893 const QRegister left = locs()->in(0).fpu_reg(); |
4894 const DRegister left0 = EvenDRegisterOf(left); | 4894 const DRegister left0 = EvenDRegisterOf(left); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4943 __ vmovd(left1, right1); | 4943 __ vmovd(left1, right1); |
4944 __ Bind(&g1); | 4944 __ Bind(&g1); |
4945 break; | 4945 break; |
4946 } | 4946 } |
4947 default: UNREACHABLE(); | 4947 default: UNREACHABLE(); |
4948 } | 4948 } |
4949 } | 4949 } |
4950 | 4950 |
4951 | 4951 |
4952 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary( | 4952 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary( |
4953 Isolate* isolate, bool opt) const { | 4953 Zone* zone, bool opt) const { |
4954 const intptr_t kNumInputs = 4; | 4954 const intptr_t kNumInputs = 4; |
4955 const intptr_t kNumTemps = 0; | 4955 const intptr_t kNumTemps = 0; |
4956 LocationSummary* summary = new(isolate) LocationSummary( | 4956 LocationSummary* summary = new(zone) LocationSummary( |
4957 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4957 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4958 summary->set_in(0, Location::RequiresRegister()); | 4958 summary->set_in(0, Location::RequiresRegister()); |
4959 summary->set_in(1, Location::RequiresRegister()); | 4959 summary->set_in(1, Location::RequiresRegister()); |
4960 summary->set_in(2, Location::RequiresRegister()); | 4960 summary->set_in(2, Location::RequiresRegister()); |
4961 summary->set_in(3, Location::RequiresRegister()); | 4961 summary->set_in(3, Location::RequiresRegister()); |
4962 summary->set_out(0, Location::RequiresRegister()); | 4962 summary->set_out(0, Location::RequiresRegister()); |
4963 return summary; | 4963 return summary; |
4964 } | 4964 } |
4965 | 4965 |
4966 | 4966 |
4967 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4967 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4968 const Register v0 = locs()->in(0).reg(); | 4968 const Register v0 = locs()->in(0).reg(); |
4969 const Register v1 = locs()->in(1).reg(); | 4969 const Register v1 = locs()->in(1).reg(); |
4970 const Register v2 = locs()->in(2).reg(); | 4970 const Register v2 = locs()->in(2).reg(); |
4971 const Register v3 = locs()->in(3).reg(); | 4971 const Register v3 = locs()->in(3).reg(); |
4972 const QRegister result = locs()->out(0).fpu_reg(); | 4972 const QRegister result = locs()->out(0).fpu_reg(); |
4973 const DRegister dresult0 = EvenDRegisterOf(result); | 4973 const DRegister dresult0 = EvenDRegisterOf(result); |
4974 const DRegister dresult1 = OddDRegisterOf(result); | 4974 const DRegister dresult1 = OddDRegisterOf(result); |
4975 __ veorq(result, result, result); | 4975 __ veorq(result, result, result); |
4976 __ vmovdrr(dresult0, v0, v1); | 4976 __ vmovdrr(dresult0, v0, v1); |
4977 __ vmovdrr(dresult1, v2, v3); | 4977 __ vmovdrr(dresult1, v2, v3); |
4978 } | 4978 } |
4979 | 4979 |
4980 | 4980 |
4981 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 4981 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
4982 Isolate* isolate, bool opt) const { | 4982 Zone* zone, bool opt) const { |
4983 const intptr_t kNumInputs = 4; | 4983 const intptr_t kNumInputs = 4; |
4984 const intptr_t kNumTemps = 1; | 4984 const intptr_t kNumTemps = 1; |
4985 LocationSummary* summary = new(isolate) LocationSummary( | 4985 LocationSummary* summary = new(zone) LocationSummary( |
4986 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4986 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4987 summary->set_in(0, Location::RequiresRegister()); | 4987 summary->set_in(0, Location::RequiresRegister()); |
4988 summary->set_in(1, Location::RequiresRegister()); | 4988 summary->set_in(1, Location::RequiresRegister()); |
4989 summary->set_in(2, Location::RequiresRegister()); | 4989 summary->set_in(2, Location::RequiresRegister()); |
4990 summary->set_in(3, Location::RequiresRegister()); | 4990 summary->set_in(3, Location::RequiresRegister()); |
4991 summary->set_temp(0, Location::RequiresRegister()); | 4991 summary->set_temp(0, Location::RequiresRegister()); |
4992 summary->set_out(0, Location::RequiresRegister()); | 4992 summary->set_out(0, Location::RequiresRegister()); |
4993 return summary; | 4993 return summary; |
4994 } | 4994 } |
4995 | 4995 |
4996 | 4996 |
(...skipping 18 matching lines...) Expand all Loading... |
5015 __ vmovdr(dresult0, 1, temp, EQ); | 5015 __ vmovdr(dresult0, 1, temp, EQ); |
5016 | 5016 |
5017 __ cmp(v2, Operand(IP)); | 5017 __ cmp(v2, Operand(IP)); |
5018 __ vmovdr(dresult1, 0, temp, EQ); | 5018 __ vmovdr(dresult1, 0, temp, EQ); |
5019 | 5019 |
5020 __ cmp(v3, Operand(IP)); | 5020 __ cmp(v3, Operand(IP)); |
5021 __ vmovdr(dresult1, 1, temp, EQ); | 5021 __ vmovdr(dresult1, 1, temp, EQ); |
5022 } | 5022 } |
5023 | 5023 |
5024 | 5024 |
5025 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate, | 5025 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Zone* zone, |
5026 bool opt) const { | 5026 bool opt) const { |
5027 const intptr_t kNumInputs = 1; | 5027 const intptr_t kNumInputs = 1; |
5028 const intptr_t kNumTemps = 0; | 5028 const intptr_t kNumTemps = 0; |
5029 LocationSummary* summary = new(isolate) LocationSummary( | 5029 LocationSummary* summary = new(zone) LocationSummary( |
5030 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5030 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5031 // Low (< 7) Q registers are needed for the vmovrs instruction. | 5031 // Low (< 7) Q registers are needed for the vmovrs instruction. |
5032 summary->set_in(0, Location::FpuRegisterLocation(Q6)); | 5032 summary->set_in(0, Location::FpuRegisterLocation(Q6)); |
5033 summary->set_out(0, Location::RequiresRegister()); | 5033 summary->set_out(0, Location::RequiresRegister()); |
5034 return summary; | 5034 return summary; |
5035 } | 5035 } |
5036 | 5036 |
5037 | 5037 |
5038 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5038 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5039 const QRegister value = locs()->in(0).fpu_reg(); | 5039 const QRegister value = locs()->in(0).fpu_reg(); |
5040 const Register result = locs()->out(0).reg(); | 5040 const Register result = locs()->out(0).reg(); |
(...skipping 20 matching lines...) Expand all Loading... |
5061 break; | 5061 break; |
5062 default: UNREACHABLE(); | 5062 default: UNREACHABLE(); |
5063 } | 5063 } |
5064 | 5064 |
5065 __ tst(result, Operand(result)); | 5065 __ tst(result, Operand(result)); |
5066 __ LoadObject(result, Bool::True(), NE); | 5066 __ LoadObject(result, Bool::True(), NE); |
5067 __ LoadObject(result, Bool::False(), EQ); | 5067 __ LoadObject(result, Bool::False(), EQ); |
5068 } | 5068 } |
5069 | 5069 |
5070 | 5070 |
5071 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate, | 5071 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Zone* zone, |
5072 bool opt) const { | 5072 bool opt) const { |
5073 const intptr_t kNumInputs = 3; | 5073 const intptr_t kNumInputs = 3; |
5074 const intptr_t kNumTemps = 1; | 5074 const intptr_t kNumTemps = 1; |
5075 LocationSummary* summary = new(isolate) LocationSummary( | 5075 LocationSummary* summary = new(zone) LocationSummary( |
5076 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5076 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5077 summary->set_in(0, Location::RequiresFpuRegister()); | 5077 summary->set_in(0, Location::RequiresFpuRegister()); |
5078 summary->set_in(1, Location::RequiresFpuRegister()); | 5078 summary->set_in(1, Location::RequiresFpuRegister()); |
5079 summary->set_in(2, Location::RequiresFpuRegister()); | 5079 summary->set_in(2, Location::RequiresFpuRegister()); |
5080 summary->set_temp(0, Location::RequiresFpuRegister()); | 5080 summary->set_temp(0, Location::RequiresFpuRegister()); |
5081 summary->set_out(0, Location::RequiresFpuRegister()); | 5081 summary->set_out(0, Location::RequiresFpuRegister()); |
5082 return summary; | 5082 return summary; |
5083 } | 5083 } |
5084 | 5084 |
5085 | 5085 |
5086 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5086 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5087 const QRegister mask = locs()->in(0).fpu_reg(); | 5087 const QRegister mask = locs()->in(0).fpu_reg(); |
5088 const QRegister trueValue = locs()->in(1).fpu_reg(); | 5088 const QRegister trueValue = locs()->in(1).fpu_reg(); |
5089 const QRegister falseValue = locs()->in(2).fpu_reg(); | 5089 const QRegister falseValue = locs()->in(2).fpu_reg(); |
5090 const QRegister out = locs()->out(0).fpu_reg(); | 5090 const QRegister out = locs()->out(0).fpu_reg(); |
5091 const QRegister temp = locs()->temp(0).fpu_reg(); | 5091 const QRegister temp = locs()->temp(0).fpu_reg(); |
5092 | 5092 |
5093 // Copy mask. | 5093 // Copy mask. |
5094 __ vmovq(temp, mask); | 5094 __ vmovq(temp, mask); |
5095 // Invert it. | 5095 // Invert it. |
5096 __ vmvnq(temp, temp); | 5096 __ vmvnq(temp, temp); |
5097 // mask = mask & trueValue. | 5097 // mask = mask & trueValue. |
5098 __ vandq(mask, mask, trueValue); | 5098 __ vandq(mask, mask, trueValue); |
5099 // temp = temp & falseValue. | 5099 // temp = temp & falseValue. |
5100 __ vandq(temp, temp, falseValue); | 5100 __ vandq(temp, temp, falseValue); |
5101 // out = mask | temp. | 5101 // out = mask | temp. |
5102 __ vorrq(out, mask, temp); | 5102 __ vorrq(out, mask, temp); |
5103 } | 5103 } |
5104 | 5104 |
5105 | 5105 |
5106 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate, | 5106 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Zone* zone, |
5107 bool opt) const { | 5107 bool opt) const { |
5108 const intptr_t kNumInputs = 2; | 5108 const intptr_t kNumInputs = 2; |
5109 const intptr_t kNumTemps = 0; | 5109 const intptr_t kNumTemps = 0; |
5110 LocationSummary* summary = new(isolate) LocationSummary( | 5110 LocationSummary* summary = new(zone) LocationSummary( |
5111 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5111 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5112 summary->set_in(0, Location::RequiresFpuRegister()); | 5112 summary->set_in(0, Location::RequiresFpuRegister()); |
5113 summary->set_in(1, Location::RequiresRegister()); | 5113 summary->set_in(1, Location::RequiresRegister()); |
5114 summary->set_out(0, Location::RequiresFpuRegister()); | 5114 summary->set_out(0, Location::RequiresFpuRegister()); |
5115 return summary; | 5115 return summary; |
5116 } | 5116 } |
5117 | 5117 |
5118 | 5118 |
5119 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5119 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5120 const QRegister mask = locs()->in(0).fpu_reg(); | 5120 const QRegister mask = locs()->in(0).fpu_reg(); |
5121 const Register flag = locs()->in(1).reg(); | 5121 const Register flag = locs()->in(1).reg(); |
(...skipping 20 matching lines...) Expand all Loading... |
5142 __ vmovdr(dresult1, 0, TMP); | 5142 __ vmovdr(dresult1, 0, TMP); |
5143 break; | 5143 break; |
5144 case MethodRecognizer::kInt32x4WithFlagW: | 5144 case MethodRecognizer::kInt32x4WithFlagW: |
5145 __ vmovdr(dresult1, 1, TMP); | 5145 __ vmovdr(dresult1, 1, TMP); |
5146 break; | 5146 break; |
5147 default: UNREACHABLE(); | 5147 default: UNREACHABLE(); |
5148 } | 5148 } |
5149 } | 5149 } |
5150 | 5150 |
5151 | 5151 |
5152 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate, | 5152 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Zone* zone, |
5153 bool opt) const { | 5153 bool opt) const { |
5154 const intptr_t kNumInputs = 1; | 5154 const intptr_t kNumInputs = 1; |
5155 const intptr_t kNumTemps = 0; | 5155 const intptr_t kNumTemps = 0; |
5156 LocationSummary* summary = new(isolate) LocationSummary( | 5156 LocationSummary* summary = new(zone) LocationSummary( |
5157 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5157 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5158 summary->set_in(0, Location::RequiresFpuRegister()); | 5158 summary->set_in(0, Location::RequiresFpuRegister()); |
5159 summary->set_out(0, Location::RequiresFpuRegister()); | 5159 summary->set_out(0, Location::RequiresFpuRegister()); |
5160 return summary; | 5160 return summary; |
5161 } | 5161 } |
5162 | 5162 |
5163 | 5163 |
5164 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5164 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5165 const QRegister value = locs()->in(0).fpu_reg(); | 5165 const QRegister value = locs()->in(0).fpu_reg(); |
5166 const QRegister result = locs()->out(0).fpu_reg(); | 5166 const QRegister result = locs()->out(0).fpu_reg(); |
5167 | 5167 |
5168 if (value != result) { | 5168 if (value != result) { |
5169 __ vmovq(result, value); | 5169 __ vmovq(result, value); |
5170 } | 5170 } |
5171 } | 5171 } |
5172 | 5172 |
5173 | 5173 |
5174 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate, | 5174 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Zone* zone, |
5175 bool opt) const { | 5175 bool opt) const { |
5176 const intptr_t kNumInputs = 2; | 5176 const intptr_t kNumInputs = 2; |
5177 const intptr_t kNumTemps = 0; | 5177 const intptr_t kNumTemps = 0; |
5178 LocationSummary* summary = new(isolate) LocationSummary( | 5178 LocationSummary* summary = new(zone) LocationSummary( |
5179 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5179 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5180 summary->set_in(0, Location::RequiresFpuRegister()); | 5180 summary->set_in(0, Location::RequiresFpuRegister()); |
5181 summary->set_in(1, Location::RequiresFpuRegister()); | 5181 summary->set_in(1, Location::RequiresFpuRegister()); |
5182 summary->set_out(0, Location::RequiresFpuRegister()); | 5182 summary->set_out(0, Location::RequiresFpuRegister()); |
5183 return summary; | 5183 return summary; |
5184 } | 5184 } |
5185 | 5185 |
5186 | 5186 |
5187 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5187 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5188 const QRegister left = locs()->in(0).fpu_reg(); | 5188 const QRegister left = locs()->in(0).fpu_reg(); |
5189 const QRegister right = locs()->in(1).fpu_reg(); | 5189 const QRegister right = locs()->in(1).fpu_reg(); |
5190 const QRegister result = locs()->out(0).fpu_reg(); | 5190 const QRegister result = locs()->out(0).fpu_reg(); |
5191 switch (op_kind()) { | 5191 switch (op_kind()) { |
5192 case Token::kBIT_AND: __ vandq(result, left, right); break; | 5192 case Token::kBIT_AND: __ vandq(result, left, right); break; |
5193 case Token::kBIT_OR: __ vorrq(result, left, right); break; | 5193 case Token::kBIT_OR: __ vorrq(result, left, right); break; |
5194 case Token::kBIT_XOR: __ veorq(result, left, right); break; | 5194 case Token::kBIT_XOR: __ veorq(result, left, right); break; |
5195 case Token::kADD: __ vaddqi(kWord, result, left, right); break; | 5195 case Token::kADD: __ vaddqi(kWord, result, left, right); break; |
5196 case Token::kSUB: __ vsubqi(kWord, result, left, right); break; | 5196 case Token::kSUB: __ vsubqi(kWord, result, left, right); break; |
5197 default: UNREACHABLE(); | 5197 default: UNREACHABLE(); |
5198 } | 5198 } |
5199 } | 5199 } |
5200 | 5200 |
5201 | 5201 |
5202 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate, | 5202 LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone, |
5203 bool opt) const { | 5203 bool opt) const { |
5204 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { | 5204 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { |
5205 const intptr_t kNumInputs = 1; | 5205 const intptr_t kNumInputs = 1; |
5206 const intptr_t kNumTemps = TargetCPUFeatures::hardfp_supported() ? 0 : 4; | 5206 const intptr_t kNumTemps = TargetCPUFeatures::hardfp_supported() ? 0 : 4; |
5207 LocationSummary* summary = new(isolate) LocationSummary( | 5207 LocationSummary* summary = new(zone) LocationSummary( |
5208 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 5208 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
5209 summary->set_in(0, Location::FpuRegisterLocation(Q0)); | 5209 summary->set_in(0, Location::FpuRegisterLocation(Q0)); |
5210 summary->set_out(0, Location::FpuRegisterLocation(Q0)); | 5210 summary->set_out(0, Location::FpuRegisterLocation(Q0)); |
5211 if (!TargetCPUFeatures::hardfp_supported()) { | 5211 if (!TargetCPUFeatures::hardfp_supported()) { |
5212 summary->set_temp(0, Location::RegisterLocation(R0)); | 5212 summary->set_temp(0, Location::RegisterLocation(R0)); |
5213 summary->set_temp(1, Location::RegisterLocation(R1)); | 5213 summary->set_temp(1, Location::RegisterLocation(R1)); |
5214 summary->set_temp(2, Location::RegisterLocation(R2)); | 5214 summary->set_temp(2, Location::RegisterLocation(R2)); |
5215 summary->set_temp(3, Location::RegisterLocation(R3)); | 5215 summary->set_temp(3, Location::RegisterLocation(R3)); |
5216 } | 5216 } |
5217 return summary; | 5217 return summary; |
5218 } | 5218 } |
5219 ASSERT((kind() == MathUnaryInstr::kSqrt) || | 5219 ASSERT((kind() == MathUnaryInstr::kSqrt) || |
5220 (kind() == MathUnaryInstr::kDoubleSquare)); | 5220 (kind() == MathUnaryInstr::kDoubleSquare)); |
5221 const intptr_t kNumInputs = 1; | 5221 const intptr_t kNumInputs = 1; |
5222 const intptr_t kNumTemps = 0; | 5222 const intptr_t kNumTemps = 0; |
5223 LocationSummary* summary = new(isolate) LocationSummary( | 5223 LocationSummary* summary = new(zone) LocationSummary( |
5224 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5224 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5225 summary->set_in(0, Location::RequiresFpuRegister()); | 5225 summary->set_in(0, Location::RequiresFpuRegister()); |
5226 summary->set_out(0, Location::RequiresFpuRegister()); | 5226 summary->set_out(0, Location::RequiresFpuRegister()); |
5227 return summary; | 5227 return summary; |
5228 } | 5228 } |
5229 | 5229 |
5230 | 5230 |
5231 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5231 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5232 if (kind() == MathUnaryInstr::kSqrt) { | 5232 if (kind() == MathUnaryInstr::kSqrt) { |
5233 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5233 const DRegister val = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
5234 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5234 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
(...skipping 15 matching lines...) Expand all Loading... |
5250 __ vmovrrd(R2, R3, D1); | 5250 __ vmovrrd(R2, R3, D1); |
5251 __ CallRuntime(TargetFunction(), InputCount()); | 5251 __ CallRuntime(TargetFunction(), InputCount()); |
5252 __ vmovdrr(D0, R0, R1); | 5252 __ vmovdrr(D0, R0, R1); |
5253 __ vmovdrr(D1, R2, R3); | 5253 __ vmovdrr(D1, R2, R3); |
5254 } | 5254 } |
5255 } | 5255 } |
5256 } | 5256 } |
5257 | 5257 |
5258 | 5258 |
5259 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( | 5259 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( |
5260 Isolate* isolate, bool opt) const { | 5260 Zone* zone, bool opt) const { |
5261 const intptr_t kNumTemps = 0; | 5261 const intptr_t kNumTemps = 0; |
5262 LocationSummary* summary = new(isolate) LocationSummary( | 5262 LocationSummary* summary = new(zone) LocationSummary( |
5263 isolate, InputCount(), kNumTemps, LocationSummary::kCall); | 5263 zone, InputCount(), kNumTemps, LocationSummary::kCall); |
5264 summary->set_in(0, Location::RegisterLocation(R0)); | 5264 summary->set_in(0, Location::RegisterLocation(R0)); |
5265 summary->set_in(1, Location::RegisterLocation(R1)); | 5265 summary->set_in(1, Location::RegisterLocation(R1)); |
5266 summary->set_in(2, Location::RegisterLocation(R2)); | 5266 summary->set_in(2, Location::RegisterLocation(R2)); |
5267 summary->set_in(3, Location::RegisterLocation(R3)); | 5267 summary->set_in(3, Location::RegisterLocation(R3)); |
5268 summary->set_out(0, Location::RegisterLocation(R0)); | 5268 summary->set_out(0, Location::RegisterLocation(R0)); |
5269 return summary; | 5269 return summary; |
5270 } | 5270 } |
5271 | 5271 |
5272 | 5272 |
5273 void CaseInsensitiveCompareUC16Instr::EmitNativeCode( | 5273 void CaseInsensitiveCompareUC16Instr::EmitNativeCode( |
5274 FlowGraphCompiler* compiler) { | 5274 FlowGraphCompiler* compiler) { |
5275 | 5275 |
5276 // Call the function. | 5276 // Call the function. |
5277 __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); | 5277 __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); |
5278 } | 5278 } |
5279 | 5279 |
5280 | 5280 |
5281 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, | 5281 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone, |
5282 bool opt) const { | 5282 bool opt) const { |
5283 if (result_cid() == kDoubleCid) { | 5283 if (result_cid() == kDoubleCid) { |
5284 const intptr_t kNumInputs = 2; | 5284 const intptr_t kNumInputs = 2; |
5285 const intptr_t kNumTemps = 1; | 5285 const intptr_t kNumTemps = 1; |
5286 LocationSummary* summary = new(isolate) LocationSummary( | 5286 LocationSummary* summary = new(zone) LocationSummary( |
5287 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5287 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5288 summary->set_in(0, Location::RequiresFpuRegister()); | 5288 summary->set_in(0, Location::RequiresFpuRegister()); |
5289 summary->set_in(1, Location::RequiresFpuRegister()); | 5289 summary->set_in(1, Location::RequiresFpuRegister()); |
5290 // Reuse the left register so that code can be made shorter. | 5290 // Reuse the left register so that code can be made shorter. |
5291 summary->set_out(0, Location::SameAsFirstInput()); | 5291 summary->set_out(0, Location::SameAsFirstInput()); |
5292 summary->set_temp(0, Location::RequiresRegister()); | 5292 summary->set_temp(0, Location::RequiresRegister()); |
5293 return summary; | 5293 return summary; |
5294 } | 5294 } |
5295 ASSERT(result_cid() == kSmiCid); | 5295 ASSERT(result_cid() == kSmiCid); |
5296 const intptr_t kNumInputs = 2; | 5296 const intptr_t kNumInputs = 2; |
5297 const intptr_t kNumTemps = 0; | 5297 const intptr_t kNumTemps = 0; |
5298 LocationSummary* summary = new(isolate) LocationSummary( | 5298 LocationSummary* summary = new(zone) LocationSummary( |
5299 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5299 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5300 summary->set_in(0, Location::RequiresRegister()); | 5300 summary->set_in(0, Location::RequiresRegister()); |
5301 summary->set_in(1, Location::RequiresRegister()); | 5301 summary->set_in(1, Location::RequiresRegister()); |
5302 // Reuse the left register so that code can be made shorter. | 5302 // Reuse the left register so that code can be made shorter. |
5303 summary->set_out(0, Location::SameAsFirstInput()); | 5303 summary->set_out(0, Location::SameAsFirstInput()); |
5304 return summary; | 5304 return summary; |
5305 } | 5305 } |
5306 | 5306 |
5307 | 5307 |
5308 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5308 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5309 ASSERT((op_kind() == MethodRecognizer::kMathMin) || | 5309 ASSERT((op_kind() == MethodRecognizer::kMathMin) || |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5357 __ cmp(left, Operand(right)); | 5357 __ cmp(left, Operand(right)); |
5358 ASSERT(result == left); | 5358 ASSERT(result == left); |
5359 if (is_min) { | 5359 if (is_min) { |
5360 __ mov(result, Operand(right), GT); | 5360 __ mov(result, Operand(right), GT); |
5361 } else { | 5361 } else { |
5362 __ mov(result, Operand(right), LT); | 5362 __ mov(result, Operand(right), LT); |
5363 } | 5363 } |
5364 } | 5364 } |
5365 | 5365 |
5366 | 5366 |
5367 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, | 5367 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone, |
5368 bool opt) const { | 5368 bool opt) const { |
5369 const intptr_t kNumInputs = 1; | 5369 const intptr_t kNumInputs = 1; |
5370 const intptr_t kNumTemps = 0; | 5370 const intptr_t kNumTemps = 0; |
5371 LocationSummary* summary = new(isolate) LocationSummary( | 5371 LocationSummary* summary = new(zone) LocationSummary( |
5372 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5372 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5373 summary->set_in(0, Location::RequiresRegister()); | 5373 summary->set_in(0, Location::RequiresRegister()); |
5374 // We make use of 3-operand instructions by not requiring result register | 5374 // We make use of 3-operand instructions by not requiring result register |
5375 // to be identical to first input register as on Intel. | 5375 // to be identical to first input register as on Intel. |
5376 summary->set_out(0, Location::RequiresRegister()); | 5376 summary->set_out(0, Location::RequiresRegister()); |
5377 return summary; | 5377 return summary; |
5378 } | 5378 } |
5379 | 5379 |
5380 | 5380 |
5381 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5381 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5382 const Register value = locs()->in(0).reg(); | 5382 const Register value = locs()->in(0).reg(); |
5383 const Register result = locs()->out(0).reg(); | 5383 const Register result = locs()->out(0).reg(); |
5384 switch (op_kind()) { | 5384 switch (op_kind()) { |
5385 case Token::kNEGATE: { | 5385 case Token::kNEGATE: { |
5386 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); | 5386 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); |
5387 __ rsbs(result, value, Operand(0)); | 5387 __ rsbs(result, value, Operand(0)); |
5388 __ b(deopt, VS); | 5388 __ b(deopt, VS); |
5389 break; | 5389 break; |
5390 } | 5390 } |
5391 case Token::kBIT_NOT: | 5391 case Token::kBIT_NOT: |
5392 __ mvn(result, Operand(value)); | 5392 __ mvn(result, Operand(value)); |
5393 // Remove inverted smi-tag. | 5393 // Remove inverted smi-tag. |
5394 __ bic(result, result, Operand(kSmiTagMask)); | 5394 __ bic(result, result, Operand(kSmiTagMask)); |
5395 break; | 5395 break; |
5396 default: | 5396 default: |
5397 UNREACHABLE(); | 5397 UNREACHABLE(); |
5398 } | 5398 } |
5399 } | 5399 } |
5400 | 5400 |
5401 | 5401 |
5402 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, | 5402 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone, |
5403 bool opt) const { | 5403 bool opt) const { |
5404 const intptr_t kNumInputs = 1; | 5404 const intptr_t kNumInputs = 1; |
5405 const intptr_t kNumTemps = 0; | 5405 const intptr_t kNumTemps = 0; |
5406 LocationSummary* summary = new(isolate) LocationSummary( | 5406 LocationSummary* summary = new(zone) LocationSummary( |
5407 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5407 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5408 summary->set_in(0, Location::RequiresFpuRegister()); | 5408 summary->set_in(0, Location::RequiresFpuRegister()); |
5409 summary->set_out(0, Location::RequiresFpuRegister()); | 5409 summary->set_out(0, Location::RequiresFpuRegister()); |
5410 return summary; | 5410 return summary; |
5411 } | 5411 } |
5412 | 5412 |
5413 | 5413 |
5414 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5414 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5415 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5415 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
5416 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5416 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
5417 __ vnegd(result, value); | 5417 __ vnegd(result, value); |
5418 } | 5418 } |
5419 | 5419 |
5420 | 5420 |
5421 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 5421 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone, |
5422 bool opt) const { | 5422 bool opt) const { |
5423 const intptr_t kNumInputs = 1; | 5423 const intptr_t kNumInputs = 1; |
5424 const intptr_t kNumTemps = 0; | 5424 const intptr_t kNumTemps = 0; |
5425 LocationSummary* result = new(isolate) LocationSummary( | 5425 LocationSummary* result = new(zone) LocationSummary( |
5426 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5426 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5427 result->set_in(0, Location::RequiresRegister()); | 5427 result->set_in(0, Location::RequiresRegister()); |
5428 result->set_out(0, Location::RequiresFpuRegister()); | 5428 result->set_out(0, Location::RequiresFpuRegister()); |
5429 return result; | 5429 return result; |
5430 } | 5430 } |
5431 | 5431 |
5432 | 5432 |
5433 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5433 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5434 const Register value = locs()->in(0).reg(); | 5434 const Register value = locs()->in(0).reg(); |
5435 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5435 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
5436 __ vmovdr(DTMP, 0, value); | 5436 __ vmovdr(DTMP, 0, value); |
5437 __ vcvtdi(result, STMP); | 5437 __ vcvtdi(result, STMP); |
5438 } | 5438 } |
5439 | 5439 |
5440 | 5440 |
5441 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 5441 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Zone* zone, |
5442 bool opt) const { | 5442 bool opt) const { |
5443 const intptr_t kNumInputs = 1; | 5443 const intptr_t kNumInputs = 1; |
5444 const intptr_t kNumTemps = 0; | 5444 const intptr_t kNumTemps = 0; |
5445 LocationSummary* result = new(isolate) LocationSummary( | 5445 LocationSummary* result = new(zone) LocationSummary( |
5446 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5446 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5447 result->set_in(0, Location::RequiresRegister()); | 5447 result->set_in(0, Location::RequiresRegister()); |
5448 result->set_out(0, Location::RequiresFpuRegister()); | 5448 result->set_out(0, Location::RequiresFpuRegister()); |
5449 return result; | 5449 return result; |
5450 } | 5450 } |
5451 | 5451 |
5452 | 5452 |
5453 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5453 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5454 const Register value = locs()->in(0).reg(); | 5454 const Register value = locs()->in(0).reg(); |
5455 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5455 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
5456 __ SmiUntag(IP, value); | 5456 __ SmiUntag(IP, value); |
5457 __ vmovdr(DTMP, 0, IP); | 5457 __ vmovdr(DTMP, 0, IP); |
5458 __ vcvtdi(result, STMP); | 5458 __ vcvtdi(result, STMP); |
5459 } | 5459 } |
5460 | 5460 |
5461 | 5461 |
5462 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 5462 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Zone* zone, |
5463 bool opt) const { | 5463 bool opt) const { |
5464 UNIMPLEMENTED(); | 5464 UNIMPLEMENTED(); |
5465 return NULL; | 5465 return NULL; |
5466 } | 5466 } |
5467 | 5467 |
5468 | 5468 |
5469 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5469 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5470 UNIMPLEMENTED(); | 5470 UNIMPLEMENTED(); |
5471 } | 5471 } |
5472 | 5472 |
5473 | 5473 |
5474 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate, | 5474 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Zone* zone, |
5475 bool opt) const { | 5475 bool opt) const { |
5476 const intptr_t kNumInputs = 1; | 5476 const intptr_t kNumInputs = 1; |
5477 const intptr_t kNumTemps = 0; | 5477 const intptr_t kNumTemps = 0; |
5478 LocationSummary* result = new(isolate) LocationSummary( | 5478 LocationSummary* result = new(zone) LocationSummary( |
5479 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 5479 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
5480 result->set_in(0, Location::RegisterLocation(R1)); | 5480 result->set_in(0, Location::RegisterLocation(R1)); |
5481 result->set_out(0, Location::RegisterLocation(R0)); | 5481 result->set_out(0, Location::RegisterLocation(R0)); |
5482 return result; | 5482 return result; |
5483 } | 5483 } |
5484 | 5484 |
5485 | 5485 |
5486 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5486 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5487 const Register result = locs()->out(0).reg(); | 5487 const Register result = locs()->out(0).reg(); |
5488 const Register value_obj = locs()->in(0).reg(); | 5488 const Register value_obj = locs()->in(0).reg(); |
5489 ASSERT(result == R0); | 5489 ASSERT(result == R0); |
(...skipping 28 matching lines...) Expand all Loading... |
5518 instance_call()->token_pos(), | 5518 instance_call()->token_pos(), |
5519 target, | 5519 target, |
5520 kNumberOfArguments, | 5520 kNumberOfArguments, |
5521 Object::null_array(), // No argument names., | 5521 Object::null_array(), // No argument names., |
5522 locs(), | 5522 locs(), |
5523 ICData::Handle()); | 5523 ICData::Handle()); |
5524 __ Bind(&done); | 5524 __ Bind(&done); |
5525 } | 5525 } |
5526 | 5526 |
5527 | 5527 |
5528 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate, | 5528 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, |
5529 bool opt) const { | 5529 bool opt) const { |
5530 const intptr_t kNumInputs = 1; | 5530 const intptr_t kNumInputs = 1; |
5531 const intptr_t kNumTemps = 0; | 5531 const intptr_t kNumTemps = 0; |
5532 LocationSummary* result = new(isolate) LocationSummary( | 5532 LocationSummary* result = new(zone) LocationSummary( |
5533 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5533 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5534 result->set_in(0, Location::RequiresFpuRegister()); | 5534 result->set_in(0, Location::RequiresFpuRegister()); |
5535 result->set_out(0, Location::RequiresRegister()); | 5535 result->set_out(0, Location::RequiresRegister()); |
5536 return result; | 5536 return result; |
5537 } | 5537 } |
5538 | 5538 |
5539 | 5539 |
5540 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5540 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5541 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); | 5541 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); |
5542 const Register result = locs()->out(0).reg(); | 5542 const Register result = locs()->out(0).reg(); |
5543 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5543 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
5544 // First check for NaN. Checking for minint after the conversion doesn't work | 5544 // First check for NaN. Checking for minint after the conversion doesn't work |
5545 // on ARM because vcvtid gives 0 for NaN. | 5545 // on ARM because vcvtid gives 0 for NaN. |
5546 __ vcmpd(value, value); | 5546 __ vcmpd(value, value); |
5547 __ vmstat(); | 5547 __ vmstat(); |
5548 __ b(deopt, VS); | 5548 __ b(deopt, VS); |
5549 | 5549 |
5550 __ vcvtid(STMP, value); | 5550 __ vcvtid(STMP, value); |
5551 __ vmovrs(result, STMP); | 5551 __ vmovrs(result, STMP); |
5552 // Check for overflow and that it fits into Smi. | 5552 // Check for overflow and that it fits into Smi. |
5553 __ CompareImmediate(result, 0xC0000000); | 5553 __ CompareImmediate(result, 0xC0000000); |
5554 __ b(deopt, MI); | 5554 __ b(deopt, MI); |
5555 __ SmiTag(result); | 5555 __ SmiTag(result); |
5556 } | 5556 } |
5557 | 5557 |
5558 | 5558 |
5559 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 5559 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Zone* zone, |
5560 bool opt) const { | 5560 bool opt) const { |
5561 UNIMPLEMENTED(); | 5561 UNIMPLEMENTED(); |
5562 return NULL; | 5562 return NULL; |
5563 } | 5563 } |
5564 | 5564 |
5565 | 5565 |
5566 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5566 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5567 UNIMPLEMENTED(); | 5567 UNIMPLEMENTED(); |
5568 } | 5568 } |
5569 | 5569 |
5570 | 5570 |
5571 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate, | 5571 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Zone* zone, |
5572 bool opt) const { | 5572 bool opt) const { |
5573 const intptr_t kNumInputs = 1; | 5573 const intptr_t kNumInputs = 1; |
5574 const intptr_t kNumTemps = 0; | 5574 const intptr_t kNumTemps = 0; |
5575 LocationSummary* result = new(isolate) LocationSummary( | 5575 LocationSummary* result = new(zone) LocationSummary( |
5576 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5576 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5577 // Low (<= Q7) Q registers are needed for the conversion instructions. | 5577 // Low (<= Q7) Q registers are needed for the conversion instructions. |
5578 result->set_in(0, Location::RequiresFpuRegister()); | 5578 result->set_in(0, Location::RequiresFpuRegister()); |
5579 result->set_out(0, Location::FpuRegisterLocation(Q7)); | 5579 result->set_out(0, Location::FpuRegisterLocation(Q7)); |
5580 return result; | 5580 return result; |
5581 } | 5581 } |
5582 | 5582 |
5583 | 5583 |
5584 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5584 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5585 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); | 5585 const DRegister value = EvenDRegisterOf(locs()->in(0).fpu_reg()); |
5586 const SRegister result = | 5586 const SRegister result = |
5587 EvenSRegisterOf(EvenDRegisterOf(locs()->out(0).fpu_reg())); | 5587 EvenSRegisterOf(EvenDRegisterOf(locs()->out(0).fpu_reg())); |
5588 __ vcvtsd(result, value); | 5588 __ vcvtsd(result, value); |
5589 } | 5589 } |
5590 | 5590 |
5591 | 5591 |
5592 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 5592 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Zone* zone, |
5593 bool opt) const { | 5593 bool opt) const { |
5594 const intptr_t kNumInputs = 1; | 5594 const intptr_t kNumInputs = 1; |
5595 const intptr_t kNumTemps = 0; | 5595 const intptr_t kNumTemps = 0; |
5596 LocationSummary* result = new(isolate) LocationSummary( | 5596 LocationSummary* result = new(zone) LocationSummary( |
5597 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5597 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5598 // Low (<= Q7) Q registers are needed for the conversion instructions. | 5598 // Low (<= Q7) Q registers are needed for the conversion instructions. |
5599 result->set_in(0, Location::FpuRegisterLocation(Q7)); | 5599 result->set_in(0, Location::FpuRegisterLocation(Q7)); |
5600 result->set_out(0, Location::RequiresFpuRegister()); | 5600 result->set_out(0, Location::RequiresFpuRegister()); |
5601 return result; | 5601 return result; |
5602 } | 5602 } |
5603 | 5603 |
5604 | 5604 |
5605 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5605 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5606 const SRegister value = | 5606 const SRegister value = |
5607 EvenSRegisterOf(EvenDRegisterOf(locs()->in(0).fpu_reg())); | 5607 EvenSRegisterOf(EvenDRegisterOf(locs()->in(0).fpu_reg())); |
5608 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); | 5608 const DRegister result = EvenDRegisterOf(locs()->out(0).fpu_reg()); |
5609 __ vcvtds(result, value); | 5609 __ vcvtds(result, value); |
5610 } | 5610 } |
5611 | 5611 |
5612 | 5612 |
5613 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate, | 5613 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Zone* zone, |
5614 bool opt) const { | 5614 bool opt) const { |
5615 ASSERT((InputCount() == 1) || (InputCount() == 2)); | 5615 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
5616 const intptr_t kNumTemps = | 5616 const intptr_t kNumTemps = |
5617 (TargetCPUFeatures::hardfp_supported()) ? | 5617 (TargetCPUFeatures::hardfp_supported()) ? |
5618 ((recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0) : 4; | 5618 ((recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0) : 4; |
5619 LocationSummary* result = new(isolate) LocationSummary( | 5619 LocationSummary* result = new(zone) LocationSummary( |
5620 isolate, InputCount(), kNumTemps, LocationSummary::kCall); | 5620 zone, InputCount(), kNumTemps, LocationSummary::kCall); |
5621 result->set_in(0, Location::FpuRegisterLocation(Q0)); | 5621 result->set_in(0, Location::FpuRegisterLocation(Q0)); |
5622 if (InputCount() == 2) { | 5622 if (InputCount() == 2) { |
5623 result->set_in(1, Location::FpuRegisterLocation(Q1)); | 5623 result->set_in(1, Location::FpuRegisterLocation(Q1)); |
5624 } | 5624 } |
5625 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 5625 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
5626 result->set_temp(0, Location::RegisterLocation(R2)); | 5626 result->set_temp(0, Location::RegisterLocation(R2)); |
5627 if (!TargetCPUFeatures::hardfp_supported()) { | 5627 if (!TargetCPUFeatures::hardfp_supported()) { |
5628 result->set_temp(1, Location::RegisterLocation(R0)); | 5628 result->set_temp(1, Location::RegisterLocation(R0)); |
5629 result->set_temp(2, Location::RegisterLocation(R1)); | 5629 result->set_temp(2, Location::RegisterLocation(R1)); |
5630 result->set_temp(3, Location::RegisterLocation(R3)); | 5630 result->set_temp(3, Location::RegisterLocation(R3)); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5790 // registers. | 5790 // registers. |
5791 __ vmovrrd(R0, R1, D0); | 5791 __ vmovrrd(R0, R1, D0); |
5792 __ vmovrrd(R2, R3, D1); | 5792 __ vmovrrd(R2, R3, D1); |
5793 __ CallRuntime(TargetFunction(), InputCount()); | 5793 __ CallRuntime(TargetFunction(), InputCount()); |
5794 __ vmovdrr(D0, R0, R1); | 5794 __ vmovdrr(D0, R0, R1); |
5795 __ vmovdrr(D1, R2, R3); | 5795 __ vmovdrr(D1, R2, R3); |
5796 } | 5796 } |
5797 } | 5797 } |
5798 | 5798 |
5799 | 5799 |
5800 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate, | 5800 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Zone* zone, |
5801 bool opt) const { | 5801 bool opt) const { |
5802 // Only use this instruction in optimized code. | 5802 // Only use this instruction in optimized code. |
5803 ASSERT(opt); | 5803 ASSERT(opt); |
5804 const intptr_t kNumInputs = 1; | 5804 const intptr_t kNumInputs = 1; |
5805 LocationSummary* summary = new(isolate) LocationSummary( | 5805 LocationSummary* summary = new(zone) LocationSummary( |
5806 isolate, kNumInputs, 0, LocationSummary::kNoCall); | 5806 zone, kNumInputs, 0, LocationSummary::kNoCall); |
5807 if (representation() == kUnboxedDouble) { | 5807 if (representation() == kUnboxedDouble) { |
5808 if (index() == 0) { | 5808 if (index() == 0) { |
5809 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), | 5809 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), |
5810 Location::Any())); | 5810 Location::Any())); |
5811 } else { | 5811 } else { |
5812 ASSERT(index() == 1); | 5812 ASSERT(index() == 1); |
5813 summary->set_in(0, Location::Pair(Location::Any(), | 5813 summary->set_in(0, Location::Pair(Location::Any(), |
5814 Location::RequiresFpuRegister())); | 5814 Location::RequiresFpuRegister())); |
5815 } | 5815 } |
5816 summary->set_out(0, Location::RequiresFpuRegister()); | 5816 summary->set_out(0, Location::RequiresFpuRegister()); |
(...skipping 23 matching lines...) Expand all Loading... |
5840 __ vmovq(out, in); | 5840 __ vmovq(out, in); |
5841 } else { | 5841 } else { |
5842 ASSERT(representation() == kTagged); | 5842 ASSERT(representation() == kTagged); |
5843 const Register out = locs()->out(0).reg(); | 5843 const Register out = locs()->out(0).reg(); |
5844 const Register in = in_loc.reg(); | 5844 const Register in = in_loc.reg(); |
5845 __ mov(out, Operand(in)); | 5845 __ mov(out, Operand(in)); |
5846 } | 5846 } |
5847 } | 5847 } |
5848 | 5848 |
5849 | 5849 |
5850 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate, | 5850 LocationSummary* MergedMathInstr::MakeLocationSummary(Zone* zone, |
5851 bool opt) const { | 5851 bool opt) const { |
5852 if (kind() == MergedMathInstr::kTruncDivMod) { | 5852 if (kind() == MergedMathInstr::kTruncDivMod) { |
5853 const intptr_t kNumInputs = 2; | 5853 const intptr_t kNumInputs = 2; |
5854 const intptr_t kNumTemps = 2; | 5854 const intptr_t kNumTemps = 2; |
5855 LocationSummary* summary = new(isolate) LocationSummary( | 5855 LocationSummary* summary = new(zone) LocationSummary( |
5856 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5856 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5857 summary->set_in(0, Location::RequiresRegister()); | 5857 summary->set_in(0, Location::RequiresRegister()); |
5858 summary->set_in(1, Location::RequiresRegister()); | 5858 summary->set_in(1, Location::RequiresRegister()); |
5859 summary->set_temp(0, Location::RequiresRegister()); | 5859 summary->set_temp(0, Location::RequiresRegister()); |
5860 summary->set_temp(1, Location::RequiresFpuRegister()); | 5860 summary->set_temp(1, Location::RequiresFpuRegister()); |
5861 // Output is a pair of registers. | 5861 // Output is a pair of registers. |
5862 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 5862 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
5863 Location::RequiresRegister())); | 5863 Location::RequiresRegister())); |
5864 return summary; | 5864 return summary; |
5865 } | 5865 } |
5866 UNIMPLEMENTED(); | 5866 UNIMPLEMENTED(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5928 return; | 5928 return; |
5929 } | 5929 } |
5930 if (kind() == MergedMathInstr::kSinCos) { | 5930 if (kind() == MergedMathInstr::kSinCos) { |
5931 UNIMPLEMENTED(); | 5931 UNIMPLEMENTED(); |
5932 } | 5932 } |
5933 UNIMPLEMENTED(); | 5933 UNIMPLEMENTED(); |
5934 } | 5934 } |
5935 | 5935 |
5936 | 5936 |
5937 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5937 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
5938 Isolate* isolate, bool opt) const { | 5938 Zone* zone, bool opt) const { |
5939 return MakeCallSummary(isolate); | 5939 return MakeCallSummary(zone); |
5940 } | 5940 } |
5941 | 5941 |
5942 | 5942 |
5943 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5943 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5944 ASSERT(ic_data().NumArgsTested() == 1); | 5944 ASSERT(ic_data().NumArgsTested() == 1); |
5945 if (!with_checks()) { | 5945 if (!with_checks()) { |
5946 ASSERT(ic_data().HasOneTarget()); | 5946 ASSERT(ic_data().HasOneTarget()); |
5947 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 5947 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
5948 compiler->GenerateStaticCall(deopt_id(), | 5948 compiler->GenerateStaticCall(deopt_id(), |
5949 instance_call()->token_pos(), | 5949 instance_call()->token_pos(), |
(...skipping 18 matching lines...) Expand all Loading... |
5968 R2, // Class id register. | 5968 R2, // Class id register. |
5969 instance_call()->ArgumentCount(), | 5969 instance_call()->ArgumentCount(), |
5970 instance_call()->argument_names(), | 5970 instance_call()->argument_names(), |
5971 deopt, | 5971 deopt, |
5972 deopt_id(), | 5972 deopt_id(), |
5973 instance_call()->token_pos(), | 5973 instance_call()->token_pos(), |
5974 locs()); | 5974 locs()); |
5975 } | 5975 } |
5976 | 5976 |
5977 | 5977 |
5978 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate, | 5978 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, |
5979 bool opt) const { | 5979 bool opt) const { |
5980 comparison()->InitializeLocationSummary(isolate, opt); | 5980 comparison()->InitializeLocationSummary(zone, opt); |
5981 // Branches don't produce a result. | 5981 // Branches don't produce a result. |
5982 comparison()->locs()->set_out(0, Location::NoLocation()); | 5982 comparison()->locs()->set_out(0, Location::NoLocation()); |
5983 return comparison()->locs(); | 5983 return comparison()->locs(); |
5984 } | 5984 } |
5985 | 5985 |
5986 | 5986 |
5987 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5987 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5988 comparison()->EmitBranchCode(compiler, this); | 5988 comparison()->EmitBranchCode(compiler, this); |
5989 } | 5989 } |
5990 | 5990 |
5991 | 5991 |
5992 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, | 5992 LocationSummary* CheckClassInstr::MakeLocationSummary(Zone* zone, |
5993 bool opt) const { | 5993 bool opt) const { |
5994 const intptr_t kNumInputs = 1; | 5994 const intptr_t kNumInputs = 1; |
5995 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask()); | 5995 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask()); |
5996 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0; | 5996 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0; |
5997 LocationSummary* summary = new(isolate) LocationSummary( | 5997 LocationSummary* summary = new(zone) LocationSummary( |
5998 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5998 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5999 summary->set_in(0, Location::RequiresRegister()); | 5999 summary->set_in(0, Location::RequiresRegister()); |
6000 if (!IsNullCheck()) { | 6000 if (!IsNullCheck()) { |
6001 summary->set_temp(0, Location::RequiresRegister()); | 6001 summary->set_temp(0, Location::RequiresRegister()); |
6002 if (need_mask_temp) { | 6002 if (need_mask_temp) { |
6003 summary->set_temp(1, Location::RequiresRegister()); | 6003 summary->set_temp(1, Location::RequiresRegister()); |
6004 } | 6004 } |
6005 } | 6005 } |
6006 return summary; | 6006 return summary; |
6007 } | 6007 } |
6008 | 6008 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6059 __ b(deopt, NE); | 6059 __ b(deopt, NE); |
6060 } else { | 6060 } else { |
6061 __ b(&is_ok, EQ); | 6061 __ b(&is_ok, EQ); |
6062 } | 6062 } |
6063 } | 6063 } |
6064 } | 6064 } |
6065 __ Bind(&is_ok); | 6065 __ Bind(&is_ok); |
6066 } | 6066 } |
6067 | 6067 |
6068 | 6068 |
6069 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate, | 6069 LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone, |
6070 bool opt) const { | 6070 bool opt) const { |
6071 const intptr_t kNumInputs = 1; | 6071 const intptr_t kNumInputs = 1; |
6072 const intptr_t kNumTemps = 0; | 6072 const intptr_t kNumTemps = 0; |
6073 LocationSummary* summary = new(isolate) LocationSummary( | 6073 LocationSummary* summary = new(zone) LocationSummary( |
6074 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6074 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6075 summary->set_in(0, Location::RequiresRegister()); | 6075 summary->set_in(0, Location::RequiresRegister()); |
6076 return summary; | 6076 return summary; |
6077 } | 6077 } |
6078 | 6078 |
6079 | 6079 |
6080 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6080 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6081 const Register value = locs()->in(0).reg(); | 6081 const Register value = locs()->in(0).reg(); |
6082 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 6082 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
6083 ICData::kDeoptCheckSmi, | 6083 ICData::kDeoptCheckSmi, |
6084 licm_hoisted_ ? ICData::kHoisted : 0); | 6084 licm_hoisted_ ? ICData::kHoisted : 0); |
6085 __ tst(value, Operand(kSmiTagMask)); | 6085 __ tst(value, Operand(kSmiTagMask)); |
6086 __ b(deopt, NE); | 6086 __ b(deopt, NE); |
6087 } | 6087 } |
6088 | 6088 |
6089 | 6089 |
6090 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Isolate* isolate, | 6090 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
6091 bool opt) const { | 6091 bool opt) const { |
6092 const intptr_t kNumInputs = 1; | 6092 const intptr_t kNumInputs = 1; |
6093 const intptr_t kNumTemps = 0; | 6093 const intptr_t kNumTemps = 0; |
6094 LocationSummary* summary = new(isolate) LocationSummary( | 6094 LocationSummary* summary = new(zone) LocationSummary( |
6095 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6095 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6096 summary->set_in(0, Location::RequiresRegister()); | 6096 summary->set_in(0, Location::RequiresRegister()); |
6097 return summary; | 6097 return summary; |
6098 } | 6098 } |
6099 | 6099 |
6100 | 6100 |
6101 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6101 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6102 Register value = locs()->in(0).reg(); | 6102 Register value = locs()->in(0).reg(); |
6103 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); | 6103 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); |
6104 __ CompareImmediate(value, Smi::RawValue(cid_)); | 6104 __ CompareImmediate(value, Smi::RawValue(cid_)); |
6105 __ b(deopt, NE); | 6105 __ b(deopt, NE); |
6106 } | 6106 } |
6107 | 6107 |
6108 | 6108 |
6109 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, | 6109 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone, |
6110 bool opt) const { | 6110 bool opt) const { |
6111 const intptr_t kNumInputs = 2; | 6111 const intptr_t kNumInputs = 2; |
6112 const intptr_t kNumTemps = 0; | 6112 const intptr_t kNumTemps = 0; |
6113 LocationSummary* locs = new(isolate) LocationSummary( | 6113 LocationSummary* locs = new(zone) LocationSummary( |
6114 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6114 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6115 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 6115 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
6116 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 6116 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
6117 return locs; | 6117 return locs; |
6118 } | 6118 } |
6119 | 6119 |
6120 | 6120 |
6121 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6121 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6122 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; | 6122 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; |
6123 flags |= licm_hoisted_ ? ICData::kHoisted : 0; | 6123 flags |= licm_hoisted_ ? ICData::kHoisted : 0; |
6124 Label* deopt = compiler->AddDeoptStub( | 6124 Label* deopt = compiler->AddDeoptStub( |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6177 __ b(overflow, HI); | 6177 __ b(overflow, HI); |
6178 | 6178 |
6179 __ Bind(&check_lower); | 6179 __ Bind(&check_lower); |
6180 __ CompareImmediate(result_hi, -0x00200000); | 6180 __ CompareImmediate(result_hi, -0x00200000); |
6181 __ b(overflow, LT); | 6181 __ b(overflow, LT); |
6182 // Anything in the lower part would make the number bigger than the lower | 6182 // Anything in the lower part would make the number bigger than the lower |
6183 // bound, so we are done. | 6183 // bound, so we are done. |
6184 } | 6184 } |
6185 | 6185 |
6186 | 6186 |
6187 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate, | 6187 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Zone* zone, |
6188 bool opt) const { | 6188 bool opt) const { |
6189 const intptr_t kNumInputs = 2; | 6189 const intptr_t kNumInputs = 2; |
6190 const intptr_t kNumTemps = 0; | 6190 const intptr_t kNumTemps = 0; |
6191 LocationSummary* summary = new(isolate) LocationSummary( | 6191 LocationSummary* summary = new(zone) LocationSummary( |
6192 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6192 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6193 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6193 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
6194 Location::RequiresRegister())); | 6194 Location::RequiresRegister())); |
6195 summary->set_in(1, Location::Pair(Location::RequiresRegister(), | 6195 summary->set_in(1, Location::Pair(Location::RequiresRegister(), |
6196 Location::RequiresRegister())); | 6196 Location::RequiresRegister())); |
6197 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6197 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
6198 Location::RequiresRegister())); | 6198 Location::RequiresRegister())); |
6199 return summary; | 6199 return summary; |
6200 } | 6200 } |
6201 | 6201 |
6202 | 6202 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6266 } | 6266 } |
6267 default: | 6267 default: |
6268 UNREACHABLE(); | 6268 UNREACHABLE(); |
6269 } | 6269 } |
6270 if (FLAG_throw_on_javascript_int_overflow) { | 6270 if (FLAG_throw_on_javascript_int_overflow) { |
6271 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); | 6271 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); |
6272 } | 6272 } |
6273 } | 6273 } |
6274 | 6274 |
6275 | 6275 |
6276 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate, | 6276 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Zone* zone, |
6277 bool opt) const { | 6277 bool opt) const { |
6278 const intptr_t kNumInputs = 2; | 6278 const intptr_t kNumInputs = 2; |
6279 const intptr_t kNumTemps = 0; | 6279 const intptr_t kNumTemps = 0; |
6280 LocationSummary* summary = new(isolate) LocationSummary( | 6280 LocationSummary* summary = new(zone) LocationSummary( |
6281 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6281 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6282 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6282 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
6283 Location::RequiresRegister())); | 6283 Location::RequiresRegister())); |
6284 summary->set_in(1, Location::WritableRegisterOrSmiConstant(right())); | 6284 summary->set_in(1, Location::WritableRegisterOrSmiConstant(right())); |
6285 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6285 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
6286 Location::RequiresRegister())); | 6286 Location::RequiresRegister())); |
6287 return summary; | 6287 return summary; |
6288 } | 6288 } |
6289 | 6289 |
6290 | 6290 |
6291 static const intptr_t kMintShiftCountLimit = 63; | 6291 static const intptr_t kMintShiftCountLimit = 63; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6412 UNREACHABLE(); | 6412 UNREACHABLE(); |
6413 } | 6413 } |
6414 } | 6414 } |
6415 | 6415 |
6416 if (FLAG_throw_on_javascript_int_overflow) { | 6416 if (FLAG_throw_on_javascript_int_overflow) { |
6417 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); | 6417 EmitJavascriptIntOverflowCheck(compiler, deopt, out_lo, out_hi); |
6418 } | 6418 } |
6419 } | 6419 } |
6420 | 6420 |
6421 | 6421 |
6422 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate, | 6422 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Zone* zone, |
6423 bool opt) const { | 6423 bool opt) const { |
6424 const intptr_t kNumInputs = 1; | 6424 const intptr_t kNumInputs = 1; |
6425 const intptr_t kNumTemps = 0; | 6425 const intptr_t kNumTemps = 0; |
6426 LocationSummary* summary = new(isolate) LocationSummary( | 6426 LocationSummary* summary = new(zone) LocationSummary( |
6427 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6427 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6428 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6428 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
6429 Location::RequiresRegister())); | 6429 Location::RequiresRegister())); |
6430 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6430 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
6431 Location::RequiresRegister())); | 6431 Location::RequiresRegister())); |
6432 return summary; | 6432 return summary; |
6433 } | 6433 } |
6434 | 6434 |
6435 | 6435 |
6436 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6436 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6437 ASSERT(op_kind() == Token::kBIT_NOT); | 6437 ASSERT(op_kind() == Token::kBIT_NOT); |
(...skipping 26 matching lines...) Expand all Loading... |
6464 CompileType ShiftUint32OpInstr::ComputeType() const { | 6464 CompileType ShiftUint32OpInstr::ComputeType() const { |
6465 return CompileType::Int(); | 6465 return CompileType::Int(); |
6466 } | 6466 } |
6467 | 6467 |
6468 | 6468 |
6469 CompileType UnaryUint32OpInstr::ComputeType() const { | 6469 CompileType UnaryUint32OpInstr::ComputeType() const { |
6470 return CompileType::Int(); | 6470 return CompileType::Int(); |
6471 } | 6471 } |
6472 | 6472 |
6473 | 6473 |
6474 LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, | 6474 LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Zone* zone, |
6475 bool opt) const { | 6475 bool opt) const { |
6476 const intptr_t kNumInputs = 2; | 6476 const intptr_t kNumInputs = 2; |
6477 const intptr_t kNumTemps = 0; | 6477 const intptr_t kNumTemps = 0; |
6478 LocationSummary* summary = new(isolate) LocationSummary( | 6478 LocationSummary* summary = new(zone) LocationSummary( |
6479 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6479 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6480 summary->set_in(0, Location::RequiresRegister()); | 6480 summary->set_in(0, Location::RequiresRegister()); |
6481 summary->set_in(1, Location::RequiresRegister()); | 6481 summary->set_in(1, Location::RequiresRegister()); |
6482 summary->set_out(0, Location::RequiresRegister()); | 6482 summary->set_out(0, Location::RequiresRegister()); |
6483 return summary; | 6483 return summary; |
6484 } | 6484 } |
6485 | 6485 |
6486 | 6486 |
6487 void BinaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6487 void BinaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6488 Register left = locs()->in(0).reg(); | 6488 Register left = locs()->in(0).reg(); |
6489 Register right = locs()->in(1).reg(); | 6489 Register right = locs()->in(1).reg(); |
(...skipping 17 matching lines...) Expand all Loading... |
6507 break; | 6507 break; |
6508 case Token::kMUL: | 6508 case Token::kMUL: |
6509 __ mul(out, left, right); | 6509 __ mul(out, left, right); |
6510 break; | 6510 break; |
6511 default: | 6511 default: |
6512 UNREACHABLE(); | 6512 UNREACHABLE(); |
6513 } | 6513 } |
6514 } | 6514 } |
6515 | 6515 |
6516 | 6516 |
6517 LocationSummary* ShiftUint32OpInstr::MakeLocationSummary(Isolate* isolate, | 6517 LocationSummary* ShiftUint32OpInstr::MakeLocationSummary(Zone* zone, |
6518 bool opt) const { | 6518 bool opt) const { |
6519 const intptr_t kNumInputs = 2; | 6519 const intptr_t kNumInputs = 2; |
6520 const intptr_t kNumTemps = 1; | 6520 const intptr_t kNumTemps = 1; |
6521 LocationSummary* summary = new(isolate) LocationSummary( | 6521 LocationSummary* summary = new(zone) LocationSummary( |
6522 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6522 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6523 summary->set_in(0, Location::RequiresRegister()); | 6523 summary->set_in(0, Location::RequiresRegister()); |
6524 summary->set_in(1, Location::RegisterOrSmiConstant(right())); | 6524 summary->set_in(1, Location::RegisterOrSmiConstant(right())); |
6525 summary->set_temp(0, Location::RequiresRegister()); | 6525 summary->set_temp(0, Location::RequiresRegister()); |
6526 summary->set_out(0, Location::RequiresRegister()); | 6526 summary->set_out(0, Location::RequiresRegister()); |
6527 return summary; | 6527 return summary; |
6528 } | 6528 } |
6529 | 6529 |
6530 | 6530 |
6531 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6531 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6532 const intptr_t kShifterLimit = 31; | 6532 const intptr_t kShifterLimit = 31; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6577 break; | 6577 break; |
6578 case Token::kSHL: | 6578 case Token::kSHL: |
6579 __ Lsl(out, left, temp, LS); | 6579 __ Lsl(out, left, temp, LS); |
6580 break; | 6580 break; |
6581 default: | 6581 default: |
6582 UNREACHABLE(); | 6582 UNREACHABLE(); |
6583 } | 6583 } |
6584 } | 6584 } |
6585 | 6585 |
6586 | 6586 |
6587 LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, | 6587 LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Zone* zone, |
6588 bool opt) const { | 6588 bool opt) const { |
6589 const intptr_t kNumInputs = 1; | 6589 const intptr_t kNumInputs = 1; |
6590 const intptr_t kNumTemps = 0; | 6590 const intptr_t kNumTemps = 0; |
6591 LocationSummary* summary = new(isolate) LocationSummary( | 6591 LocationSummary* summary = new(zone) LocationSummary( |
6592 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6592 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6593 summary->set_in(0, Location::RequiresRegister()); | 6593 summary->set_in(0, Location::RequiresRegister()); |
6594 summary->set_out(0, Location::RequiresRegister()); | 6594 summary->set_out(0, Location::RequiresRegister()); |
6595 return summary; | 6595 return summary; |
6596 } | 6596 } |
6597 | 6597 |
6598 | 6598 |
6599 void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6599 void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6600 Register left = locs()->in(0).reg(); | 6600 Register left = locs()->in(0).reg(); |
6601 Register out = locs()->out(0).reg(); | 6601 Register out = locs()->out(0).reg(); |
6602 ASSERT(left != out); | 6602 ASSERT(left != out); |
6603 | 6603 |
6604 ASSERT(op_kind() == Token::kBIT_NOT); | 6604 ASSERT(op_kind() == Token::kBIT_NOT); |
6605 | 6605 |
6606 __ mvn(out, Operand(left)); | 6606 __ mvn(out, Operand(left)); |
6607 } | 6607 } |
6608 | 6608 |
6609 | 6609 |
6610 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Isolate* isolate, | 6610 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone, |
6611 bool opt) const { | 6611 bool opt) const { |
6612 const intptr_t kNumInputs = 1; | 6612 const intptr_t kNumInputs = 1; |
6613 const intptr_t kNumTemps = 0; | 6613 const intptr_t kNumTemps = 0; |
6614 LocationSummary* summary = new(isolate) LocationSummary( | 6614 LocationSummary* summary = new(zone) LocationSummary( |
6615 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6615 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6616 if (from() == kUnboxedMint) { | 6616 if (from() == kUnboxedMint) { |
6617 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); | 6617 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); |
6618 summary->set_in(0, Location::Pair(Location::RequiresRegister(), | 6618 summary->set_in(0, Location::Pair(Location::RequiresRegister(), |
6619 Location::RequiresRegister())); | 6619 Location::RequiresRegister())); |
6620 summary->set_out(0, Location::RequiresRegister()); | 6620 summary->set_out(0, Location::RequiresRegister()); |
6621 } else if (to() == kUnboxedMint) { | 6621 } else if (to() == kUnboxedMint) { |
6622 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); | 6622 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); |
6623 summary->set_in(0, Location::RequiresRegister()); | 6623 summary->set_in(0, Location::RequiresRegister()); |
6624 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 6624 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
6625 Location::RequiresRegister())); | 6625 Location::RequiresRegister())); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6676 } else { | 6676 } else { |
6677 ASSERT(from() == kUnboxedInt32); | 6677 ASSERT(from() == kUnboxedInt32); |
6678 __ mov(out_hi, Operand(in, ASR, kBitsPerWord - 1)); | 6678 __ mov(out_hi, Operand(in, ASR, kBitsPerWord - 1)); |
6679 } | 6679 } |
6680 } else { | 6680 } else { |
6681 UNREACHABLE(); | 6681 UNREACHABLE(); |
6682 } | 6682 } |
6683 } | 6683 } |
6684 | 6684 |
6685 | 6685 |
6686 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, | 6686 LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, |
6687 bool opt) const { | 6687 bool opt) const { |
6688 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | 6688 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); |
6689 } | 6689 } |
6690 | 6690 |
6691 | 6691 |
6692 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6692 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6693 compiler->GenerateRuntimeCall(token_pos(), | 6693 compiler->GenerateRuntimeCall(token_pos(), |
6694 deopt_id(), | 6694 deopt_id(), |
6695 kThrowRuntimeEntry, | 6695 kThrowRuntimeEntry, |
6696 1, | 6696 1, |
6697 locs()); | 6697 locs()); |
6698 __ bkpt(0); | 6698 __ bkpt(0); |
6699 } | 6699 } |
6700 | 6700 |
6701 | 6701 |
6702 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate, | 6702 LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, |
6703 bool opt) const { | 6703 bool opt) const { |
6704 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | 6704 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); |
6705 } | 6705 } |
6706 | 6706 |
6707 | 6707 |
6708 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6708 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6709 compiler->SetNeedsStacktrace(catch_try_index()); | 6709 compiler->SetNeedsStacktrace(catch_try_index()); |
6710 compiler->GenerateRuntimeCall(token_pos(), | 6710 compiler->GenerateRuntimeCall(token_pos(), |
6711 deopt_id(), | 6711 deopt_id(), |
6712 kReThrowRuntimeEntry, | 6712 kReThrowRuntimeEntry, |
6713 2, | 6713 2, |
6714 locs()); | 6714 locs()); |
6715 __ bkpt(0); | 6715 __ bkpt(0); |
6716 } | 6716 } |
6717 | 6717 |
6718 | 6718 |
6719 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6719 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6720 if (!compiler->CanFallThroughTo(normal_entry())) { | 6720 if (!compiler->CanFallThroughTo(normal_entry())) { |
6721 __ b(compiler->GetJumpLabel(normal_entry())); | 6721 __ b(compiler->GetJumpLabel(normal_entry())); |
6722 } | 6722 } |
6723 } | 6723 } |
6724 | 6724 |
6725 | 6725 |
6726 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, | 6726 LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, |
6727 bool opt) const { | 6727 bool opt) const { |
6728 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | 6728 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall); |
6729 } | 6729 } |
6730 | 6730 |
6731 | 6731 |
6732 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6732 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6733 if (!compiler->is_optimizing()) { | 6733 if (!compiler->is_optimizing()) { |
6734 if (FLAG_emit_edge_counters) { | 6734 if (FLAG_emit_edge_counters) { |
6735 compiler->EmitEdgeCounter(); | 6735 compiler->EmitEdgeCounter(); |
6736 } | 6736 } |
6737 // Add a deoptimization descriptor for deoptimizing instructions that | 6737 // Add a deoptimization descriptor for deoptimizing instructions that |
6738 // may be inserted before this instruction. On ARM this descriptor | 6738 // may be inserted before this instruction. On ARM this descriptor |
6739 // points after the edge counter code so that we can reuse the same | 6739 // points after the edge counter code so that we can reuse the same |
6740 // pattern matching code as at call sites, which matches backwards from | 6740 // pattern matching code as at call sites, which matches backwards from |
6741 // the end of the pattern. | 6741 // the end of the pattern. |
6742 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 6742 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
6743 GetDeoptId(), | 6743 GetDeoptId(), |
6744 Scanner::kNoSourcePos); | 6744 Scanner::kNoSourcePos); |
6745 } | 6745 } |
6746 if (HasParallelMove()) { | 6746 if (HasParallelMove()) { |
6747 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 6747 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
6748 } | 6748 } |
6749 | 6749 |
6750 // We can fall through if the successor is the next block in the list. | 6750 // We can fall through if the successor is the next block in the list. |
6751 // Otherwise, we need a jump. | 6751 // Otherwise, we need a jump. |
6752 if (!compiler->CanFallThroughTo(successor())) { | 6752 if (!compiler->CanFallThroughTo(successor())) { |
6753 __ b(compiler->GetJumpLabel(successor())); | 6753 __ b(compiler->GetJumpLabel(successor())); |
6754 } | 6754 } |
6755 } | 6755 } |
6756 | 6756 |
6757 | 6757 |
6758 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate, | 6758 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Zone* zone, |
6759 bool opt) const { | 6759 bool opt) const { |
6760 const intptr_t kNumInputs = 1; | 6760 const intptr_t kNumInputs = 1; |
6761 const intptr_t kNumTemps = 1; | 6761 const intptr_t kNumTemps = 1; |
6762 | 6762 |
6763 LocationSummary* summary = new(isolate) LocationSummary( | 6763 LocationSummary* summary = new(zone) LocationSummary( |
6764 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6764 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6765 | 6765 |
6766 summary->set_in(0, Location::RequiresRegister()); | 6766 summary->set_in(0, Location::RequiresRegister()); |
6767 summary->set_temp(0, Location::RequiresRegister()); | 6767 summary->set_temp(0, Location::RequiresRegister()); |
6768 | 6768 |
6769 return summary; | 6769 return summary; |
6770 } | 6770 } |
6771 | 6771 |
6772 | 6772 |
6773 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6773 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6774 Register target_address_reg = locs()->temp_slot(0)->reg(); | 6774 Register target_address_reg = locs()->temp_slot(0)->reg(); |
6775 | 6775 |
6776 // Load from [current frame pointer] + kPcMarkerSlotFromFp. | 6776 // Load from [current frame pointer] + kPcMarkerSlotFromFp. |
6777 __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); | 6777 __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); |
6778 | 6778 |
6779 // Add the offset. | 6779 // Add the offset. |
6780 Register offset_reg = locs()->in(0).reg(); | 6780 Register offset_reg = locs()->in(0).reg(); |
6781 Operand offset_opr = | 6781 Operand offset_opr = |
6782 (offset()->definition()->representation() == kTagged) ? | 6782 (offset()->definition()->representation() == kTagged) ? |
6783 Operand(offset_reg, ASR, kSmiTagSize) : | 6783 Operand(offset_reg, ASR, kSmiTagSize) : |
6784 Operand(offset_reg); | 6784 Operand(offset_reg); |
6785 __ add(target_address_reg, target_address_reg, offset_opr); | 6785 __ add(target_address_reg, target_address_reg, offset_opr); |
6786 | 6786 |
6787 // Jump to the absolute address. | 6787 // Jump to the absolute address. |
6788 __ bx(target_address_reg); | 6788 __ bx(target_address_reg); |
6789 } | 6789 } |
6790 | 6790 |
6791 | 6791 |
6792 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate, | 6792 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone, |
6793 bool opt) const { | 6793 bool opt) const { |
6794 const intptr_t kNumInputs = 2; | 6794 const intptr_t kNumInputs = 2; |
6795 const intptr_t kNumTemps = 0; | 6795 const intptr_t kNumTemps = 0; |
6796 if (needs_number_check()) { | 6796 if (needs_number_check()) { |
6797 LocationSummary* locs = new(isolate) LocationSummary( | 6797 LocationSummary* locs = new(zone) LocationSummary( |
6798 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 6798 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
6799 locs->set_in(0, Location::RegisterLocation(R0)); | 6799 locs->set_in(0, Location::RegisterLocation(R0)); |
6800 locs->set_in(1, Location::RegisterLocation(R1)); | 6800 locs->set_in(1, Location::RegisterLocation(R1)); |
6801 locs->set_out(0, Location::RegisterLocation(R0)); | 6801 locs->set_out(0, Location::RegisterLocation(R0)); |
6802 return locs; | 6802 return locs; |
6803 } | 6803 } |
6804 LocationSummary* locs = new(isolate) LocationSummary( | 6804 LocationSummary* locs = new(zone) LocationSummary( |
6805 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 6805 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
6806 | 6806 |
6807 // If a constant has more than one use, make sure it is loaded in register | 6807 // If a constant has more than one use, make sure it is loaded in register |
6808 // so that multiple immediate loads can be avoided. | 6808 // so that multiple immediate loads can be avoided. |
6809 ConstantInstr* constant = left()->definition()->AsConstant(); | 6809 ConstantInstr* constant = left()->definition()->AsConstant(); |
6810 if ((constant != NULL) && !left()->IsSingleUse()) { | 6810 if ((constant != NULL) && !left()->IsSingleUse()) { |
6811 locs->set_in(0, Location::RequiresRegister()); | 6811 locs->set_in(0, Location::RequiresRegister()); |
6812 } else { | 6812 } else { |
6813 locs->set_in(0, Location::RegisterOrConstant(left())); | 6813 locs->set_in(0, Location::RegisterOrConstant(left())); |
6814 } | 6814 } |
6815 | 6815 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6874 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 6874 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
6875 BranchInstr* branch) { | 6875 BranchInstr* branch) { |
6876 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 6876 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
6877 | 6877 |
6878 BranchLabels labels = compiler->CreateBranchLabels(branch); | 6878 BranchLabels labels = compiler->CreateBranchLabels(branch); |
6879 Condition true_condition = EmitComparisonCode(compiler, labels); | 6879 Condition true_condition = EmitComparisonCode(compiler, labels); |
6880 EmitBranchOnCondition(compiler, true_condition, labels); | 6880 EmitBranchOnCondition(compiler, true_condition, labels); |
6881 } | 6881 } |
6882 | 6882 |
6883 | 6883 |
6884 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, | 6884 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone, |
6885 bool opt) const { | 6885 bool opt) const { |
6886 return LocationSummary::Make(isolate, | 6886 return LocationSummary::Make(zone, |
6887 1, | 6887 1, |
6888 Location::RequiresRegister(), | 6888 Location::RequiresRegister(), |
6889 LocationSummary::kNoCall); | 6889 LocationSummary::kNoCall); |
6890 } | 6890 } |
6891 | 6891 |
6892 | 6892 |
6893 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6893 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6894 const Register value = locs()->in(0).reg(); | 6894 const Register value = locs()->in(0).reg(); |
6895 const Register result = locs()->out(0).reg(); | 6895 const Register result = locs()->out(0).reg(); |
6896 | 6896 |
6897 __ LoadObject(result, Bool::True()); | 6897 __ LoadObject(result, Bool::True()); |
6898 __ cmp(result, Operand(value)); | 6898 __ cmp(result, Operand(value)); |
6899 __ LoadObject(result, Bool::False(), EQ); | 6899 __ LoadObject(result, Bool::False(), EQ); |
6900 } | 6900 } |
6901 | 6901 |
6902 | 6902 |
6903 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, | 6903 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, |
6904 bool opt) const { | 6904 bool opt) const { |
6905 return MakeCallSummary(isolate); | 6905 return MakeCallSummary(zone); |
6906 } | 6906 } |
6907 | 6907 |
6908 | 6908 |
6909 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6909 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
6910 Isolate* isolate = compiler->isolate(); | 6910 Isolate* isolate = compiler->isolate(); |
6911 StubCode* stub_code = isolate->stub_code(); | 6911 StubCode* stub_code = isolate->stub_code(); |
6912 const Code& stub = Code::Handle(isolate, | 6912 const Code& stub = Code::Handle(isolate, |
6913 stub_code->GetAllocationStubForClass(cls())); | 6913 stub_code->GetAllocationStubForClass(cls())); |
6914 const ExternalLabel label(stub.EntryPoint()); | 6914 const ExternalLabel label(stub.EntryPoint()); |
6915 compiler->GenerateCall(token_pos(), | 6915 compiler->GenerateCall(token_pos(), |
(...skipping 12 matching lines...) Expand all Loading... |
6928 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6928 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
6929 #if defined(DEBUG) | 6929 #if defined(DEBUG) |
6930 __ LoadImmediate(R4, kInvalidObjectPointer); | 6930 __ LoadImmediate(R4, kInvalidObjectPointer); |
6931 __ LoadImmediate(R5, kInvalidObjectPointer); | 6931 __ LoadImmediate(R5, kInvalidObjectPointer); |
6932 #endif | 6932 #endif |
6933 } | 6933 } |
6934 | 6934 |
6935 } // namespace dart | 6935 } // namespace dart |
6936 | 6936 |
6937 #endif // defined TARGET_ARCH_ARM | 6937 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |