OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace dart { | 24 namespace dart { |
25 | 25 |
26 DECLARE_FLAG(bool, emit_edge_counters); | 26 DECLARE_FLAG(bool, emit_edge_counters); |
27 DECLARE_FLAG(bool, enable_asserts); | 27 DECLARE_FLAG(bool, enable_asserts); |
28 DECLARE_FLAG(bool, enable_type_checks); | 28 DECLARE_FLAG(bool, enable_type_checks); |
29 DECLARE_FLAG(int, optimization_counter_threshold); | 29 DECLARE_FLAG(int, optimization_counter_threshold); |
30 DECLARE_FLAG(bool, use_osr); | 30 DECLARE_FLAG(bool, use_osr); |
31 | 31 |
32 // Generic summary for call instructions that have all arguments pushed | 32 // Generic summary for call instructions that have all arguments pushed |
33 // on the stack and return the result in a fixed register R0. | 33 // on the stack and return the result in a fixed register R0. |
34 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { | 34 LocationSummary* Instruction::MakeCallSummary(Zone* zone) { |
35 LocationSummary* result = new(isolate) LocationSummary( | 35 LocationSummary* result = new(zone) LocationSummary( |
36 isolate, 0, 0, LocationSummary::kCall); | 36 zone, 0, 0, LocationSummary::kCall); |
37 result->set_out(0, Location::RegisterLocation(R0)); | 37 result->set_out(0, Location::RegisterLocation(R0)); |
38 return result; | 38 return result; |
39 } | 39 } |
40 | 40 |
41 | 41 |
42 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate, | 42 LocationSummary* PushArgumentInstr::MakeLocationSummary(Zone* zone, |
43 bool opt) const { | 43 bool opt) const { |
44 const intptr_t kNumInputs = 1; | 44 const intptr_t kNumInputs = 1; |
45 const intptr_t kNumTemps = 0; | 45 const intptr_t kNumTemps = 0; |
46 LocationSummary* locs = new(isolate) LocationSummary( | 46 LocationSummary* locs = new(zone) LocationSummary( |
47 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 47 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
48 locs->set_in(0, Location::AnyOrConstant(value())); | 48 locs->set_in(0, Location::AnyOrConstant(value())); |
49 return locs; | 49 return locs; |
50 } | 50 } |
51 | 51 |
52 | 52 |
53 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 53 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
54 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 54 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
55 // where PushArgument is handled by BindInstr::EmitNativeCode. | 55 // where PushArgument is handled by BindInstr::EmitNativeCode. |
56 if (compiler->is_optimizing()) { | 56 if (compiler->is_optimizing()) { |
57 Location value = locs()->in(0); | 57 Location value = locs()->in(0); |
58 if (value.IsRegister()) { | 58 if (value.IsRegister()) { |
59 __ Push(value.reg()); | 59 __ Push(value.reg()); |
60 } else if (value.IsConstant()) { | 60 } else if (value.IsConstant()) { |
61 __ PushObject(value.constant(), PP); | 61 __ PushObject(value.constant(), PP); |
62 } else { | 62 } else { |
63 ASSERT(value.IsStackSlot()); | 63 ASSERT(value.IsStackSlot()); |
64 const intptr_t value_offset = value.ToStackSlotOffset(); | 64 const intptr_t value_offset = value.ToStackSlotOffset(); |
65 __ LoadFromOffset(TMP, value.base_reg(), value_offset, PP); | 65 __ LoadFromOffset(TMP, value.base_reg(), value_offset, PP); |
66 __ Push(TMP); | 66 __ Push(TMP); |
67 } | 67 } |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 | 71 |
72 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate, | 72 LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone, |
73 bool opt) const { | 73 bool opt) const { |
74 const intptr_t kNumInputs = 1; | 74 const intptr_t kNumInputs = 1; |
75 const intptr_t kNumTemps = 0; | 75 const intptr_t kNumTemps = 0; |
76 LocationSummary* locs = new(isolate) LocationSummary( | 76 LocationSummary* locs = new(zone) LocationSummary( |
77 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 77 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
78 locs->set_in(0, Location::RegisterLocation(R0)); | 78 locs->set_in(0, Location::RegisterLocation(R0)); |
79 return locs; | 79 return locs; |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 // Attempt optimized compilation at return instruction instead of at the entry. | 83 // Attempt optimized compilation at return instruction instead of at the entry. |
84 // The entry needs to be patchable, no inlined objects are allowed in the area | 84 // The entry needs to be patchable, no inlined objects are allowed in the area |
85 // that will be overwritten by the patch instructions: a branch macro sequence. | 85 // that will be overwritten by the patch instructions: a branch macro sequence. |
86 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 86 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
87 const Register result = locs()->in(0).reg(); | 87 const Register result = locs()->in(0).reg(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 | 131 |
132 // Detect pattern when one value is zero and another is a power of 2. | 132 // Detect pattern when one value is zero and another is a power of 2. |
133 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { | 133 static bool IsPowerOfTwoKind(intptr_t v1, intptr_t v2) { |
134 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || | 134 return (Utils::IsPowerOfTwo(v1) && (v2 == 0)) || |
135 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); | 135 (Utils::IsPowerOfTwo(v2) && (v1 == 0)); |
136 } | 136 } |
137 | 137 |
138 | 138 |
139 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate, | 139 LocationSummary* IfThenElseInstr::MakeLocationSummary(Zone* zone, |
140 bool opt) const { | 140 bool opt) const { |
141 comparison()->InitializeLocationSummary(isolate, opt); | 141 comparison()->InitializeLocationSummary(zone, opt); |
142 return comparison()->locs(); | 142 return comparison()->locs(); |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 146 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
147 const Register result = locs()->out(0).reg(); | 147 const Register result = locs()->out(0).reg(); |
148 | 148 |
149 Location left = locs()->in(0); | 149 Location left = locs()->in(0); |
150 Location right = locs()->in(1); | 150 Location right = locs()->in(1); |
151 ASSERT(!left.IsConstant() || !right.IsConstant()); | 151 ASSERT(!left.IsConstant() || !right.IsConstant()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const int64_t val = | 186 const int64_t val = |
187 Smi::RawValue(true_value) - Smi::RawValue(false_value); | 187 Smi::RawValue(true_value) - Smi::RawValue(false_value); |
188 __ AndImmediate(result, result, val, PP); | 188 __ AndImmediate(result, result, val, PP); |
189 if (false_value != 0) { | 189 if (false_value != 0) { |
190 __ AddImmediate(result, result, Smi::RawValue(false_value), PP); | 190 __ AddImmediate(result, result, Smi::RawValue(false_value), PP); |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 | 195 |
196 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate, | 196 LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone, |
197 bool opt) const { | 197 bool opt) const { |
198 const intptr_t kNumInputs = 1; | 198 const intptr_t kNumInputs = 1; |
199 const intptr_t kNumTemps = 0; | 199 const intptr_t kNumTemps = 0; |
200 LocationSummary* summary = new(isolate) LocationSummary( | 200 LocationSummary* summary = new(zone) LocationSummary( |
201 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 201 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
202 summary->set_in(0, Location::RegisterLocation(R0)); // Function. | 202 summary->set_in(0, Location::RegisterLocation(R0)); // Function. |
203 summary->set_out(0, Location::RegisterLocation(R0)); | 203 summary->set_out(0, Location::RegisterLocation(R0)); |
204 return summary; | 204 return summary; |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 208 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
209 // Load arguments descriptor in R4. | 209 // Load arguments descriptor in R4. |
210 int argument_count = ArgumentCount(); | 210 int argument_count = ArgumentCount(); |
211 const Array& arguments_descriptor = | 211 const Array& arguments_descriptor = |
(...skipping 24 matching lines...) Expand all Loading... |
236 // Add deoptimization continuation point after the call and before the | 236 // Add deoptimization continuation point after the call and before the |
237 // arguments are removed. | 237 // arguments are removed. |
238 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 238 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
239 deopt_id_after, | 239 deopt_id_after, |
240 token_pos()); | 240 token_pos()); |
241 } | 241 } |
242 __ Drop(argument_count); | 242 __ Drop(argument_count); |
243 } | 243 } |
244 | 244 |
245 | 245 |
246 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, | 246 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone, |
247 bool opt) const { | 247 bool opt) const { |
248 return LocationSummary::Make(isolate, | 248 return LocationSummary::Make(zone, |
249 0, | 249 0, |
250 Location::RequiresRegister(), | 250 Location::RequiresRegister(), |
251 LocationSummary::kNoCall); | 251 LocationSummary::kNoCall); |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 255 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
256 const Register result = locs()->out(0).reg(); | 256 const Register result = locs()->out(0).reg(); |
257 __ LoadFromOffset(result, FP, local().index() * kWordSize, PP); | 257 __ LoadFromOffset(result, FP, local().index() * kWordSize, PP); |
258 } | 258 } |
259 | 259 |
260 | 260 |
261 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, | 261 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone, |
262 bool opt) const { | 262 bool opt) const { |
263 return LocationSummary::Make(isolate, | 263 return LocationSummary::Make(zone, |
264 1, | 264 1, |
265 Location::SameAsFirstInput(), | 265 Location::SameAsFirstInput(), |
266 LocationSummary::kNoCall); | 266 LocationSummary::kNoCall); |
267 } | 267 } |
268 | 268 |
269 | 269 |
270 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 270 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
271 const Register value = locs()->in(0).reg(); | 271 const Register value = locs()->in(0).reg(); |
272 const Register result = locs()->out(0).reg(); | 272 const Register result = locs()->out(0).reg(); |
273 ASSERT(result == value); // Assert that register assignment is correct. | 273 ASSERT(result == value); // Assert that register assignment is correct. |
274 __ StoreToOffset(value, FP, local().index() * kWordSize, PP); | 274 __ StoreToOffset(value, FP, local().index() * kWordSize, PP); |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, | 278 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, |
279 bool opt) const { | 279 bool opt) const { |
280 return LocationSummary::Make(isolate, | 280 return LocationSummary::Make(zone, |
281 0, | 281 0, |
282 Location::RequiresRegister(), | 282 Location::RequiresRegister(), |
283 LocationSummary::kNoCall); | 283 LocationSummary::kNoCall); |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 287 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
288 // The register allocator drops constant definitions that have no uses. | 288 // The register allocator drops constant definitions that have no uses. |
289 if (!locs()->out(0).IsInvalid()) { | 289 if (!locs()->out(0).IsInvalid()) { |
290 const Register result = locs()->out(0).reg(); | 290 const Register result = locs()->out(0).reg(); |
291 __ LoadObject(result, value(), PP); | 291 __ LoadObject(result, value(), PP); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 | 295 |
296 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, | 296 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, |
297 bool opt) const { | 297 bool opt) const { |
298 const intptr_t kNumInputs = 0; | 298 const intptr_t kNumInputs = 0; |
299 const Location out = (representation_ == kUnboxedInt32) ? | 299 const Location out = (representation_ == kUnboxedInt32) ? |
300 Location::RequiresRegister() : Location::RequiresFpuRegister(); | 300 Location::RequiresRegister() : Location::RequiresFpuRegister(); |
301 return LocationSummary::Make(isolate, | 301 return LocationSummary::Make(zone, |
302 kNumInputs, | 302 kNumInputs, |
303 out, | 303 out, |
304 LocationSummary::kNoCall); | 304 LocationSummary::kNoCall); |
305 } | 305 } |
306 | 306 |
307 | 307 |
308 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 308 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
309 if (!locs()->out(0).IsInvalid()) { | 309 if (!locs()->out(0).IsInvalid()) { |
310 switch (representation_) { | 310 switch (representation_) { |
311 case kUnboxedDouble: | 311 case kUnboxedDouble: |
(...skipping 11 matching lines...) Expand all Loading... |
323 PP); | 323 PP); |
324 break; | 324 break; |
325 default: | 325 default: |
326 UNREACHABLE(); | 326 UNREACHABLE(); |
327 break; | 327 break; |
328 } | 328 } |
329 } | 329 } |
330 } | 330 } |
331 | 331 |
332 | 332 |
333 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate, | 333 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Zone* zone, |
334 bool opt) const { | 334 bool opt) const { |
335 const intptr_t kNumInputs = 3; | 335 const intptr_t kNumInputs = 3; |
336 const intptr_t kNumTemps = 0; | 336 const intptr_t kNumTemps = 0; |
337 LocationSummary* summary = new(isolate) LocationSummary( | 337 LocationSummary* summary = new(zone) LocationSummary( |
338 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 338 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
339 summary->set_in(0, Location::RegisterLocation(R0)); // Value. | 339 summary->set_in(0, Location::RegisterLocation(R0)); // Value. |
340 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. | 340 summary->set_in(1, Location::RegisterLocation(R2)); // Instantiator. |
341 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. | 341 summary->set_in(2, Location::RegisterLocation(R1)); // Type arguments. |
342 summary->set_out(0, Location::RegisterLocation(R0)); | 342 summary->set_out(0, Location::RegisterLocation(R0)); |
343 return summary; | 343 return summary; |
344 } | 344 } |
345 | 345 |
346 | 346 |
347 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate, | 347 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Zone* zone, |
348 bool opt) const { | 348 bool opt) const { |
349 const intptr_t kNumInputs = 1; | 349 const intptr_t kNumInputs = 1; |
350 const intptr_t kNumTemps = 0; | 350 const intptr_t kNumTemps = 0; |
351 LocationSummary* locs = new(isolate) LocationSummary( | 351 LocationSummary* locs = new(zone) LocationSummary( |
352 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 352 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
353 locs->set_in(0, Location::RegisterLocation(R0)); | 353 locs->set_in(0, Location::RegisterLocation(R0)); |
354 locs->set_out(0, Location::RegisterLocation(R0)); | 354 locs->set_out(0, Location::RegisterLocation(R0)); |
355 return locs; | 355 return locs; |
356 } | 356 } |
357 | 357 |
358 | 358 |
359 static void EmitAssertBoolean(Register reg, | 359 static void EmitAssertBoolean(Register reg, |
360 intptr_t token_pos, | 360 intptr_t token_pos, |
361 intptr_t deopt_id, | 361 intptr_t deopt_id, |
362 LocationSummary* locs, | 362 LocationSummary* locs, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 true_condition = FlipCondition(true_condition); | 465 true_condition = FlipCondition(true_condition); |
466 } else if (right.IsConstant()) { | 466 } else if (right.IsConstant()) { |
467 __ CompareObject(left.reg(), right.constant(), PP); | 467 __ CompareObject(left.reg(), right.constant(), PP); |
468 } else { | 468 } else { |
469 __ CompareRegisters(left.reg(), right.reg()); | 469 __ CompareRegisters(left.reg(), right.reg()); |
470 } | 470 } |
471 return true_condition; | 471 return true_condition; |
472 } | 472 } |
473 | 473 |
474 | 474 |
475 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate, | 475 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone, |
476 bool opt) const { | 476 bool opt) const { |
477 const intptr_t kNumInputs = 2; | 477 const intptr_t kNumInputs = 2; |
478 if (operation_cid() == kDoubleCid) { | 478 if (operation_cid() == kDoubleCid) { |
479 const intptr_t kNumTemps = 0; | 479 const intptr_t kNumTemps = 0; |
480 LocationSummary* locs = new(isolate) LocationSummary( | 480 LocationSummary* locs = new(zone) LocationSummary( |
481 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 481 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
482 locs->set_in(0, Location::RequiresFpuRegister()); | 482 locs->set_in(0, Location::RequiresFpuRegister()); |
483 locs->set_in(1, Location::RequiresFpuRegister()); | 483 locs->set_in(1, Location::RequiresFpuRegister()); |
484 locs->set_out(0, Location::RequiresRegister()); | 484 locs->set_out(0, Location::RequiresRegister()); |
485 return locs; | 485 return locs; |
486 } | 486 } |
487 if (operation_cid() == kSmiCid) { | 487 if (operation_cid() == kSmiCid) { |
488 const intptr_t kNumTemps = 0; | 488 const intptr_t kNumTemps = 0; |
489 LocationSummary* locs = new(isolate) LocationSummary( | 489 LocationSummary* locs = new(zone) LocationSummary( |
490 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 490 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
491 locs->set_in(0, Location::RegisterOrConstant(left())); | 491 locs->set_in(0, Location::RegisterOrConstant(left())); |
492 // Only one input can be a constant operand. The case of two constant | 492 // Only one input can be a constant operand. The case of two constant |
493 // operands should be handled by constant propagation. | 493 // operands should be handled by constant propagation. |
494 // Only right can be a stack slot. | 494 // Only right can be a stack slot. |
495 locs->set_in(1, locs->in(0).IsConstant() | 495 locs->set_in(1, locs->in(0).IsConstant() |
496 ? Location::RequiresRegister() | 496 ? Location::RequiresRegister() |
497 : Location::RegisterOrConstant(right())); | 497 : Location::RegisterOrConstant(right())); |
498 locs->set_out(0, Location::RequiresRegister()); | 498 locs->set_out(0, Location::RequiresRegister()); |
499 return locs; | 499 return locs; |
500 } | 500 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 Condition true_condition = EmitComparisonCode(compiler, labels); | 572 Condition true_condition = EmitComparisonCode(compiler, labels); |
573 if ((operation_cid() == kDoubleCid) && (true_condition != NE)) { | 573 if ((operation_cid() == kDoubleCid) && (true_condition != NE)) { |
574 // Special case for NaN comparison. Result is always false unless | 574 // Special case for NaN comparison. Result is always false unless |
575 // relational operator is !=. | 575 // relational operator is !=. |
576 __ b(labels.false_label, VS); | 576 __ b(labels.false_label, VS); |
577 } | 577 } |
578 EmitBranchOnCondition(compiler, true_condition, labels); | 578 EmitBranchOnCondition(compiler, true_condition, labels); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate, | 582 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, |
583 bool opt) const { | 583 bool opt) const { |
584 const intptr_t kNumInputs = 2; | 584 const intptr_t kNumInputs = 2; |
585 const intptr_t kNumTemps = 0; | 585 const intptr_t kNumTemps = 0; |
586 LocationSummary* locs = new(isolate) LocationSummary( | 586 LocationSummary* locs = new(zone) LocationSummary( |
587 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 587 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
588 locs->set_in(0, Location::RequiresRegister()); | 588 locs->set_in(0, Location::RequiresRegister()); |
589 // Only one input can be a constant operand. The case of two constant | 589 // Only one input can be a constant operand. The case of two constant |
590 // operands should be handled by constant propagation. | 590 // operands should be handled by constant propagation. |
591 locs->set_in(1, Location::RegisterOrConstant(right())); | 591 locs->set_in(1, Location::RegisterOrConstant(right())); |
592 return locs; | 592 return locs; |
593 } | 593 } |
594 | 594 |
595 | 595 |
596 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 596 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
597 BranchLabels labels) { | 597 BranchLabels labels) { |
(...skipping 19 matching lines...) Expand all Loading... |
617 | 617 |
618 | 618 |
619 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 619 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
620 BranchInstr* branch) { | 620 BranchInstr* branch) { |
621 BranchLabels labels = compiler->CreateBranchLabels(branch); | 621 BranchLabels labels = compiler->CreateBranchLabels(branch); |
622 Condition true_condition = EmitComparisonCode(compiler, labels); | 622 Condition true_condition = EmitComparisonCode(compiler, labels); |
623 EmitBranchOnCondition(compiler, true_condition, labels); | 623 EmitBranchOnCondition(compiler, true_condition, labels); |
624 } | 624 } |
625 | 625 |
626 | 626 |
627 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate, | 627 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone, |
628 bool opt) const { | 628 bool opt) const { |
629 const intptr_t kNumInputs = 1; | 629 const intptr_t kNumInputs = 1; |
630 const intptr_t kNumTemps = 1; | 630 const intptr_t kNumTemps = 1; |
631 LocationSummary* locs = new(isolate) LocationSummary( | 631 LocationSummary* locs = new(zone) LocationSummary( |
632 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 632 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
633 locs->set_in(0, Location::RequiresRegister()); | 633 locs->set_in(0, Location::RequiresRegister()); |
634 locs->set_temp(0, Location::RequiresRegister()); | 634 locs->set_temp(0, Location::RequiresRegister()); |
635 locs->set_out(0, Location::RequiresRegister()); | 635 locs->set_out(0, Location::RequiresRegister()); |
636 return locs; | 636 return locs; |
637 } | 637 } |
638 | 638 |
639 | 639 |
640 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 640 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
641 BranchLabels labels) { | 641 BranchLabels labels) { |
642 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 642 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 // True or False into result. | 692 // True or False into result. |
693 __ Bind(&is_false); | 693 __ Bind(&is_false); |
694 __ LoadObject(result_reg, Bool::False(), PP); | 694 __ LoadObject(result_reg, Bool::False(), PP); |
695 __ b(&done); | 695 __ b(&done); |
696 __ Bind(&is_true); | 696 __ Bind(&is_true); |
697 __ LoadObject(result_reg, Bool::True(), PP); | 697 __ LoadObject(result_reg, Bool::True(), PP); |
698 __ Bind(&done); | 698 __ Bind(&done); |
699 } | 699 } |
700 | 700 |
701 | 701 |
702 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate, | 702 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone, |
703 bool opt) const { | 703 bool opt) const { |
704 const intptr_t kNumInputs = 2; | 704 const intptr_t kNumInputs = 2; |
705 const intptr_t kNumTemps = 0; | 705 const intptr_t kNumTemps = 0; |
706 if (operation_cid() == kDoubleCid) { | 706 if (operation_cid() == kDoubleCid) { |
707 LocationSummary* summary = new(isolate) LocationSummary( | 707 LocationSummary* summary = new(zone) LocationSummary( |
708 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 708 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
709 summary->set_in(0, Location::RequiresFpuRegister()); | 709 summary->set_in(0, Location::RequiresFpuRegister()); |
710 summary->set_in(1, Location::RequiresFpuRegister()); | 710 summary->set_in(1, Location::RequiresFpuRegister()); |
711 summary->set_out(0, Location::RequiresRegister()); | 711 summary->set_out(0, Location::RequiresRegister()); |
712 return summary; | 712 return summary; |
713 } | 713 } |
714 ASSERT(operation_cid() == kSmiCid); | 714 ASSERT(operation_cid() == kSmiCid); |
715 LocationSummary* summary = new(isolate) LocationSummary( | 715 LocationSummary* summary = new(zone) LocationSummary( |
716 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 716 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
717 summary->set_in(0, Location::RegisterOrConstant(left())); | 717 summary->set_in(0, Location::RegisterOrConstant(left())); |
718 // Only one input can be a constant operand. The case of two constant | 718 // Only one input can be a constant operand. The case of two constant |
719 // operands should be handled by constant propagation. | 719 // operands should be handled by constant propagation. |
720 summary->set_in(1, summary->in(0).IsConstant() | 720 summary->set_in(1, summary->in(0).IsConstant() |
721 ? Location::RequiresRegister() | 721 ? Location::RequiresRegister() |
722 : Location::RegisterOrConstant(right())); | 722 : Location::RegisterOrConstant(right())); |
723 summary->set_out(0, Location::RequiresRegister()); | 723 summary->set_out(0, Location::RequiresRegister()); |
724 return summary; | 724 return summary; |
725 } | 725 } |
726 | 726 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 Condition true_condition = EmitComparisonCode(compiler, labels); | 765 Condition true_condition = EmitComparisonCode(compiler, labels); |
766 if ((operation_cid() == kDoubleCid) && (true_condition != NE)) { | 766 if ((operation_cid() == kDoubleCid) && (true_condition != NE)) { |
767 // Special case for NaN comparison. Result is always false unless | 767 // Special case for NaN comparison. Result is always false unless |
768 // relational operator is !=. | 768 // relational operator is !=. |
769 __ b(labels.false_label, VS); | 769 __ b(labels.false_label, VS); |
770 } | 770 } |
771 EmitBranchOnCondition(compiler, true_condition, labels); | 771 EmitBranchOnCondition(compiler, true_condition, labels); |
772 } | 772 } |
773 | 773 |
774 | 774 |
775 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate, | 775 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, |
776 bool opt) const { | 776 bool opt) const { |
777 return MakeCallSummary(isolate); | 777 return MakeCallSummary(zone); |
778 } | 778 } |
779 | 779 |
780 | 780 |
781 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 781 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
782 const Register result = locs()->out(0).reg(); | 782 const Register result = locs()->out(0).reg(); |
783 | 783 |
784 // Push the result place holder initialized to NULL. | 784 // Push the result place holder initialized to NULL. |
785 __ PushObject(Object::null_object(), PP); | 785 __ PushObject(Object::null_object(), PP); |
786 // Pass a pointer to the first argument in R2. | 786 // Pass a pointer to the first argument in R2. |
787 if (!function().HasOptionalParameters()) { | 787 if (!function().HasOptionalParameters()) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 __ LoadImmediate(R5, entry, PP); | 820 __ LoadImmediate(R5, entry, PP); |
821 __ LoadImmediate(R1, argc_tag, PP); | 821 __ LoadImmediate(R1, argc_tag, PP); |
822 compiler->GenerateCall(token_pos(), | 822 compiler->GenerateCall(token_pos(), |
823 stub_entry, | 823 stub_entry, |
824 RawPcDescriptors::kOther, | 824 RawPcDescriptors::kOther, |
825 locs()); | 825 locs()); |
826 __ Pop(result); | 826 __ Pop(result); |
827 } | 827 } |
828 | 828 |
829 | 829 |
830 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 830 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone, |
831 bool opt) const { | 831 bool opt) const { |
832 const intptr_t kNumInputs = 1; | 832 const intptr_t kNumInputs = 1; |
833 // TODO(fschneider): Allow immediate operands for the char code. | 833 // TODO(fschneider): Allow immediate operands for the char code. |
834 return LocationSummary::Make(isolate, | 834 return LocationSummary::Make(zone, |
835 kNumInputs, | 835 kNumInputs, |
836 Location::RequiresRegister(), | 836 Location::RequiresRegister(), |
837 LocationSummary::kNoCall); | 837 LocationSummary::kNoCall); |
838 } | 838 } |
839 | 839 |
840 | 840 |
841 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 841 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
842 const Register char_code = locs()->in(0).reg(); | 842 const Register char_code = locs()->in(0).reg(); |
843 const Register result = locs()->out(0).reg(); | 843 const Register result = locs()->out(0).reg(); |
844 __ LoadImmediate( | 844 __ LoadImmediate( |
845 result, reinterpret_cast<uword>(Symbols::PredefinedAddress()), PP); | 845 result, reinterpret_cast<uword>(Symbols::PredefinedAddress()), PP); |
846 __ AddImmediate( | 846 __ AddImmediate( |
847 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize, PP); | 847 result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize, PP); |
848 __ SmiUntag(TMP, char_code); // Untag to use scaled adress mode. | 848 __ SmiUntag(TMP, char_code); // Untag to use scaled adress mode. |
849 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); | 849 __ ldr(result, Address(result, TMP, UXTX, Address::Scaled)); |
850 } | 850 } |
851 | 851 |
852 | 852 |
853 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, | 853 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone, |
854 bool opt) const { | 854 bool opt) const { |
855 const intptr_t kNumInputs = 1; | 855 const intptr_t kNumInputs = 1; |
856 return LocationSummary::Make(isolate, | 856 return LocationSummary::Make(zone, |
857 kNumInputs, | 857 kNumInputs, |
858 Location::RequiresRegister(), | 858 Location::RequiresRegister(), |
859 LocationSummary::kNoCall); | 859 LocationSummary::kNoCall); |
860 } | 860 } |
861 | 861 |
862 | 862 |
863 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 863 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
864 ASSERT(cid_ == kOneByteStringCid); | 864 ASSERT(cid_ == kOneByteStringCid); |
865 const Register str = locs()->in(0).reg(); | 865 const Register str = locs()->in(0).reg(); |
866 const Register result = locs()->out(0).reg(); | 866 const Register result = locs()->out(0).reg(); |
867 __ LoadFieldFromOffset(result, str, String::length_offset(), PP); | 867 __ LoadFieldFromOffset(result, str, String::length_offset(), PP); |
868 __ ldr(TMP, FieldAddress(str, OneByteString::data_offset()), kUnsignedByte); | 868 __ ldr(TMP, FieldAddress(str, OneByteString::data_offset()), kUnsignedByte); |
869 __ CompareImmediate(result, Smi::RawValue(1), PP); | 869 __ CompareImmediate(result, Smi::RawValue(1), PP); |
870 __ LoadImmediate(result, -1, PP); | 870 __ LoadImmediate(result, -1, PP); |
871 __ csel(result, TMP, result, EQ); | 871 __ csel(result, TMP, result, EQ); |
872 __ SmiTag(result); | 872 __ SmiTag(result); |
873 } | 873 } |
874 | 874 |
875 | 875 |
876 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate, | 876 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Zone* zone, |
877 bool opt) const { | 877 bool opt) const { |
878 const intptr_t kNumInputs = 1; | 878 const intptr_t kNumInputs = 1; |
879 const intptr_t kNumTemps = 0; | 879 const intptr_t kNumTemps = 0; |
880 LocationSummary* summary = new(isolate) LocationSummary( | 880 LocationSummary* summary = new(zone) LocationSummary( |
881 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 881 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
882 summary->set_in(0, Location::RegisterLocation(R0)); | 882 summary->set_in(0, Location::RegisterLocation(R0)); |
883 summary->set_out(0, Location::RegisterLocation(R0)); | 883 summary->set_out(0, Location::RegisterLocation(R0)); |
884 return summary; | 884 return summary; |
885 } | 885 } |
886 | 886 |
887 | 887 |
888 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 888 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
889 const Register array = locs()->in(0).reg(); | 889 const Register array = locs()->in(0).reg(); |
890 __ Push(array); | 890 __ Push(array); |
891 const int kNumberOfArguments = 1; | 891 const int kNumberOfArguments = 1; |
892 const Array& kNoArgumentNames = Object::null_array(); | 892 const Array& kNoArgumentNames = Object::null_array(); |
893 compiler->GenerateStaticCall(deopt_id(), | 893 compiler->GenerateStaticCall(deopt_id(), |
894 token_pos(), | 894 token_pos(), |
895 CallFunction(), | 895 CallFunction(), |
896 kNumberOfArguments, | 896 kNumberOfArguments, |
897 kNoArgumentNames, | 897 kNoArgumentNames, |
898 locs(), | 898 locs(), |
899 ICData::Handle()); | 899 ICData::Handle()); |
900 ASSERT(locs()->out(0).reg() == R0); | 900 ASSERT(locs()->out(0).reg() == R0); |
901 } | 901 } |
902 | 902 |
903 | 903 |
904 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, | 904 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, |
905 bool opt) const { | 905 bool opt) const { |
906 const intptr_t kNumInputs = 1; | 906 const intptr_t kNumInputs = 1; |
907 return LocationSummary::Make(isolate, | 907 return LocationSummary::Make(zone, |
908 kNumInputs, | 908 kNumInputs, |
909 Location::RequiresRegister(), | 909 Location::RequiresRegister(), |
910 LocationSummary::kNoCall); | 910 LocationSummary::kNoCall); |
911 } | 911 } |
912 | 912 |
913 | 913 |
914 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 914 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
915 const Register obj = locs()->in(0).reg(); | 915 const Register obj = locs()->in(0).reg(); |
916 const Register result = locs()->out(0).reg(); | 916 const Register result = locs()->out(0).reg(); |
917 if (object()->definition()->representation() == kUntagged) { | 917 if (object()->definition()->representation() == kUntagged) { |
918 __ LoadFromOffset(result, obj, offset(), PP); | 918 __ LoadFromOffset(result, obj, offset(), PP); |
919 } else { | 919 } else { |
920 ASSERT(object()->definition()->representation() == kTagged); | 920 ASSERT(object()->definition()->representation() == kTagged); |
921 __ LoadFieldFromOffset(result, obj, offset(), PP); | 921 __ LoadFieldFromOffset(result, obj, offset(), PP); |
922 } | 922 } |
923 } | 923 } |
924 | 924 |
925 | 925 |
926 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, | 926 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone, |
927 bool opt) const { | 927 bool opt) const { |
928 const intptr_t kNumInputs = 1; | 928 const intptr_t kNumInputs = 1; |
929 return LocationSummary::Make(isolate, | 929 return LocationSummary::Make(zone, |
930 kNumInputs, | 930 kNumInputs, |
931 Location::RequiresRegister(), | 931 Location::RequiresRegister(), |
932 LocationSummary::kNoCall); | 932 LocationSummary::kNoCall); |
933 } | 933 } |
934 | 934 |
935 | 935 |
936 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 936 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
937 const Register object = locs()->in(0).reg(); | 937 const Register object = locs()->in(0).reg(); |
938 const Register result = locs()->out(0).reg(); | 938 const Register result = locs()->out(0).reg(); |
939 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; | 939 static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag)); | 1027 (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag)); |
1028 if (!Utils::IsInt(32, offset)) { | 1028 if (!Utils::IsInt(32, offset)) { |
1029 return false; | 1029 return false; |
1030 } | 1030 } |
1031 return Address::CanHoldOffset(static_cast<int32_t>(offset), | 1031 return Address::CanHoldOffset(static_cast<int32_t>(offset), |
1032 Address::Offset, | 1032 Address::Offset, |
1033 Address::OperandSizeFor(cid)); | 1033 Address::OperandSizeFor(cid)); |
1034 } | 1034 } |
1035 | 1035 |
1036 | 1036 |
1037 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1037 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone, |
1038 bool opt) const { | 1038 bool opt) const { |
1039 const intptr_t kNumInputs = 2; | 1039 const intptr_t kNumInputs = 2; |
1040 const intptr_t kNumTemps = 0; | 1040 const intptr_t kNumTemps = 0; |
1041 LocationSummary* locs = new(isolate) LocationSummary( | 1041 LocationSummary* locs = new(zone) LocationSummary( |
1042 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1042 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1043 locs->set_in(0, Location::RequiresRegister()); | 1043 locs->set_in(0, Location::RequiresRegister()); |
1044 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1044 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
1045 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1045 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
1046 } else { | 1046 } else { |
1047 locs->set_in(1, Location::RequiresRegister()); | 1047 locs->set_in(1, Location::RequiresRegister()); |
1048 } | 1048 } |
1049 if ((representation() == kUnboxedDouble) || | 1049 if ((representation() == kUnboxedDouble) || |
1050 (representation() == kUnboxedFloat32x4) || | 1050 (representation() == kUnboxedFloat32x4) || |
1051 (representation() == kUnboxedInt32x4) || | 1051 (representation() == kUnboxedInt32x4) || |
1052 (representation() == kUnboxedFloat64x2)) { | 1052 (representation() == kUnboxedFloat64x2)) { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 __ SmiTag(result); | 1142 __ SmiTag(result); |
1143 break; | 1143 break; |
1144 default: | 1144 default: |
1145 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); | 1145 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); |
1146 __ ldr(result, element_address); | 1146 __ ldr(result, element_address); |
1147 break; | 1147 break; |
1148 } | 1148 } |
1149 } | 1149 } |
1150 | 1150 |
1151 | 1151 |
1152 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate, | 1152 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone, |
1153 bool opt) const { | 1153 bool opt) const { |
1154 const intptr_t kNumInputs = 2; | 1154 const intptr_t kNumInputs = 2; |
1155 const intptr_t kNumTemps = 0; | 1155 const intptr_t kNumTemps = 0; |
1156 LocationSummary* summary = new(isolate) LocationSummary( | 1156 LocationSummary* summary = new(zone) LocationSummary( |
1157 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1157 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1158 summary->set_in(0, Location::RequiresRegister()); | 1158 summary->set_in(0, Location::RequiresRegister()); |
1159 summary->set_in(1, Location::RequiresRegister()); | 1159 summary->set_in(1, Location::RequiresRegister()); |
1160 summary->set_out(0, Location::RequiresRegister()); | 1160 summary->set_out(0, Location::RequiresRegister()); |
1161 return summary; | 1161 return summary; |
1162 } | 1162 } |
1163 | 1163 |
1164 | 1164 |
1165 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1165 void LoadCodeUnitsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1166 // The string register points to the backing store for external strings. | 1166 // The string register points to the backing store for external strings. |
1167 const Register str = locs()->in(0).reg(); | 1167 const Register str = locs()->in(0).reg(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 return kUnboxedInt32x4; | 1229 return kUnboxedInt32x4; |
1230 case kTypedDataFloat64x2ArrayCid: | 1230 case kTypedDataFloat64x2ArrayCid: |
1231 return kUnboxedFloat64x2; | 1231 return kUnboxedFloat64x2; |
1232 default: | 1232 default: |
1233 UNREACHABLE(); | 1233 UNREACHABLE(); |
1234 return kTagged; | 1234 return kTagged; |
1235 } | 1235 } |
1236 } | 1236 } |
1237 | 1237 |
1238 | 1238 |
1239 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, | 1239 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone, |
1240 bool opt) const { | 1240 bool opt) const { |
1241 const intptr_t kNumInputs = 3; | 1241 const intptr_t kNumInputs = 3; |
1242 const intptr_t kNumTemps = 0; | 1242 const intptr_t kNumTemps = 0; |
1243 LocationSummary* locs = new(isolate) LocationSummary( | 1243 LocationSummary* locs = new(zone) LocationSummary( |
1244 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1244 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1245 locs->set_in(0, Location::RequiresRegister()); | 1245 locs->set_in(0, Location::RequiresRegister()); |
1246 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { | 1246 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { |
1247 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); | 1247 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); |
1248 } else { | 1248 } else { |
1249 locs->set_in(1, Location::WritableRegister()); | 1249 locs->set_in(1, Location::WritableRegister()); |
1250 } | 1250 } |
1251 switch (class_id()) { | 1251 switch (class_id()) { |
1252 case kArrayCid: | 1252 case kArrayCid: |
1253 locs->set_in(2, ShouldEmitStoreBarrier() | 1253 locs->set_in(2, ShouldEmitStoreBarrier() |
1254 ? Location::WritableRegister() | 1254 ? Location::WritableRegister() |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 if (value_is_smi == NULL) { | 1396 if (value_is_smi == NULL) { |
1397 __ b(&done, EQ); | 1397 __ b(&done, EQ); |
1398 } else { | 1398 } else { |
1399 __ b(value_is_smi, EQ); | 1399 __ b(value_is_smi, EQ); |
1400 } | 1400 } |
1401 __ LoadClassId(value_cid_reg, value_reg, PP); | 1401 __ LoadClassId(value_cid_reg, value_reg, PP); |
1402 __ Bind(&done); | 1402 __ Bind(&done); |
1403 } | 1403 } |
1404 | 1404 |
1405 | 1405 |
1406 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Isolate* isolate, | 1406 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone, |
1407 bool opt) const { | 1407 bool opt) const { |
1408 const intptr_t kNumInputs = 1; | 1408 const intptr_t kNumInputs = 1; |
1409 | 1409 |
1410 const intptr_t value_cid = value()->Type()->ToCid(); | 1410 const intptr_t value_cid = value()->Type()->ToCid(); |
1411 const intptr_t field_cid = field().guarded_cid(); | 1411 const intptr_t field_cid = field().guarded_cid(); |
1412 | 1412 |
1413 const bool emit_full_guard = | 1413 const bool emit_full_guard = |
1414 !opt || (field_cid == kIllegalCid); | 1414 !opt || (field_cid == kIllegalCid); |
1415 | 1415 |
1416 const bool needs_value_cid_temp_reg = emit_full_guard || | 1416 const bool needs_value_cid_temp_reg = emit_full_guard || |
1417 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); | 1417 ((value_cid == kDynamicCid) && (field_cid != kSmiCid)); |
1418 | 1418 |
1419 const bool needs_field_temp_reg = emit_full_guard; | 1419 const bool needs_field_temp_reg = emit_full_guard; |
1420 | 1420 |
1421 intptr_t num_temps = 0; | 1421 intptr_t num_temps = 0; |
1422 if (needs_value_cid_temp_reg) { | 1422 if (needs_value_cid_temp_reg) { |
1423 num_temps++; | 1423 num_temps++; |
1424 } | 1424 } |
1425 if (needs_field_temp_reg) { | 1425 if (needs_field_temp_reg) { |
1426 num_temps++; | 1426 num_temps++; |
1427 } | 1427 } |
1428 | 1428 |
1429 LocationSummary* summary = new(isolate) LocationSummary( | 1429 LocationSummary* summary = new(zone) LocationSummary( |
1430 isolate, kNumInputs, num_temps, LocationSummary::kNoCall); | 1430 zone, kNumInputs, num_temps, LocationSummary::kNoCall); |
1431 summary->set_in(0, Location::RequiresRegister()); | 1431 summary->set_in(0, Location::RequiresRegister()); |
1432 | 1432 |
1433 for (intptr_t i = 0; i < num_temps; i++) { | 1433 for (intptr_t i = 0; i < num_temps; i++) { |
1434 summary->set_temp(i, Location::RequiresRegister()); | 1434 summary->set_temp(i, Location::RequiresRegister()); |
1435 } | 1435 } |
1436 | 1436 |
1437 return summary; | 1437 return summary; |
1438 } | 1438 } |
1439 | 1439 |
1440 | 1440 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 } else { | 1563 } else { |
1564 // Both value's and field's class id is known. | 1564 // Both value's and field's class id is known. |
1565 ASSERT((value_cid != field_cid) && (value_cid != nullability)); | 1565 ASSERT((value_cid != field_cid) && (value_cid != nullability)); |
1566 __ b(fail); | 1566 __ b(fail); |
1567 } | 1567 } |
1568 } | 1568 } |
1569 __ Bind(&ok); | 1569 __ Bind(&ok); |
1570 } | 1570 } |
1571 | 1571 |
1572 | 1572 |
1573 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Isolate* isolate, | 1573 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Zone* zone, |
1574 bool opt) const { | 1574 bool opt) const { |
1575 const intptr_t kNumInputs = 1; | 1575 const intptr_t kNumInputs = 1; |
1576 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) { | 1576 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) { |
1577 const intptr_t kNumTemps = 3; | 1577 const intptr_t kNumTemps = 3; |
1578 LocationSummary* summary = new(isolate) LocationSummary( | 1578 LocationSummary* summary = new(zone) LocationSummary( |
1579 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1579 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1580 summary->set_in(0, Location::RequiresRegister()); | 1580 summary->set_in(0, Location::RequiresRegister()); |
1581 // We need temporaries for field object, length offset and expected length. | 1581 // We need temporaries for field object, length offset and expected length. |
1582 summary->set_temp(0, Location::RequiresRegister()); | 1582 summary->set_temp(0, Location::RequiresRegister()); |
1583 summary->set_temp(1, Location::RequiresRegister()); | 1583 summary->set_temp(1, Location::RequiresRegister()); |
1584 summary->set_temp(2, Location::RequiresRegister()); | 1584 summary->set_temp(2, Location::RequiresRegister()); |
1585 return summary; | 1585 return summary; |
1586 } else { | 1586 } else { |
1587 LocationSummary* summary = new(isolate) LocationSummary( | 1587 LocationSummary* summary = new(zone) LocationSummary( |
1588 isolate, kNumInputs, 0, LocationSummary::kNoCall); | 1588 zone, kNumInputs, 0, LocationSummary::kNoCall); |
1589 summary->set_in(0, Location::RequiresRegister()); | 1589 summary->set_in(0, Location::RequiresRegister()); |
1590 return summary; | 1590 return summary; |
1591 } | 1591 } |
1592 UNREACHABLE(); | 1592 UNREACHABLE(); |
1593 } | 1593 } |
1594 | 1594 |
1595 | 1595 |
1596 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1596 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1597 if (field().guarded_list_length() == Field::kNoFixedLength) { | 1597 if (field().guarded_list_length() == Field::kNoFixedLength) { |
1598 ASSERT(!compiler->is_optimizing()); | 1598 ASSERT(!compiler->is_optimizing()); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 __ CompareObject(box_reg, Object::null_object(), PP); | 1738 __ CompareObject(box_reg, Object::null_object(), PP); |
1739 __ b(&done, NE); | 1739 __ b(&done, NE); |
1740 BoxAllocationSlowPath::Allocate( | 1740 BoxAllocationSlowPath::Allocate( |
1741 compiler, instruction, cls, box_reg, temp); | 1741 compiler, instruction, cls, box_reg, temp); |
1742 __ mov(temp, box_reg); | 1742 __ mov(temp, box_reg); |
1743 __ StoreIntoObjectOffset(instance_reg, offset, temp, PP); | 1743 __ StoreIntoObjectOffset(instance_reg, offset, temp, PP); |
1744 __ Bind(&done); | 1744 __ Bind(&done); |
1745 } | 1745 } |
1746 | 1746 |
1747 | 1747 |
1748 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate, | 1748 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone, |
1749 bool opt) const { | 1749 bool opt) const { |
1750 const intptr_t kNumInputs = 2; | 1750 const intptr_t kNumInputs = 2; |
1751 const intptr_t kNumTemps = | 1751 const intptr_t kNumTemps = |
1752 (IsUnboxedStore() && opt) ? 2 : | 1752 (IsUnboxedStore() && opt) ? 2 : |
1753 ((IsPotentialUnboxedStore()) ? 2 : 0); | 1753 ((IsPotentialUnboxedStore()) ? 2 : 0); |
1754 LocationSummary* summary = new(isolate) LocationSummary( | 1754 LocationSummary* summary = new(zone) LocationSummary( |
1755 isolate, kNumInputs, kNumTemps, | 1755 zone, kNumInputs, kNumTemps, |
1756 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || | 1756 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || |
1757 IsPotentialUnboxedStore()) | 1757 IsPotentialUnboxedStore()) |
1758 ? LocationSummary::kCallOnSlowPath | 1758 ? LocationSummary::kCallOnSlowPath |
1759 : LocationSummary::kNoCall); | 1759 : LocationSummary::kNoCall); |
1760 | 1760 |
1761 summary->set_in(0, Location::RequiresRegister()); | 1761 summary->set_in(0, Location::RequiresRegister()); |
1762 if (IsUnboxedStore() && opt) { | 1762 if (IsUnboxedStore() && opt) { |
1763 summary->set_in(1, Location::RequiresFpuRegister()); | 1763 summary->set_in(1, Location::RequiresFpuRegister()); |
1764 summary->set_temp(0, Location::RequiresRegister()); | 1764 summary->set_temp(0, Location::RequiresRegister()); |
1765 summary->set_temp(1, Location::RequiresRegister()); | 1765 summary->set_temp(1, Location::RequiresRegister()); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 instance_reg, | 1941 instance_reg, |
1942 offset_in_bytes_, | 1942 offset_in_bytes_, |
1943 value_reg, | 1943 value_reg, |
1944 PP); | 1944 PP); |
1945 } | 1945 } |
1946 } | 1946 } |
1947 __ Bind(&skip_store); | 1947 __ Bind(&skip_store); |
1948 } | 1948 } |
1949 | 1949 |
1950 | 1950 |
1951 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 1951 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone, |
1952 bool opt) const { | 1952 bool opt) const { |
1953 const intptr_t kNumInputs = 1; | 1953 const intptr_t kNumInputs = 1; |
1954 const intptr_t kNumTemps = 0; | 1954 const intptr_t kNumTemps = 0; |
1955 LocationSummary* summary = new(isolate) LocationSummary( | 1955 LocationSummary* summary = new(zone) LocationSummary( |
1956 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1956 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
1957 summary->set_in(0, Location::RequiresRegister()); | 1957 summary->set_in(0, Location::RequiresRegister()); |
1958 summary->set_out(0, Location::RequiresRegister()); | 1958 summary->set_out(0, Location::RequiresRegister()); |
1959 return summary; | 1959 return summary; |
1960 } | 1960 } |
1961 | 1961 |
1962 | 1962 |
1963 // When the parser is building an implicit static getter for optimization, | 1963 // When the parser is building an implicit static getter for optimization, |
1964 // it can generate a function body where deoptimization ids do not line up | 1964 // it can generate a function body where deoptimization ids do not line up |
1965 // with the unoptimized code. | 1965 // with the unoptimized code. |
1966 // | 1966 // |
1967 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 1967 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
1968 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1968 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1969 const Register field = locs()->in(0).reg(); | 1969 const Register field = locs()->in(0).reg(); |
1970 const Register result = locs()->out(0).reg(); | 1970 const Register result = locs()->out(0).reg(); |
1971 __ LoadFieldFromOffset(result, field, Field::value_offset(), PP); | 1971 __ LoadFieldFromOffset(result, field, Field::value_offset(), PP); |
1972 } | 1972 } |
1973 | 1973 |
1974 | 1974 |
1975 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 1975 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, |
1976 bool opt) const { | 1976 bool opt) const { |
1977 LocationSummary* locs = new(isolate) LocationSummary( | 1977 LocationSummary* locs = new(zone) LocationSummary( |
1978 isolate, 1, 1, LocationSummary::kNoCall); | 1978 zone, 1, 1, LocationSummary::kNoCall); |
1979 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 1979 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
1980 : Location::RequiresRegister()); | 1980 : Location::RequiresRegister()); |
1981 locs->set_temp(0, Location::RequiresRegister()); | 1981 locs->set_temp(0, Location::RequiresRegister()); |
1982 return locs; | 1982 return locs; |
1983 } | 1983 } |
1984 | 1984 |
1985 | 1985 |
1986 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1986 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1987 const Register value = locs()->in(0).reg(); | 1987 const Register value = locs()->in(0).reg(); |
1988 const Register temp = locs()->temp(0).reg(); | 1988 const Register temp = locs()->temp(0).reg(); |
1989 | 1989 |
1990 __ LoadObject(temp, field(), PP); | 1990 __ LoadObject(temp, field(), PP); |
1991 if (this->value()->NeedsStoreBuffer()) { | 1991 if (this->value()->NeedsStoreBuffer()) { |
1992 __ StoreIntoObjectOffset( | 1992 __ StoreIntoObjectOffset( |
1993 temp, Field::value_offset(), value, PP, CanValueBeSmi()); | 1993 temp, Field::value_offset(), value, PP, CanValueBeSmi()); |
1994 } else { | 1994 } else { |
1995 __ StoreIntoObjectOffsetNoBarrier(temp, Field::value_offset(), value, PP); | 1995 __ StoreIntoObjectOffsetNoBarrier(temp, Field::value_offset(), value, PP); |
1996 } | 1996 } |
1997 } | 1997 } |
1998 | 1998 |
1999 | 1999 |
2000 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate, | 2000 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, |
2001 bool opt) const { | 2001 bool opt) const { |
2002 const intptr_t kNumInputs = 3; | 2002 const intptr_t kNumInputs = 3; |
2003 const intptr_t kNumTemps = 0; | 2003 const intptr_t kNumTemps = 0; |
2004 LocationSummary* summary = new(isolate) LocationSummary( | 2004 LocationSummary* summary = new(zone) LocationSummary( |
2005 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2005 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2006 summary->set_in(0, Location::RegisterLocation(R0)); | 2006 summary->set_in(0, Location::RegisterLocation(R0)); |
2007 summary->set_in(1, Location::RegisterLocation(R2)); | 2007 summary->set_in(1, Location::RegisterLocation(R2)); |
2008 summary->set_in(2, Location::RegisterLocation(R1)); | 2008 summary->set_in(2, Location::RegisterLocation(R1)); |
2009 summary->set_out(0, Location::RegisterLocation(R0)); | 2009 summary->set_out(0, Location::RegisterLocation(R0)); |
2010 return summary; | 2010 return summary; |
2011 } | 2011 } |
2012 | 2012 |
2013 | 2013 |
2014 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2014 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2015 ASSERT(locs()->in(0).reg() == R0); // Value. | 2015 ASSERT(locs()->in(0).reg() == R0); // Value. |
2016 ASSERT(locs()->in(1).reg() == R2); // Instantiator. | 2016 ASSERT(locs()->in(1).reg() == R2); // Instantiator. |
2017 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. | 2017 ASSERT(locs()->in(2).reg() == R1); // Instantiator type arguments. |
2018 | 2018 |
2019 compiler->GenerateInstanceOf(token_pos(), | 2019 compiler->GenerateInstanceOf(token_pos(), |
2020 deopt_id(), | 2020 deopt_id(), |
2021 type(), | 2021 type(), |
2022 negate_result(), | 2022 negate_result(), |
2023 locs()); | 2023 locs()); |
2024 ASSERT(locs()->out(0).reg() == R0); | 2024 ASSERT(locs()->out(0).reg() == R0); |
2025 } | 2025 } |
2026 | 2026 |
2027 | 2027 |
2028 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate, | 2028 LocationSummary* CreateArrayInstr::MakeLocationSummary(Zone* zone, |
2029 bool opt) const { | 2029 bool opt) const { |
2030 const intptr_t kNumInputs = 2; | 2030 const intptr_t kNumInputs = 2; |
2031 const intptr_t kNumTemps = 0; | 2031 const intptr_t kNumTemps = 0; |
2032 LocationSummary* locs = new(isolate) LocationSummary( | 2032 LocationSummary* locs = new(zone) LocationSummary( |
2033 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2033 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2034 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); | 2034 locs->set_in(kElementTypePos, Location::RegisterLocation(R1)); |
2035 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); | 2035 locs->set_in(kLengthPos, Location::RegisterLocation(R2)); |
2036 locs->set_out(0, Location::RegisterLocation(R0)); | 2036 locs->set_out(0, Location::RegisterLocation(R0)); |
2037 return locs; | 2037 return locs; |
2038 } | 2038 } |
2039 | 2039 |
2040 | 2040 |
2041 // Inlines array allocation for known constant values. | 2041 // Inlines array allocation for known constant values. |
2042 static void InlineArrayAllocation(FlowGraphCompiler* compiler, | 2042 static void InlineArrayAllocation(FlowGraphCompiler* compiler, |
2043 intptr_t num_elements, | 2043 intptr_t num_elements, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2133 const ExternalLabel label(stub.EntryPoint()); | 2133 const ExternalLabel label(stub.EntryPoint()); |
2134 compiler->GenerateCall(token_pos(), | 2134 compiler->GenerateCall(token_pos(), |
2135 &label, | 2135 &label, |
2136 RawPcDescriptors::kOther, | 2136 RawPcDescriptors::kOther, |
2137 locs()); | 2137 locs()); |
2138 compiler->AddStubCallTarget(stub); | 2138 compiler->AddStubCallTarget(stub); |
2139 ASSERT(locs()->out(0).reg() == kResultReg); | 2139 ASSERT(locs()->out(0).reg() == kResultReg); |
2140 } | 2140 } |
2141 | 2141 |
2142 | 2142 |
2143 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate, | 2143 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone, |
2144 bool opt) const { | 2144 bool opt) const { |
2145 const intptr_t kNumInputs = 1; | 2145 const intptr_t kNumInputs = 1; |
2146 const intptr_t kNumTemps = | 2146 const intptr_t kNumTemps = |
2147 (IsUnboxedLoad() && opt) ? 1 : | 2147 (IsUnboxedLoad() && opt) ? 1 : |
2148 ((IsPotentialUnboxedLoad()) ? 1 : 0); | 2148 ((IsPotentialUnboxedLoad()) ? 1 : 0); |
2149 LocationSummary* locs = new(isolate) LocationSummary( | 2149 LocationSummary* locs = new(zone) LocationSummary( |
2150 isolate, kNumInputs, kNumTemps, | 2150 zone, kNumInputs, kNumTemps, |
2151 (opt && !IsPotentialUnboxedLoad()) | 2151 (opt && !IsPotentialUnboxedLoad()) |
2152 ? LocationSummary::kNoCall | 2152 ? LocationSummary::kNoCall |
2153 : LocationSummary::kCallOnSlowPath); | 2153 : LocationSummary::kCallOnSlowPath); |
2154 | 2154 |
2155 locs->set_in(0, Location::RequiresRegister()); | 2155 locs->set_in(0, Location::RequiresRegister()); |
2156 | 2156 |
2157 if (IsUnboxedLoad() && opt) { | 2157 if (IsUnboxedLoad() && opt) { |
2158 locs->set_temp(0, Location::RequiresRegister()); | 2158 locs->set_temp(0, Location::RequiresRegister()); |
2159 } else if (IsPotentialUnboxedLoad()) { | 2159 } else if (IsPotentialUnboxedLoad()) { |
2160 locs->set_temp(0, Location::RequiresRegister()); | 2160 locs->set_temp(0, Location::RequiresRegister()); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 __ b(&done); | 2267 __ b(&done); |
2268 } | 2268 } |
2269 | 2269 |
2270 __ Bind(&load_pointer); | 2270 __ Bind(&load_pointer); |
2271 } | 2271 } |
2272 __ LoadFieldFromOffset(result_reg, instance_reg, offset_in_bytes(), PP); | 2272 __ LoadFieldFromOffset(result_reg, instance_reg, offset_in_bytes(), PP); |
2273 __ Bind(&done); | 2273 __ Bind(&done); |
2274 } | 2274 } |
2275 | 2275 |
2276 | 2276 |
2277 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate, | 2277 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Zone* zone, |
2278 bool opt) const { | 2278 bool opt) const { |
2279 const intptr_t kNumInputs = 1; | 2279 const intptr_t kNumInputs = 1; |
2280 const intptr_t kNumTemps = 0; | 2280 const intptr_t kNumTemps = 0; |
2281 LocationSummary* locs = new(isolate) LocationSummary( | 2281 LocationSummary* locs = new(zone) LocationSummary( |
2282 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2282 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2283 locs->set_in(0, Location::RegisterLocation(R0)); | 2283 locs->set_in(0, Location::RegisterLocation(R0)); |
2284 locs->set_out(0, Location::RegisterLocation(R0)); | 2284 locs->set_out(0, Location::RegisterLocation(R0)); |
2285 return locs; | 2285 return locs; |
2286 } | 2286 } |
2287 | 2287 |
2288 | 2288 |
2289 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2289 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2290 const Register instantiator_reg = locs()->in(0).reg(); | 2290 const Register instantiator_reg = locs()->in(0).reg(); |
2291 const Register result_reg = locs()->out(0).reg(); | 2291 const Register result_reg = locs()->out(0).reg(); |
2292 | 2292 |
2293 // 'instantiator_reg' is the instantiator TypeArguments object (or null). | 2293 // 'instantiator_reg' is the instantiator TypeArguments object (or null). |
2294 // A runtime call to instantiate the type is required. | 2294 // A runtime call to instantiate the type is required. |
2295 __ PushObject(Object::null_object(), PP); // Make room for the result. | 2295 __ PushObject(Object::null_object(), PP); // Make room for the result. |
2296 __ PushObject(type(), PP); | 2296 __ PushObject(type(), PP); |
2297 __ Push(instantiator_reg); // Push instantiator type arguments. | 2297 __ Push(instantiator_reg); // Push instantiator type arguments. |
2298 compiler->GenerateRuntimeCall(token_pos(), | 2298 compiler->GenerateRuntimeCall(token_pos(), |
2299 deopt_id(), | 2299 deopt_id(), |
2300 kInstantiateTypeRuntimeEntry, | 2300 kInstantiateTypeRuntimeEntry, |
2301 2, | 2301 2, |
2302 locs()); | 2302 locs()); |
2303 __ Drop(2); // Drop instantiator and uninstantiated type. | 2303 __ Drop(2); // Drop instantiator and uninstantiated type. |
2304 __ Pop(result_reg); // Pop instantiated type. | 2304 __ Pop(result_reg); // Pop instantiated type. |
2305 ASSERT(instantiator_reg == result_reg); | 2305 ASSERT(instantiator_reg == result_reg); |
2306 } | 2306 } |
2307 | 2307 |
2308 | 2308 |
2309 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( | 2309 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( |
2310 Isolate* isolate, bool opt) const { | 2310 Zone* zone, bool opt) const { |
2311 const intptr_t kNumInputs = 1; | 2311 const intptr_t kNumInputs = 1; |
2312 const intptr_t kNumTemps = 0; | 2312 const intptr_t kNumTemps = 0; |
2313 LocationSummary* locs = new(isolate) LocationSummary( | 2313 LocationSummary* locs = new(zone) LocationSummary( |
2314 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2314 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2315 locs->set_in(0, Location::RegisterLocation(R0)); | 2315 locs->set_in(0, Location::RegisterLocation(R0)); |
2316 locs->set_out(0, Location::RegisterLocation(R0)); | 2316 locs->set_out(0, Location::RegisterLocation(R0)); |
2317 return locs; | 2317 return locs; |
2318 } | 2318 } |
2319 | 2319 |
2320 | 2320 |
2321 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 2321 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
2322 FlowGraphCompiler* compiler) { | 2322 FlowGraphCompiler* compiler) { |
2323 const Register instantiator_reg = locs()->in(0).reg(); | 2323 const Register instantiator_reg = locs()->in(0).reg(); |
2324 const Register result_reg = locs()->out(0).reg(); | 2324 const Register result_reg = locs()->out(0).reg(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 kInstantiateTypeArgumentsRuntimeEntry, | 2368 kInstantiateTypeArgumentsRuntimeEntry, |
2369 2, | 2369 2, |
2370 locs()); | 2370 locs()); |
2371 __ Drop(2); // Drop instantiator and uninstantiated type arguments. | 2371 __ Drop(2); // Drop instantiator and uninstantiated type arguments. |
2372 __ Pop(result_reg); // Pop instantiated type arguments. | 2372 __ Pop(result_reg); // Pop instantiated type arguments. |
2373 __ Bind(&type_arguments_instantiated); | 2373 __ Bind(&type_arguments_instantiated); |
2374 } | 2374 } |
2375 | 2375 |
2376 | 2376 |
2377 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary( | 2377 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary( |
2378 Isolate* isolate, | 2378 Zone* zone, |
2379 bool opt) const { | 2379 bool opt) const { |
2380 ASSERT(opt); | 2380 ASSERT(opt); |
2381 const intptr_t kNumInputs = 0; | 2381 const intptr_t kNumInputs = 0; |
2382 const intptr_t kNumTemps = 3; | 2382 const intptr_t kNumTemps = 3; |
2383 LocationSummary* locs = new(isolate) LocationSummary( | 2383 LocationSummary* locs = new(zone) LocationSummary( |
2384 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 2384 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
2385 locs->set_temp(0, Location::RegisterLocation(R1)); | 2385 locs->set_temp(0, Location::RegisterLocation(R1)); |
2386 locs->set_temp(1, Location::RegisterLocation(R2)); | 2386 locs->set_temp(1, Location::RegisterLocation(R2)); |
2387 locs->set_temp(2, Location::RegisterLocation(R3)); | 2387 locs->set_temp(2, Location::RegisterLocation(R3)); |
2388 locs->set_out(0, Location::RegisterLocation(R0)); | 2388 locs->set_out(0, Location::RegisterLocation(R0)); |
2389 return locs; | 2389 return locs; |
2390 } | 2390 } |
2391 | 2391 |
2392 | 2392 |
2393 class AllocateContextSlowPath : public SlowPathCode { | 2393 class AllocateContextSlowPath : public SlowPathCode { |
2394 public: | 2394 public: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 temp2); | 2441 temp2); |
2442 | 2442 |
2443 // Setup up number of context variables field. | 2443 // Setup up number of context variables field. |
2444 __ LoadImmediate(temp0, num_context_variables(), PP); | 2444 __ LoadImmediate(temp0, num_context_variables(), PP); |
2445 __ str(temp0, FieldAddress(result, Context::num_variables_offset())); | 2445 __ str(temp0, FieldAddress(result, Context::num_variables_offset())); |
2446 | 2446 |
2447 __ Bind(slow_path->exit_label()); | 2447 __ Bind(slow_path->exit_label()); |
2448 } | 2448 } |
2449 | 2449 |
2450 | 2450 |
2451 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate, | 2451 LocationSummary* AllocateContextInstr::MakeLocationSummary(Zone* zone, |
2452 bool opt) const { | 2452 bool opt) const { |
2453 const intptr_t kNumInputs = 0; | 2453 const intptr_t kNumInputs = 0; |
2454 const intptr_t kNumTemps = 1; | 2454 const intptr_t kNumTemps = 1; |
2455 LocationSummary* locs = new(isolate) LocationSummary( | 2455 LocationSummary* locs = new(zone) LocationSummary( |
2456 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2456 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2457 locs->set_temp(0, Location::RegisterLocation(R1)); | 2457 locs->set_temp(0, Location::RegisterLocation(R1)); |
2458 locs->set_out(0, Location::RegisterLocation(R0)); | 2458 locs->set_out(0, Location::RegisterLocation(R0)); |
2459 return locs; | 2459 return locs; |
2460 } | 2460 } |
2461 | 2461 |
2462 | 2462 |
2463 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2463 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2464 ASSERT(locs()->temp(0).reg() == R1); | 2464 ASSERT(locs()->temp(0).reg() == R1); |
2465 ASSERT(locs()->out(0).reg() == R0); | 2465 ASSERT(locs()->out(0).reg() == R0); |
2466 | 2466 |
2467 __ LoadImmediate(R1, num_context_variables(), PP); | 2467 __ LoadImmediate(R1, num_context_variables(), PP); |
2468 StubCode* stub_code = compiler->isolate()->stub_code(); | 2468 StubCode* stub_code = compiler->isolate()->stub_code(); |
2469 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); | 2469 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); |
2470 compiler->GenerateCall(token_pos(), | 2470 compiler->GenerateCall(token_pos(), |
2471 &label, | 2471 &label, |
2472 RawPcDescriptors::kOther, | 2472 RawPcDescriptors::kOther, |
2473 locs()); | 2473 locs()); |
2474 } | 2474 } |
2475 | 2475 |
2476 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate, | 2476 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Zone* zone, |
2477 bool opt) const { | 2477 bool opt) const { |
2478 const intptr_t kNumInputs = 1; | 2478 const intptr_t kNumInputs = 1; |
2479 const intptr_t kNumTemps = 1; | 2479 const intptr_t kNumTemps = 1; |
2480 LocationSummary* locs = new(isolate) LocationSummary( | 2480 LocationSummary* locs = new(zone) LocationSummary( |
2481 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2481 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2482 locs->set_in(0, Location::RegisterLocation(R0)); | 2482 locs->set_in(0, Location::RegisterLocation(R0)); |
2483 locs->set_temp(0, Location::RegisterLocation(R1)); | 2483 locs->set_temp(0, Location::RegisterLocation(R1)); |
2484 return locs; | 2484 return locs; |
2485 } | 2485 } |
2486 | 2486 |
2487 | 2487 |
2488 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2488 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2489 Register field = locs()->in(0).reg(); | 2489 Register field = locs()->in(0).reg(); |
2490 Register temp = locs()->temp(0).reg(); | 2490 Register temp = locs()->temp(0).reg(); |
2491 Label call_runtime, no_call; | 2491 Label call_runtime, no_call; |
(...skipping 11 matching lines...) Expand all Loading... |
2503 compiler->GenerateRuntimeCall(token_pos(), | 2503 compiler->GenerateRuntimeCall(token_pos(), |
2504 deopt_id(), | 2504 deopt_id(), |
2505 kInitStaticFieldRuntimeEntry, | 2505 kInitStaticFieldRuntimeEntry, |
2506 1, | 2506 1, |
2507 locs()); | 2507 locs()); |
2508 __ Drop(2); // Remove argument and result placeholder. | 2508 __ Drop(2); // Remove argument and result placeholder. |
2509 __ Bind(&no_call); | 2509 __ Bind(&no_call); |
2510 } | 2510 } |
2511 | 2511 |
2512 | 2512 |
2513 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, | 2513 LocationSummary* CloneContextInstr::MakeLocationSummary(Zone* zone, |
2514 bool opt) const { | 2514 bool opt) const { |
2515 const intptr_t kNumInputs = 1; | 2515 const intptr_t kNumInputs = 1; |
2516 const intptr_t kNumTemps = 0; | 2516 const intptr_t kNumTemps = 0; |
2517 LocationSummary* locs = new(isolate) LocationSummary( | 2517 LocationSummary* locs = new(zone) LocationSummary( |
2518 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 2518 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
2519 locs->set_in(0, Location::RegisterLocation(R0)); | 2519 locs->set_in(0, Location::RegisterLocation(R0)); |
2520 locs->set_out(0, Location::RegisterLocation(R0)); | 2520 locs->set_out(0, Location::RegisterLocation(R0)); |
2521 return locs; | 2521 return locs; |
2522 } | 2522 } |
2523 | 2523 |
2524 | 2524 |
2525 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2525 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2526 const Register context_value = locs()->in(0).reg(); | 2526 const Register context_value = locs()->in(0).reg(); |
2527 const Register result = locs()->out(0).reg(); | 2527 const Register result = locs()->out(0).reg(); |
2528 | 2528 |
2529 __ PushObject(Object::null_object(), PP); // Make room for the result. | 2529 __ PushObject(Object::null_object(), PP); // Make room for the result. |
2530 __ Push(context_value); | 2530 __ Push(context_value); |
2531 compiler->GenerateRuntimeCall(token_pos(), | 2531 compiler->GenerateRuntimeCall(token_pos(), |
2532 deopt_id(), | 2532 deopt_id(), |
2533 kCloneContextRuntimeEntry, | 2533 kCloneContextRuntimeEntry, |
2534 1, | 2534 1, |
2535 locs()); | 2535 locs()); |
2536 __ Drop(1); // Remove argument. | 2536 __ Drop(1); // Remove argument. |
2537 __ Pop(result); // Get result (cloned context). | 2537 __ Pop(result); // Get result (cloned context). |
2538 } | 2538 } |
2539 | 2539 |
2540 | 2540 |
2541 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate, | 2541 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Zone* zone, |
2542 bool opt) const { | 2542 bool opt) const { |
2543 UNREACHABLE(); | 2543 UNREACHABLE(); |
2544 return NULL; | 2544 return NULL; |
2545 } | 2545 } |
2546 | 2546 |
2547 | 2547 |
2548 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2548 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2549 __ Bind(compiler->GetJumpLabel(this)); | 2549 __ Bind(compiler->GetJumpLabel(this)); |
2550 compiler->AddExceptionHandler(catch_try_index(), | 2550 compiler->AddExceptionHandler(catch_try_index(), |
2551 try_index(), | 2551 try_index(), |
(...skipping 17 matching lines...) Expand all Loading... |
2569 | 2569 |
2570 // Restore stack and initialize the two exception variables: | 2570 // Restore stack and initialize the two exception variables: |
2571 // exception and stack trace variables. | 2571 // exception and stack trace variables. |
2572 __ StoreToOffset(kExceptionObjectReg, | 2572 __ StoreToOffset(kExceptionObjectReg, |
2573 FP, exception_var().index() * kWordSize, PP); | 2573 FP, exception_var().index() * kWordSize, PP); |
2574 __ StoreToOffset(kStackTraceObjectReg, | 2574 __ StoreToOffset(kStackTraceObjectReg, |
2575 FP, stacktrace_var().index() * kWordSize, PP); | 2575 FP, stacktrace_var().index() * kWordSize, PP); |
2576 } | 2576 } |
2577 | 2577 |
2578 | 2578 |
2579 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate, | 2579 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Zone* zone, |
2580 bool opt) const { | 2580 bool opt) const { |
2581 const intptr_t kNumInputs = 0; | 2581 const intptr_t kNumInputs = 0; |
2582 const intptr_t kNumTemps = 1; | 2582 const intptr_t kNumTemps = 1; |
2583 LocationSummary* summary = new(isolate) LocationSummary( | 2583 LocationSummary* summary = new(zone) LocationSummary( |
2584 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 2584 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
2585 summary->set_temp(0, Location::RequiresRegister()); | 2585 summary->set_temp(0, Location::RequiresRegister()); |
2586 return summary; | 2586 return summary; |
2587 } | 2587 } |
2588 | 2588 |
2589 | 2589 |
2590 class CheckStackOverflowSlowPath : public SlowPathCode { | 2590 class CheckStackOverflowSlowPath : public SlowPathCode { |
2591 public: | 2591 public: |
2592 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2592 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
2593 : instruction_(instruction) { } | 2593 : instruction_(instruction) { } |
2594 | 2594 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2781 __ b(deopt, NE); // Overflow. | 2781 __ b(deopt, NE); // Overflow. |
2782 // Shift for result now we know there is no overflow. | 2782 // Shift for result now we know there is no overflow. |
2783 __ lslv(result, left, TMP); | 2783 __ lslv(result, left, TMP); |
2784 } | 2784 } |
2785 if (FLAG_throw_on_javascript_int_overflow) { | 2785 if (FLAG_throw_on_javascript_int_overflow) { |
2786 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); | 2786 EmitJavascriptOverflowCheck(compiler, shift_left->range(), deopt, result); |
2787 } | 2787 } |
2788 } | 2788 } |
2789 | 2789 |
2790 | 2790 |
2791 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate, | 2791 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone, |
2792 bool opt) const { | 2792 bool opt) const { |
2793 const intptr_t kNumInputs = 2; | 2793 const intptr_t kNumInputs = 2; |
2794 const intptr_t kNumTemps = | 2794 const intptr_t kNumTemps = |
2795 (((op_kind() == Token::kSHL) && can_overflow()) || | 2795 (((op_kind() == Token::kSHL) && can_overflow()) || |
2796 (op_kind() == Token::kSHR)) ? 1 : 0; | 2796 (op_kind() == Token::kSHR)) ? 1 : 0; |
2797 LocationSummary* summary = new(isolate) LocationSummary( | 2797 LocationSummary* summary = new(zone) LocationSummary( |
2798 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2798 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
2799 if (op_kind() == Token::kTRUNCDIV) { | 2799 if (op_kind() == Token::kTRUNCDIV) { |
2800 summary->set_in(0, Location::RequiresRegister()); | 2800 summary->set_in(0, Location::RequiresRegister()); |
2801 if (RightIsPowerOfTwoConstant()) { | 2801 if (RightIsPowerOfTwoConstant()) { |
2802 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 2802 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
2803 summary->set_in(1, Location::Constant(right_constant)); | 2803 summary->set_in(1, Location::Constant(right_constant)); |
2804 } else { | 2804 } else { |
2805 summary->set_in(1, Location::RequiresRegister()); | 2805 summary->set_in(1, Location::RequiresRegister()); |
2806 } | 2806 } |
2807 summary->set_out(0, Location::RequiresRegister()); | 2807 summary->set_out(0, Location::RequiresRegister()); |
2808 return summary; | 2808 return summary; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 default: | 3064 default: |
3065 UNREACHABLE(); | 3065 UNREACHABLE(); |
3066 break; | 3066 break; |
3067 } | 3067 } |
3068 if (FLAG_throw_on_javascript_int_overflow) { | 3068 if (FLAG_throw_on_javascript_int_overflow) { |
3069 EmitJavascriptOverflowCheck(compiler, range(), deopt, result); | 3069 EmitJavascriptOverflowCheck(compiler, range(), deopt, result); |
3070 } | 3070 } |
3071 } | 3071 } |
3072 | 3072 |
3073 | 3073 |
3074 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, | 3074 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone, |
3075 bool opt) const { | 3075 bool opt) const { |
3076 intptr_t left_cid = left()->Type()->ToCid(); | 3076 intptr_t left_cid = left()->Type()->ToCid(); |
3077 intptr_t right_cid = right()->Type()->ToCid(); | 3077 intptr_t right_cid = right()->Type()->ToCid(); |
3078 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3078 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
3079 const intptr_t kNumInputs = 2; | 3079 const intptr_t kNumInputs = 2; |
3080 const intptr_t kNumTemps = 0; | 3080 const intptr_t kNumTemps = 0; |
3081 LocationSummary* summary = new(isolate) LocationSummary( | 3081 LocationSummary* summary = new(zone) LocationSummary( |
3082 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3082 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3083 summary->set_in(0, Location::RequiresRegister()); | 3083 summary->set_in(0, Location::RequiresRegister()); |
3084 summary->set_in(1, Location::RequiresRegister()); | 3084 summary->set_in(1, Location::RequiresRegister()); |
3085 return summary; | 3085 return summary; |
3086 } | 3086 } |
3087 | 3087 |
3088 | 3088 |
3089 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3089 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3090 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3090 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
3091 ICData::kDeoptBinaryDoubleOp, | 3091 ICData::kDeoptBinaryDoubleOp, |
3092 licm_hoisted_ ? ICData::kHoisted : 0); | 3092 licm_hoisted_ ? ICData::kHoisted : 0); |
3093 intptr_t left_cid = left()->Type()->ToCid(); | 3093 intptr_t left_cid = left()->Type()->ToCid(); |
3094 intptr_t right_cid = right()->Type()->ToCid(); | 3094 intptr_t right_cid = right()->Type()->ToCid(); |
3095 const Register left = locs()->in(0).reg(); | 3095 const Register left = locs()->in(0).reg(); |
3096 const Register right = locs()->in(1).reg(); | 3096 const Register right = locs()->in(1).reg(); |
3097 if (left_cid == kSmiCid) { | 3097 if (left_cid == kSmiCid) { |
3098 __ tsti(right, Immediate(kSmiTagMask)); | 3098 __ tsti(right, Immediate(kSmiTagMask)); |
3099 } else if (right_cid == kSmiCid) { | 3099 } else if (right_cid == kSmiCid) { |
3100 __ tsti(left, Immediate(kSmiTagMask)); | 3100 __ tsti(left, Immediate(kSmiTagMask)); |
3101 } else { | 3101 } else { |
3102 __ orr(TMP, left, Operand(right)); | 3102 __ orr(TMP, left, Operand(right)); |
3103 __ tsti(TMP, Immediate(kSmiTagMask)); | 3103 __ tsti(TMP, Immediate(kSmiTagMask)); |
3104 } | 3104 } |
3105 __ b(deopt, EQ); | 3105 __ b(deopt, EQ); |
3106 } | 3106 } |
3107 | 3107 |
3108 | 3108 |
3109 LocationSummary* BoxInstr::MakeLocationSummary(Isolate* isolate, | 3109 LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone, |
3110 bool opt) const { | 3110 bool opt) const { |
3111 const intptr_t kNumInputs = 1; | 3111 const intptr_t kNumInputs = 1; |
3112 const intptr_t kNumTemps = 1; | 3112 const intptr_t kNumTemps = 1; |
3113 LocationSummary* summary = new(isolate) LocationSummary( | 3113 LocationSummary* summary = new(zone) LocationSummary( |
3114 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); | 3114 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); |
3115 summary->set_in(0, Location::RequiresFpuRegister()); | 3115 summary->set_in(0, Location::RequiresFpuRegister()); |
3116 summary->set_temp(0, Location::RequiresRegister()); | 3116 summary->set_temp(0, Location::RequiresRegister()); |
3117 summary->set_out(0, Location::RequiresRegister()); | 3117 summary->set_out(0, Location::RequiresRegister()); |
3118 return summary; | 3118 return summary; |
3119 } | 3119 } |
3120 | 3120 |
3121 | 3121 |
3122 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3122 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3123 const Register out_reg = locs()->out(0).reg(); | 3123 const Register out_reg = locs()->out(0).reg(); |
3124 const Register temp_reg = locs()->temp(0).reg(); | 3124 const Register temp_reg = locs()->temp(0).reg(); |
(...skipping 15 matching lines...) Expand all Loading... |
3140 case kUnboxedInt32x4: | 3140 case kUnboxedInt32x4: |
3141 __ StoreQFieldToOffset(value, out_reg, ValueOffset(), PP); | 3141 __ StoreQFieldToOffset(value, out_reg, ValueOffset(), PP); |
3142 break; | 3142 break; |
3143 default: | 3143 default: |
3144 UNREACHABLE(); | 3144 UNREACHABLE(); |
3145 break; | 3145 break; |
3146 } | 3146 } |
3147 } | 3147 } |
3148 | 3148 |
3149 | 3149 |
3150 LocationSummary* UnboxInstr::MakeLocationSummary(Isolate* isolate, | 3150 LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone, |
3151 bool opt) const { | 3151 bool opt) const { |
3152 const intptr_t kNumInputs = 1; | 3152 const intptr_t kNumInputs = 1; |
3153 const intptr_t kNumTemps = 0; | 3153 const intptr_t kNumTemps = 0; |
3154 LocationSummary* summary = new(isolate) LocationSummary( | 3154 LocationSummary* summary = new(zone) LocationSummary( |
3155 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3155 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3156 summary->set_in(0, Location::RequiresRegister()); | 3156 summary->set_in(0, Location::RequiresRegister()); |
3157 summary->set_out(0, Location::RequiresFpuRegister()); | 3157 summary->set_out(0, Location::RequiresFpuRegister()); |
3158 return summary; | 3158 return summary; |
3159 } | 3159 } |
3160 | 3160 |
3161 | 3161 |
3162 void UnboxInstr::EmitLoadFromBox(FlowGraphCompiler* compiler) { | 3162 void UnboxInstr::EmitLoadFromBox(FlowGraphCompiler* compiler) { |
3163 const Register box = locs()->in(0).reg(); | 3163 const Register box = locs()->in(0).reg(); |
3164 | 3164 |
3165 switch (representation()) { | 3165 switch (representation()) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3243 Label done; | 3243 Label done; |
3244 __ b(&done); | 3244 __ b(&done); |
3245 __ Bind(&is_smi); | 3245 __ Bind(&is_smi); |
3246 EmitSmiConversion(compiler); | 3246 EmitSmiConversion(compiler); |
3247 __ Bind(&done); | 3247 __ Bind(&done); |
3248 } | 3248 } |
3249 } | 3249 } |
3250 } | 3250 } |
3251 | 3251 |
3252 | 3252 |
3253 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Isolate* isolate, | 3253 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone, |
3254 bool opt) const { | 3254 bool opt) const { |
3255 ASSERT((from_representation() == kUnboxedInt32) || | 3255 ASSERT((from_representation() == kUnboxedInt32) || |
3256 (from_representation() == kUnboxedUint32)); | 3256 (from_representation() == kUnboxedUint32)); |
3257 const intptr_t kNumInputs = 1; | 3257 const intptr_t kNumInputs = 1; |
3258 const intptr_t kNumTemps = 0; | 3258 const intptr_t kNumTemps = 0; |
3259 LocationSummary* summary = new(isolate) LocationSummary( | 3259 LocationSummary* summary = new(zone) LocationSummary( |
3260 isolate, | 3260 zone, |
3261 kNumInputs, | 3261 kNumInputs, |
3262 kNumTemps, | 3262 kNumTemps, |
3263 LocationSummary::kNoCall); | 3263 LocationSummary::kNoCall); |
3264 summary->set_in(0, Location::RequiresRegister()); | 3264 summary->set_in(0, Location::RequiresRegister()); |
3265 summary->set_out(0, Location::RequiresRegister()); | 3265 summary->set_out(0, Location::RequiresRegister()); |
3266 return summary; | 3266 return summary; |
3267 } | 3267 } |
3268 | 3268 |
3269 | 3269 |
3270 void BoxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3270 void BoxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3271 Register value = locs()->in(0).reg(); | 3271 Register value = locs()->in(0).reg(); |
3272 Register out = locs()->out(0).reg(); | 3272 Register out = locs()->out(0).reg(); |
3273 ASSERT(value != out); | 3273 ASSERT(value != out); |
3274 | 3274 |
3275 ASSERT(kSmiTagSize == 1); | 3275 ASSERT(kSmiTagSize == 1); |
3276 // TODO(vegorov) implement and use UBFM/SBFM for this. | 3276 // TODO(vegorov) implement and use UBFM/SBFM for this. |
3277 __ LslImmediate(out, value, 32); | 3277 __ LslImmediate(out, value, 32); |
3278 if (from_representation() == kUnboxedInt32) { | 3278 if (from_representation() == kUnboxedInt32) { |
3279 __ AsrImmediate(out, out, 32 - kSmiTagSize); | 3279 __ AsrImmediate(out, out, 32 - kSmiTagSize); |
3280 } else { | 3280 } else { |
3281 ASSERT(from_representation() == kUnboxedUint32); | 3281 ASSERT(from_representation() == kUnboxedUint32); |
3282 __ LsrImmediate(out, out, 32 - kSmiTagSize); | 3282 __ LsrImmediate(out, out, 32 - kSmiTagSize); |
3283 } | 3283 } |
3284 } | 3284 } |
3285 | 3285 |
3286 | 3286 |
3287 DEFINE_UNIMPLEMENTED_INSTRUCTION(BoxInt64Instr) | 3287 DEFINE_UNIMPLEMENTED_INSTRUCTION(BoxInt64Instr) |
3288 | 3288 |
3289 | 3289 |
3290 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Isolate* isolate, | 3290 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Zone* zone, |
3291 bool opt) const { | 3291 bool opt) const { |
3292 const intptr_t kNumInputs = 1; | 3292 const intptr_t kNumInputs = 1; |
3293 const intptr_t kNumTemps = 0; | 3293 const intptr_t kNumTemps = 0; |
3294 LocationSummary* summary = new(isolate) LocationSummary( | 3294 LocationSummary* summary = new(zone) LocationSummary( |
3295 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3295 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3296 summary->set_in(0, Location::RequiresRegister()); | 3296 summary->set_in(0, Location::RequiresRegister()); |
3297 summary->set_out(0, Location::RequiresRegister()); | 3297 summary->set_out(0, Location::RequiresRegister()); |
3298 return summary; | 3298 return summary; |
3299 } | 3299 } |
3300 | 3300 |
3301 | 3301 |
3302 void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3302 void UnboxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3303 const intptr_t value_cid = value()->Type()->ToCid(); | 3303 const intptr_t value_cid = value()->Type()->ToCid(); |
3304 const Register out = locs()->out(0).reg(); | 3304 const Register out = locs()->out(0).reg(); |
3305 const Register value = locs()->in(0).reg(); | 3305 const Register value = locs()->in(0).reg(); |
(...skipping 18 matching lines...) Expand all Loading... |
3324 // TODO(vegorov): as it is implemented right now truncating unboxing would | 3324 // TODO(vegorov): as it is implemented right now truncating unboxing would |
3325 // leave "garbage" in the higher word. | 3325 // leave "garbage" in the higher word. |
3326 if (!is_truncating() && (deopt != NULL)) { | 3326 if (!is_truncating() && (deopt != NULL)) { |
3327 ASSERT(representation() == kUnboxedInt32); | 3327 ASSERT(representation() == kUnboxedInt32); |
3328 __ cmp(out, Operand(out, SXTW, 0)); | 3328 __ cmp(out, Operand(out, SXTW, 0)); |
3329 __ b(deopt, NE); | 3329 __ b(deopt, NE); |
3330 } | 3330 } |
3331 } | 3331 } |
3332 | 3332 |
3333 | 3333 |
3334 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, | 3334 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Zone* zone, |
3335 bool opt) const { | 3335 bool opt) const { |
3336 const intptr_t kNumInputs = 2; | 3336 const intptr_t kNumInputs = 2; |
3337 const intptr_t kNumTemps = 0; | 3337 const intptr_t kNumTemps = 0; |
3338 LocationSummary* summary = new(isolate) LocationSummary( | 3338 LocationSummary* summary = new(zone) LocationSummary( |
3339 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3339 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3340 summary->set_in(0, Location::RequiresFpuRegister()); | 3340 summary->set_in(0, Location::RequiresFpuRegister()); |
3341 summary->set_in(1, Location::RequiresFpuRegister()); | 3341 summary->set_in(1, Location::RequiresFpuRegister()); |
3342 summary->set_out(0, Location::RequiresFpuRegister()); | 3342 summary->set_out(0, Location::RequiresFpuRegister()); |
3343 return summary; | 3343 return summary; |
3344 } | 3344 } |
3345 | 3345 |
3346 | 3346 |
3347 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3347 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3348 const VRegister left = locs()->in(0).fpu_reg(); | 3348 const VRegister left = locs()->in(0).fpu_reg(); |
3349 const VRegister right = locs()->in(1).fpu_reg(); | 3349 const VRegister right = locs()->in(1).fpu_reg(); |
3350 const VRegister result = locs()->out(0).fpu_reg(); | 3350 const VRegister result = locs()->out(0).fpu_reg(); |
3351 switch (op_kind()) { | 3351 switch (op_kind()) { |
3352 case Token::kADD: __ faddd(result, left, right); break; | 3352 case Token::kADD: __ faddd(result, left, right); break; |
3353 case Token::kSUB: __ fsubd(result, left, right); break; | 3353 case Token::kSUB: __ fsubd(result, left, right); break; |
3354 case Token::kMUL: __ fmuld(result, left, right); break; | 3354 case Token::kMUL: __ fmuld(result, left, right); break; |
3355 case Token::kDIV: __ fdivd(result, left, right); break; | 3355 case Token::kDIV: __ fdivd(result, left, right); break; |
3356 default: UNREACHABLE(); | 3356 default: UNREACHABLE(); |
3357 } | 3357 } |
3358 } | 3358 } |
3359 | 3359 |
3360 | 3360 |
3361 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate, | 3361 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, |
3362 bool opt) const { | 3362 bool opt) const { |
3363 const intptr_t kNumInputs = 2; | 3363 const intptr_t kNumInputs = 2; |
3364 const intptr_t kNumTemps = 0; | 3364 const intptr_t kNumTemps = 0; |
3365 LocationSummary* summary = new(isolate) LocationSummary( | 3365 LocationSummary* summary = new(zone) LocationSummary( |
3366 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3366 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3367 summary->set_in(0, Location::RequiresFpuRegister()); | 3367 summary->set_in(0, Location::RequiresFpuRegister()); |
3368 summary->set_in(1, Location::RequiresFpuRegister()); | 3368 summary->set_in(1, Location::RequiresFpuRegister()); |
3369 summary->set_out(0, Location::RequiresFpuRegister()); | 3369 summary->set_out(0, Location::RequiresFpuRegister()); |
3370 return summary; | 3370 return summary; |
3371 } | 3371 } |
3372 | 3372 |
3373 | 3373 |
3374 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3374 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3375 const VRegister left = locs()->in(0).fpu_reg(); | 3375 const VRegister left = locs()->in(0).fpu_reg(); |
3376 const VRegister right = locs()->in(1).fpu_reg(); | 3376 const VRegister right = locs()->in(1).fpu_reg(); |
3377 const VRegister result = locs()->out(0).fpu_reg(); | 3377 const VRegister result = locs()->out(0).fpu_reg(); |
3378 | 3378 |
3379 switch (op_kind()) { | 3379 switch (op_kind()) { |
3380 case Token::kADD: __ vadds(result, left, right); break; | 3380 case Token::kADD: __ vadds(result, left, right); break; |
3381 case Token::kSUB: __ vsubs(result, left, right); break; | 3381 case Token::kSUB: __ vsubs(result, left, right); break; |
3382 case Token::kMUL: __ vmuls(result, left, right); break; | 3382 case Token::kMUL: __ vmuls(result, left, right); break; |
3383 case Token::kDIV: __ vdivs(result, left, right); break; | 3383 case Token::kDIV: __ vdivs(result, left, right); break; |
3384 default: UNREACHABLE(); | 3384 default: UNREACHABLE(); |
3385 } | 3385 } |
3386 } | 3386 } |
3387 | 3387 |
3388 | 3388 |
3389 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate, | 3389 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Zone* zone, |
3390 bool opt) const { | 3390 bool opt) const { |
3391 const intptr_t kNumInputs = 2; | 3391 const intptr_t kNumInputs = 2; |
3392 const intptr_t kNumTemps = 0; | 3392 const intptr_t kNumTemps = 0; |
3393 LocationSummary* summary = new(isolate) LocationSummary( | 3393 LocationSummary* summary = new(zone) LocationSummary( |
3394 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3394 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3395 summary->set_in(0, Location::RequiresFpuRegister()); | 3395 summary->set_in(0, Location::RequiresFpuRegister()); |
3396 summary->set_in(1, Location::RequiresFpuRegister()); | 3396 summary->set_in(1, Location::RequiresFpuRegister()); |
3397 summary->set_out(0, Location::RequiresFpuRegister()); | 3397 summary->set_out(0, Location::RequiresFpuRegister()); |
3398 return summary; | 3398 return summary; |
3399 } | 3399 } |
3400 | 3400 |
3401 | 3401 |
3402 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3402 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3403 const VRegister left = locs()->in(0).fpu_reg(); | 3403 const VRegister left = locs()->in(0).fpu_reg(); |
3404 const VRegister right = locs()->in(1).fpu_reg(); | 3404 const VRegister right = locs()->in(1).fpu_reg(); |
3405 const VRegister result = locs()->out(0).fpu_reg(); | 3405 const VRegister result = locs()->out(0).fpu_reg(); |
3406 | 3406 |
3407 switch (op_kind()) { | 3407 switch (op_kind()) { |
3408 case Token::kADD: __ vaddd(result, left, right); break; | 3408 case Token::kADD: __ vaddd(result, left, right); break; |
3409 case Token::kSUB: __ vsubd(result, left, right); break; | 3409 case Token::kSUB: __ vsubd(result, left, right); break; |
3410 case Token::kMUL: __ vmuld(result, left, right); break; | 3410 case Token::kMUL: __ vmuld(result, left, right); break; |
3411 case Token::kDIV: __ vdivd(result, left, right); break; | 3411 case Token::kDIV: __ vdivd(result, left, right); break; |
3412 default: UNREACHABLE(); | 3412 default: UNREACHABLE(); |
3413 } | 3413 } |
3414 } | 3414 } |
3415 | 3415 |
3416 | 3416 |
3417 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate, | 3417 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Zone* zone, |
3418 bool opt) const { | 3418 bool opt) const { |
3419 const intptr_t kNumInputs = 1; | 3419 const intptr_t kNumInputs = 1; |
3420 const intptr_t kNumTemps = 0; | 3420 const intptr_t kNumTemps = 0; |
3421 LocationSummary* summary = new LocationSummary( | 3421 LocationSummary* summary = new LocationSummary( |
3422 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3422 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3423 summary->set_in(0, Location::RequiresFpuRegister()); | 3423 summary->set_in(0, Location::RequiresFpuRegister()); |
3424 summary->set_out(0, Location::RequiresFpuRegister()); | 3424 summary->set_out(0, Location::RequiresFpuRegister()); |
3425 return summary; | 3425 return summary; |
3426 } | 3426 } |
3427 | 3427 |
3428 | 3428 |
3429 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3429 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3430 const VRegister value = locs()->in(0).fpu_reg(); | 3430 const VRegister value = locs()->in(0).fpu_reg(); |
3431 const VRegister result = locs()->out(0).fpu_reg(); | 3431 const VRegister result = locs()->out(0).fpu_reg(); |
3432 | 3432 |
(...skipping 29 matching lines...) Expand all Loading... |
3462 __ vinss(result, 1, value, (mask_ >> 2) & 0x3); | 3462 __ vinss(result, 1, value, (mask_ >> 2) & 0x3); |
3463 __ vinss(result, 2, value, (mask_ >> 4) & 0x3); | 3463 __ vinss(result, 2, value, (mask_ >> 4) & 0x3); |
3464 __ vinss(result, 3, value, (mask_ >> 6) & 0x3); | 3464 __ vinss(result, 3, value, (mask_ >> 6) & 0x3); |
3465 } | 3465 } |
3466 break; | 3466 break; |
3467 default: UNREACHABLE(); | 3467 default: UNREACHABLE(); |
3468 } | 3468 } |
3469 } | 3469 } |
3470 | 3470 |
3471 | 3471 |
3472 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate, | 3472 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Zone* zone, |
3473 bool opt) const { | 3473 bool opt) const { |
3474 const intptr_t kNumInputs = 2; | 3474 const intptr_t kNumInputs = 2; |
3475 const intptr_t kNumTemps = 0; | 3475 const intptr_t kNumTemps = 0; |
3476 LocationSummary* summary = new LocationSummary( | 3476 LocationSummary* summary = new LocationSummary( |
3477 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3477 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3478 summary->set_in(0, Location::RequiresFpuRegister()); | 3478 summary->set_in(0, Location::RequiresFpuRegister()); |
3479 summary->set_in(1, Location::RequiresFpuRegister()); | 3479 summary->set_in(1, Location::RequiresFpuRegister()); |
3480 summary->set_out(0, Location::RequiresFpuRegister()); | 3480 summary->set_out(0, Location::RequiresFpuRegister()); |
3481 return summary; | 3481 return summary; |
3482 } | 3482 } |
3483 | 3483 |
3484 | 3484 |
3485 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3485 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3486 const VRegister left = locs()->in(0).fpu_reg(); | 3486 const VRegister left = locs()->in(0).fpu_reg(); |
3487 const VRegister right = locs()->in(1).fpu_reg(); | 3487 const VRegister right = locs()->in(1).fpu_reg(); |
3488 const VRegister result = locs()->out(0).fpu_reg(); | 3488 const VRegister result = locs()->out(0).fpu_reg(); |
3489 | 3489 |
3490 switch (op_kind()) { | 3490 switch (op_kind()) { |
3491 case MethodRecognizer::kFloat32x4ShuffleMix: | 3491 case MethodRecognizer::kFloat32x4ShuffleMix: |
3492 case MethodRecognizer::kInt32x4ShuffleMix: | 3492 case MethodRecognizer::kInt32x4ShuffleMix: |
3493 __ vinss(result, 0, left, mask_ & 0x3); | 3493 __ vinss(result, 0, left, mask_ & 0x3); |
3494 __ vinss(result, 1, left, (mask_ >> 2) & 0x3); | 3494 __ vinss(result, 1, left, (mask_ >> 2) & 0x3); |
3495 __ vinss(result, 2, right, (mask_ >> 4) & 0x3); | 3495 __ vinss(result, 2, right, (mask_ >> 4) & 0x3); |
3496 __ vinss(result, 3, right, (mask_ >> 6) & 0x3); | 3496 __ vinss(result, 3, right, (mask_ >> 6) & 0x3); |
3497 break; | 3497 break; |
3498 default: UNREACHABLE(); | 3498 default: UNREACHABLE(); |
3499 } | 3499 } |
3500 } | 3500 } |
3501 | 3501 |
3502 | 3502 |
3503 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate, | 3503 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Zone* zone, |
3504 bool opt) const { | 3504 bool opt) const { |
3505 const intptr_t kNumInputs = 1; | 3505 const intptr_t kNumInputs = 1; |
3506 const intptr_t kNumTemps = 1; | 3506 const intptr_t kNumTemps = 1; |
3507 LocationSummary* summary = new LocationSummary( | 3507 LocationSummary* summary = new LocationSummary( |
3508 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3508 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3509 summary->set_in(0, Location::RequiresFpuRegister()); | 3509 summary->set_in(0, Location::RequiresFpuRegister()); |
3510 summary->set_temp(0, Location::RequiresRegister()); | 3510 summary->set_temp(0, Location::RequiresRegister()); |
3511 summary->set_out(0, Location::RequiresRegister()); | 3511 summary->set_out(0, Location::RequiresRegister()); |
3512 return summary; | 3512 return summary; |
3513 } | 3513 } |
3514 | 3514 |
3515 | 3515 |
3516 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3516 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3517 const VRegister value = locs()->in(0).fpu_reg(); | 3517 const VRegister value = locs()->in(0).fpu_reg(); |
3518 const Register out = locs()->out(0).reg(); | 3518 const Register out = locs()->out(0).reg(); |
(...skipping 13 matching lines...) Expand all Loading... |
3532 // W lane. | 3532 // W lane. |
3533 __ vmovrs(temp, value, 3); | 3533 __ vmovrs(temp, value, 3); |
3534 __ LsrImmediate(temp, temp, 31); | 3534 __ LsrImmediate(temp, temp, 31); |
3535 __ orr(out, out, Operand(temp, LSL, 3)); | 3535 __ orr(out, out, Operand(temp, LSL, 3)); |
3536 // Tag. | 3536 // Tag. |
3537 __ SmiTag(out); | 3537 __ SmiTag(out); |
3538 } | 3538 } |
3539 | 3539 |
3540 | 3540 |
3541 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( | 3541 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( |
3542 Isolate* isolate, bool opt) const { | 3542 Zone* zone, bool opt) const { |
3543 const intptr_t kNumInputs = 4; | 3543 const intptr_t kNumInputs = 4; |
3544 const intptr_t kNumTemps = 0; | 3544 const intptr_t kNumTemps = 0; |
3545 LocationSummary* summary = new(isolate) LocationSummary( | 3545 LocationSummary* summary = new(zone) LocationSummary( |
3546 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3546 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3547 summary->set_in(0, Location::RequiresFpuRegister()); | 3547 summary->set_in(0, Location::RequiresFpuRegister()); |
3548 summary->set_in(1, Location::RequiresFpuRegister()); | 3548 summary->set_in(1, Location::RequiresFpuRegister()); |
3549 summary->set_in(2, Location::RequiresFpuRegister()); | 3549 summary->set_in(2, Location::RequiresFpuRegister()); |
3550 summary->set_in(3, Location::RequiresFpuRegister()); | 3550 summary->set_in(3, Location::RequiresFpuRegister()); |
3551 summary->set_out(0, Location::RequiresFpuRegister()); | 3551 summary->set_out(0, Location::RequiresFpuRegister()); |
3552 return summary; | 3552 return summary; |
3553 } | 3553 } |
3554 | 3554 |
3555 | 3555 |
3556 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3556 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3557 const VRegister v0 = locs()->in(0).fpu_reg(); | 3557 const VRegister v0 = locs()->in(0).fpu_reg(); |
3558 const VRegister v1 = locs()->in(1).fpu_reg(); | 3558 const VRegister v1 = locs()->in(1).fpu_reg(); |
3559 const VRegister v2 = locs()->in(2).fpu_reg(); | 3559 const VRegister v2 = locs()->in(2).fpu_reg(); |
3560 const VRegister v3 = locs()->in(3).fpu_reg(); | 3560 const VRegister v3 = locs()->in(3).fpu_reg(); |
3561 const VRegister r = locs()->out(0).fpu_reg(); | 3561 const VRegister r = locs()->out(0).fpu_reg(); |
3562 | 3562 |
3563 __ fcvtsd(VTMP, v0); | 3563 __ fcvtsd(VTMP, v0); |
3564 __ vinss(r, 0, VTMP, 0); | 3564 __ vinss(r, 0, VTMP, 0); |
3565 __ fcvtsd(VTMP, v1); | 3565 __ fcvtsd(VTMP, v1); |
3566 __ vinss(r, 1, VTMP, 0); | 3566 __ vinss(r, 1, VTMP, 0); |
3567 __ fcvtsd(VTMP, v2); | 3567 __ fcvtsd(VTMP, v2); |
3568 __ vinss(r, 2, VTMP, 0); | 3568 __ vinss(r, 2, VTMP, 0); |
3569 __ fcvtsd(VTMP, v3); | 3569 __ fcvtsd(VTMP, v3); |
3570 __ vinss(r, 3, VTMP, 0); | 3570 __ vinss(r, 3, VTMP, 0); |
3571 } | 3571 } |
3572 | 3572 |
3573 | 3573 |
3574 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate, | 3574 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Zone* zone, |
3575 bool opt) const { | 3575 bool opt) const { |
3576 const intptr_t kNumInputs = 0; | 3576 const intptr_t kNumInputs = 0; |
3577 const intptr_t kNumTemps = 0; | 3577 const intptr_t kNumTemps = 0; |
3578 LocationSummary* summary = new(isolate) LocationSummary( | 3578 LocationSummary* summary = new(zone) LocationSummary( |
3579 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3579 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3580 summary->set_out(0, Location::RequiresFpuRegister()); | 3580 summary->set_out(0, Location::RequiresFpuRegister()); |
3581 return summary; | 3581 return summary; |
3582 } | 3582 } |
3583 | 3583 |
3584 | 3584 |
3585 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3585 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3586 const VRegister v = locs()->out(0).fpu_reg(); | 3586 const VRegister v = locs()->out(0).fpu_reg(); |
3587 __ veor(v, v, v); | 3587 __ veor(v, v, v); |
3588 } | 3588 } |
3589 | 3589 |
3590 | 3590 |
3591 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate, | 3591 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Zone* zone, |
3592 bool opt) const { | 3592 bool opt) const { |
3593 const intptr_t kNumInputs = 1; | 3593 const intptr_t kNumInputs = 1; |
3594 const intptr_t kNumTemps = 0; | 3594 const intptr_t kNumTemps = 0; |
3595 LocationSummary* summary = new(isolate) LocationSummary( | 3595 LocationSummary* summary = new(zone) LocationSummary( |
3596 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3596 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3597 summary->set_in(0, Location::RequiresFpuRegister()); | 3597 summary->set_in(0, Location::RequiresFpuRegister()); |
3598 summary->set_out(0, Location::RequiresFpuRegister()); | 3598 summary->set_out(0, Location::RequiresFpuRegister()); |
3599 return summary; | 3599 return summary; |
3600 } | 3600 } |
3601 | 3601 |
3602 | 3602 |
3603 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3603 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3604 const VRegister value = locs()->in(0).fpu_reg(); | 3604 const VRegister value = locs()->in(0).fpu_reg(); |
3605 const VRegister result = locs()->out(0).fpu_reg(); | 3605 const VRegister result = locs()->out(0).fpu_reg(); |
3606 | 3606 |
3607 // Convert to Float32. | 3607 // Convert to Float32. |
3608 __ fcvtsd(VTMP, value); | 3608 __ fcvtsd(VTMP, value); |
3609 | 3609 |
3610 // Splat across all lanes. | 3610 // Splat across all lanes. |
3611 __ vdups(result, VTMP, 0); | 3611 __ vdups(result, VTMP, 0); |
3612 } | 3612 } |
3613 | 3613 |
3614 | 3614 |
3615 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate, | 3615 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Zone* zone, |
3616 bool opt) const { | 3616 bool opt) const { |
3617 const intptr_t kNumInputs = 2; | 3617 const intptr_t kNumInputs = 2; |
3618 const intptr_t kNumTemps = 0; | 3618 const intptr_t kNumTemps = 0; |
3619 LocationSummary* summary = new(isolate) LocationSummary( | 3619 LocationSummary* summary = new(zone) LocationSummary( |
3620 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3620 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3621 summary->set_in(0, Location::RequiresFpuRegister()); | 3621 summary->set_in(0, Location::RequiresFpuRegister()); |
3622 summary->set_in(1, Location::RequiresFpuRegister()); | 3622 summary->set_in(1, Location::RequiresFpuRegister()); |
3623 summary->set_out(0, Location::RequiresFpuRegister()); | 3623 summary->set_out(0, Location::RequiresFpuRegister()); |
3624 return summary; | 3624 return summary; |
3625 } | 3625 } |
3626 | 3626 |
3627 | 3627 |
3628 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3628 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3629 const VRegister left = locs()->in(0).fpu_reg(); | 3629 const VRegister left = locs()->in(0).fpu_reg(); |
3630 const VRegister right = locs()->in(1).fpu_reg(); | 3630 const VRegister right = locs()->in(1).fpu_reg(); |
(...skipping 19 matching lines...) Expand all Loading... |
3650 break; | 3650 break; |
3651 case MethodRecognizer::kFloat32x4LessThanOrEqual: | 3651 case MethodRecognizer::kFloat32x4LessThanOrEqual: |
3652 __ vcges(result, right, left); | 3652 __ vcges(result, right, left); |
3653 break; | 3653 break; |
3654 | 3654 |
3655 default: UNREACHABLE(); | 3655 default: UNREACHABLE(); |
3656 } | 3656 } |
3657 } | 3657 } |
3658 | 3658 |
3659 | 3659 |
3660 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Isolate* isolate, | 3660 LocationSummary* Float32x4MinMaxInstr::MakeLocationSummary(Zone* zone, |
3661 bool opt) const { | 3661 bool opt) const { |
3662 const intptr_t kNumInputs = 2; | 3662 const intptr_t kNumInputs = 2; |
3663 const intptr_t kNumTemps = 0; | 3663 const intptr_t kNumTemps = 0; |
3664 LocationSummary* summary = new(isolate) LocationSummary( | 3664 LocationSummary* summary = new(zone) LocationSummary( |
3665 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3665 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3666 summary->set_in(0, Location::RequiresFpuRegister()); | 3666 summary->set_in(0, Location::RequiresFpuRegister()); |
3667 summary->set_in(1, Location::RequiresFpuRegister()); | 3667 summary->set_in(1, Location::RequiresFpuRegister()); |
3668 summary->set_out(0, Location::RequiresFpuRegister()); | 3668 summary->set_out(0, Location::RequiresFpuRegister()); |
3669 return summary; | 3669 return summary; |
3670 } | 3670 } |
3671 | 3671 |
3672 | 3672 |
3673 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3673 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3674 const VRegister left = locs()->in(0).fpu_reg(); | 3674 const VRegister left = locs()->in(0).fpu_reg(); |
3675 const VRegister right = locs()->in(1).fpu_reg(); | 3675 const VRegister right = locs()->in(1).fpu_reg(); |
3676 const VRegister result = locs()->out(0).fpu_reg(); | 3676 const VRegister result = locs()->out(0).fpu_reg(); |
3677 | 3677 |
3678 switch (op_kind()) { | 3678 switch (op_kind()) { |
3679 case MethodRecognizer::kFloat32x4Min: | 3679 case MethodRecognizer::kFloat32x4Min: |
3680 __ vmins(result, left, right); | 3680 __ vmins(result, left, right); |
3681 break; | 3681 break; |
3682 case MethodRecognizer::kFloat32x4Max: | 3682 case MethodRecognizer::kFloat32x4Max: |
3683 __ vmaxs(result, left, right); | 3683 __ vmaxs(result, left, right); |
3684 break; | 3684 break; |
3685 default: UNREACHABLE(); | 3685 default: UNREACHABLE(); |
3686 } | 3686 } |
3687 } | 3687 } |
3688 | 3688 |
3689 | 3689 |
3690 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate, | 3690 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Zone* zone, |
3691 bool opt) const { | 3691 bool opt) const { |
3692 const intptr_t kNumInputs = 1; | 3692 const intptr_t kNumInputs = 1; |
3693 const intptr_t kNumTemps = 0; | 3693 const intptr_t kNumTemps = 0; |
3694 LocationSummary* summary = new(isolate) LocationSummary( | 3694 LocationSummary* summary = new(zone) LocationSummary( |
3695 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3695 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3696 summary->set_in(0, Location::RequiresFpuRegister()); | 3696 summary->set_in(0, Location::RequiresFpuRegister()); |
3697 summary->set_out(0, Location::RequiresFpuRegister()); | 3697 summary->set_out(0, Location::RequiresFpuRegister()); |
3698 return summary; | 3698 return summary; |
3699 } | 3699 } |
3700 | 3700 |
3701 | 3701 |
3702 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3702 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3703 const VRegister left = locs()->in(0).fpu_reg(); | 3703 const VRegister left = locs()->in(0).fpu_reg(); |
3704 const VRegister result = locs()->out(0).fpu_reg(); | 3704 const VRegister result = locs()->out(0).fpu_reg(); |
3705 | 3705 |
3706 switch (op_kind()) { | 3706 switch (op_kind()) { |
3707 case MethodRecognizer::kFloat32x4Sqrt: | 3707 case MethodRecognizer::kFloat32x4Sqrt: |
3708 __ vsqrts(result, left); | 3708 __ vsqrts(result, left); |
3709 break; | 3709 break; |
3710 case MethodRecognizer::kFloat32x4Reciprocal: | 3710 case MethodRecognizer::kFloat32x4Reciprocal: |
3711 __ VRecps(result, left); | 3711 __ VRecps(result, left); |
3712 break; | 3712 break; |
3713 case MethodRecognizer::kFloat32x4ReciprocalSqrt: | 3713 case MethodRecognizer::kFloat32x4ReciprocalSqrt: |
3714 __ VRSqrts(result, left); | 3714 __ VRSqrts(result, left); |
3715 break; | 3715 break; |
3716 default: UNREACHABLE(); | 3716 default: UNREACHABLE(); |
3717 } | 3717 } |
3718 } | 3718 } |
3719 | 3719 |
3720 | 3720 |
3721 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate, | 3721 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Zone* zone, |
3722 bool opt) const { | 3722 bool opt) const { |
3723 const intptr_t kNumInputs = 2; | 3723 const intptr_t kNumInputs = 2; |
3724 const intptr_t kNumTemps = 0; | 3724 const intptr_t kNumTemps = 0; |
3725 LocationSummary* summary = new(isolate) LocationSummary( | 3725 LocationSummary* summary = new(zone) LocationSummary( |
3726 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3726 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3727 summary->set_in(0, Location::RequiresFpuRegister()); | 3727 summary->set_in(0, Location::RequiresFpuRegister()); |
3728 summary->set_in(1, Location::RequiresFpuRegister()); | 3728 summary->set_in(1, Location::RequiresFpuRegister()); |
3729 summary->set_out(0, Location::RequiresFpuRegister()); | 3729 summary->set_out(0, Location::RequiresFpuRegister()); |
3730 return summary; | 3730 return summary; |
3731 } | 3731 } |
3732 | 3732 |
3733 | 3733 |
3734 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3734 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3735 const VRegister left = locs()->in(0).fpu_reg(); | 3735 const VRegister left = locs()->in(0).fpu_reg(); |
3736 const VRegister right = locs()->in(1).fpu_reg(); | 3736 const VRegister right = locs()->in(1).fpu_reg(); |
3737 const VRegister result = locs()->out(0).fpu_reg(); | 3737 const VRegister result = locs()->out(0).fpu_reg(); |
3738 | 3738 |
3739 switch (op_kind()) { | 3739 switch (op_kind()) { |
3740 case MethodRecognizer::kFloat32x4Scale: | 3740 case MethodRecognizer::kFloat32x4Scale: |
3741 __ fcvtsd(VTMP, left); | 3741 __ fcvtsd(VTMP, left); |
3742 __ vdups(result, VTMP, 0); | 3742 __ vdups(result, VTMP, 0); |
3743 __ vmuls(result, result, right); | 3743 __ vmuls(result, result, right); |
3744 break; | 3744 break; |
3745 default: UNREACHABLE(); | 3745 default: UNREACHABLE(); |
3746 } | 3746 } |
3747 } | 3747 } |
3748 | 3748 |
3749 | 3749 |
3750 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate, | 3750 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Zone* zone, |
3751 bool opt) const { | 3751 bool opt) const { |
3752 const intptr_t kNumInputs = 1; | 3752 const intptr_t kNumInputs = 1; |
3753 const intptr_t kNumTemps = 0; | 3753 const intptr_t kNumTemps = 0; |
3754 LocationSummary* summary = new LocationSummary( | 3754 LocationSummary* summary = new LocationSummary( |
3755 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3755 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3756 summary->set_in(0, Location::RequiresFpuRegister()); | 3756 summary->set_in(0, Location::RequiresFpuRegister()); |
3757 summary->set_out(0, Location::RequiresFpuRegister()); | 3757 summary->set_out(0, Location::RequiresFpuRegister()); |
3758 return summary; | 3758 return summary; |
3759 } | 3759 } |
3760 | 3760 |
3761 | 3761 |
3762 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3762 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3763 const VRegister left = locs()->in(0).fpu_reg(); | 3763 const VRegister left = locs()->in(0).fpu_reg(); |
3764 const VRegister result = locs()->out(0).fpu_reg(); | 3764 const VRegister result = locs()->out(0).fpu_reg(); |
3765 | 3765 |
3766 switch (op_kind()) { | 3766 switch (op_kind()) { |
3767 case MethodRecognizer::kFloat32x4Negate: | 3767 case MethodRecognizer::kFloat32x4Negate: |
3768 __ vnegs(result, left); | 3768 __ vnegs(result, left); |
3769 break; | 3769 break; |
3770 case MethodRecognizer::kFloat32x4Absolute: | 3770 case MethodRecognizer::kFloat32x4Absolute: |
3771 __ vabss(result, left); | 3771 __ vabss(result, left); |
3772 break; | 3772 break; |
3773 default: UNREACHABLE(); | 3773 default: UNREACHABLE(); |
3774 } | 3774 } |
3775 } | 3775 } |
3776 | 3776 |
3777 | 3777 |
3778 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate, | 3778 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Zone* zone, |
3779 bool opt) const { | 3779 bool opt) const { |
3780 const intptr_t kNumInputs = 3; | 3780 const intptr_t kNumInputs = 3; |
3781 const intptr_t kNumTemps = 0; | 3781 const intptr_t kNumTemps = 0; |
3782 LocationSummary* summary = new(isolate) LocationSummary( | 3782 LocationSummary* summary = new(zone) LocationSummary( |
3783 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3783 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3784 summary->set_in(0, Location::RequiresFpuRegister()); | 3784 summary->set_in(0, Location::RequiresFpuRegister()); |
3785 summary->set_in(1, Location::RequiresFpuRegister()); | 3785 summary->set_in(1, Location::RequiresFpuRegister()); |
3786 summary->set_in(2, Location::RequiresFpuRegister()); | 3786 summary->set_in(2, Location::RequiresFpuRegister()); |
3787 summary->set_out(0, Location::RequiresFpuRegister()); | 3787 summary->set_out(0, Location::RequiresFpuRegister()); |
3788 return summary; | 3788 return summary; |
3789 } | 3789 } |
3790 | 3790 |
3791 | 3791 |
3792 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3792 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3793 const VRegister left = locs()->in(0).fpu_reg(); | 3793 const VRegister left = locs()->in(0).fpu_reg(); |
3794 const VRegister lower = locs()->in(1).fpu_reg(); | 3794 const VRegister lower = locs()->in(1).fpu_reg(); |
3795 const VRegister upper = locs()->in(2).fpu_reg(); | 3795 const VRegister upper = locs()->in(2).fpu_reg(); |
3796 const VRegister result = locs()->out(0).fpu_reg(); | 3796 const VRegister result = locs()->out(0).fpu_reg(); |
3797 __ vmins(result, left, upper); | 3797 __ vmins(result, left, upper); |
3798 __ vmaxs(result, result, lower); | 3798 __ vmaxs(result, result, lower); |
3799 } | 3799 } |
3800 | 3800 |
3801 | 3801 |
3802 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate, | 3802 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Zone* zone, |
3803 bool opt) const { | 3803 bool opt) const { |
3804 const intptr_t kNumInputs = 2; | 3804 const intptr_t kNumInputs = 2; |
3805 const intptr_t kNumTemps = 0; | 3805 const intptr_t kNumTemps = 0; |
3806 LocationSummary* summary = new LocationSummary( | 3806 LocationSummary* summary = new LocationSummary( |
3807 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3807 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3808 summary->set_in(0, Location::RequiresFpuRegister()); | 3808 summary->set_in(0, Location::RequiresFpuRegister()); |
3809 summary->set_in(1, Location::RequiresFpuRegister()); | 3809 summary->set_in(1, Location::RequiresFpuRegister()); |
3810 summary->set_out(0, Location::RequiresFpuRegister()); | 3810 summary->set_out(0, Location::RequiresFpuRegister()); |
3811 return summary; | 3811 return summary; |
3812 } | 3812 } |
3813 | 3813 |
3814 | 3814 |
3815 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3815 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3816 const VRegister replacement = locs()->in(0).fpu_reg(); | 3816 const VRegister replacement = locs()->in(0).fpu_reg(); |
3817 const VRegister value = locs()->in(1).fpu_reg(); | 3817 const VRegister value = locs()->in(1).fpu_reg(); |
(...skipping 15 matching lines...) Expand all Loading... |
3833 __ vinss(result, 2, VTMP, 0); | 3833 __ vinss(result, 2, VTMP, 0); |
3834 break; | 3834 break; |
3835 case MethodRecognizer::kFloat32x4WithW: | 3835 case MethodRecognizer::kFloat32x4WithW: |
3836 __ vinss(result, 3, VTMP, 0); | 3836 __ vinss(result, 3, VTMP, 0); |
3837 break; | 3837 break; |
3838 default: UNREACHABLE(); | 3838 default: UNREACHABLE(); |
3839 } | 3839 } |
3840 } | 3840 } |
3841 | 3841 |
3842 | 3842 |
3843 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate, | 3843 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Zone* zone, |
3844 bool opt) const { | 3844 bool opt) const { |
3845 const intptr_t kNumInputs = 1; | 3845 const intptr_t kNumInputs = 1; |
3846 const intptr_t kNumTemps = 0; | 3846 const intptr_t kNumTemps = 0; |
3847 LocationSummary* summary = new LocationSummary( | 3847 LocationSummary* summary = new LocationSummary( |
3848 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3848 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3849 summary->set_in(0, Location::RequiresFpuRegister()); | 3849 summary->set_in(0, Location::RequiresFpuRegister()); |
3850 summary->set_out(0, Location::RequiresFpuRegister()); | 3850 summary->set_out(0, Location::RequiresFpuRegister()); |
3851 return summary; | 3851 return summary; |
3852 } | 3852 } |
3853 | 3853 |
3854 | 3854 |
3855 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3855 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3856 const VRegister value = locs()->in(0).fpu_reg(); | 3856 const VRegister value = locs()->in(0).fpu_reg(); |
3857 const VRegister result = locs()->out(0).fpu_reg(); | 3857 const VRegister result = locs()->out(0).fpu_reg(); |
3858 | 3858 |
3859 if (value != result) { | 3859 if (value != result) { |
3860 __ vmov(result, value); | 3860 __ vmov(result, value); |
3861 } | 3861 } |
3862 } | 3862 } |
3863 | 3863 |
3864 | 3864 |
3865 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate, | 3865 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Zone* zone, |
3866 bool opt) const { | 3866 bool opt) const { |
3867 const intptr_t kNumInputs = 1; | 3867 const intptr_t kNumInputs = 1; |
3868 const intptr_t kNumTemps = 0; | 3868 const intptr_t kNumTemps = 0; |
3869 LocationSummary* summary = new(isolate) LocationSummary( | 3869 LocationSummary* summary = new(zone) LocationSummary( |
3870 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3870 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3871 summary->set_in(0, Location::RequiresFpuRegister()); | 3871 summary->set_in(0, Location::RequiresFpuRegister()); |
3872 summary->set_out(0, Location::RequiresFpuRegister()); | 3872 summary->set_out(0, Location::RequiresFpuRegister()); |
3873 return summary; | 3873 return summary; |
3874 } | 3874 } |
3875 | 3875 |
3876 | 3876 |
3877 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3877 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3878 const VRegister value = locs()->in(0).fpu_reg(); | 3878 const VRegister value = locs()->in(0).fpu_reg(); |
3879 const VRegister result = locs()->out(0).fpu_reg(); | 3879 const VRegister result = locs()->out(0).fpu_reg(); |
3880 | 3880 |
3881 switch (op_kind()) { | 3881 switch (op_kind()) { |
3882 case MethodRecognizer::kFloat64x2GetX: | 3882 case MethodRecognizer::kFloat64x2GetX: |
3883 __ vinsd(result, 0, value, 0); | 3883 __ vinsd(result, 0, value, 0); |
3884 break; | 3884 break; |
3885 case MethodRecognizer::kFloat64x2GetY: | 3885 case MethodRecognizer::kFloat64x2GetY: |
3886 __ vinsd(result, 0, value, 1); | 3886 __ vinsd(result, 0, value, 1); |
3887 break; | 3887 break; |
3888 default: UNREACHABLE(); | 3888 default: UNREACHABLE(); |
3889 } | 3889 } |
3890 } | 3890 } |
3891 | 3891 |
3892 | 3892 |
3893 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate, | 3893 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Zone* zone, |
3894 bool opt) const { | 3894 bool opt) const { |
3895 const intptr_t kNumInputs = 0; | 3895 const intptr_t kNumInputs = 0; |
3896 const intptr_t kNumTemps = 0; | 3896 const intptr_t kNumTemps = 0; |
3897 LocationSummary* summary = new(isolate) LocationSummary( | 3897 LocationSummary* summary = new(zone) LocationSummary( |
3898 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3898 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3899 summary->set_out(0, Location::RequiresFpuRegister()); | 3899 summary->set_out(0, Location::RequiresFpuRegister()); |
3900 return summary; | 3900 return summary; |
3901 } | 3901 } |
3902 | 3902 |
3903 | 3903 |
3904 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3904 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3905 const VRegister v = locs()->out(0).fpu_reg(); | 3905 const VRegister v = locs()->out(0).fpu_reg(); |
3906 __ veor(v, v, v); | 3906 __ veor(v, v, v); |
3907 } | 3907 } |
3908 | 3908 |
3909 | 3909 |
3910 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate, | 3910 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Zone* zone, |
3911 bool opt) const { | 3911 bool opt) const { |
3912 const intptr_t kNumInputs = 1; | 3912 const intptr_t kNumInputs = 1; |
3913 const intptr_t kNumTemps = 0; | 3913 const intptr_t kNumTemps = 0; |
3914 LocationSummary* summary = new(isolate) LocationSummary( | 3914 LocationSummary* summary = new(zone) LocationSummary( |
3915 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3915 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3916 summary->set_in(0, Location::RequiresFpuRegister()); | 3916 summary->set_in(0, Location::RequiresFpuRegister()); |
3917 summary->set_out(0, Location::RequiresFpuRegister()); | 3917 summary->set_out(0, Location::RequiresFpuRegister()); |
3918 return summary; | 3918 return summary; |
3919 } | 3919 } |
3920 | 3920 |
3921 | 3921 |
3922 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3922 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3923 const VRegister value = locs()->in(0).fpu_reg(); | 3923 const VRegister value = locs()->in(0).fpu_reg(); |
3924 const VRegister result = locs()->out(0).fpu_reg(); | 3924 const VRegister result = locs()->out(0).fpu_reg(); |
3925 __ vdupd(result, value, 0); | 3925 __ vdupd(result, value, 0); |
3926 } | 3926 } |
3927 | 3927 |
3928 | 3928 |
3929 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( | 3929 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( |
3930 Isolate* isolate, bool opt) const { | 3930 Zone* zone, bool opt) const { |
3931 const intptr_t kNumInputs = 2; | 3931 const intptr_t kNumInputs = 2; |
3932 const intptr_t kNumTemps = 0; | 3932 const intptr_t kNumTemps = 0; |
3933 LocationSummary* summary = new(isolate) LocationSummary( | 3933 LocationSummary* summary = new(zone) LocationSummary( |
3934 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3934 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3935 summary->set_in(0, Location::RequiresFpuRegister()); | 3935 summary->set_in(0, Location::RequiresFpuRegister()); |
3936 summary->set_in(1, Location::RequiresFpuRegister()); | 3936 summary->set_in(1, Location::RequiresFpuRegister()); |
3937 summary->set_out(0, Location::RequiresFpuRegister()); | 3937 summary->set_out(0, Location::RequiresFpuRegister()); |
3938 return summary; | 3938 return summary; |
3939 } | 3939 } |
3940 | 3940 |
3941 | 3941 |
3942 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3942 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3943 const VRegister v0 = locs()->in(0).fpu_reg(); | 3943 const VRegister v0 = locs()->in(0).fpu_reg(); |
3944 const VRegister v1 = locs()->in(1).fpu_reg(); | 3944 const VRegister v1 = locs()->in(1).fpu_reg(); |
3945 const VRegister r = locs()->out(0).fpu_reg(); | 3945 const VRegister r = locs()->out(0).fpu_reg(); |
3946 __ vinsd(r, 0, v0, 0); | 3946 __ vinsd(r, 0, v0, 0); |
3947 __ vinsd(r, 1, v1, 0); | 3947 __ vinsd(r, 1, v1, 0); |
3948 } | 3948 } |
3949 | 3949 |
3950 | 3950 |
3951 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( | 3951 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( |
3952 Isolate* isolate, bool opt) const { | 3952 Zone* zone, bool opt) const { |
3953 const intptr_t kNumInputs = 1; | 3953 const intptr_t kNumInputs = 1; |
3954 const intptr_t kNumTemps = 0; | 3954 const intptr_t kNumTemps = 0; |
3955 LocationSummary* summary = new LocationSummary( | 3955 LocationSummary* summary = new LocationSummary( |
3956 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3956 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3957 summary->set_in(0, Location::RequiresFpuRegister()); | 3957 summary->set_in(0, Location::RequiresFpuRegister()); |
3958 summary->set_out(0, Location::RequiresFpuRegister()); | 3958 summary->set_out(0, Location::RequiresFpuRegister()); |
3959 return summary; | 3959 return summary; |
3960 } | 3960 } |
3961 | 3961 |
3962 | 3962 |
3963 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3963 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3964 const VRegister q = locs()->in(0).fpu_reg(); | 3964 const VRegister q = locs()->in(0).fpu_reg(); |
3965 const VRegister r = locs()->out(0).fpu_reg(); | 3965 const VRegister r = locs()->out(0).fpu_reg(); |
3966 | 3966 |
3967 // Zero register. | 3967 // Zero register. |
3968 __ veor(r, r, r); | 3968 __ veor(r, r, r); |
3969 // Set X lane. | 3969 // Set X lane. |
3970 __ vinsd(VTMP, 0, q, 0); | 3970 __ vinsd(VTMP, 0, q, 0); |
3971 __ fcvtsd(VTMP, VTMP); | 3971 __ fcvtsd(VTMP, VTMP); |
3972 __ vinss(r, 0, VTMP, 0); | 3972 __ vinss(r, 0, VTMP, 0); |
3973 // Set Y lane. | 3973 // Set Y lane. |
3974 __ vinsd(VTMP, 0, q, 1); | 3974 __ vinsd(VTMP, 0, q, 1); |
3975 __ fcvtsd(VTMP, VTMP); | 3975 __ fcvtsd(VTMP, VTMP); |
3976 __ vinss(r, 1, VTMP, 0); | 3976 __ vinss(r, 1, VTMP, 0); |
3977 } | 3977 } |
3978 | 3978 |
3979 | 3979 |
3980 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( | 3980 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( |
3981 Isolate* isolate, bool opt) const { | 3981 Zone* zone, bool opt) const { |
3982 const intptr_t kNumInputs = 1; | 3982 const intptr_t kNumInputs = 1; |
3983 const intptr_t kNumTemps = 0; | 3983 const intptr_t kNumTemps = 0; |
3984 LocationSummary* summary = new LocationSummary( | 3984 LocationSummary* summary = new LocationSummary( |
3985 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3985 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3986 summary->set_in(0, Location::RequiresFpuRegister()); | 3986 summary->set_in(0, Location::RequiresFpuRegister()); |
3987 summary->set_out(0, Location::RequiresFpuRegister()); | 3987 summary->set_out(0, Location::RequiresFpuRegister()); |
3988 return summary; | 3988 return summary; |
3989 } | 3989 } |
3990 | 3990 |
3991 | 3991 |
3992 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3992 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3993 const VRegister q = locs()->in(0).fpu_reg(); | 3993 const VRegister q = locs()->in(0).fpu_reg(); |
3994 const VRegister r = locs()->out(0).fpu_reg(); | 3994 const VRegister r = locs()->out(0).fpu_reg(); |
3995 | 3995 |
3996 // Set X. | 3996 // Set X. |
3997 __ vinss(VTMP, 0, q, 0); | 3997 __ vinss(VTMP, 0, q, 0); |
3998 __ fcvtds(VTMP, VTMP); | 3998 __ fcvtds(VTMP, VTMP); |
3999 __ vinsd(r, 0, VTMP, 0); | 3999 __ vinsd(r, 0, VTMP, 0); |
4000 // Set Y. | 4000 // Set Y. |
4001 __ vinss(VTMP, 0, q, 1); | 4001 __ vinss(VTMP, 0, q, 1); |
4002 __ fcvtds(VTMP, VTMP); | 4002 __ fcvtds(VTMP, VTMP); |
4003 __ vinsd(r, 1, VTMP, 0); | 4003 __ vinsd(r, 1, VTMP, 0); |
4004 } | 4004 } |
4005 | 4005 |
4006 | 4006 |
4007 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate, | 4007 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Zone* zone, |
4008 bool opt) const { | 4008 bool opt) const { |
4009 const intptr_t kNumInputs = 1; | 4009 const intptr_t kNumInputs = 1; |
4010 const intptr_t kNumTemps = 0; | 4010 const intptr_t kNumTemps = 0; |
4011 LocationSummary* summary = new(isolate) LocationSummary( | 4011 LocationSummary* summary = new(zone) LocationSummary( |
4012 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4012 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4013 | 4013 |
4014 if (representation() == kTagged) { | 4014 if (representation() == kTagged) { |
4015 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); | 4015 ASSERT(op_kind() == MethodRecognizer::kFloat64x2GetSignMask); |
4016 summary->set_in(0, Location::RequiresFpuRegister()); | 4016 summary->set_in(0, Location::RequiresFpuRegister()); |
4017 summary->set_out(0, Location::RequiresRegister()); | 4017 summary->set_out(0, Location::RequiresRegister()); |
4018 } else { | 4018 } else { |
4019 summary->set_in(0, Location::RequiresFpuRegister()); | 4019 summary->set_in(0, Location::RequiresFpuRegister()); |
4020 summary->set_out(0, Location::RequiresFpuRegister()); | 4020 summary->set_out(0, Location::RequiresFpuRegister()); |
4021 } | 4021 } |
4022 return summary; | 4022 return summary; |
(...skipping 28 matching lines...) Expand all Loading... |
4051 __ vabsd(result, value); | 4051 __ vabsd(result, value); |
4052 break; | 4052 break; |
4053 case MethodRecognizer::kFloat64x2Sqrt: | 4053 case MethodRecognizer::kFloat64x2Sqrt: |
4054 __ vsqrtd(result, value); | 4054 __ vsqrtd(result, value); |
4055 break; | 4055 break; |
4056 default: UNREACHABLE(); | 4056 default: UNREACHABLE(); |
4057 } | 4057 } |
4058 } | 4058 } |
4059 | 4059 |
4060 | 4060 |
4061 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate, | 4061 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Zone* zone, |
4062 bool opt) const { | 4062 bool opt) const { |
4063 const intptr_t kNumInputs = 2; | 4063 const intptr_t kNumInputs = 2; |
4064 const intptr_t kNumTemps = 0; | 4064 const intptr_t kNumTemps = 0; |
4065 LocationSummary* summary = new LocationSummary( | 4065 LocationSummary* summary = new LocationSummary( |
4066 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4066 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4067 summary->set_in(0, Location::RequiresFpuRegister()); | 4067 summary->set_in(0, Location::RequiresFpuRegister()); |
4068 summary->set_in(1, Location::RequiresFpuRegister()); | 4068 summary->set_in(1, Location::RequiresFpuRegister()); |
4069 summary->set_out(0, Location::SameAsFirstInput()); | 4069 summary->set_out(0, Location::SameAsFirstInput()); |
4070 return summary; | 4070 return summary; |
4071 } | 4071 } |
4072 | 4072 |
4073 | 4073 |
4074 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4074 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4075 const VRegister left = locs()->in(0).fpu_reg(); | 4075 const VRegister left = locs()->in(0).fpu_reg(); |
4076 const VRegister right = locs()->in(1).fpu_reg(); | 4076 const VRegister right = locs()->in(1).fpu_reg(); |
(...skipping 16 matching lines...) Expand all Loading... |
4093 break; | 4093 break; |
4094 case MethodRecognizer::kFloat64x2Max: | 4094 case MethodRecognizer::kFloat64x2Max: |
4095 __ vmaxd(out, left, right); | 4095 __ vmaxd(out, left, right); |
4096 break; | 4096 break; |
4097 default: UNREACHABLE(); | 4097 default: UNREACHABLE(); |
4098 } | 4098 } |
4099 } | 4099 } |
4100 | 4100 |
4101 | 4101 |
4102 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary( | 4102 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary( |
4103 Isolate* isolate, bool opt) const { | 4103 Zone* zone, bool opt) const { |
4104 const intptr_t kNumInputs = 4; | 4104 const intptr_t kNumInputs = 4; |
4105 const intptr_t kNumTemps = 0; | 4105 const intptr_t kNumTemps = 0; |
4106 LocationSummary* summary = new(isolate) LocationSummary( | 4106 LocationSummary* summary = new(zone) LocationSummary( |
4107 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4107 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4108 summary->set_in(0, Location::RequiresRegister()); | 4108 summary->set_in(0, Location::RequiresRegister()); |
4109 summary->set_in(1, Location::RequiresRegister()); | 4109 summary->set_in(1, Location::RequiresRegister()); |
4110 summary->set_in(2, Location::RequiresRegister()); | 4110 summary->set_in(2, Location::RequiresRegister()); |
4111 summary->set_in(3, Location::RequiresRegister()); | 4111 summary->set_in(3, Location::RequiresRegister()); |
4112 summary->set_out(0, Location::RequiresFpuRegister()); | 4112 summary->set_out(0, Location::RequiresFpuRegister()); |
4113 return summary; | 4113 return summary; |
4114 } | 4114 } |
4115 | 4115 |
4116 | 4116 |
4117 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4117 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4118 const Register v0 = locs()->in(0).reg(); | 4118 const Register v0 = locs()->in(0).reg(); |
4119 const Register v1 = locs()->in(1).reg(); | 4119 const Register v1 = locs()->in(1).reg(); |
4120 const Register v2 = locs()->in(2).reg(); | 4120 const Register v2 = locs()->in(2).reg(); |
4121 const Register v3 = locs()->in(3).reg(); | 4121 const Register v3 = locs()->in(3).reg(); |
4122 const VRegister result = locs()->out(0).fpu_reg(); | 4122 const VRegister result = locs()->out(0).fpu_reg(); |
4123 __ veor(result, result, result); | 4123 __ veor(result, result, result); |
4124 __ vinsw(result, 0, v0); | 4124 __ vinsw(result, 0, v0); |
4125 __ vinsw(result, 1, v1); | 4125 __ vinsw(result, 1, v1); |
4126 __ vinsw(result, 2, v2); | 4126 __ vinsw(result, 2, v2); |
4127 __ vinsw(result, 3, v3); | 4127 __ vinsw(result, 3, v3); |
4128 } | 4128 } |
4129 | 4129 |
4130 | 4130 |
4131 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( | 4131 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( |
4132 Isolate* isolate, bool opt) const { | 4132 Zone* zone, bool opt) const { |
4133 const intptr_t kNumInputs = 4; | 4133 const intptr_t kNumInputs = 4; |
4134 const intptr_t kNumTemps = 1; | 4134 const intptr_t kNumTemps = 1; |
4135 LocationSummary* summary = new LocationSummary( | 4135 LocationSummary* summary = new LocationSummary( |
4136 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4136 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4137 summary->set_in(0, Location::RequiresRegister()); | 4137 summary->set_in(0, Location::RequiresRegister()); |
4138 summary->set_in(1, Location::RequiresRegister()); | 4138 summary->set_in(1, Location::RequiresRegister()); |
4139 summary->set_in(2, Location::RequiresRegister()); | 4139 summary->set_in(2, Location::RequiresRegister()); |
4140 summary->set_in(3, Location::RequiresRegister()); | 4140 summary->set_in(3, Location::RequiresRegister()); |
4141 summary->set_temp(0, Location::RequiresRegister()); | 4141 summary->set_temp(0, Location::RequiresRegister()); |
4142 summary->set_out(0, Location::RequiresFpuRegister()); | 4142 summary->set_out(0, Location::RequiresFpuRegister()); |
4143 return summary; | 4143 return summary; |
4144 } | 4144 } |
4145 | 4145 |
4146 | 4146 |
(...skipping 24 matching lines...) Expand all Loading... |
4171 __ csel(TMP, temp, ZR, EQ); | 4171 __ csel(TMP, temp, ZR, EQ); |
4172 __ vinsw(result, 2, TMP); | 4172 __ vinsw(result, 2, TMP); |
4173 | 4173 |
4174 // __ CompareObject(v3, Bool::True(), PP); | 4174 // __ CompareObject(v3, Bool::True(), PP); |
4175 __ CompareRegisters(v3, TMP2); | 4175 __ CompareRegisters(v3, TMP2); |
4176 __ csel(TMP, temp, ZR, EQ); | 4176 __ csel(TMP, temp, ZR, EQ); |
4177 __ vinsw(result, 3, TMP); | 4177 __ vinsw(result, 3, TMP); |
4178 } | 4178 } |
4179 | 4179 |
4180 | 4180 |
4181 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate, | 4181 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Zone* zone, |
4182 bool opt) const { | 4182 bool opt) const { |
4183 const intptr_t kNumInputs = 1; | 4183 const intptr_t kNumInputs = 1; |
4184 const intptr_t kNumTemps = 0; | 4184 const intptr_t kNumTemps = 0; |
4185 LocationSummary* summary = new LocationSummary( | 4185 LocationSummary* summary = new LocationSummary( |
4186 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4186 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4187 summary->set_in(0, Location::RequiresFpuRegister()); | 4187 summary->set_in(0, Location::RequiresFpuRegister()); |
4188 summary->set_out(0, Location::RequiresRegister()); | 4188 summary->set_out(0, Location::RequiresRegister()); |
4189 return summary; | 4189 return summary; |
4190 } | 4190 } |
4191 | 4191 |
4192 | 4192 |
4193 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4193 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4194 const VRegister value = locs()->in(0).fpu_reg(); | 4194 const VRegister value = locs()->in(0).fpu_reg(); |
4195 const Register result = locs()->out(0).reg(); | 4195 const Register result = locs()->out(0).reg(); |
4196 | 4196 |
(...skipping 13 matching lines...) Expand all Loading... |
4210 default: UNREACHABLE(); | 4210 default: UNREACHABLE(); |
4211 } | 4211 } |
4212 | 4212 |
4213 __ tst(result, Operand(result)); | 4213 __ tst(result, Operand(result)); |
4214 __ LoadObject(result, Bool::True(), PP); | 4214 __ LoadObject(result, Bool::True(), PP); |
4215 __ LoadObject(TMP, Bool::False(), PP); | 4215 __ LoadObject(TMP, Bool::False(), PP); |
4216 __ csel(result, TMP, result, EQ); | 4216 __ csel(result, TMP, result, EQ); |
4217 } | 4217 } |
4218 | 4218 |
4219 | 4219 |
4220 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate, | 4220 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Zone* zone, |
4221 bool opt) const { | 4221 bool opt) const { |
4222 const intptr_t kNumInputs = 3; | 4222 const intptr_t kNumInputs = 3; |
4223 const intptr_t kNumTemps = 1; | 4223 const intptr_t kNumTemps = 1; |
4224 LocationSummary* summary = new LocationSummary( | 4224 LocationSummary* summary = new LocationSummary( |
4225 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4225 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4226 summary->set_in(0, Location::RequiresFpuRegister()); | 4226 summary->set_in(0, Location::RequiresFpuRegister()); |
4227 summary->set_in(1, Location::RequiresFpuRegister()); | 4227 summary->set_in(1, Location::RequiresFpuRegister()); |
4228 summary->set_in(2, Location::RequiresFpuRegister()); | 4228 summary->set_in(2, Location::RequiresFpuRegister()); |
4229 summary->set_temp(0, Location::RequiresFpuRegister()); | 4229 summary->set_temp(0, Location::RequiresFpuRegister()); |
4230 summary->set_out(0, Location::RequiresFpuRegister()); | 4230 summary->set_out(0, Location::RequiresFpuRegister()); |
4231 return summary; | 4231 return summary; |
4232 } | 4232 } |
4233 | 4233 |
4234 | 4234 |
4235 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4235 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4236 const VRegister mask = locs()->in(0).fpu_reg(); | 4236 const VRegister mask = locs()->in(0).fpu_reg(); |
4237 const VRegister trueValue = locs()->in(1).fpu_reg(); | 4237 const VRegister trueValue = locs()->in(1).fpu_reg(); |
4238 const VRegister falseValue = locs()->in(2).fpu_reg(); | 4238 const VRegister falseValue = locs()->in(2).fpu_reg(); |
4239 const VRegister out = locs()->out(0).fpu_reg(); | 4239 const VRegister out = locs()->out(0).fpu_reg(); |
4240 const VRegister temp = locs()->temp(0).fpu_reg(); | 4240 const VRegister temp = locs()->temp(0).fpu_reg(); |
4241 | 4241 |
4242 // Copy mask. | 4242 // Copy mask. |
4243 __ vmov(temp, mask); | 4243 __ vmov(temp, mask); |
4244 // Invert it. | 4244 // Invert it. |
4245 __ vnot(temp, temp); | 4245 __ vnot(temp, temp); |
4246 // mask = mask & trueValue. | 4246 // mask = mask & trueValue. |
4247 __ vand(mask, mask, trueValue); | 4247 __ vand(mask, mask, trueValue); |
4248 // temp = temp & falseValue. | 4248 // temp = temp & falseValue. |
4249 __ vand(temp, temp, falseValue); | 4249 __ vand(temp, temp, falseValue); |
4250 // out = mask | temp. | 4250 // out = mask | temp. |
4251 __ vorr(out, mask, temp); | 4251 __ vorr(out, mask, temp); |
4252 } | 4252 } |
4253 | 4253 |
4254 | 4254 |
4255 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate, | 4255 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Zone* zone, |
4256 bool opt) const { | 4256 bool opt) const { |
4257 const intptr_t kNumInputs = 2; | 4257 const intptr_t kNumInputs = 2; |
4258 const intptr_t kNumTemps = 0; | 4258 const intptr_t kNumTemps = 0; |
4259 LocationSummary* summary = new LocationSummary( | 4259 LocationSummary* summary = new LocationSummary( |
4260 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4260 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4261 summary->set_in(0, Location::RequiresFpuRegister()); | 4261 summary->set_in(0, Location::RequiresFpuRegister()); |
4262 summary->set_in(1, Location::RequiresRegister()); | 4262 summary->set_in(1, Location::RequiresRegister()); |
4263 summary->set_out(0, Location::RequiresFpuRegister()); | 4263 summary->set_out(0, Location::RequiresFpuRegister()); |
4264 return summary; | 4264 return summary; |
4265 } | 4265 } |
4266 | 4266 |
4267 | 4267 |
4268 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4268 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4269 const VRegister mask = locs()->in(0).fpu_reg(); | 4269 const VRegister mask = locs()->in(0).fpu_reg(); |
4270 const Register flag = locs()->in(1).reg(); | 4270 const Register flag = locs()->in(1).reg(); |
(...skipping 17 matching lines...) Expand all Loading... |
4288 __ vinsw(result, 2, TMP); | 4288 __ vinsw(result, 2, TMP); |
4289 break; | 4289 break; |
4290 case MethodRecognizer::kInt32x4WithFlagW: | 4290 case MethodRecognizer::kInt32x4WithFlagW: |
4291 __ vinsw(result, 3, TMP); | 4291 __ vinsw(result, 3, TMP); |
4292 break; | 4292 break; |
4293 default: UNREACHABLE(); | 4293 default: UNREACHABLE(); |
4294 } | 4294 } |
4295 } | 4295 } |
4296 | 4296 |
4297 | 4297 |
4298 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate, | 4298 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Zone* zone, |
4299 bool opt) const { | 4299 bool opt) const { |
4300 const intptr_t kNumInputs = 1; | 4300 const intptr_t kNumInputs = 1; |
4301 const intptr_t kNumTemps = 0; | 4301 const intptr_t kNumTemps = 0; |
4302 LocationSummary* summary = new LocationSummary( | 4302 LocationSummary* summary = new LocationSummary( |
4303 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4303 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4304 summary->set_in(0, Location::RequiresFpuRegister()); | 4304 summary->set_in(0, Location::RequiresFpuRegister()); |
4305 summary->set_out(0, Location::RequiresFpuRegister()); | 4305 summary->set_out(0, Location::RequiresFpuRegister()); |
4306 return summary; | 4306 return summary; |
4307 } | 4307 } |
4308 | 4308 |
4309 | 4309 |
4310 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4310 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4311 const VRegister value = locs()->in(0).fpu_reg(); | 4311 const VRegister value = locs()->in(0).fpu_reg(); |
4312 const VRegister result = locs()->out(0).fpu_reg(); | 4312 const VRegister result = locs()->out(0).fpu_reg(); |
4313 | 4313 |
4314 if (value != result) { | 4314 if (value != result) { |
4315 __ vmov(result, value); | 4315 __ vmov(result, value); |
4316 } | 4316 } |
4317 } | 4317 } |
4318 | 4318 |
4319 | 4319 |
4320 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate, | 4320 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Zone* zone, |
4321 bool opt) const { | 4321 bool opt) const { |
4322 const intptr_t kNumInputs = 2; | 4322 const intptr_t kNumInputs = 2; |
4323 const intptr_t kNumTemps = 0; | 4323 const intptr_t kNumTemps = 0; |
4324 LocationSummary* summary = new LocationSummary( | 4324 LocationSummary* summary = new LocationSummary( |
4325 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4325 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4326 summary->set_in(0, Location::RequiresFpuRegister()); | 4326 summary->set_in(0, Location::RequiresFpuRegister()); |
4327 summary->set_in(1, Location::RequiresFpuRegister()); | 4327 summary->set_in(1, Location::RequiresFpuRegister()); |
4328 summary->set_out(0, Location::RequiresFpuRegister()); | 4328 summary->set_out(0, Location::RequiresFpuRegister()); |
4329 return summary; | 4329 return summary; |
4330 } | 4330 } |
4331 | 4331 |
4332 | 4332 |
4333 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4333 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4334 const VRegister left = locs()->in(0).fpu_reg(); | 4334 const VRegister left = locs()->in(0).fpu_reg(); |
4335 const VRegister right = locs()->in(1).fpu_reg(); | 4335 const VRegister right = locs()->in(1).fpu_reg(); |
4336 const VRegister result = locs()->out(0).fpu_reg(); | 4336 const VRegister result = locs()->out(0).fpu_reg(); |
4337 switch (op_kind()) { | 4337 switch (op_kind()) { |
4338 case Token::kBIT_AND: __ vand(result, left, right); break; | 4338 case Token::kBIT_AND: __ vand(result, left, right); break; |
4339 case Token::kBIT_OR: __ vorr(result, left, right); break; | 4339 case Token::kBIT_OR: __ vorr(result, left, right); break; |
4340 case Token::kBIT_XOR: __ veor(result, left, right); break; | 4340 case Token::kBIT_XOR: __ veor(result, left, right); break; |
4341 case Token::kADD: __ vaddw(result, left, right); break; | 4341 case Token::kADD: __ vaddw(result, left, right); break; |
4342 case Token::kSUB: __ vsubw(result, left, right); break; | 4342 case Token::kSUB: __ vsubw(result, left, right); break; |
4343 default: UNREACHABLE(); | 4343 default: UNREACHABLE(); |
4344 } | 4344 } |
4345 } | 4345 } |
4346 | 4346 |
4347 | 4347 |
4348 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate, | 4348 LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone, |
4349 bool opt) const { | 4349 bool opt) const { |
4350 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { | 4350 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { |
4351 const intptr_t kNumInputs = 1; | 4351 const intptr_t kNumInputs = 1; |
4352 const intptr_t kNumTemps = 0; | 4352 const intptr_t kNumTemps = 0; |
4353 LocationSummary* summary = new(isolate) LocationSummary( | 4353 LocationSummary* summary = new(zone) LocationSummary( |
4354 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 4354 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
4355 summary->set_in(0, Location::FpuRegisterLocation(V0)); | 4355 summary->set_in(0, Location::FpuRegisterLocation(V0)); |
4356 summary->set_out(0, Location::FpuRegisterLocation(V0)); | 4356 summary->set_out(0, Location::FpuRegisterLocation(V0)); |
4357 return summary; | 4357 return summary; |
4358 } | 4358 } |
4359 ASSERT((kind() == MathUnaryInstr::kSqrt) || | 4359 ASSERT((kind() == MathUnaryInstr::kSqrt) || |
4360 (kind() == MathUnaryInstr::kDoubleSquare)); | 4360 (kind() == MathUnaryInstr::kDoubleSquare)); |
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 MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4371 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4372 if (kind() == MathUnaryInstr::kSqrt) { | 4372 if (kind() == MathUnaryInstr::kSqrt) { |
4373 const VRegister val = locs()->in(0).fpu_reg(); | 4373 const VRegister val = locs()->in(0).fpu_reg(); |
4374 const VRegister result = locs()->out(0).fpu_reg(); | 4374 const VRegister result = locs()->out(0).fpu_reg(); |
4375 __ fsqrtd(result, val); | 4375 __ fsqrtd(result, val); |
4376 } else if (kind() == MathUnaryInstr::kDoubleSquare) { | 4376 } else if (kind() == MathUnaryInstr::kDoubleSquare) { |
4377 const VRegister val = locs()->in(0).fpu_reg(); | 4377 const VRegister val = locs()->in(0).fpu_reg(); |
4378 const VRegister result = locs()->out(0).fpu_reg(); | 4378 const VRegister result = locs()->out(0).fpu_reg(); |
4379 __ fmuld(result, val, val); | 4379 __ fmuld(result, val, val); |
4380 } else { | 4380 } else { |
4381 ASSERT((kind() == MathUnaryInstr::kSin) || | 4381 ASSERT((kind() == MathUnaryInstr::kSin) || |
4382 (kind() == MathUnaryInstr::kCos)); | 4382 (kind() == MathUnaryInstr::kCos)); |
4383 __ CallRuntime(TargetFunction(), InputCount()); | 4383 __ CallRuntime(TargetFunction(), InputCount()); |
4384 } | 4384 } |
4385 } | 4385 } |
4386 | 4386 |
4387 | 4387 |
4388 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( | 4388 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( |
4389 Isolate* isolate, bool opt) const { | 4389 Zone* zone, bool opt) const { |
4390 const intptr_t kNumTemps = 0; | 4390 const intptr_t kNumTemps = 0; |
4391 LocationSummary* summary = new(isolate) LocationSummary( | 4391 LocationSummary* summary = new(zone) LocationSummary( |
4392 isolate, InputCount(), kNumTemps, LocationSummary::kCall); | 4392 zone, InputCount(), kNumTemps, LocationSummary::kCall); |
4393 summary->set_in(0, Location::RegisterLocation(R0)); | 4393 summary->set_in(0, Location::RegisterLocation(R0)); |
4394 summary->set_in(1, Location::RegisterLocation(R1)); | 4394 summary->set_in(1, Location::RegisterLocation(R1)); |
4395 summary->set_in(2, Location::RegisterLocation(R2)); | 4395 summary->set_in(2, Location::RegisterLocation(R2)); |
4396 summary->set_in(3, Location::RegisterLocation(R3)); | 4396 summary->set_in(3, Location::RegisterLocation(R3)); |
4397 summary->set_out(0, Location::RegisterLocation(R0)); | 4397 summary->set_out(0, Location::RegisterLocation(R0)); |
4398 return summary; | 4398 return summary; |
4399 } | 4399 } |
4400 | 4400 |
4401 | 4401 |
4402 void CaseInsensitiveCompareUC16Instr::EmitNativeCode( | 4402 void CaseInsensitiveCompareUC16Instr::EmitNativeCode( |
4403 FlowGraphCompiler* compiler) { | 4403 FlowGraphCompiler* compiler) { |
4404 | 4404 |
4405 // Call the function. | 4405 // Call the function. |
4406 __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); | 4406 __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); |
4407 } | 4407 } |
4408 | 4408 |
4409 | 4409 |
4410 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, | 4410 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone, |
4411 bool opt) const { | 4411 bool opt) const { |
4412 if (result_cid() == kDoubleCid) { | 4412 if (result_cid() == kDoubleCid) { |
4413 const intptr_t kNumInputs = 2; | 4413 const intptr_t kNumInputs = 2; |
4414 const intptr_t kNumTemps = 0; | 4414 const intptr_t kNumTemps = 0; |
4415 LocationSummary* summary = new(isolate) LocationSummary( | 4415 LocationSummary* summary = new(zone) LocationSummary( |
4416 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4416 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4417 summary->set_in(0, Location::RequiresFpuRegister()); | 4417 summary->set_in(0, Location::RequiresFpuRegister()); |
4418 summary->set_in(1, Location::RequiresFpuRegister()); | 4418 summary->set_in(1, Location::RequiresFpuRegister()); |
4419 // Reuse the left register so that code can be made shorter. | 4419 // Reuse the left register so that code can be made shorter. |
4420 summary->set_out(0, Location::SameAsFirstInput()); | 4420 summary->set_out(0, Location::SameAsFirstInput()); |
4421 return summary; | 4421 return summary; |
4422 } | 4422 } |
4423 ASSERT(result_cid() == kSmiCid); | 4423 ASSERT(result_cid() == kSmiCid); |
4424 const intptr_t kNumInputs = 2; | 4424 const intptr_t kNumInputs = 2; |
4425 const intptr_t kNumTemps = 0; | 4425 const intptr_t kNumTemps = 0; |
4426 LocationSummary* summary = new(isolate) LocationSummary( | 4426 LocationSummary* summary = new(zone) LocationSummary( |
4427 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4427 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4428 summary->set_in(0, Location::RequiresRegister()); | 4428 summary->set_in(0, Location::RequiresRegister()); |
4429 summary->set_in(1, Location::RequiresRegister()); | 4429 summary->set_in(1, Location::RequiresRegister()); |
4430 // Reuse the left register so that code can be made shorter. | 4430 // Reuse the left register so that code can be made shorter. |
4431 summary->set_out(0, Location::SameAsFirstInput()); | 4431 summary->set_out(0, Location::SameAsFirstInput()); |
4432 return summary; | 4432 return summary; |
4433 } | 4433 } |
4434 | 4434 |
4435 | 4435 |
4436 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4436 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4437 ASSERT((op_kind() == MethodRecognizer::kMathMin) || | 4437 ASSERT((op_kind() == MethodRecognizer::kMathMin) || |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4486 __ CompareRegisters(left, right); | 4486 __ CompareRegisters(left, right); |
4487 ASSERT(result == left); | 4487 ASSERT(result == left); |
4488 if (is_min) { | 4488 if (is_min) { |
4489 __ csel(result, right, left, GT); | 4489 __ csel(result, right, left, GT); |
4490 } else { | 4490 } else { |
4491 __ csel(result, right, left, LT); | 4491 __ csel(result, right, left, LT); |
4492 } | 4492 } |
4493 } | 4493 } |
4494 | 4494 |
4495 | 4495 |
4496 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, | 4496 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone, |
4497 bool opt) const { | 4497 bool opt) const { |
4498 const intptr_t kNumInputs = 1; | 4498 const intptr_t kNumInputs = 1; |
4499 const intptr_t kNumTemps = 0; | 4499 const intptr_t kNumTemps = 0; |
4500 LocationSummary* summary = new(isolate) LocationSummary( | 4500 LocationSummary* summary = new(zone) LocationSummary( |
4501 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4501 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4502 summary->set_in(0, Location::RequiresRegister()); | 4502 summary->set_in(0, Location::RequiresRegister()); |
4503 // We make use of 3-operand instructions by not requiring result register | 4503 // We make use of 3-operand instructions by not requiring result register |
4504 // to be identical to first input register as on Intel. | 4504 // to be identical to first input register as on Intel. |
4505 summary->set_out(0, Location::RequiresRegister()); | 4505 summary->set_out(0, Location::RequiresRegister()); |
4506 return summary; | 4506 return summary; |
4507 } | 4507 } |
4508 | 4508 |
4509 | 4509 |
4510 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4510 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4511 const Register value = locs()->in(0).reg(); | 4511 const Register value = locs()->in(0).reg(); |
(...skipping 12 matching lines...) Expand all Loading... |
4524 __ mvn(result, value); | 4524 __ mvn(result, value); |
4525 // Remove inverted smi-tag. | 4525 // Remove inverted smi-tag. |
4526 __ andi(result, result, Immediate(~kSmiTagMask)); | 4526 __ andi(result, result, Immediate(~kSmiTagMask)); |
4527 break; | 4527 break; |
4528 default: | 4528 default: |
4529 UNREACHABLE(); | 4529 UNREACHABLE(); |
4530 } | 4530 } |
4531 } | 4531 } |
4532 | 4532 |
4533 | 4533 |
4534 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, | 4534 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone, |
4535 bool opt) const { | 4535 bool opt) const { |
4536 const intptr_t kNumInputs = 1; | 4536 const intptr_t kNumInputs = 1; |
4537 const intptr_t kNumTemps = 0; | 4537 const intptr_t kNumTemps = 0; |
4538 LocationSummary* summary = new(isolate) LocationSummary( | 4538 LocationSummary* summary = new(zone) LocationSummary( |
4539 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4539 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4540 summary->set_in(0, Location::RequiresFpuRegister()); | 4540 summary->set_in(0, Location::RequiresFpuRegister()); |
4541 summary->set_out(0, Location::RequiresFpuRegister()); | 4541 summary->set_out(0, Location::RequiresFpuRegister()); |
4542 return summary; | 4542 return summary; |
4543 } | 4543 } |
4544 | 4544 |
4545 | 4545 |
4546 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4546 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4547 const VRegister result = locs()->out(0).fpu_reg(); | 4547 const VRegister result = locs()->out(0).fpu_reg(); |
4548 const VRegister value = locs()->in(0).fpu_reg(); | 4548 const VRegister value = locs()->in(0).fpu_reg(); |
4549 __ fnegd(result, value); | 4549 __ fnegd(result, value); |
4550 } | 4550 } |
4551 | 4551 |
4552 | 4552 |
4553 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4553 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone, |
4554 bool opt) const { | 4554 bool opt) const { |
4555 const intptr_t kNumInputs = 1; | 4555 const intptr_t kNumInputs = 1; |
4556 const intptr_t kNumTemps = 0; | 4556 const intptr_t kNumTemps = 0; |
4557 LocationSummary* result = new(isolate) LocationSummary( | 4557 LocationSummary* result = new(zone) LocationSummary( |
4558 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4558 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4559 result->set_in(0, Location::RequiresRegister()); | 4559 result->set_in(0, Location::RequiresRegister()); |
4560 result->set_out(0, Location::RequiresFpuRegister()); | 4560 result->set_out(0, Location::RequiresFpuRegister()); |
4561 return result; | 4561 return result; |
4562 } | 4562 } |
4563 | 4563 |
4564 | 4564 |
4565 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4565 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4566 const Register value = locs()->in(0).reg(); | 4566 const Register value = locs()->in(0).reg(); |
4567 const VRegister result = locs()->out(0).fpu_reg(); | 4567 const VRegister result = locs()->out(0).fpu_reg(); |
4568 __ scvtfdw(result, value); | 4568 __ scvtfdw(result, value); |
4569 } | 4569 } |
4570 | 4570 |
4571 | 4571 |
4572 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4572 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Zone* zone, |
4573 bool opt) const { | 4573 bool opt) const { |
4574 const intptr_t kNumInputs = 1; | 4574 const intptr_t kNumInputs = 1; |
4575 const intptr_t kNumTemps = 0; | 4575 const intptr_t kNumTemps = 0; |
4576 LocationSummary* result = new(isolate) LocationSummary( | 4576 LocationSummary* result = new(zone) LocationSummary( |
4577 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4577 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4578 result->set_in(0, Location::RequiresRegister()); | 4578 result->set_in(0, Location::RequiresRegister()); |
4579 result->set_out(0, Location::RequiresFpuRegister()); | 4579 result->set_out(0, Location::RequiresFpuRegister()); |
4580 return result; | 4580 return result; |
4581 } | 4581 } |
4582 | 4582 |
4583 | 4583 |
4584 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4584 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4585 const Register value = locs()->in(0).reg(); | 4585 const Register value = locs()->in(0).reg(); |
4586 const VRegister result = locs()->out(0).fpu_reg(); | 4586 const VRegister result = locs()->out(0).fpu_reg(); |
4587 __ SmiUntag(TMP, value); | 4587 __ SmiUntag(TMP, value); |
4588 __ scvtfdx(result, TMP); | 4588 __ scvtfdx(result, TMP); |
4589 } | 4589 } |
4590 | 4590 |
4591 | 4591 |
4592 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4592 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Zone* zone, |
4593 bool opt) const { | 4593 bool opt) const { |
4594 UNIMPLEMENTED(); | 4594 UNIMPLEMENTED(); |
4595 return NULL; | 4595 return NULL; |
4596 } | 4596 } |
4597 | 4597 |
4598 | 4598 |
4599 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4599 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4600 UNIMPLEMENTED(); | 4600 UNIMPLEMENTED(); |
4601 } | 4601 } |
4602 | 4602 |
4603 | 4603 |
4604 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate, | 4604 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Zone* zone, |
4605 bool opt) const { | 4605 bool opt) const { |
4606 const intptr_t kNumInputs = 1; | 4606 const intptr_t kNumInputs = 1; |
4607 const intptr_t kNumTemps = 0; | 4607 const intptr_t kNumTemps = 0; |
4608 LocationSummary* result = new(isolate) LocationSummary( | 4608 LocationSummary* result = new(zone) LocationSummary( |
4609 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 4609 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
4610 result->set_in(0, Location::RegisterLocation(R1)); | 4610 result->set_in(0, Location::RegisterLocation(R1)); |
4611 result->set_out(0, Location::RegisterLocation(R0)); | 4611 result->set_out(0, Location::RegisterLocation(R0)); |
4612 return result; | 4612 return result; |
4613 } | 4613 } |
4614 | 4614 |
4615 | 4615 |
4616 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4616 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4617 const Register result = locs()->out(0).reg(); | 4617 const Register result = locs()->out(0).reg(); |
4618 const Register value_obj = locs()->in(0).reg(); | 4618 const Register value_obj = locs()->in(0).reg(); |
4619 ASSERT(result == R0); | 4619 ASSERT(result == R0); |
(...skipping 29 matching lines...) Expand all Loading... |
4649 instance_call()->token_pos(), | 4649 instance_call()->token_pos(), |
4650 target, | 4650 target, |
4651 kNumberOfArguments, | 4651 kNumberOfArguments, |
4652 Object::null_array(), // No argument names., | 4652 Object::null_array(), // No argument names., |
4653 locs(), | 4653 locs(), |
4654 ICData::Handle()); | 4654 ICData::Handle()); |
4655 __ Bind(&done); | 4655 __ Bind(&done); |
4656 } | 4656 } |
4657 | 4657 |
4658 | 4658 |
4659 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate, | 4659 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, |
4660 bool opt) const { | 4660 bool opt) const { |
4661 const intptr_t kNumInputs = 1; | 4661 const intptr_t kNumInputs = 1; |
4662 const intptr_t kNumTemps = 0; | 4662 const intptr_t kNumTemps = 0; |
4663 LocationSummary* result = new(isolate) LocationSummary( | 4663 LocationSummary* result = new(zone) LocationSummary( |
4664 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4664 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4665 result->set_in(0, Location::RequiresFpuRegister()); | 4665 result->set_in(0, Location::RequiresFpuRegister()); |
4666 result->set_out(0, Location::RequiresRegister()); | 4666 result->set_out(0, Location::RequiresRegister()); |
4667 return result; | 4667 return result; |
4668 } | 4668 } |
4669 | 4669 |
4670 | 4670 |
4671 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4671 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4672 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); | 4672 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); |
4673 const Register result = locs()->out(0).reg(); | 4673 const Register result = locs()->out(0).reg(); |
4674 const VRegister value = locs()->in(0).fpu_reg(); | 4674 const VRegister value = locs()->in(0).fpu_reg(); |
4675 // First check for NaN. Checking for minint after the conversion doesn't work | 4675 // First check for NaN. Checking for minint after the conversion doesn't work |
4676 // on ARM64 because fcvtzds gives 0 for NaN. | 4676 // on ARM64 because fcvtzds gives 0 for NaN. |
4677 // TODO(zra): Check spec that this is true. | 4677 // TODO(zra): Check spec that this is true. |
4678 __ fcmpd(value, value); | 4678 __ fcmpd(value, value); |
4679 __ b(deopt, VS); | 4679 __ b(deopt, VS); |
4680 | 4680 |
4681 __ fcvtzds(result, value); | 4681 __ fcvtzds(result, value); |
4682 // Check for overflow and that it fits into Smi. | 4682 // Check for overflow and that it fits into Smi. |
4683 __ CompareImmediate(result, 0xC000000000000000, PP); | 4683 __ CompareImmediate(result, 0xC000000000000000, PP); |
4684 __ b(deopt, MI); | 4684 __ b(deopt, MI); |
4685 __ SmiTag(result); | 4685 __ SmiTag(result); |
4686 if (FLAG_throw_on_javascript_int_overflow) { | 4686 if (FLAG_throw_on_javascript_int_overflow) { |
4687 EmitJavascriptOverflowCheck(compiler, range(), deopt, result); | 4687 EmitJavascriptOverflowCheck(compiler, range(), deopt, result); |
4688 } | 4688 } |
4689 } | 4689 } |
4690 | 4690 |
4691 | 4691 |
4692 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4692 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Zone* zone, |
4693 bool opt) const { | 4693 bool opt) const { |
4694 UNIMPLEMENTED(); | 4694 UNIMPLEMENTED(); |
4695 return NULL; | 4695 return NULL; |
4696 } | 4696 } |
4697 | 4697 |
4698 | 4698 |
4699 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4699 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4700 UNIMPLEMENTED(); | 4700 UNIMPLEMENTED(); |
4701 } | 4701 } |
4702 | 4702 |
4703 | 4703 |
4704 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate, | 4704 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Zone* zone, |
4705 bool opt) const { | 4705 bool opt) const { |
4706 const intptr_t kNumInputs = 1; | 4706 const intptr_t kNumInputs = 1; |
4707 const intptr_t kNumTemps = 0; | 4707 const intptr_t kNumTemps = 0; |
4708 LocationSummary* result = new(isolate) LocationSummary( | 4708 LocationSummary* result = new(zone) LocationSummary( |
4709 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4709 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4710 result->set_in(0, Location::RequiresFpuRegister()); | 4710 result->set_in(0, Location::RequiresFpuRegister()); |
4711 result->set_out(0, Location::RequiresFpuRegister()); | 4711 result->set_out(0, Location::RequiresFpuRegister()); |
4712 return result; | 4712 return result; |
4713 } | 4713 } |
4714 | 4714 |
4715 | 4715 |
4716 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4716 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4717 const VRegister value = locs()->in(0).fpu_reg(); | 4717 const VRegister value = locs()->in(0).fpu_reg(); |
4718 const VRegister result = locs()->out(0).fpu_reg(); | 4718 const VRegister result = locs()->out(0).fpu_reg(); |
4719 __ fcvtsd(result, value); | 4719 __ fcvtsd(result, value); |
4720 } | 4720 } |
4721 | 4721 |
4722 | 4722 |
4723 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate, | 4723 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Zone* zone, |
4724 bool opt) const { | 4724 bool opt) const { |
4725 const intptr_t kNumInputs = 1; | 4725 const intptr_t kNumInputs = 1; |
4726 const intptr_t kNumTemps = 0; | 4726 const intptr_t kNumTemps = 0; |
4727 LocationSummary* result = new(isolate) LocationSummary( | 4727 LocationSummary* result = new(zone) LocationSummary( |
4728 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4728 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4729 result->set_in(0, Location::RequiresFpuRegister()); | 4729 result->set_in(0, Location::RequiresFpuRegister()); |
4730 result->set_out(0, Location::RequiresFpuRegister()); | 4730 result->set_out(0, Location::RequiresFpuRegister()); |
4731 return result; | 4731 return result; |
4732 } | 4732 } |
4733 | 4733 |
4734 | 4734 |
4735 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4735 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4736 const VRegister value = locs()->in(0).fpu_reg(); | 4736 const VRegister value = locs()->in(0).fpu_reg(); |
4737 const VRegister result = locs()->out(0).fpu_reg(); | 4737 const VRegister result = locs()->out(0).fpu_reg(); |
4738 __ fcvtds(result, value); | 4738 __ fcvtds(result, value); |
4739 } | 4739 } |
4740 | 4740 |
4741 | 4741 |
4742 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate, | 4742 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Zone* zone, |
4743 bool opt) const { | 4743 bool opt) const { |
4744 ASSERT((InputCount() == 1) || (InputCount() == 2)); | 4744 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
4745 const intptr_t kNumTemps = | 4745 const intptr_t kNumTemps = |
4746 (recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0; | 4746 (recognized_kind() == MethodRecognizer::kMathDoublePow) ? 1 : 0; |
4747 LocationSummary* result = new(isolate) LocationSummary( | 4747 LocationSummary* result = new(zone) LocationSummary( |
4748 isolate, InputCount(), kNumTemps, LocationSummary::kCall); | 4748 zone, InputCount(), kNumTemps, LocationSummary::kCall); |
4749 result->set_in(0, Location::FpuRegisterLocation(V0)); | 4749 result->set_in(0, Location::FpuRegisterLocation(V0)); |
4750 if (InputCount() == 2) { | 4750 if (InputCount() == 2) { |
4751 result->set_in(1, Location::FpuRegisterLocation(V1)); | 4751 result->set_in(1, Location::FpuRegisterLocation(V1)); |
4752 } | 4752 } |
4753 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 4753 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
4754 result->set_temp(0, Location::FpuRegisterLocation(V30)); | 4754 result->set_temp(0, Location::FpuRegisterLocation(V30)); |
4755 } | 4755 } |
4756 result->set_out(0, Location::FpuRegisterLocation(V0)); | 4756 result->set_out(0, Location::FpuRegisterLocation(V0)); |
4757 return result; | 4757 return result; |
4758 } | 4758 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4873 | 4873 |
4874 void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4874 void InvokeMathCFunctionInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
4875 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { | 4875 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { |
4876 InvokeDoublePow(compiler, this); | 4876 InvokeDoublePow(compiler, this); |
4877 return; | 4877 return; |
4878 } | 4878 } |
4879 __ CallRuntime(TargetFunction(), InputCount()); | 4879 __ CallRuntime(TargetFunction(), InputCount()); |
4880 } | 4880 } |
4881 | 4881 |
4882 | 4882 |
4883 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate, | 4883 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Zone* zone, |
4884 bool opt) const { | 4884 bool opt) const { |
4885 // Only use this instruction in optimized code. | 4885 // Only use this instruction in optimized code. |
4886 ASSERT(opt); | 4886 ASSERT(opt); |
4887 const intptr_t kNumInputs = 1; | 4887 const intptr_t kNumInputs = 1; |
4888 LocationSummary* summary = new(isolate) LocationSummary( | 4888 LocationSummary* summary = new(zone) LocationSummary( |
4889 isolate, kNumInputs, 0, LocationSummary::kNoCall); | 4889 zone, kNumInputs, 0, LocationSummary::kNoCall); |
4890 if (representation() == kUnboxedDouble) { | 4890 if (representation() == kUnboxedDouble) { |
4891 if (index() == 0) { | 4891 if (index() == 0) { |
4892 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), | 4892 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), |
4893 Location::Any())); | 4893 Location::Any())); |
4894 } else { | 4894 } else { |
4895 ASSERT(index() == 1); | 4895 ASSERT(index() == 1); |
4896 summary->set_in(0, Location::Pair(Location::Any(), | 4896 summary->set_in(0, Location::Pair(Location::Any(), |
4897 Location::RequiresFpuRegister())); | 4897 Location::RequiresFpuRegister())); |
4898 } | 4898 } |
4899 summary->set_out(0, Location::RequiresFpuRegister()); | 4899 summary->set_out(0, Location::RequiresFpuRegister()); |
(...skipping 23 matching lines...) Expand all Loading... |
4923 __ fmovdd(out, in); | 4923 __ fmovdd(out, in); |
4924 } else { | 4924 } else { |
4925 ASSERT(representation() == kTagged); | 4925 ASSERT(representation() == kTagged); |
4926 const Register out = locs()->out(0).reg(); | 4926 const Register out = locs()->out(0).reg(); |
4927 const Register in = in_loc.reg(); | 4927 const Register in = in_loc.reg(); |
4928 __ mov(out, in); | 4928 __ mov(out, in); |
4929 } | 4929 } |
4930 } | 4930 } |
4931 | 4931 |
4932 | 4932 |
4933 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate, | 4933 LocationSummary* MergedMathInstr::MakeLocationSummary(Zone* zone, |
4934 bool opt) const { | 4934 bool opt) const { |
4935 if (kind() == MergedMathInstr::kTruncDivMod) { | 4935 if (kind() == MergedMathInstr::kTruncDivMod) { |
4936 const intptr_t kNumInputs = 2; | 4936 const intptr_t kNumInputs = 2; |
4937 const intptr_t kNumTemps = 0; | 4937 const intptr_t kNumTemps = 0; |
4938 LocationSummary* summary = new(isolate) LocationSummary( | 4938 LocationSummary* summary = new(zone) LocationSummary( |
4939 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4939 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
4940 summary->set_in(0, Location::RequiresRegister()); | 4940 summary->set_in(0, Location::RequiresRegister()); |
4941 summary->set_in(1, Location::RequiresRegister()); | 4941 summary->set_in(1, Location::RequiresRegister()); |
4942 // Output is a pair of registers. | 4942 // Output is a pair of registers. |
4943 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 4943 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
4944 Location::RequiresRegister())); | 4944 Location::RequiresRegister())); |
4945 return summary; | 4945 return summary; |
4946 } | 4946 } |
4947 UNIMPLEMENTED(); | 4947 UNIMPLEMENTED(); |
4948 return NULL; | 4948 return NULL; |
4949 } | 4949 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5005 return; | 5005 return; |
5006 } | 5006 } |
5007 if (kind() == MergedMathInstr::kSinCos) { | 5007 if (kind() == MergedMathInstr::kSinCos) { |
5008 UNIMPLEMENTED(); | 5008 UNIMPLEMENTED(); |
5009 } | 5009 } |
5010 UNIMPLEMENTED(); | 5010 UNIMPLEMENTED(); |
5011 } | 5011 } |
5012 | 5012 |
5013 | 5013 |
5014 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( | 5014 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( |
5015 Isolate* isolate, bool opt) const { | 5015 Zone* zone, bool opt) const { |
5016 return MakeCallSummary(isolate); | 5016 return MakeCallSummary(zone); |
5017 } | 5017 } |
5018 | 5018 |
5019 | 5019 |
5020 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5020 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5021 ASSERT(ic_data().NumArgsTested() == 1); | 5021 ASSERT(ic_data().NumArgsTested() == 1); |
5022 if (!with_checks()) { | 5022 if (!with_checks()) { |
5023 ASSERT(ic_data().HasOneTarget()); | 5023 ASSERT(ic_data().HasOneTarget()); |
5024 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 5024 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
5025 compiler->GenerateStaticCall(deopt_id(), | 5025 compiler->GenerateStaticCall(deopt_id(), |
5026 instance_call()->token_pos(), | 5026 instance_call()->token_pos(), |
(...skipping 18 matching lines...) Expand all Loading... |
5045 R2, // Class id register. | 5045 R2, // Class id register. |
5046 instance_call()->ArgumentCount(), | 5046 instance_call()->ArgumentCount(), |
5047 instance_call()->argument_names(), | 5047 instance_call()->argument_names(), |
5048 deopt, | 5048 deopt, |
5049 deopt_id(), | 5049 deopt_id(), |
5050 instance_call()->token_pos(), | 5050 instance_call()->token_pos(), |
5051 locs()); | 5051 locs()); |
5052 } | 5052 } |
5053 | 5053 |
5054 | 5054 |
5055 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate, | 5055 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone, |
5056 bool opt) const { | 5056 bool opt) const { |
5057 comparison()->InitializeLocationSummary(isolate, opt); | 5057 comparison()->InitializeLocationSummary(zone, opt); |
5058 // Branches don't produce a result. | 5058 // Branches don't produce a result. |
5059 comparison()->locs()->set_out(0, Location::NoLocation()); | 5059 comparison()->locs()->set_out(0, Location::NoLocation()); |
5060 return comparison()->locs(); | 5060 return comparison()->locs(); |
5061 } | 5061 } |
5062 | 5062 |
5063 | 5063 |
5064 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5064 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5065 comparison()->EmitBranchCode(compiler, this); | 5065 comparison()->EmitBranchCode(compiler, this); |
5066 } | 5066 } |
5067 | 5067 |
5068 | 5068 |
5069 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, | 5069 LocationSummary* CheckClassInstr::MakeLocationSummary(Zone* zone, |
5070 bool opt) const { | 5070 bool opt) const { |
5071 const intptr_t kNumInputs = 1; | 5071 const intptr_t kNumInputs = 1; |
5072 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask()); | 5072 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask()); |
5073 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0; | 5073 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0; |
5074 LocationSummary* summary = new(isolate) LocationSummary( | 5074 LocationSummary* summary = new(zone) LocationSummary( |
5075 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5075 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5076 summary->set_in(0, Location::RequiresRegister()); | 5076 summary->set_in(0, Location::RequiresRegister()); |
5077 if (!IsNullCheck()) { | 5077 if (!IsNullCheck()) { |
5078 summary->set_temp(0, Location::RequiresRegister()); | 5078 summary->set_temp(0, Location::RequiresRegister()); |
5079 if (need_mask_temp) { | 5079 if (need_mask_temp) { |
5080 summary->set_temp(1, Location::RequiresRegister()); | 5080 summary->set_temp(1, Location::RequiresRegister()); |
5081 } | 5081 } |
5082 } | 5082 } |
5083 return summary; | 5083 return summary; |
5084 } | 5084 } |
5085 | 5085 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5136 __ b(deopt, NE); | 5136 __ b(deopt, NE); |
5137 } else { | 5137 } else { |
5138 __ b(&is_ok, EQ); | 5138 __ b(&is_ok, EQ); |
5139 } | 5139 } |
5140 } | 5140 } |
5141 } | 5141 } |
5142 __ Bind(&is_ok); | 5142 __ Bind(&is_ok); |
5143 } | 5143 } |
5144 | 5144 |
5145 | 5145 |
5146 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Isolate* isolate, | 5146 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone, |
5147 bool opt) const { | 5147 bool opt) const { |
5148 const intptr_t kNumInputs = 1; | 5148 const intptr_t kNumInputs = 1; |
5149 const intptr_t kNumTemps = 0; | 5149 const intptr_t kNumTemps = 0; |
5150 LocationSummary* summary = new(isolate) LocationSummary( | 5150 LocationSummary* summary = new(zone) LocationSummary( |
5151 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5151 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5152 summary->set_in(0, Location::RequiresRegister()); | 5152 summary->set_in(0, Location::RequiresRegister()); |
5153 return summary; | 5153 return summary; |
5154 } | 5154 } |
5155 | 5155 |
5156 | 5156 |
5157 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5157 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5158 Register value = locs()->in(0).reg(); | 5158 Register value = locs()->in(0).reg(); |
5159 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); | 5159 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); |
5160 __ CompareImmediate(value, Smi::RawValue(cid_), PP); | 5160 __ CompareImmediate(value, Smi::RawValue(cid_), PP); |
5161 __ b(deopt, NE); | 5161 __ b(deopt, NE); |
5162 } | 5162 } |
5163 | 5163 |
5164 | 5164 |
5165 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate, | 5165 LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone, |
5166 bool opt) const { | 5166 bool opt) const { |
5167 const intptr_t kNumInputs = 1; | 5167 const intptr_t kNumInputs = 1; |
5168 const intptr_t kNumTemps = 0; | 5168 const intptr_t kNumTemps = 0; |
5169 LocationSummary* summary = new(isolate) LocationSummary( | 5169 LocationSummary* summary = new(zone) LocationSummary( |
5170 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5170 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5171 summary->set_in(0, Location::RequiresRegister()); | 5171 summary->set_in(0, Location::RequiresRegister()); |
5172 return summary; | 5172 return summary; |
5173 } | 5173 } |
5174 | 5174 |
5175 | 5175 |
5176 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5176 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5177 const Register value = locs()->in(0).reg(); | 5177 const Register value = locs()->in(0).reg(); |
5178 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 5178 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
5179 ICData::kDeoptCheckSmi, | 5179 ICData::kDeoptCheckSmi, |
5180 licm_hoisted_ ? ICData::kHoisted : 0); | 5180 licm_hoisted_ ? ICData::kHoisted : 0); |
5181 __ tsti(value, Immediate(kSmiTagMask)); | 5181 __ tsti(value, Immediate(kSmiTagMask)); |
5182 __ b(deopt, NE); | 5182 __ b(deopt, NE); |
5183 } | 5183 } |
5184 | 5184 |
5185 | 5185 |
5186 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, | 5186 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone, |
5187 bool opt) const { | 5187 bool opt) const { |
5188 const intptr_t kNumInputs = 2; | 5188 const intptr_t kNumInputs = 2; |
5189 const intptr_t kNumTemps = 0; | 5189 const intptr_t kNumTemps = 0; |
5190 LocationSummary* locs = new(isolate) LocationSummary( | 5190 LocationSummary* locs = new(zone) LocationSummary( |
5191 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5191 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5192 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 5192 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
5193 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 5193 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
5194 return locs; | 5194 return locs; |
5195 } | 5195 } |
5196 | 5196 |
5197 | 5197 |
5198 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5198 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5199 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; | 5199 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; |
5200 flags |= licm_hoisted_ ? ICData::kHoisted : 0; | 5200 flags |= licm_hoisted_ ? ICData::kHoisted : 0; |
5201 Label* deopt = compiler->AddDeoptStub( | 5201 Label* deopt = compiler->AddDeoptStub( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5240 } | 5240 } |
5241 } else { | 5241 } else { |
5242 const Register length = length_loc.reg(); | 5242 const Register length = length_loc.reg(); |
5243 const Register index = index_loc.reg(); | 5243 const Register index = index_loc.reg(); |
5244 __ CompareRegisters(index, length); | 5244 __ CompareRegisters(index, length); |
5245 __ b(deopt, CS); | 5245 __ b(deopt, CS); |
5246 } | 5246 } |
5247 } | 5247 } |
5248 | 5248 |
5249 | 5249 |
5250 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate, | 5250 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Zone* zone, |
5251 bool opt) const { | 5251 bool opt) const { |
5252 UNIMPLEMENTED(); | 5252 UNIMPLEMENTED(); |
5253 return NULL; | 5253 return NULL; |
5254 } | 5254 } |
5255 | 5255 |
5256 | 5256 |
5257 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5257 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5258 UNIMPLEMENTED(); | 5258 UNIMPLEMENTED(); |
5259 } | 5259 } |
5260 | 5260 |
5261 | 5261 |
5262 bool ShiftMintOpInstr::has_shift_count_check() const { | 5262 bool ShiftMintOpInstr::has_shift_count_check() const { |
5263 UNREACHABLE(); | 5263 UNREACHABLE(); |
5264 return false; | 5264 return false; |
5265 } | 5265 } |
5266 | 5266 |
5267 | 5267 |
5268 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate, | 5268 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Zone* zone, |
5269 bool opt) const { | 5269 bool opt) const { |
5270 UNIMPLEMENTED(); | 5270 UNIMPLEMENTED(); |
5271 return NULL; | 5271 return NULL; |
5272 } | 5272 } |
5273 | 5273 |
5274 | 5274 |
5275 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5275 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5276 UNIMPLEMENTED(); | 5276 UNIMPLEMENTED(); |
5277 } | 5277 } |
5278 | 5278 |
5279 | 5279 |
5280 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate, | 5280 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Zone* zone, |
5281 bool opt) const { | 5281 bool opt) const { |
5282 UNIMPLEMENTED(); | 5282 UNIMPLEMENTED(); |
5283 return NULL; | 5283 return NULL; |
5284 } | 5284 } |
5285 | 5285 |
5286 | 5286 |
5287 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5287 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5288 UNIMPLEMENTED(); | 5288 UNIMPLEMENTED(); |
5289 } | 5289 } |
5290 | 5290 |
(...skipping 12 matching lines...) Expand all Loading... |
5303 return CompileType::FromCid(kSmiCid); | 5303 return CompileType::FromCid(kSmiCid); |
5304 } | 5304 } |
5305 | 5305 |
5306 | 5306 |
5307 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryUint32OpInstr) | 5307 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryUint32OpInstr) |
5308 DEFINE_UNIMPLEMENTED_INSTRUCTION(ShiftUint32OpInstr) | 5308 DEFINE_UNIMPLEMENTED_INSTRUCTION(ShiftUint32OpInstr) |
5309 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnaryUint32OpInstr) | 5309 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnaryUint32OpInstr) |
5310 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) | 5310 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) |
5311 | 5311 |
5312 | 5312 |
5313 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Isolate* isolate, | 5313 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone, |
5314 bool opt) const { | 5314 bool opt) const { |
5315 const intptr_t kNumInputs = 1; | 5315 const intptr_t kNumInputs = 1; |
5316 const intptr_t kNumTemps = 0; | 5316 const intptr_t kNumTemps = 0; |
5317 LocationSummary* summary = new(isolate) LocationSummary( | 5317 LocationSummary* summary = new(zone) LocationSummary( |
5318 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5318 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5319 if (from() == kUnboxedMint) { | 5319 if (from() == kUnboxedMint) { |
5320 UNREACHABLE(); | 5320 UNREACHABLE(); |
5321 } else if (to() == kUnboxedMint) { | 5321 } else if (to() == kUnboxedMint) { |
5322 UNREACHABLE(); | 5322 UNREACHABLE(); |
5323 } else { | 5323 } else { |
5324 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); | 5324 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); |
5325 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); | 5325 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); |
5326 summary->set_in(0, Location::RequiresRegister()); | 5326 summary->set_in(0, Location::RequiresRegister()); |
5327 summary->set_out(0, Location::RequiresRegister()); | 5327 summary->set_out(0, Location::RequiresRegister()); |
5328 } | 5328 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5360 UNREACHABLE(); | 5360 UNREACHABLE(); |
5361 } else if (to() == kUnboxedMint) { | 5361 } else if (to() == kUnboxedMint) { |
5362 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); | 5362 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); |
5363 UNREACHABLE(); | 5363 UNREACHABLE(); |
5364 } else { | 5364 } else { |
5365 UNREACHABLE(); | 5365 UNREACHABLE(); |
5366 } | 5366 } |
5367 } | 5367 } |
5368 | 5368 |
5369 | 5369 |
5370 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, | 5370 LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, |
5371 bool opt) const { | 5371 bool opt) const { |
5372 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | 5372 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); |
5373 } | 5373 } |
5374 | 5374 |
5375 | 5375 |
5376 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5376 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5377 compiler->GenerateRuntimeCall(token_pos(), | 5377 compiler->GenerateRuntimeCall(token_pos(), |
5378 deopt_id(), | 5378 deopt_id(), |
5379 kThrowRuntimeEntry, | 5379 kThrowRuntimeEntry, |
5380 1, | 5380 1, |
5381 locs()); | 5381 locs()); |
5382 __ brk(0); | 5382 __ brk(0); |
5383 } | 5383 } |
5384 | 5384 |
5385 | 5385 |
5386 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate, | 5386 LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone, |
5387 bool opt) const { | 5387 bool opt) const { |
5388 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); | 5388 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); |
5389 } | 5389 } |
5390 | 5390 |
5391 | 5391 |
5392 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5392 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5393 compiler->SetNeedsStacktrace(catch_try_index()); | 5393 compiler->SetNeedsStacktrace(catch_try_index()); |
5394 compiler->GenerateRuntimeCall(token_pos(), | 5394 compiler->GenerateRuntimeCall(token_pos(), |
5395 deopt_id(), | 5395 deopt_id(), |
5396 kReThrowRuntimeEntry, | 5396 kReThrowRuntimeEntry, |
5397 2, | 5397 2, |
5398 locs()); | 5398 locs()); |
5399 __ brk(0); | 5399 __ brk(0); |
5400 } | 5400 } |
5401 | 5401 |
5402 | 5402 |
5403 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5403 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5404 if (!compiler->CanFallThroughTo(normal_entry())) { | 5404 if (!compiler->CanFallThroughTo(normal_entry())) { |
5405 __ b(compiler->GetJumpLabel(normal_entry())); | 5405 __ b(compiler->GetJumpLabel(normal_entry())); |
5406 } | 5406 } |
5407 } | 5407 } |
5408 | 5408 |
5409 | 5409 |
5410 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, | 5410 LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone, |
5411 bool opt) const { | 5411 bool opt) const { |
5412 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); | 5412 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall); |
5413 } | 5413 } |
5414 | 5414 |
5415 | 5415 |
5416 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5416 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5417 if (!compiler->is_optimizing()) { | 5417 if (!compiler->is_optimizing()) { |
5418 if (FLAG_emit_edge_counters) { | 5418 if (FLAG_emit_edge_counters) { |
5419 compiler->EmitEdgeCounter(); | 5419 compiler->EmitEdgeCounter(); |
5420 } | 5420 } |
5421 // Add a deoptimization descriptor for deoptimizing instructions that | 5421 // Add a deoptimization descriptor for deoptimizing instructions that |
5422 // may be inserted before this instruction. On ARM64 this descriptor | 5422 // may be inserted before this instruction. On ARM64 this descriptor |
5423 // points after the edge counter code so that we can reuse the same | 5423 // points after the edge counter code so that we can reuse the same |
5424 // pattern matching code as at call sites, which matches backwards from | 5424 // pattern matching code as at call sites, which matches backwards from |
5425 // the end of the pattern. | 5425 // the end of the pattern. |
5426 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 5426 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
5427 GetDeoptId(), | 5427 GetDeoptId(), |
5428 Scanner::kNoSourcePos); | 5428 Scanner::kNoSourcePos); |
5429 } | 5429 } |
5430 if (HasParallelMove()) { | 5430 if (HasParallelMove()) { |
5431 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 5431 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
5432 } | 5432 } |
5433 | 5433 |
5434 // We can fall through if the successor is the next block in the list. | 5434 // We can fall through if the successor is the next block in the list. |
5435 // Otherwise, we need a jump. | 5435 // Otherwise, we need a jump. |
5436 if (!compiler->CanFallThroughTo(successor())) { | 5436 if (!compiler->CanFallThroughTo(successor())) { |
5437 __ b(compiler->GetJumpLabel(successor())); | 5437 __ b(compiler->GetJumpLabel(successor())); |
5438 } | 5438 } |
5439 } | 5439 } |
5440 | 5440 |
5441 | 5441 |
5442 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate, | 5442 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Zone* zone, |
5443 bool opt) const { | 5443 bool opt) const { |
5444 const intptr_t kNumInputs = 1; | 5444 const intptr_t kNumInputs = 1; |
5445 const intptr_t kNumTemps = 1; | 5445 const intptr_t kNumTemps = 1; |
5446 | 5446 |
5447 LocationSummary* summary = new(isolate) LocationSummary( | 5447 LocationSummary* summary = new(zone) LocationSummary( |
5448 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5448 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5449 | 5449 |
5450 summary->set_in(0, Location::RequiresRegister()); | 5450 summary->set_in(0, Location::RequiresRegister()); |
5451 summary->set_temp(0, Location::RequiresRegister()); | 5451 summary->set_temp(0, Location::RequiresRegister()); |
5452 | 5452 |
5453 return summary; | 5453 return summary; |
5454 } | 5454 } |
5455 | 5455 |
5456 | 5456 |
5457 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5457 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5458 Register target_address_reg = locs()->temp_slot(0)->reg(); | 5458 Register target_address_reg = locs()->temp_slot(0)->reg(); |
5459 | 5459 |
5460 // Load from [current frame pointer] + kPcMarkerSlotFromFp. | 5460 // Load from [current frame pointer] + kPcMarkerSlotFromFp. |
5461 __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); | 5461 __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); |
5462 | 5462 |
5463 // Add the offset. | 5463 // Add the offset. |
5464 Register offset_reg = locs()->in(0).reg(); | 5464 Register offset_reg = locs()->in(0).reg(); |
5465 Operand offset_opr = | 5465 Operand offset_opr = |
5466 (offset()->definition()->representation() == kTagged) ? | 5466 (offset()->definition()->representation() == kTagged) ? |
5467 Operand(offset_reg, ASR, kSmiTagSize) : | 5467 Operand(offset_reg, ASR, kSmiTagSize) : |
5468 Operand(offset_reg); | 5468 Operand(offset_reg); |
5469 __ add(target_address_reg, target_address_reg, offset_opr); | 5469 __ add(target_address_reg, target_address_reg, offset_opr); |
5470 | 5470 |
5471 // Jump to the absolute address. | 5471 // Jump to the absolute address. |
5472 __ br(target_address_reg); | 5472 __ br(target_address_reg); |
5473 } | 5473 } |
5474 | 5474 |
5475 | 5475 |
5476 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate, | 5476 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone, |
5477 bool opt) const { | 5477 bool opt) const { |
5478 const intptr_t kNumInputs = 2; | 5478 const intptr_t kNumInputs = 2; |
5479 const intptr_t kNumTemps = 0; | 5479 const intptr_t kNumTemps = 0; |
5480 if (needs_number_check()) { | 5480 if (needs_number_check()) { |
5481 LocationSummary* locs = new(isolate) LocationSummary( | 5481 LocationSummary* locs = new(zone) LocationSummary( |
5482 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); | 5482 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
5483 locs->set_in(0, Location::RegisterLocation(R0)); | 5483 locs->set_in(0, Location::RegisterLocation(R0)); |
5484 locs->set_in(1, Location::RegisterLocation(R1)); | 5484 locs->set_in(1, Location::RegisterLocation(R1)); |
5485 locs->set_out(0, Location::RegisterLocation(R0)); | 5485 locs->set_out(0, Location::RegisterLocation(R0)); |
5486 return locs; | 5486 return locs; |
5487 } | 5487 } |
5488 LocationSummary* locs = new(isolate) LocationSummary( | 5488 LocationSummary* locs = new(zone) LocationSummary( |
5489 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5489 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
5490 locs->set_in(0, Location::RegisterOrConstant(left())); | 5490 locs->set_in(0, Location::RegisterOrConstant(left())); |
5491 // Only one of the inputs can be a constant. Choose register if the first one | 5491 // Only one of the inputs can be a constant. Choose register if the first one |
5492 // is a constant. | 5492 // is a constant. |
5493 locs->set_in(1, locs->in(0).IsConstant() | 5493 locs->set_in(1, locs->in(0).IsConstant() |
5494 ? Location::RequiresRegister() | 5494 ? Location::RequiresRegister() |
5495 : Location::RegisterOrConstant(right())); | 5495 : Location::RegisterOrConstant(right())); |
5496 locs->set_out(0, Location::RequiresRegister()); | 5496 locs->set_out(0, Location::RequiresRegister()); |
5497 return locs; | 5497 return locs; |
5498 } | 5498 } |
5499 | 5499 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5551 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 5551 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
5552 BranchInstr* branch) { | 5552 BranchInstr* branch) { |
5553 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | 5553 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); |
5554 | 5554 |
5555 BranchLabels labels = compiler->CreateBranchLabels(branch); | 5555 BranchLabels labels = compiler->CreateBranchLabels(branch); |
5556 Condition true_condition = EmitComparisonCode(compiler, labels); | 5556 Condition true_condition = EmitComparisonCode(compiler, labels); |
5557 EmitBranchOnCondition(compiler, true_condition, labels); | 5557 EmitBranchOnCondition(compiler, true_condition, labels); |
5558 } | 5558 } |
5559 | 5559 |
5560 | 5560 |
5561 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, | 5561 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone, |
5562 bool opt) const { | 5562 bool opt) const { |
5563 return LocationSummary::Make(isolate, | 5563 return LocationSummary::Make(zone, |
5564 1, | 5564 1, |
5565 Location::RequiresRegister(), | 5565 Location::RequiresRegister(), |
5566 LocationSummary::kNoCall); | 5566 LocationSummary::kNoCall); |
5567 } | 5567 } |
5568 | 5568 |
5569 | 5569 |
5570 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5570 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5571 const Register value = locs()->in(0).reg(); | 5571 const Register value = locs()->in(0).reg(); |
5572 const Register result = locs()->out(0).reg(); | 5572 const Register result = locs()->out(0).reg(); |
5573 | 5573 |
5574 __ LoadObject(result, Bool::True(), PP); | 5574 __ LoadObject(result, Bool::True(), PP); |
5575 __ LoadObject(TMP, Bool::False(), PP); | 5575 __ LoadObject(TMP, Bool::False(), PP); |
5576 __ CompareRegisters(result, value); | 5576 __ CompareRegisters(result, value); |
5577 __ csel(result, TMP, result, EQ); | 5577 __ csel(result, TMP, result, EQ); |
5578 } | 5578 } |
5579 | 5579 |
5580 | 5580 |
5581 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, | 5581 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone, |
5582 bool opt) const { | 5582 bool opt) const { |
5583 return MakeCallSummary(isolate); | 5583 return MakeCallSummary(zone); |
5584 } | 5584 } |
5585 | 5585 |
5586 | 5586 |
5587 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5587 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
5588 Isolate* isolate = compiler->isolate(); | 5588 Isolate* isolate = compiler->isolate(); |
5589 StubCode* stub_code = isolate->stub_code(); | 5589 StubCode* stub_code = isolate->stub_code(); |
5590 const Code& stub = Code::Handle(isolate, | 5590 const Code& stub = Code::Handle(isolate, |
5591 stub_code->GetAllocationStubForClass(cls())); | 5591 stub_code->GetAllocationStubForClass(cls())); |
5592 const ExternalLabel label(stub.EntryPoint()); | 5592 const ExternalLabel label(stub.EntryPoint()); |
5593 compiler->GenerateCall(token_pos(), | 5593 compiler->GenerateCall(token_pos(), |
(...skipping 12 matching lines...) Expand all Loading... |
5606 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 5606 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
5607 #if defined(DEBUG) | 5607 #if defined(DEBUG) |
5608 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); | 5608 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); |
5609 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); | 5609 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); |
5610 #endif | 5610 #endif |
5611 } | 5611 } |
5612 | 5612 |
5613 } // namespace dart | 5613 } // namespace dart |
5614 | 5614 |
5615 #endif // defined TARGET_ARCH_ARM64 | 5615 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |