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

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

Issue 855533002: Isolate/Thread split: Isolate -> Zone for LocationSummary. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 14 matching lines...) Expand all
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, propagate_ic_data); 30 DECLARE_FLAG(bool, propagate_ic_data);
31 DECLARE_FLAG(bool, use_osr); 31 DECLARE_FLAG(bool, use_osr);
32 32
33 // Generic summary for call instructions that have all arguments pushed 33 // Generic summary for call instructions that have all arguments pushed
34 // on the stack and return the result in a fixed register V0. 34 // on the stack and return the result in a fixed register V0.
35 LocationSummary* Instruction::MakeCallSummary(Isolate* isolate) { 35 LocationSummary* Instruction::MakeCallSummary(Zone* zone) {
36 LocationSummary* result = new(isolate) LocationSummary( 36 LocationSummary* result = new(zone) LocationSummary(
37 isolate, 0, 0, LocationSummary::kCall); 37 zone, 0, 0, LocationSummary::kCall);
38 result->set_out(0, Location::RegisterLocation(V0)); 38 result->set_out(0, Location::RegisterLocation(V0));
39 return result; 39 return result;
40 } 40 }
41 41
42 42
43 LocationSummary* PushArgumentInstr::MakeLocationSummary(Isolate* isolate, 43 LocationSummary* PushArgumentInstr::MakeLocationSummary(Zone* zone,
44 bool opt) const { 44 bool opt) const {
45 const intptr_t kNumInputs = 1; 45 const intptr_t kNumInputs = 1;
46 const intptr_t kNumTemps = 0; 46 const intptr_t kNumTemps = 0;
47 LocationSummary* locs = new(isolate) LocationSummary( 47 LocationSummary* locs = new(zone) LocationSummary(
48 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 48 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
49 locs->set_in(0, Location::AnyOrConstant(value())); 49 locs->set_in(0, Location::AnyOrConstant(value()));
50 return locs; 50 return locs;
51 } 51 }
52 52
53 53
54 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 54 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
55 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode 55 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode
56 // where PushArgument is handled by BindInstr::EmitNativeCode. 56 // where PushArgument is handled by BindInstr::EmitNativeCode.
57 __ TraceSimMsg("PushArgumentInstr"); 57 __ TraceSimMsg("PushArgumentInstr");
58 if (compiler->is_optimizing()) { 58 if (compiler->is_optimizing()) {
59 Location value = locs()->in(0); 59 Location value = locs()->in(0);
60 if (value.IsRegister()) { 60 if (value.IsRegister()) {
61 __ Push(value.reg()); 61 __ Push(value.reg());
62 } else if (value.IsConstant()) { 62 } else if (value.IsConstant()) {
63 __ PushObject(value.constant()); 63 __ PushObject(value.constant());
64 } else { 64 } else {
65 ASSERT(value.IsStackSlot()); 65 ASSERT(value.IsStackSlot());
66 const intptr_t value_offset = value.ToStackSlotOffset(); 66 const intptr_t value_offset = value.ToStackSlotOffset();
67 __ LoadFromOffset(TMP, FP, value_offset); 67 __ LoadFromOffset(TMP, FP, value_offset);
68 __ Push(TMP); 68 __ Push(TMP);
69 } 69 }
70 } 70 }
71 } 71 }
72 72
73 73
74 LocationSummary* ReturnInstr::MakeLocationSummary(Isolate* isolate, 74 LocationSummary* ReturnInstr::MakeLocationSummary(Zone* zone,
75 bool opt) const { 75 bool opt) const {
76 const intptr_t kNumInputs = 1; 76 const intptr_t kNumInputs = 1;
77 const intptr_t kNumTemps = 0; 77 const intptr_t kNumTemps = 0;
78 LocationSummary* locs = new(isolate) LocationSummary( 78 LocationSummary* locs = new(zone) LocationSummary(
79 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 79 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
80 locs->set_in(0, Location::RegisterLocation(V0)); 80 locs->set_in(0, Location::RegisterLocation(V0));
81 return locs; 81 return locs;
82 } 82 }
83 83
84 84
85 // Attempt optimized compilation at return instruction instead of at the entry. 85 // Attempt optimized compilation at return instruction instead of at the entry.
86 // The entry needs to be patchable, no inlined objects are allowed in the area 86 // The entry needs to be patchable, no inlined objects are allowed in the area
87 // that will be overwritten by the patch instructions: a branch macro sequence. 87 // that will be overwritten by the patch instructions: a branch macro sequence.
88 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 88 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
89 __ TraceSimMsg("ReturnInstr"); 89 __ TraceSimMsg("ReturnInstr");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 case ULE: condition.set_rel_op(UGT); break; 128 case ULE: condition.set_rel_op(UGT); break;
129 case UGT: condition.set_rel_op(ULE); break; 129 case UGT: condition.set_rel_op(ULE); break;
130 case UGE: condition.set_rel_op(ULT); break; 130 case UGE: condition.set_rel_op(ULT); break;
131 default: 131 default:
132 UNREACHABLE(); 132 UNREACHABLE();
133 } 133 }
134 return condition; 134 return condition;
135 } 135 }
136 136
137 137
138 LocationSummary* IfThenElseInstr::MakeLocationSummary(Isolate* isolate, 138 LocationSummary* IfThenElseInstr::MakeLocationSummary(Zone* zone,
139 bool opt) const { 139 bool opt) const {
140 comparison()->InitializeLocationSummary(isolate, opt); 140 comparison()->InitializeLocationSummary(zone, opt);
141 return comparison()->locs(); 141 return comparison()->locs();
142 } 142 }
143 143
144 144
145 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 145 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
146 const Register result = locs()->out(0).reg(); 146 const Register result = locs()->out(0).reg();
147 147
148 intptr_t true_value = if_true_; 148 intptr_t true_value = if_true_;
149 intptr_t false_value = if_false_; 149 intptr_t false_value = if_false_;
150 bool swapped = false; 150 bool swapped = false;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 false_value_reg = CMPRES2; 244 false_value_reg = CMPRES2;
245 } 245 }
246 if (zero_is_false) { 246 if (zero_is_false) {
247 __ movz(result, false_value_reg, CMPRES1); 247 __ movz(result, false_value_reg, CMPRES1);
248 } else { 248 } else {
249 __ movn(result, false_value_reg, CMPRES1); 249 __ movn(result, false_value_reg, CMPRES1);
250 } 250 }
251 } 251 }
252 252
253 253
254 LocationSummary* ClosureCallInstr::MakeLocationSummary(Isolate* isolate, 254 LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone,
255 bool opt) const { 255 bool opt) const {
256 const intptr_t kNumInputs = 1; 256 const intptr_t kNumInputs = 1;
257 const intptr_t kNumTemps = 0; 257 const intptr_t kNumTemps = 0;
258 LocationSummary* summary = new(isolate) LocationSummary( 258 LocationSummary* summary = new(zone) LocationSummary(
259 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 259 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
260 summary->set_in(0, Location::RegisterLocation(T0)); // Function. 260 summary->set_in(0, Location::RegisterLocation(T0)); // Function.
261 summary->set_out(0, Location::RegisterLocation(V0)); 261 summary->set_out(0, Location::RegisterLocation(V0));
262 return summary; 262 return summary;
263 } 263 }
264 264
265 265
266 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 266 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
267 // Load arguments descriptor in S4. 267 // Load arguments descriptor in S4.
268 int argument_count = ArgumentCount(); 268 int argument_count = ArgumentCount();
269 const Array& arguments_descriptor = 269 const Array& arguments_descriptor =
(...skipping 22 matching lines...) Expand all
292 // Add deoptimization continuation point after the call and before the 292 // Add deoptimization continuation point after the call and before the
293 // arguments are removed. 293 // arguments are removed.
294 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt, 294 compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
295 deopt_id_after, 295 deopt_id_after,
296 token_pos()); 296 token_pos());
297 } 297 }
298 __ Drop(argument_count); 298 __ Drop(argument_count);
299 } 299 }
300 300
301 301
302 LocationSummary* LoadLocalInstr::MakeLocationSummary(Isolate* isolate, 302 LocationSummary* LoadLocalInstr::MakeLocationSummary(Zone* zone,
303 bool opt) const { 303 bool opt) const {
304 return LocationSummary::Make(isolate, 304 return LocationSummary::Make(zone,
305 0, 305 0,
306 Location::RequiresRegister(), 306 Location::RequiresRegister(),
307 LocationSummary::kNoCall); 307 LocationSummary::kNoCall);
308 } 308 }
309 309
310 310
311 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 311 void LoadLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
312 __ TraceSimMsg("LoadLocalInstr"); 312 __ TraceSimMsg("LoadLocalInstr");
313 Register result = locs()->out(0).reg(); 313 Register result = locs()->out(0).reg();
314 __ LoadFromOffset(result, FP, local().index() * kWordSize); 314 __ LoadFromOffset(result, FP, local().index() * kWordSize);
315 } 315 }
316 316
317 317
318 LocationSummary* StoreLocalInstr::MakeLocationSummary(Isolate* isolate, 318 LocationSummary* StoreLocalInstr::MakeLocationSummary(Zone* zone,
319 bool opt) const { 319 bool opt) const {
320 return LocationSummary::Make(isolate, 320 return LocationSummary::Make(zone,
321 1, 321 1,
322 Location::SameAsFirstInput(), 322 Location::SameAsFirstInput(),
323 LocationSummary::kNoCall); 323 LocationSummary::kNoCall);
324 } 324 }
325 325
326 326
327 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 327 void StoreLocalInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
328 __ TraceSimMsg("StoreLocalInstr"); 328 __ TraceSimMsg("StoreLocalInstr");
329 Register value = locs()->in(0).reg(); 329 Register value = locs()->in(0).reg();
330 Register result = locs()->out(0).reg(); 330 Register result = locs()->out(0).reg();
331 ASSERT(result == value); // Assert that register assignment is correct. 331 ASSERT(result == value); // Assert that register assignment is correct.
332 __ StoreToOffset(value, FP, local().index() * kWordSize); 332 __ StoreToOffset(value, FP, local().index() * kWordSize);
333 } 333 }
334 334
335 335
336 LocationSummary* ConstantInstr::MakeLocationSummary(Isolate* isolate, 336 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone,
337 bool opt) const { 337 bool opt) const {
338 return LocationSummary::Make(isolate, 338 return LocationSummary::Make(zone,
339 0, 339 0,
340 Location::RequiresRegister(), 340 Location::RequiresRegister(),
341 LocationSummary::kNoCall); 341 LocationSummary::kNoCall);
342 } 342 }
343 343
344 344
345 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 345 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
346 // The register allocator drops constant definitions that have no uses. 346 // The register allocator drops constant definitions that have no uses.
347 if (!locs()->out(0).IsInvalid()) { 347 if (!locs()->out(0).IsInvalid()) {
348 __ TraceSimMsg("ConstantInstr"); 348 __ TraceSimMsg("ConstantInstr");
349 Register result = locs()->out(0).reg(); 349 Register result = locs()->out(0).reg();
350 __ LoadObject(result, value()); 350 __ LoadObject(result, value());
351 } 351 }
352 } 352 }
353 353
354 354
355 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Isolate* isolate, 355 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone,
356 bool opt) const { 356 bool opt) const {
357 const intptr_t kNumInputs = 0; 357 const intptr_t kNumInputs = 0;
358 const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1; 358 const intptr_t kNumTemps = (representation_ == kUnboxedInt32) ? 0 : 1;
359 LocationSummary* locs = new(isolate) LocationSummary( 359 LocationSummary* locs = new(zone) LocationSummary(
360 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 360 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
361 if (representation_ == kUnboxedInt32) { 361 if (representation_ == kUnboxedInt32) {
362 locs->set_out(0, Location::RequiresRegister()); 362 locs->set_out(0, Location::RequiresRegister());
363 } else { 363 } else {
364 ASSERT(representation_ == kUnboxedDouble); 364 ASSERT(representation_ == kUnboxedDouble);
365 locs->set_out(0, Location::RequiresFpuRegister()); 365 locs->set_out(0, Location::RequiresFpuRegister());
366 } 366 }
367 if (kNumTemps > 0) { 367 if (kNumTemps > 0) {
368 locs->set_temp(0, Location::RequiresRegister()); 368 locs->set_temp(0, Location::RequiresRegister());
369 } 369 }
370 return locs; 370 return locs;
(...skipping 19 matching lines...) Expand all
390 Smi::Cast(value()).Value()); 390 Smi::Cast(value()).Value());
391 break; 391 break;
392 392
393 default: 393 default:
394 UNREACHABLE(); 394 UNREACHABLE();
395 } 395 }
396 } 396 }
397 } 397 }
398 398
399 399
400 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Isolate* isolate, 400 LocationSummary* AssertAssignableInstr::MakeLocationSummary(Zone* zone,
401 bool opt) const { 401 bool opt) const {
402 const intptr_t kNumInputs = 3; 402 const intptr_t kNumInputs = 3;
403 const intptr_t kNumTemps = 0; 403 const intptr_t kNumTemps = 0;
404 LocationSummary* summary = new(isolate) LocationSummary( 404 LocationSummary* summary = new(zone) LocationSummary(
405 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 405 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
406 summary->set_in(0, Location::RegisterLocation(A0)); // Value. 406 summary->set_in(0, Location::RegisterLocation(A0)); // Value.
407 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator. 407 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator.
408 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments. 408 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments.
409 summary->set_out(0, Location::RegisterLocation(A0)); 409 summary->set_out(0, Location::RegisterLocation(A0));
410 return summary; 410 return summary;
411 } 411 }
412 412
413 413
414 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Isolate* isolate, 414 LocationSummary* AssertBooleanInstr::MakeLocationSummary(Zone* zone,
415 bool opt) const { 415 bool opt) const {
416 const intptr_t kNumInputs = 1; 416 const intptr_t kNumInputs = 1;
417 const intptr_t kNumTemps = 0; 417 const intptr_t kNumTemps = 0;
418 LocationSummary* locs = new(isolate) LocationSummary( 418 LocationSummary* locs = new(zone) LocationSummary(
419 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 419 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
420 locs->set_in(0, Location::RegisterLocation(A0)); 420 locs->set_in(0, Location::RegisterLocation(A0));
421 locs->set_out(0, Location::RegisterLocation(A0)); 421 locs->set_out(0, Location::RegisterLocation(A0));
422 return locs; 422 return locs;
423 } 423 }
424 424
425 425
426 static void EmitAssertBoolean(Register reg, 426 static void EmitAssertBoolean(Register reg,
427 intptr_t token_pos, 427 intptr_t token_pos,
428 intptr_t deopt_id, 428 intptr_t deopt_id,
429 LocationSummary* locs, 429 LocationSummary* locs,
(...skipping 26 matching lines...) Expand all
456 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 456 void AssertBooleanInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
457 Register obj = locs()->in(0).reg(); 457 Register obj = locs()->in(0).reg();
458 Register result = locs()->out(0).reg(); 458 Register result = locs()->out(0).reg();
459 459
460 __ TraceSimMsg("AssertBooleanInstr"); 460 __ TraceSimMsg("AssertBooleanInstr");
461 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); 461 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler);
462 ASSERT(obj == result); 462 ASSERT(obj == result);
463 } 463 }
464 464
465 465
466 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Isolate* isolate, 466 LocationSummary* EqualityCompareInstr::MakeLocationSummary(Zone* zone,
467 bool opt) const { 467 bool opt) const {
468 const intptr_t kNumInputs = 2; 468 const intptr_t kNumInputs = 2;
469 if (operation_cid() == kMintCid) { 469 if (operation_cid() == kMintCid) {
470 const intptr_t kNumTemps = 0; 470 const intptr_t kNumTemps = 0;
471 LocationSummary* locs = new(isolate) LocationSummary( 471 LocationSummary* locs = new(zone) LocationSummary(
472 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 472 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
473 locs->set_in(0, Location::Pair(Location::RequiresRegister(), 473 locs->set_in(0, Location::Pair(Location::RequiresRegister(),
474 Location::RequiresRegister())); 474 Location::RequiresRegister()));
475 locs->set_in(1, Location::Pair(Location::RequiresRegister(), 475 locs->set_in(1, Location::Pair(Location::RequiresRegister(),
476 Location::RequiresRegister())); 476 Location::RequiresRegister()));
477 locs->set_out(0, Location::RequiresRegister()); 477 locs->set_out(0, Location::RequiresRegister());
478 return locs; 478 return locs;
479 } 479 }
480 if (operation_cid() == kDoubleCid) { 480 if (operation_cid() == kDoubleCid) {
481 const intptr_t kNumTemps = 0; 481 const intptr_t kNumTemps = 0;
482 LocationSummary* locs = new(isolate) LocationSummary( 482 LocationSummary* locs = new(zone) LocationSummary(
483 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 483 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
484 locs->set_in(0, Location::RequiresFpuRegister()); 484 locs->set_in(0, Location::RequiresFpuRegister());
485 locs->set_in(1, Location::RequiresFpuRegister()); 485 locs->set_in(1, Location::RequiresFpuRegister());
486 locs->set_out(0, Location::RequiresRegister()); 486 locs->set_out(0, Location::RequiresRegister());
487 return locs; 487 return locs;
488 } 488 }
489 if (operation_cid() == kSmiCid) { 489 if (operation_cid() == kSmiCid) {
490 const intptr_t kNumTemps = 0; 490 const intptr_t kNumTemps = 0;
491 LocationSummary* locs = new(isolate) LocationSummary( 491 LocationSummary* locs = new(zone) LocationSummary(
492 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 492 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
493 locs->set_in(0, Location::RegisterOrConstant(left())); 493 locs->set_in(0, Location::RegisterOrConstant(left()));
494 // Only one input can be a constant operand. The case of two constant 494 // Only one input can be a constant operand. The case of two constant
495 // operands should be handled by constant propagation. 495 // operands should be handled by constant propagation.
496 locs->set_in(1, locs->in(0).IsConstant() 496 locs->set_in(1, locs->in(0).IsConstant()
497 ? Location::RequiresRegister() 497 ? Location::RequiresRegister()
498 : Location::RegisterOrConstant(right())); 498 : Location::RegisterOrConstant(right()));
499 locs->set_out(0, Location::RequiresRegister()); 499 locs->set_out(0, Location::RequiresRegister());
500 return locs; 500 return locs;
501 } 501 }
502 UNREACHABLE(); 502 UNREACHABLE();
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 __ TraceSimMsg("EqualityCompareInstr"); 776 __ TraceSimMsg("EqualityCompareInstr");
777 __ Comment("EqualityCompareInstr:BranchCode"); 777 __ Comment("EqualityCompareInstr:BranchCode");
778 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); 778 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ));
779 779
780 BranchLabels labels = compiler->CreateBranchLabels(branch); 780 BranchLabels labels = compiler->CreateBranchLabels(branch);
781 Condition true_condition = EmitComparisonCode(compiler, labels); 781 Condition true_condition = EmitComparisonCode(compiler, labels);
782 EmitBranchOnCondition(compiler, true_condition, labels); 782 EmitBranchOnCondition(compiler, true_condition, labels);
783 } 783 }
784 784
785 785
786 LocationSummary* TestSmiInstr::MakeLocationSummary(Isolate* isolate, 786 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone,
787 bool opt) const { 787 bool opt) const {
788 const intptr_t kNumInputs = 2; 788 const intptr_t kNumInputs = 2;
789 const intptr_t kNumTemps = 0; 789 const intptr_t kNumTemps = 0;
790 LocationSummary* locs = new(isolate) LocationSummary( 790 LocationSummary* locs = new(zone) LocationSummary(
791 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 791 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
792 locs->set_in(0, Location::RequiresRegister()); 792 locs->set_in(0, Location::RequiresRegister());
793 // Only one input can be a constant operand. The case of two constant 793 // Only one input can be a constant operand. The case of two constant
794 // operands should be handled by constant propagation. 794 // operands should be handled by constant propagation.
795 locs->set_in(1, Location::RegisterOrConstant(right())); 795 locs->set_in(1, Location::RegisterOrConstant(right()));
796 return locs; 796 return locs;
797 } 797 }
798 798
799 799
800 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 800 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
801 BranchLabels labels) { 801 BranchLabels labels) {
(...skipping 18 matching lines...) Expand all
820 820
821 821
822 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, 822 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler,
823 BranchInstr* branch) { 823 BranchInstr* branch) {
824 BranchLabels labels = compiler->CreateBranchLabels(branch); 824 BranchLabels labels = compiler->CreateBranchLabels(branch);
825 Condition true_condition = EmitComparisonCode(compiler, labels); 825 Condition true_condition = EmitComparisonCode(compiler, labels);
826 EmitBranchOnCondition(compiler, true_condition, labels); 826 EmitBranchOnCondition(compiler, true_condition, labels);
827 } 827 }
828 828
829 829
830 LocationSummary* TestCidsInstr::MakeLocationSummary(Isolate* isolate, 830 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone,
831 bool opt) const { 831 bool opt) const {
832 const intptr_t kNumInputs = 1; 832 const intptr_t kNumInputs = 1;
833 const intptr_t kNumTemps = 1; 833 const intptr_t kNumTemps = 1;
834 LocationSummary* locs = new(isolate) LocationSummary( 834 LocationSummary* locs = new(zone) LocationSummary(
835 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 835 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
836 locs->set_in(0, Location::RequiresRegister()); 836 locs->set_in(0, Location::RequiresRegister());
837 locs->set_temp(0, Location::RequiresRegister()); 837 locs->set_temp(0, Location::RequiresRegister());
838 locs->set_out(0, Location::RequiresRegister()); 838 locs->set_out(0, Location::RequiresRegister());
839 return locs; 839 return locs;
840 } 840 }
841 841
842 842
843 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, 843 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler,
844 BranchLabels labels) { 844 BranchLabels labels) {
845 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); 845 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 EmitComparisonCode(compiler, labels); 892 EmitComparisonCode(compiler, labels);
893 __ Bind(&is_false); 893 __ Bind(&is_false);
894 __ LoadObject(result_reg, Bool::False()); 894 __ LoadObject(result_reg, Bool::False());
895 __ b(&done); 895 __ b(&done);
896 __ Bind(&is_true); 896 __ Bind(&is_true);
897 __ LoadObject(result_reg, Bool::True()); 897 __ LoadObject(result_reg, Bool::True());
898 __ Bind(&done); 898 __ Bind(&done);
899 } 899 }
900 900
901 901
902 LocationSummary* RelationalOpInstr::MakeLocationSummary(Isolate* isolate, 902 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone,
903 bool opt) const { 903 bool opt) const {
904 const intptr_t kNumInputs = 2; 904 const intptr_t kNumInputs = 2;
905 const intptr_t kNumTemps = 0; 905 const intptr_t kNumTemps = 0;
906 if (operation_cid() == kMintCid) { 906 if (operation_cid() == kMintCid) {
907 const intptr_t kNumTemps = 0; 907 const intptr_t kNumTemps = 0;
908 LocationSummary* locs = new(isolate) LocationSummary( 908 LocationSummary* locs = new(zone) LocationSummary(
909 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 909 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
910 locs->set_in(0, Location::Pair(Location::RequiresRegister(), 910 locs->set_in(0, Location::Pair(Location::RequiresRegister(),
911 Location::RequiresRegister())); 911 Location::RequiresRegister()));
912 locs->set_in(1, Location::Pair(Location::RequiresRegister(), 912 locs->set_in(1, Location::Pair(Location::RequiresRegister(),
913 Location::RequiresRegister())); 913 Location::RequiresRegister()));
914 locs->set_out(0, Location::RequiresRegister()); 914 locs->set_out(0, Location::RequiresRegister());
915 return locs; 915 return locs;
916 } 916 }
917 if (operation_cid() == kDoubleCid) { 917 if (operation_cid() == kDoubleCid) {
918 LocationSummary* summary = new(isolate) LocationSummary( 918 LocationSummary* summary = new(zone) LocationSummary(
919 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 919 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
920 summary->set_in(0, Location::RequiresFpuRegister()); 920 summary->set_in(0, Location::RequiresFpuRegister());
921 summary->set_in(1, Location::RequiresFpuRegister()); 921 summary->set_in(1, Location::RequiresFpuRegister());
922 summary->set_out(0, Location::RequiresRegister()); 922 summary->set_out(0, Location::RequiresRegister());
923 return summary; 923 return summary;
924 } 924 }
925 ASSERT(operation_cid() == kSmiCid); 925 ASSERT(operation_cid() == kSmiCid);
926 LocationSummary* summary = new(isolate) LocationSummary( 926 LocationSummary* summary = new(zone) LocationSummary(
927 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 927 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
928 summary->set_in(0, Location::RegisterOrConstant(left())); 928 summary->set_in(0, Location::RegisterOrConstant(left()));
929 // Only one input can be a constant operand. The case of two constant 929 // Only one input can be a constant operand. The case of two constant
930 // operands should be handled by constant propagation. 930 // operands should be handled by constant propagation.
931 summary->set_in(1, summary->in(0).IsConstant() 931 summary->set_in(1, summary->in(0).IsConstant()
932 ? Location::RequiresRegister() 932 ? Location::RequiresRegister()
933 : Location::RegisterOrConstant(right())); 933 : Location::RegisterOrConstant(right()));
934 summary->set_out(0, Location::RequiresRegister()); 934 summary->set_out(0, Location::RequiresRegister());
935 return summary; 935 return summary;
936 } 936 }
937 937
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, 971 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler,
972 BranchInstr* branch) { 972 BranchInstr* branch) {
973 __ TraceSimMsg("RelationalOpInstr"); 973 __ TraceSimMsg("RelationalOpInstr");
974 974
975 BranchLabels labels = compiler->CreateBranchLabels(branch); 975 BranchLabels labels = compiler->CreateBranchLabels(branch);
976 Condition true_condition = EmitComparisonCode(compiler, labels); 976 Condition true_condition = EmitComparisonCode(compiler, labels);
977 EmitBranchOnCondition(compiler, true_condition, labels); 977 EmitBranchOnCondition(compiler, true_condition, labels);
978 } 978 }
979 979
980 980
981 LocationSummary* NativeCallInstr::MakeLocationSummary(Isolate* isolate, 981 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone,
982 bool opt) const { 982 bool opt) const {
983 return MakeCallSummary(isolate); 983 return MakeCallSummary(zone);
984 } 984 }
985 985
986 986
987 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 987 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
988 __ TraceSimMsg("NativeCallInstr"); 988 __ TraceSimMsg("NativeCallInstr");
989 Register result = locs()->out(0).reg(); 989 Register result = locs()->out(0).reg();
990 990
991 // Push the result place holder initialized to NULL. 991 // Push the result place holder initialized to NULL.
992 __ PushObject(Object::null_object()); 992 __ PushObject(Object::null_object());
993 // Pass a pointer to the first argument in A2. 993 // Pass a pointer to the first argument in A2.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 __ LoadImmediate(T5, entry); 1027 __ LoadImmediate(T5, entry);
1028 __ LoadImmediate(A1, argc_tag); 1028 __ LoadImmediate(A1, argc_tag);
1029 compiler->GenerateCall(token_pos(), 1029 compiler->GenerateCall(token_pos(),
1030 stub_entry, 1030 stub_entry,
1031 RawPcDescriptors::kOther, 1031 RawPcDescriptors::kOther,
1032 locs()); 1032 locs());
1033 __ Pop(result); 1033 __ Pop(result);
1034 } 1034 }
1035 1035
1036 1036
1037 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Isolate* isolate, 1037 LocationSummary* StringFromCharCodeInstr::MakeLocationSummary(Zone* zone,
1038 bool opt) const { 1038 bool opt) const {
1039 const intptr_t kNumInputs = 1; 1039 const intptr_t kNumInputs = 1;
1040 // TODO(fschneider): Allow immediate operands for the char code. 1040 // TODO(fschneider): Allow immediate operands for the char code.
1041 return LocationSummary::Make(isolate, 1041 return LocationSummary::Make(zone,
1042 kNumInputs, 1042 kNumInputs,
1043 Location::RequiresRegister(), 1043 Location::RequiresRegister(),
1044 LocationSummary::kNoCall); 1044 LocationSummary::kNoCall);
1045 } 1045 }
1046 1046
1047 1047
1048 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1048 void StringFromCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1049 Register char_code = locs()->in(0).reg(); 1049 Register char_code = locs()->in(0).reg();
1050 Register result = locs()->out(0).reg(); 1050 Register result = locs()->out(0).reg();
1051 1051
1052 __ TraceSimMsg("StringFromCharCodeInstr"); 1052 __ TraceSimMsg("StringFromCharCodeInstr");
1053 1053
1054 __ LoadImmediate(result, 1054 __ LoadImmediate(result,
1055 reinterpret_cast<uword>(Symbols::PredefinedAddress())); 1055 reinterpret_cast<uword>(Symbols::PredefinedAddress()));
1056 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize); 1056 __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
1057 __ sll(TMP, char_code, 1); // Char code is a smi. 1057 __ sll(TMP, char_code, 1); // Char code is a smi.
1058 __ addu(TMP, TMP, result); 1058 __ addu(TMP, TMP, result);
1059 __ lw(result, Address(TMP)); 1059 __ lw(result, Address(TMP));
1060 } 1060 }
1061 1061
1062 1062
1063 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Isolate* isolate, 1063 LocationSummary* StringToCharCodeInstr::MakeLocationSummary(Zone* zone,
1064 bool opt) const { 1064 bool opt) const {
1065 const intptr_t kNumInputs = 1; 1065 const intptr_t kNumInputs = 1;
1066 return LocationSummary::Make(isolate, 1066 return LocationSummary::Make(zone,
1067 kNumInputs, 1067 kNumInputs,
1068 Location::RequiresRegister(), 1068 Location::RequiresRegister(),
1069 LocationSummary::kNoCall); 1069 LocationSummary::kNoCall);
1070 } 1070 }
1071 1071
1072 1072
1073 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1073 void StringToCharCodeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1074 __ TraceSimMsg("StringToCharCodeInstr"); 1074 __ TraceSimMsg("StringToCharCodeInstr");
1075 1075
1076 ASSERT(cid_ == kOneByteStringCid); 1076 ASSERT(cid_ == kOneByteStringCid);
1077 Register str = locs()->in(0).reg(); 1077 Register str = locs()->in(0).reg();
1078 Register result = locs()->out(0).reg(); 1078 Register result = locs()->out(0).reg();
1079 ASSERT(str != result); 1079 ASSERT(str != result);
1080 Label done; 1080 Label done;
1081 __ lw(result, FieldAddress(str, String::length_offset())); 1081 __ lw(result, FieldAddress(str, String::length_offset()));
1082 __ BranchNotEqual(result, Immediate(Smi::RawValue(1)), &done); 1082 __ BranchNotEqual(result, Immediate(Smi::RawValue(1)), &done);
1083 __ delay_slot()->addiu(result, ZR, Immediate(Smi::RawValue(-1))); 1083 __ delay_slot()->addiu(result, ZR, Immediate(Smi::RawValue(-1)));
1084 __ lbu(result, FieldAddress(str, OneByteString::data_offset())); 1084 __ lbu(result, FieldAddress(str, OneByteString::data_offset()));
1085 __ SmiTag(result); 1085 __ SmiTag(result);
1086 __ Bind(&done); 1086 __ Bind(&done);
1087 } 1087 }
1088 1088
1089 1089
1090 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Isolate* isolate, 1090 LocationSummary* StringInterpolateInstr::MakeLocationSummary(Zone* zone,
1091 bool opt) const { 1091 bool opt) const {
1092 const intptr_t kNumInputs = 1; 1092 const intptr_t kNumInputs = 1;
1093 const intptr_t kNumTemps = 0; 1093 const intptr_t kNumTemps = 0;
1094 LocationSummary* summary = new(isolate) LocationSummary( 1094 LocationSummary* summary = new(zone) LocationSummary(
1095 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 1095 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
1096 summary->set_in(0, Location::RegisterLocation(A0)); 1096 summary->set_in(0, Location::RegisterLocation(A0));
1097 summary->set_out(0, Location::RegisterLocation(V0)); 1097 summary->set_out(0, Location::RegisterLocation(V0));
1098 return summary; 1098 return summary;
1099 } 1099 }
1100 1100
1101 1101
1102 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1102 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1103 Register array = locs()->in(0).reg(); 1103 Register array = locs()->in(0).reg();
1104 __ Push(array); 1104 __ Push(array);
1105 const int kNumberOfArguments = 1; 1105 const int kNumberOfArguments = 1;
1106 const Array& kNoArgumentNames = Object::null_array(); 1106 const Array& kNoArgumentNames = Object::null_array();
1107 compiler->GenerateStaticCall(deopt_id(), 1107 compiler->GenerateStaticCall(deopt_id(),
1108 token_pos(), 1108 token_pos(),
1109 CallFunction(), 1109 CallFunction(),
1110 kNumberOfArguments, 1110 kNumberOfArguments,
1111 kNoArgumentNames, 1111 kNoArgumentNames,
1112 locs(), 1112 locs(),
1113 ICData::Handle()); 1113 ICData::Handle());
1114 ASSERT(locs()->out(0).reg() == V0); 1114 ASSERT(locs()->out(0).reg() == V0);
1115 } 1115 }
1116 1116
1117 1117
1118 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Isolate* isolate, 1118 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
1119 bool opt) const { 1119 bool opt) const {
1120 const intptr_t kNumInputs = 1; 1120 const intptr_t kNumInputs = 1;
1121 return LocationSummary::Make(isolate, 1121 return LocationSummary::Make(zone,
1122 kNumInputs, 1122 kNumInputs,
1123 Location::RequiresRegister(), 1123 Location::RequiresRegister(),
1124 LocationSummary::kNoCall); 1124 LocationSummary::kNoCall);
1125 } 1125 }
1126 1126
1127 1127
1128 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1128 void LoadUntaggedInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1129 Register obj = locs()->in(0).reg(); 1129 Register obj = locs()->in(0).reg();
1130 Register result = locs()->out(0).reg(); 1130 Register result = locs()->out(0).reg();
1131 if (object()->definition()->representation() == kUntagged) { 1131 if (object()->definition()->representation() == kUntagged) {
1132 __ LoadFromOffset(result, obj, offset()); 1132 __ LoadFromOffset(result, obj, offset());
1133 } else { 1133 } else {
1134 ASSERT(object()->definition()->representation() == kTagged); 1134 ASSERT(object()->definition()->representation() == kTagged);
1135 __ LoadFieldFromOffset(result, obj, offset()); 1135 __ LoadFieldFromOffset(result, obj, offset());
1136 } 1136 }
1137 } 1137 }
1138 1138
1139 1139
1140 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Isolate* isolate, 1140 LocationSummary* LoadClassIdInstr::MakeLocationSummary(Zone* zone,
1141 bool opt) const { 1141 bool opt) const {
1142 const intptr_t kNumInputs = 1; 1142 const intptr_t kNumInputs = 1;
1143 return LocationSummary::Make(isolate, 1143 return LocationSummary::Make(zone,
1144 kNumInputs, 1144 kNumInputs,
1145 Location::RequiresRegister(), 1145 Location::RequiresRegister(),
1146 LocationSummary::kNoCall); 1146 LocationSummary::kNoCall);
1147 } 1147 }
1148 1148
1149 1149
1150 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1150 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1151 Register object = locs()->in(0).reg(); 1151 Register object = locs()->in(0).reg();
1152 Register result = locs()->out(0).reg(); 1152 Register result = locs()->out(0).reg();
1153 __ LoadTaggedClassIdMayBeSmi(result, object); 1153 __ LoadTaggedClassIdMayBeSmi(result, object);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 const intptr_t scale = Instance::ElementSizeFor(cid); 1231 const intptr_t scale = Instance::ElementSizeFor(cid);
1232 const int64_t offset = index * scale + 1232 const int64_t offset = index * scale +
1233 (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag)); 1233 (is_external ? 0 : (Instance::DataOffsetFor(cid) - kHeapObjectTag));
1234 if (!Utils::IsInt(32, offset)) { 1234 if (!Utils::IsInt(32, offset)) {
1235 return false; 1235 return false;
1236 } 1236 }
1237 return Address::CanHoldOffset(static_cast<int32_t>(offset)); 1237 return Address::CanHoldOffset(static_cast<int32_t>(offset));
1238 } 1238 }
1239 1239
1240 1240
1241 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Isolate* isolate, 1241 LocationSummary* LoadIndexedInstr::MakeLocationSummary(Zone* zone,
1242 bool opt) const { 1242 bool opt) const {
1243 const intptr_t kNumInputs = 2; 1243 const intptr_t kNumInputs = 2;
1244 const intptr_t kNumTemps = 0; 1244 const intptr_t kNumTemps = 0;
1245 LocationSummary* locs = new(isolate) LocationSummary( 1245 LocationSummary* locs = new(zone) LocationSummary(
1246 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1246 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1247 locs->set_in(0, Location::RequiresRegister()); 1247 locs->set_in(0, Location::RequiresRegister());
1248 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { 1248 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
1249 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); 1249 locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
1250 } else { 1250 } else {
1251 locs->set_in(1, Location::RequiresRegister()); 1251 locs->set_in(1, Location::RequiresRegister());
1252 } 1252 }
1253 if ((representation() == kUnboxedDouble) || 1253 if ((representation() == kUnboxedDouble) ||
1254 (representation() == kUnboxedFloat32x4) || 1254 (representation() == kUnboxedFloat32x4) ||
1255 (representation() == kUnboxedInt32x4)) { 1255 (representation() == kUnboxedInt32x4)) {
1256 locs->set_out(0, Location::RequiresFpuRegister()); 1256 locs->set_out(0, Location::RequiresFpuRegister());
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1346 __ SmiTag(result); 1346 __ SmiTag(result);
1347 break; 1347 break;
1348 default: 1348 default:
1349 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid)); 1349 ASSERT((class_id() == kArrayCid) || (class_id() == kImmutableArrayCid));
1350 __ lw(result, element_address); 1350 __ lw(result, element_address);
1351 break; 1351 break;
1352 } 1352 }
1353 } 1353 }
1354 1354
1355 1355
1356 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Isolate* isolate, 1356 LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone,
1357 bool opt) const { 1357 bool opt) const {
1358 const intptr_t kNumInputs = 2; 1358 const intptr_t kNumInputs = 2;
1359 const intptr_t kNumTemps = 0; 1359 const intptr_t kNumTemps = 0;
1360 LocationSummary* summary = new(isolate) LocationSummary( 1360 LocationSummary* summary = new(zone) LocationSummary(
1361 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1361 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1362 summary->set_in(0, Location::RequiresRegister()); 1362 summary->set_in(0, Location::RequiresRegister());
1363 summary->set_in(1, Location::RequiresRegister()); 1363 summary->set_in(1, Location::RequiresRegister());
1364 1364
1365 // TODO(zerny): Handle mints properly once possible. 1365 // TODO(zerny): Handle mints properly once possible.
1366 ASSERT(representation() == kTagged); 1366 ASSERT(representation() == kTagged);
1367 summary->set_out(0, Location::RequiresRegister()); 1367 summary->set_out(0, Location::RequiresRegister());
1368 1368
1369 return summary; 1369 return summary;
1370 } 1370 }
1371 1371
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 return kUnboxedFloat32x4; 1436 return kUnboxedFloat32x4;
1437 case kTypedDataInt32x4ArrayCid: 1437 case kTypedDataInt32x4ArrayCid:
1438 return kUnboxedInt32x4; 1438 return kUnboxedInt32x4;
1439 default: 1439 default:
1440 UNIMPLEMENTED(); 1440 UNIMPLEMENTED();
1441 return kTagged; 1441 return kTagged;
1442 } 1442 }
1443 } 1443 }
1444 1444
1445 1445
1446 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Isolate* isolate, 1446 LocationSummary* StoreIndexedInstr::MakeLocationSummary(Zone* zone,
1447 bool opt) const { 1447 bool opt) const {
1448 const intptr_t kNumInputs = 3; 1448 const intptr_t kNumInputs = 3;
1449 const intptr_t kNumTemps = 0; 1449 const intptr_t kNumTemps = 0;
1450 LocationSummary* locs = new(isolate) LocationSummary( 1450 LocationSummary* locs = new(zone) LocationSummary(
1451 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1451 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1452 locs->set_in(0, Location::RequiresRegister()); 1452 locs->set_in(0, Location::RequiresRegister());
1453 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) { 1453 if (CanBeImmediateIndex(index(), class_id(), IsExternal())) {
1454 locs->set_in(1, Location::Constant(index()->definition()->AsConstant())); 1454 locs->set_in(1, Location::Constant(index()->definition()->AsConstant()));
1455 } else { 1455 } else {
1456 locs->set_in(1, Location::WritableRegister()); 1456 locs->set_in(1, Location::WritableRegister());
1457 } 1457 }
1458 switch (class_id()) { 1458 switch (class_id()) {
1459 case kArrayCid: 1459 case kArrayCid:
1460 locs->set_in(2, ShouldEmitStoreBarrier() 1460 locs->set_in(2, ShouldEmitStoreBarrier()
1461 ? Location::WritableRegister() 1461 ? Location::WritableRegister()
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 case kTypedDataInt32x4ArrayCid: 1580 case kTypedDataInt32x4ArrayCid:
1581 case kTypedDataFloat32x4ArrayCid: 1581 case kTypedDataFloat32x4ArrayCid:
1582 UNIMPLEMENTED(); 1582 UNIMPLEMENTED();
1583 break; 1583 break;
1584 default: 1584 default:
1585 UNREACHABLE(); 1585 UNREACHABLE();
1586 } 1586 }
1587 } 1587 }
1588 1588
1589 1589
1590 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Isolate* isolate, 1590 LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone,
1591 bool opt) const { 1591 bool opt) const {
1592 const intptr_t kNumInputs = 1; 1592 const intptr_t kNumInputs = 1;
1593 1593
1594 const intptr_t value_cid = value()->Type()->ToCid(); 1594 const intptr_t value_cid = value()->Type()->ToCid();
1595 const intptr_t field_cid = field().guarded_cid(); 1595 const intptr_t field_cid = field().guarded_cid();
1596 1596
1597 const bool emit_full_guard = !opt || (field_cid == kIllegalCid); 1597 const bool emit_full_guard = !opt || (field_cid == kIllegalCid);
1598 const bool needs_value_cid_temp_reg = 1598 const bool needs_value_cid_temp_reg =
1599 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid)); 1599 (value_cid == kDynamicCid) && (emit_full_guard || (field_cid != kSmiCid));
1600 const bool needs_field_temp_reg = emit_full_guard; 1600 const bool needs_field_temp_reg = emit_full_guard;
1601 1601
1602 intptr_t num_temps = 0; 1602 intptr_t num_temps = 0;
1603 if (needs_value_cid_temp_reg) { 1603 if (needs_value_cid_temp_reg) {
1604 num_temps++; 1604 num_temps++;
1605 } 1605 }
1606 if (needs_field_temp_reg) { 1606 if (needs_field_temp_reg) {
1607 num_temps++; 1607 num_temps++;
1608 } 1608 }
1609 1609
1610 LocationSummary* summary = new(isolate) LocationSummary( 1610 LocationSummary* summary = new(zone) LocationSummary(
1611 isolate, kNumInputs, num_temps, LocationSummary::kNoCall); 1611 zone, kNumInputs, num_temps, LocationSummary::kNoCall);
1612 summary->set_in(0, Location::RequiresRegister()); 1612 summary->set_in(0, Location::RequiresRegister());
1613 1613
1614 for (intptr_t i = 0; i < num_temps; i++) { 1614 for (intptr_t i = 0; i < num_temps; i++) {
1615 summary->set_temp(i, Location::RequiresRegister()); 1615 summary->set_temp(i, Location::RequiresRegister());
1616 } 1616 }
1617 1617
1618 return summary; 1618 return summary;
1619 } 1619 }
1620 1620
1621 1621
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 } else { 1750 } else {
1751 // Both value's and field's class id is known. 1751 // Both value's and field's class id is known.
1752 ASSERT((value_cid != field_cid) && (value_cid != nullability)); 1752 ASSERT((value_cid != field_cid) && (value_cid != nullability));
1753 __ b(fail); 1753 __ b(fail);
1754 } 1754 }
1755 } 1755 }
1756 __ Bind(&ok); 1756 __ Bind(&ok);
1757 } 1757 }
1758 1758
1759 1759
1760 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Isolate* isolate, 1760 LocationSummary* GuardFieldLengthInstr::MakeLocationSummary(Zone* zone,
1761 bool opt) const { 1761 bool opt) const {
1762 const intptr_t kNumInputs = 1; 1762 const intptr_t kNumInputs = 1;
1763 1763
1764 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1764 if (!opt || (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1765 const intptr_t kNumTemps = 1; 1765 const intptr_t kNumTemps = 1;
1766 LocationSummary* summary = new(isolate) LocationSummary( 1766 LocationSummary* summary = new(zone) LocationSummary(
1767 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 1767 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
1768 summary->set_in(0, Location::RequiresRegister()); 1768 summary->set_in(0, Location::RequiresRegister());
1769 // We need temporaries for field object. 1769 // We need temporaries for field object.
1770 summary->set_temp(0, Location::RequiresRegister()); 1770 summary->set_temp(0, Location::RequiresRegister());
1771 return summary; 1771 return summary;
1772 } else { 1772 } else {
1773 LocationSummary* summary = new(isolate) LocationSummary( 1773 LocationSummary* summary = new(zone) LocationSummary(
1774 isolate, kNumInputs, 0, LocationSummary::kNoCall); 1774 zone, kNumInputs, 0, LocationSummary::kNoCall);
1775 summary->set_in(0, Location::RequiresRegister()); 1775 summary->set_in(0, Location::RequiresRegister());
1776 return summary; 1776 return summary;
1777 } 1777 }
1778 UNREACHABLE(); 1778 UNREACHABLE();
1779 } 1779 }
1780 1780
1781 1781
1782 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1782 void GuardFieldLengthInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1783 if (field().guarded_list_length() == Field::kNoFixedLength) { 1783 if (field().guarded_list_length() == Field::kNoFixedLength) {
1784 ASSERT(!compiler->is_optimizing()); 1784 ASSERT(!compiler->is_optimizing());
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 } 1901 }
1902 } 1902 }
1903 1903
1904 private: 1904 private:
1905 Instruction* instruction_; 1905 Instruction* instruction_;
1906 const Class& cls_; 1906 const Class& cls_;
1907 const Register result_; 1907 const Register result_;
1908 }; 1908 };
1909 1909
1910 1910
1911 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Isolate* isolate, 1911 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone,
1912 bool opt) const { 1912 bool opt) const {
1913 const intptr_t kNumInputs = 2; 1913 const intptr_t kNumInputs = 2;
1914 const intptr_t kNumTemps = 1914 const intptr_t kNumTemps =
1915 (IsUnboxedStore() && opt) ? 2 : 1915 (IsUnboxedStore() && opt) ? 2 :
1916 ((IsPotentialUnboxedStore()) ? 3 : 0); 1916 ((IsPotentialUnboxedStore()) ? 3 : 0);
1917 LocationSummary* summary = new(isolate) LocationSummary( 1917 LocationSummary* summary = new(zone) LocationSummary(
1918 isolate, kNumInputs, kNumTemps, 1918 zone, kNumInputs, kNumTemps,
1919 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || 1919 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) ||
1920 IsPotentialUnboxedStore()) 1920 IsPotentialUnboxedStore())
1921 ? LocationSummary::kCallOnSlowPath 1921 ? LocationSummary::kCallOnSlowPath
1922 : LocationSummary::kNoCall); 1922 : LocationSummary::kNoCall);
1923 1923
1924 summary->set_in(0, Location::RequiresRegister()); 1924 summary->set_in(0, Location::RequiresRegister());
1925 if (IsUnboxedStore() && opt) { 1925 if (IsUnboxedStore() && opt) {
1926 summary->set_in(1, Location::RequiresFpuRegister()); 1926 summary->set_in(1, Location::RequiresFpuRegister());
1927 summary->set_temp(0, Location::RequiresRegister()); 1927 summary->set_temp(0, Location::RequiresRegister());
1928 summary->set_temp(1, Location::RequiresRegister()); 1928 summary->set_temp(1, Location::RequiresRegister());
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 Register value_reg = locs()->in(1).reg(); 2068 Register value_reg = locs()->in(1).reg();
2069 __ StoreIntoObjectNoBarrierOffset(instance_reg, 2069 __ StoreIntoObjectNoBarrierOffset(instance_reg,
2070 offset_in_bytes_, 2070 offset_in_bytes_,
2071 value_reg); 2071 value_reg);
2072 } 2072 }
2073 } 2073 }
2074 __ Bind(&skip_store); 2074 __ Bind(&skip_store);
2075 } 2075 }
2076 2076
2077 2077
2078 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Isolate* isolate, 2078 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone,
2079 bool opt) const { 2079 bool opt) const {
2080 const intptr_t kNumInputs = 1; 2080 const intptr_t kNumInputs = 1;
2081 const intptr_t kNumTemps = 0; 2081 const intptr_t kNumTemps = 0;
2082 LocationSummary* summary = new(isolate) LocationSummary( 2082 LocationSummary* summary = new(zone) LocationSummary(
2083 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 2083 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
2084 summary->set_in(0, Location::RequiresRegister()); 2084 summary->set_in(0, Location::RequiresRegister());
2085 summary->set_out(0, Location::RequiresRegister()); 2085 summary->set_out(0, Location::RequiresRegister());
2086 return summary; 2086 return summary;
2087 } 2087 }
2088 2088
2089 2089
2090 // When the parser is building an implicit static getter for optimization, 2090 // When the parser is building an implicit static getter for optimization,
2091 // it can generate a function body where deoptimization ids do not line up 2091 // it can generate a function body where deoptimization ids do not line up
2092 // with the unoptimized code. 2092 // with the unoptimized code.
2093 // 2093 //
2094 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. 2094 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
2095 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2095 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2096 __ TraceSimMsg("LoadStaticFieldInstr"); 2096 __ TraceSimMsg("LoadStaticFieldInstr");
2097 Register field = locs()->in(0).reg(); 2097 Register field = locs()->in(0).reg();
2098 Register result = locs()->out(0).reg(); 2098 Register result = locs()->out(0).reg();
2099 __ LoadFromOffset(result, field, Field::value_offset() - kHeapObjectTag); 2099 __ LoadFromOffset(result, field, Field::value_offset() - kHeapObjectTag);
2100 } 2100 }
2101 2101
2102 2102
2103 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Isolate* isolate, 2103 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
2104 bool opt) const { 2104 bool opt) const {
2105 LocationSummary* locs = new(isolate) LocationSummary( 2105 LocationSummary* locs = new(zone) LocationSummary(
2106 isolate, 1, 1, LocationSummary::kNoCall); 2106 zone, 1, 1, LocationSummary::kNoCall);
2107 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() 2107 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
2108 : Location::RequiresRegister()); 2108 : Location::RequiresRegister());
2109 locs->set_temp(0, Location::RequiresRegister()); 2109 locs->set_temp(0, Location::RequiresRegister());
2110 return locs; 2110 return locs;
2111 } 2111 }
2112 2112
2113 2113
2114 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2114 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2115 __ TraceSimMsg("StoreStaticFieldInstr"); 2115 __ TraceSimMsg("StoreStaticFieldInstr");
2116 Register value = locs()->in(0).reg(); 2116 Register value = locs()->in(0).reg();
2117 Register temp = locs()->temp(0).reg(); 2117 Register temp = locs()->temp(0).reg();
2118 2118
2119 __ LoadObject(temp, field()); 2119 __ LoadObject(temp, field());
2120 if (this->value()->NeedsStoreBuffer()) { 2120 if (this->value()->NeedsStoreBuffer()) {
2121 __ StoreIntoObject(temp, 2121 __ StoreIntoObject(temp,
2122 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); 2122 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
2123 } else { 2123 } else {
2124 __ StoreIntoObjectNoBarrier( 2124 __ StoreIntoObjectNoBarrier(
2125 temp, FieldAddress(temp, Field::value_offset()), value); 2125 temp, FieldAddress(temp, Field::value_offset()), value);
2126 } 2126 }
2127 } 2127 }
2128 2128
2129 2129
2130 LocationSummary* InstanceOfInstr::MakeLocationSummary(Isolate* isolate, 2130 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone,
2131 bool opt) const { 2131 bool opt) const {
2132 const intptr_t kNumInputs = 3; 2132 const intptr_t kNumInputs = 3;
2133 const intptr_t kNumTemps = 0; 2133 const intptr_t kNumTemps = 0;
2134 LocationSummary* summary = new(isolate) LocationSummary( 2134 LocationSummary* summary = new(zone) LocationSummary(
2135 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2135 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2136 summary->set_in(0, Location::RegisterLocation(A0)); 2136 summary->set_in(0, Location::RegisterLocation(A0));
2137 summary->set_in(1, Location::RegisterLocation(A2)); 2137 summary->set_in(1, Location::RegisterLocation(A2));
2138 summary->set_in(2, Location::RegisterLocation(A1)); 2138 summary->set_in(2, Location::RegisterLocation(A1));
2139 summary->set_out(0, Location::RegisterLocation(V0)); 2139 summary->set_out(0, Location::RegisterLocation(V0));
2140 return summary; 2140 return summary;
2141 } 2141 }
2142 2142
2143 2143
2144 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2144 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2145 ASSERT(locs()->in(0).reg() == A0); // Value. 2145 ASSERT(locs()->in(0).reg() == A0); // Value.
2146 ASSERT(locs()->in(1).reg() == A2); // Instantiator. 2146 ASSERT(locs()->in(1).reg() == A2); // Instantiator.
2147 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments. 2147 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments.
2148 2148
2149 __ Comment("InstanceOfInstr"); 2149 __ Comment("InstanceOfInstr");
2150 compiler->GenerateInstanceOf(token_pos(), 2150 compiler->GenerateInstanceOf(token_pos(),
2151 deopt_id(), 2151 deopt_id(),
2152 type(), 2152 type(),
2153 negate_result(), 2153 negate_result(),
2154 locs()); 2154 locs());
2155 ASSERT(locs()->out(0).reg() == V0); 2155 ASSERT(locs()->out(0).reg() == V0);
2156 } 2156 }
2157 2157
2158 2158
2159 LocationSummary* CreateArrayInstr::MakeLocationSummary(Isolate* isolate, 2159 LocationSummary* CreateArrayInstr::MakeLocationSummary(Zone* zone,
2160 bool opt) const { 2160 bool opt) const {
2161 const intptr_t kNumInputs = 2; 2161 const intptr_t kNumInputs = 2;
2162 const intptr_t kNumTemps = 0; 2162 const intptr_t kNumTemps = 0;
2163 LocationSummary* locs = new(isolate) LocationSummary( 2163 LocationSummary* locs = new(zone) LocationSummary(
2164 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2164 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2165 locs->set_in(0, Location::RegisterLocation(A0)); 2165 locs->set_in(0, Location::RegisterLocation(A0));
2166 locs->set_in(1, Location::RegisterLocation(A1)); 2166 locs->set_in(1, Location::RegisterLocation(A1));
2167 locs->set_out(0, Location::RegisterLocation(V0)); 2167 locs->set_out(0, Location::RegisterLocation(V0));
2168 return locs; 2168 return locs;
2169 } 2169 }
2170 2170
2171 2171
2172 // Inlines array allocation for known constant values. 2172 // Inlines array allocation for known constant values.
2173 static void InlineArrayAllocation(FlowGraphCompiler* compiler, 2173 static void InlineArrayAllocation(FlowGraphCompiler* compiler,
2174 intptr_t num_elements, 2174 intptr_t num_elements,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 compiler->GenerateCall(token_pos(), 2264 compiler->GenerateCall(token_pos(),
2265 &label, 2265 &label,
2266 RawPcDescriptors::kOther, 2266 RawPcDescriptors::kOther,
2267 locs()); 2267 locs());
2268 compiler->AddStubCallTarget(stub); 2268 compiler->AddStubCallTarget(stub);
2269 __ Bind(&done); 2269 __ Bind(&done);
2270 ASSERT(locs()->out(0).reg() == kResultReg); 2270 ASSERT(locs()->out(0).reg() == kResultReg);
2271 } 2271 }
2272 2272
2273 2273
2274 LocationSummary* LoadFieldInstr::MakeLocationSummary(Isolate* isolate, 2274 LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone,
2275 bool opt) const { 2275 bool opt) const {
2276 const intptr_t kNumInputs = 1; 2276 const intptr_t kNumInputs = 1;
2277 const intptr_t kNumTemps = 2277 const intptr_t kNumTemps =
2278 (IsUnboxedLoad() && opt) ? 1 : 2278 (IsUnboxedLoad() && opt) ? 1 :
2279 ((IsPotentialUnboxedLoad()) ? 2 : 0); 2279 ((IsPotentialUnboxedLoad()) ? 2 : 0);
2280 LocationSummary* locs = new(isolate) LocationSummary( 2280 LocationSummary* locs = new(zone) LocationSummary(
2281 isolate, kNumInputs, kNumTemps, 2281 zone, kNumInputs, kNumTemps,
2282 (opt && !IsPotentialUnboxedLoad()) 2282 (opt && !IsPotentialUnboxedLoad())
2283 ? LocationSummary::kNoCall 2283 ? LocationSummary::kNoCall
2284 : LocationSummary::kCallOnSlowPath); 2284 : LocationSummary::kCallOnSlowPath);
2285 2285
2286 locs->set_in(0, Location::RequiresRegister()); 2286 locs->set_in(0, Location::RequiresRegister());
2287 2287
2288 if (IsUnboxedLoad() && opt) { 2288 if (IsUnboxedLoad() && opt) {
2289 locs->set_temp(0, Location::RequiresRegister()); 2289 locs->set_temp(0, Location::RequiresRegister());
2290 } else if (IsPotentialUnboxedLoad()) { 2290 } else if (IsPotentialUnboxedLoad()) {
2291 locs->set_temp(0, opt ? Location::RequiresFpuRegister() 2291 locs->set_temp(0, opt ? Location::RequiresFpuRegister()
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 __ b(&done); 2355 __ b(&done);
2356 } 2356 }
2357 2357
2358 __ Bind(&load_pointer); 2358 __ Bind(&load_pointer);
2359 } 2359 }
2360 __ LoadFieldFromOffset(result_reg, instance_reg, offset_in_bytes()); 2360 __ LoadFieldFromOffset(result_reg, instance_reg, offset_in_bytes());
2361 __ Bind(&done); 2361 __ Bind(&done);
2362 } 2362 }
2363 2363
2364 2364
2365 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Isolate* isolate, 2365 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(Zone* zone,
2366 bool opt) const { 2366 bool opt) const {
2367 const intptr_t kNumInputs = 1; 2367 const intptr_t kNumInputs = 1;
2368 const intptr_t kNumTemps = 0; 2368 const intptr_t kNumTemps = 0;
2369 LocationSummary* locs = new(isolate) LocationSummary( 2369 LocationSummary* locs = new(zone) LocationSummary(
2370 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2370 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2371 locs->set_in(0, Location::RegisterLocation(T0)); 2371 locs->set_in(0, Location::RegisterLocation(T0));
2372 locs->set_out(0, Location::RegisterLocation(T0)); 2372 locs->set_out(0, Location::RegisterLocation(T0));
2373 return locs; 2373 return locs;
2374 } 2374 }
2375 2375
2376 2376
2377 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2377 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2378 __ TraceSimMsg("InstantiateTypeInstr"); 2378 __ TraceSimMsg("InstantiateTypeInstr");
2379 Register instantiator_reg = locs()->in(0).reg(); 2379 Register instantiator_reg = locs()->in(0).reg();
2380 Register result_reg = locs()->out(0).reg(); 2380 Register result_reg = locs()->out(0).reg();
(...skipping 15 matching lines...) Expand all
2396 locs()); 2396 locs());
2397 // Pop instantiated type. 2397 // Pop instantiated type.
2398 __ lw(result_reg, Address(SP, 2 * kWordSize)); 2398 __ lw(result_reg, Address(SP, 2 * kWordSize));
2399 // Drop instantiator and uninstantiated type. 2399 // Drop instantiator and uninstantiated type.
2400 __ addiu(SP, SP, Immediate(3 * kWordSize)); 2400 __ addiu(SP, SP, Immediate(3 * kWordSize));
2401 ASSERT(instantiator_reg == result_reg); 2401 ASSERT(instantiator_reg == result_reg);
2402 } 2402 }
2403 2403
2404 2404
2405 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( 2405 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary(
2406 Isolate* isolate, bool opt) const { 2406 Zone* zone, bool opt) const {
2407 const intptr_t kNumInputs = 1; 2407 const intptr_t kNumInputs = 1;
2408 const intptr_t kNumTemps = 0; 2408 const intptr_t kNumTemps = 0;
2409 LocationSummary* locs = new(isolate) LocationSummary( 2409 LocationSummary* locs = new(zone) LocationSummary(
2410 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2410 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2411 locs->set_in(0, Location::RegisterLocation(T0)); 2411 locs->set_in(0, Location::RegisterLocation(T0));
2412 locs->set_out(0, Location::RegisterLocation(T0)); 2412 locs->set_out(0, Location::RegisterLocation(T0));
2413 return locs; 2413 return locs;
2414 } 2414 }
2415 2415
2416 2416
2417 void InstantiateTypeArgumentsInstr::EmitNativeCode( 2417 void InstantiateTypeArgumentsInstr::EmitNativeCode(
2418 FlowGraphCompiler* compiler) { 2418 FlowGraphCompiler* compiler) {
2419 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); 2419 __ TraceSimMsg("InstantiateTypeArgumentsInstr");
2420 Register instantiator_reg = locs()->in(0).reg(); 2420 Register instantiator_reg = locs()->in(0).reg();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 locs()); 2471 locs());
2472 // Pop instantiated type arguments. 2472 // Pop instantiated type arguments.
2473 __ lw(result_reg, Address(SP, 2 * kWordSize)); 2473 __ lw(result_reg, Address(SP, 2 * kWordSize));
2474 // Drop instantiator and uninstantiated type arguments. 2474 // Drop instantiator and uninstantiated type arguments.
2475 __ addiu(SP, SP, Immediate(3 * kWordSize)); 2475 __ addiu(SP, SP, Immediate(3 * kWordSize));
2476 __ Bind(&type_arguments_instantiated); 2476 __ Bind(&type_arguments_instantiated);
2477 } 2477 }
2478 2478
2479 2479
2480 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary( 2480 LocationSummary* AllocateUninitializedContextInstr::MakeLocationSummary(
2481 Isolate* isolate, 2481 Zone* zone,
2482 bool opt) const { 2482 bool opt) const {
2483 ASSERT(opt); 2483 ASSERT(opt);
2484 const intptr_t kNumInputs = 0; 2484 const intptr_t kNumInputs = 0;
2485 const intptr_t kNumTemps = 3; 2485 const intptr_t kNumTemps = 3;
2486 LocationSummary* locs = new(isolate) LocationSummary( 2486 LocationSummary* locs = new(zone) LocationSummary(
2487 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); 2487 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
2488 locs->set_temp(0, Location::RegisterLocation(T1)); 2488 locs->set_temp(0, Location::RegisterLocation(T1));
2489 locs->set_temp(1, Location::RegisterLocation(T2)); 2489 locs->set_temp(1, Location::RegisterLocation(T2));
2490 locs->set_temp(2, Location::RegisterLocation(T3)); 2490 locs->set_temp(2, Location::RegisterLocation(T3));
2491 locs->set_out(0, Location::RegisterLocation(V0)); 2491 locs->set_out(0, Location::RegisterLocation(V0));
2492 return locs; 2492 return locs;
2493 } 2493 }
2494 2494
2495 2495
2496 class AllocateContextSlowPath : public SlowPathCode { 2496 class AllocateContextSlowPath : public SlowPathCode {
2497 public: 2497 public:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2543 temp2); 2543 temp2);
2544 2544
2545 // Setup up number of context variables field. 2545 // Setup up number of context variables field.
2546 __ LoadImmediate(temp0, num_context_variables()); 2546 __ LoadImmediate(temp0, num_context_variables());
2547 __ sw(temp0, FieldAddress(result, Context::num_variables_offset())); 2547 __ sw(temp0, FieldAddress(result, Context::num_variables_offset()));
2548 2548
2549 __ Bind(slow_path->exit_label()); 2549 __ Bind(slow_path->exit_label());
2550 } 2550 }
2551 2551
2552 2552
2553 LocationSummary* AllocateContextInstr::MakeLocationSummary(Isolate* isolate, 2553 LocationSummary* AllocateContextInstr::MakeLocationSummary(Zone* zone,
2554 bool opt) const { 2554 bool opt) const {
2555 const intptr_t kNumInputs = 0; 2555 const intptr_t kNumInputs = 0;
2556 const intptr_t kNumTemps = 1; 2556 const intptr_t kNumTemps = 1;
2557 LocationSummary* locs = new(isolate) LocationSummary( 2557 LocationSummary* locs = new(zone) LocationSummary(
2558 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2558 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2559 locs->set_temp(0, Location::RegisterLocation(T1)); 2559 locs->set_temp(0, Location::RegisterLocation(T1));
2560 locs->set_out(0, Location::RegisterLocation(V0)); 2560 locs->set_out(0, Location::RegisterLocation(V0));
2561 return locs; 2561 return locs;
2562 } 2562 }
2563 2563
2564 2564
2565 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2565 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2566 ASSERT(locs()->temp(0).reg() == T1); 2566 ASSERT(locs()->temp(0).reg() == T1);
2567 ASSERT(locs()->out(0).reg() == V0); 2567 ASSERT(locs()->out(0).reg() == V0);
2568 2568
2569 __ TraceSimMsg("AllocateContextInstr"); 2569 __ TraceSimMsg("AllocateContextInstr");
2570 __ LoadImmediate(T1, num_context_variables()); 2570 __ LoadImmediate(T1, num_context_variables());
2571 StubCode* stub_code = compiler->isolate()->stub_code(); 2571 StubCode* stub_code = compiler->isolate()->stub_code();
2572 const ExternalLabel label(stub_code->AllocateContextEntryPoint()); 2572 const ExternalLabel label(stub_code->AllocateContextEntryPoint());
2573 compiler->GenerateCall(token_pos(), 2573 compiler->GenerateCall(token_pos(),
2574 &label, 2574 &label,
2575 RawPcDescriptors::kOther, 2575 RawPcDescriptors::kOther,
2576 locs()); 2576 locs());
2577 } 2577 }
2578 2578
2579 2579
2580 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Isolate* isolate, 2580 LocationSummary* InitStaticFieldInstr::MakeLocationSummary(Zone* zone,
2581 bool opt) const { 2581 bool opt) const {
2582 const intptr_t kNumInputs = 1; 2582 const intptr_t kNumInputs = 1;
2583 const intptr_t kNumTemps = 1; 2583 const intptr_t kNumTemps = 1;
2584 LocationSummary* locs = new(isolate) LocationSummary( 2584 LocationSummary* locs = new(zone) LocationSummary(
2585 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2585 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2586 locs->set_in(0, Location::RegisterLocation(T0)); 2586 locs->set_in(0, Location::RegisterLocation(T0));
2587 locs->set_temp(0, Location::RegisterLocation(T1)); 2587 locs->set_temp(0, Location::RegisterLocation(T1));
2588 return locs; 2588 return locs;
2589 } 2589 }
2590 2590
2591 2591
2592 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2592 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2593 Register field = locs()->in(0).reg(); 2593 Register field = locs()->in(0).reg();
2594 Register temp = locs()->temp(0).reg(); 2594 Register temp = locs()->temp(0).reg();
2595 2595
(...skipping 15 matching lines...) Expand all
2611 kInitStaticFieldRuntimeEntry, 2611 kInitStaticFieldRuntimeEntry,
2612 1, 2612 1,
2613 locs()); 2613 locs());
2614 2614
2615 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Purge argument and result. 2615 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Purge argument and result.
2616 2616
2617 __ Bind(&no_call); 2617 __ Bind(&no_call);
2618 } 2618 }
2619 2619
2620 2620
2621 LocationSummary* CloneContextInstr::MakeLocationSummary(Isolate* isolate, 2621 LocationSummary* CloneContextInstr::MakeLocationSummary(Zone* zone,
2622 bool opt) const { 2622 bool opt) const {
2623 const intptr_t kNumInputs = 1; 2623 const intptr_t kNumInputs = 1;
2624 const intptr_t kNumTemps = 0; 2624 const intptr_t kNumTemps = 0;
2625 LocationSummary* locs = new(isolate) LocationSummary( 2625 LocationSummary* locs = new(zone) LocationSummary(
2626 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 2626 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
2627 locs->set_in(0, Location::RegisterLocation(T0)); 2627 locs->set_in(0, Location::RegisterLocation(T0));
2628 locs->set_out(0, Location::RegisterLocation(T0)); 2628 locs->set_out(0, Location::RegisterLocation(T0));
2629 return locs; 2629 return locs;
2630 } 2630 }
2631 2631
2632 2632
2633 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2633 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2634 Register context_value = locs()->in(0).reg(); 2634 Register context_value = locs()->in(0).reg();
2635 Register result = locs()->out(0).reg(); 2635 Register result = locs()->out(0).reg();
2636 2636
2637 __ TraceSimMsg("CloneContextInstr"); 2637 __ TraceSimMsg("CloneContextInstr");
2638 2638
2639 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 2639 __ addiu(SP, SP, Immediate(-2 * kWordSize));
2640 __ LoadObject(TMP, Object::null_object()); // Make room for the result. 2640 __ LoadObject(TMP, Object::null_object()); // Make room for the result.
2641 __ sw(TMP, Address(SP, 1 * kWordSize)); 2641 __ sw(TMP, Address(SP, 1 * kWordSize));
2642 __ sw(context_value, Address(SP, 0 * kWordSize)); 2642 __ sw(context_value, Address(SP, 0 * kWordSize));
2643 2643
2644 compiler->GenerateRuntimeCall(token_pos(), 2644 compiler->GenerateRuntimeCall(token_pos(),
2645 deopt_id(), 2645 deopt_id(),
2646 kCloneContextRuntimeEntry, 2646 kCloneContextRuntimeEntry,
2647 1, 2647 1,
2648 locs()); 2648 locs());
2649 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context). 2649 __ lw(result, Address(SP, 1 * kWordSize)); // Get result (cloned context).
2650 __ addiu(SP, SP, Immediate(2 * kWordSize)); 2650 __ addiu(SP, SP, Immediate(2 * kWordSize));
2651 } 2651 }
2652 2652
2653 2653
2654 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Isolate* isolate, 2654 LocationSummary* CatchBlockEntryInstr::MakeLocationSummary(Zone* zone,
2655 bool opt) const { 2655 bool opt) const {
2656 UNREACHABLE(); 2656 UNREACHABLE();
2657 return NULL; 2657 return NULL;
2658 } 2658 }
2659 2659
2660 2660
2661 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2661 void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2662 __ Bind(compiler->GetJumpLabel(this)); 2662 __ Bind(compiler->GetJumpLabel(this));
2663 compiler->AddExceptionHandler(catch_try_index(), 2663 compiler->AddExceptionHandler(catch_try_index(),
2664 try_index(), 2664 try_index(),
(...skipping 20 matching lines...) Expand all
2685 2685
2686 // Restore stack and initialize the two exception variables: 2686 // Restore stack and initialize the two exception variables:
2687 // exception and stack trace variables. 2687 // exception and stack trace variables.
2688 __ StoreToOffset(kExceptionObjectReg, 2688 __ StoreToOffset(kExceptionObjectReg,
2689 FP, exception_var().index() * kWordSize); 2689 FP, exception_var().index() * kWordSize);
2690 __ StoreToOffset(kStackTraceObjectReg, 2690 __ StoreToOffset(kStackTraceObjectReg,
2691 FP, stacktrace_var().index() * kWordSize); 2691 FP, stacktrace_var().index() * kWordSize);
2692 } 2692 }
2693 2693
2694 2694
2695 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Isolate* isolate, 2695 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(Zone* zone,
2696 bool opt) const { 2696 bool opt) const {
2697 const intptr_t kNumInputs = 0; 2697 const intptr_t kNumInputs = 0;
2698 const intptr_t kNumTemps = 1; 2698 const intptr_t kNumTemps = 1;
2699 LocationSummary* summary = new(isolate) LocationSummary( 2699 LocationSummary* summary = new(zone) LocationSummary(
2700 isolate, kNumInputs, 2700 zone, kNumInputs,
2701 kNumTemps, 2701 kNumTemps,
2702 LocationSummary::kCallOnSlowPath); 2702 LocationSummary::kCallOnSlowPath);
2703 summary->set_temp(0, Location::RequiresRegister()); 2703 summary->set_temp(0, Location::RequiresRegister());
2704 return summary; 2704 return summary;
2705 } 2705 }
2706 2706
2707 2707
2708 class CheckStackOverflowSlowPath : public SlowPathCode { 2708 class CheckStackOverflowSlowPath : public SlowPathCode {
2709 public: 2709 public:
2710 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) 2710 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 // Overflow test (preserve left, right, and temp); 2879 // Overflow test (preserve left, right, and temp);
2880 __ sllv(CMPRES1, left, temp); 2880 __ sllv(CMPRES1, left, temp);
2881 __ srav(CMPRES1, CMPRES1, temp); 2881 __ srav(CMPRES1, CMPRES1, temp);
2882 __ bne(CMPRES1, left, deopt); // Overflow. 2882 __ bne(CMPRES1, left, deopt); // Overflow.
2883 // Shift for result now we know there is no overflow. 2883 // Shift for result now we know there is no overflow.
2884 __ sllv(result, left, temp); 2884 __ sllv(result, left, temp);
2885 } 2885 }
2886 } 2886 }
2887 2887
2888 2888
2889 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Isolate* isolate, 2889 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(Zone* zone,
2890 bool opt) const { 2890 bool opt) const {
2891 const intptr_t kNumInputs = 2; 2891 const intptr_t kNumInputs = 2;
2892 const intptr_t kNumTemps = 2892 const intptr_t kNumTemps =
2893 ((op_kind() == Token::kADD) || 2893 ((op_kind() == Token::kADD) ||
2894 (op_kind() == Token::kMOD) || 2894 (op_kind() == Token::kMOD) ||
2895 (op_kind() == Token::kTRUNCDIV) || 2895 (op_kind() == Token::kTRUNCDIV) ||
2896 (((op_kind() == Token::kSHL) && can_overflow()) || 2896 (((op_kind() == Token::kSHL) && can_overflow()) ||
2897 (op_kind() == Token::kSHR))) ? 1 : 0; 2897 (op_kind() == Token::kSHR))) ? 1 : 0;
2898 LocationSummary* summary = new(isolate) LocationSummary( 2898 LocationSummary* summary = new(zone) LocationSummary(
2899 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 2899 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
2900 if (op_kind() == Token::kTRUNCDIV) { 2900 if (op_kind() == Token::kTRUNCDIV) {
2901 summary->set_in(0, Location::RequiresRegister()); 2901 summary->set_in(0, Location::RequiresRegister());
2902 if (RightIsPowerOfTwoConstant()) { 2902 if (RightIsPowerOfTwoConstant()) {
2903 ConstantInstr* right_constant = right()->definition()->AsConstant(); 2903 ConstantInstr* right_constant = right()->definition()->AsConstant();
2904 summary->set_in(1, Location::Constant(right_constant)); 2904 summary->set_in(1, Location::Constant(right_constant));
2905 } else { 2905 } else {
2906 summary->set_in(1, Location::RequiresRegister()); 2906 summary->set_in(1, Location::RequiresRegister());
2907 } 2907 }
2908 summary->set_temp(0, Location::RequiresRegister()); 2908 summary->set_temp(0, Location::RequiresRegister());
2909 summary->set_out(0, Location::RequiresRegister()); 2909 summary->set_out(0, Location::RequiresRegister());
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 UNREACHABLE(); 3173 UNREACHABLE();
3174 break; 3174 break;
3175 } 3175 }
3176 default: 3176 default:
3177 UNREACHABLE(); 3177 UNREACHABLE();
3178 break; 3178 break;
3179 } 3179 }
3180 } 3180 }
3181 3181
3182 3182
3183 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Isolate* isolate, 3183 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone,
3184 bool opt) const { 3184 bool opt) const {
3185 intptr_t left_cid = left()->Type()->ToCid(); 3185 intptr_t left_cid = left()->Type()->ToCid();
3186 intptr_t right_cid = right()->Type()->ToCid(); 3186 intptr_t right_cid = right()->Type()->ToCid();
3187 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); 3187 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid));
3188 const intptr_t kNumInputs = 2; 3188 const intptr_t kNumInputs = 2;
3189 const intptr_t kNumTemps = 0; 3189 const intptr_t kNumTemps = 0;
3190 LocationSummary* summary = new(isolate) LocationSummary( 3190 LocationSummary* summary = new(zone) LocationSummary(
3191 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3191 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3192 summary->set_in(0, Location::RequiresRegister()); 3192 summary->set_in(0, Location::RequiresRegister());
3193 summary->set_in(1, Location::RequiresRegister()); 3193 summary->set_in(1, Location::RequiresRegister());
3194 return summary; 3194 return summary;
3195 } 3195 }
3196 3196
3197 3197
3198 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3198 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3199 Label* deopt = compiler->AddDeoptStub(deopt_id(), 3199 Label* deopt = compiler->AddDeoptStub(deopt_id(),
3200 ICData::kDeoptBinaryDoubleOp, 3200 ICData::kDeoptBinaryDoubleOp,
3201 licm_hoisted_ ? ICData::kHoisted : 0); 3201 licm_hoisted_ ? ICData::kHoisted : 0);
3202 intptr_t left_cid = left()->Type()->ToCid(); 3202 intptr_t left_cid = left()->Type()->ToCid();
3203 intptr_t right_cid = right()->Type()->ToCid(); 3203 intptr_t right_cid = right()->Type()->ToCid();
3204 Register left = locs()->in(0).reg(); 3204 Register left = locs()->in(0).reg();
3205 Register right = locs()->in(1).reg(); 3205 Register right = locs()->in(1).reg();
3206 if (this->left()->definition() == this->right()->definition()) { 3206 if (this->left()->definition() == this->right()->definition()) {
3207 __ andi(CMPRES1, left, Immediate(kSmiTagMask)); 3207 __ andi(CMPRES1, left, Immediate(kSmiTagMask));
3208 } else if (left_cid == kSmiCid) { 3208 } else if (left_cid == kSmiCid) {
3209 __ andi(CMPRES1, right, Immediate(kSmiTagMask)); 3209 __ andi(CMPRES1, right, Immediate(kSmiTagMask));
3210 } else if (right_cid == kSmiCid) { 3210 } else if (right_cid == kSmiCid) {
3211 __ andi(CMPRES1, left, Immediate(kSmiTagMask)); 3211 __ andi(CMPRES1, left, Immediate(kSmiTagMask));
3212 } else { 3212 } else {
3213 __ or_(TMP, left, right); 3213 __ or_(TMP, left, right);
3214 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); 3214 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask));
3215 } 3215 }
3216 __ beq(CMPRES1, ZR, deopt); 3216 __ beq(CMPRES1, ZR, deopt);
3217 } 3217 }
3218 3218
3219 3219
3220 LocationSummary* BoxInstr::MakeLocationSummary(Isolate* isolate, 3220 LocationSummary* BoxInstr::MakeLocationSummary(Zone* zone,
3221 bool opt) const { 3221 bool opt) const {
3222 const intptr_t kNumInputs = 1; 3222 const intptr_t kNumInputs = 1;
3223 const intptr_t kNumTemps = 1; 3223 const intptr_t kNumTemps = 1;
3224 LocationSummary* summary = new(isolate) LocationSummary( 3224 LocationSummary* summary = new(zone) LocationSummary(
3225 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); 3225 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
3226 summary->set_in(0, Location::RequiresFpuRegister()); 3226 summary->set_in(0, Location::RequiresFpuRegister());
3227 summary->set_temp(0, Location::RequiresRegister()); 3227 summary->set_temp(0, Location::RequiresRegister());
3228 summary->set_out(0, Location::RequiresRegister()); 3228 summary->set_out(0, Location::RequiresRegister());
3229 return summary; 3229 return summary;
3230 } 3230 }
3231 3231
3232 3232
3233 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3233 void BoxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3234 ASSERT(from_representation() == kUnboxedDouble); 3234 ASSERT(from_representation() == kUnboxedDouble);
3235 3235
3236 Register out_reg = locs()->out(0).reg(); 3236 Register out_reg = locs()->out(0).reg();
3237 DRegister value = locs()->in(0).fpu_reg(); 3237 DRegister value = locs()->in(0).fpu_reg();
3238 3238
3239 BoxAllocationSlowPath::Allocate( 3239 BoxAllocationSlowPath::Allocate(
3240 compiler, this, compiler->double_class(), out_reg, locs()->temp(0).reg()); 3240 compiler, this, compiler->double_class(), out_reg, locs()->temp(0).reg());
3241 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); 3241 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag);
3242 } 3242 }
3243 3243
3244 3244
3245 LocationSummary* UnboxInstr::MakeLocationSummary(Isolate* isolate, 3245 LocationSummary* UnboxInstr::MakeLocationSummary(Zone* zone,
3246 bool opt) const { 3246 bool opt) const {
3247 const intptr_t kNumInputs = 1; 3247 const intptr_t kNumInputs = 1;
3248 const intptr_t kNumTemps = 0; 3248 const intptr_t kNumTemps = 0;
3249 LocationSummary* summary = new(isolate) LocationSummary( 3249 LocationSummary* summary = new(zone) LocationSummary(
3250 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3250 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3251 summary->set_in(0, Location::RequiresRegister()); 3251 summary->set_in(0, Location::RequiresRegister());
3252 if (representation() == kUnboxedMint) { 3252 if (representation() == kUnboxedMint) {
3253 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 3253 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
3254 Location::RequiresRegister())); 3254 Location::RequiresRegister()));
3255 } else { 3255 } else {
3256 summary->set_out(0, Location::RequiresFpuRegister()); 3256 summary->set_out(0, Location::RequiresFpuRegister());
3257 } 3257 }
3258 return summary; 3258 return summary;
3259 } 3259 }
3260 3260
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 Label done; 3350 Label done;
3351 __ b(&done); 3351 __ b(&done);
3352 __ Bind(&is_smi); 3352 __ Bind(&is_smi);
3353 EmitSmiConversion(compiler); 3353 EmitSmiConversion(compiler);
3354 __ Bind(&done); 3354 __ Bind(&done);
3355 } 3355 }
3356 } 3356 }
3357 } 3357 }
3358 3358
3359 3359
3360 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Isolate* isolate, 3360 LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone,
3361 bool opt) const { 3361 bool opt) const {
3362 ASSERT((from_representation() == kUnboxedInt32) || 3362 ASSERT((from_representation() == kUnboxedInt32) ||
3363 (from_representation() == kUnboxedUint32)); 3363 (from_representation() == kUnboxedUint32));
3364 const intptr_t kNumInputs = 1; 3364 const intptr_t kNumInputs = 1;
3365 const intptr_t kNumTemps = 1; 3365 const intptr_t kNumTemps = 1;
3366 LocationSummary* summary = new(isolate) LocationSummary( 3366 LocationSummary* summary = new(zone) LocationSummary(
3367 isolate, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath); 3367 zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
3368 summary->set_in(0, Location::RequiresRegister()); 3368 summary->set_in(0, Location::RequiresRegister());
3369 summary->set_temp(0, Location::RequiresRegister()); 3369 summary->set_temp(0, Location::RequiresRegister());
3370 summary->set_out(0, Location::RequiresRegister()); 3370 summary->set_out(0, Location::RequiresRegister());
3371 return summary; 3371 return summary;
3372 } 3372 }
3373 3373
3374 3374
3375 void BoxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3375 void BoxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3376 Register value = locs()->in(0).reg(); 3376 Register value = locs()->in(0).reg();
3377 Register out = locs()->out(0).reg(); 3377 Register out = locs()->out(0).reg();
(...skipping 29 matching lines...) Expand all
3407 out, 3407 out,
3408 Mint::value_offset() - kHeapObjectTag); 3408 Mint::value_offset() - kHeapObjectTag);
3409 __ StoreToOffset(hi, 3409 __ StoreToOffset(hi,
3410 out, 3410 out,
3411 Mint::value_offset() - kHeapObjectTag + kWordSize); 3411 Mint::value_offset() - kHeapObjectTag + kWordSize);
3412 __ Bind(&done); 3412 __ Bind(&done);
3413 } 3413 }
3414 } 3414 }
3415 3415
3416 3416
3417 LocationSummary* BoxInt64Instr::MakeLocationSummary(Isolate* isolate, 3417 LocationSummary* BoxInt64Instr::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 = ValueFitsSmi() ? 0 : 1; 3420 const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
3421 LocationSummary* summary = new(isolate) LocationSummary( 3421 LocationSummary* summary = new(zone) LocationSummary(
3422 isolate, 3422 zone,
3423 kNumInputs, 3423 kNumInputs,
3424 kNumTemps, 3424 kNumTemps,
3425 ValueFitsSmi() ? LocationSummary::kNoCall 3425 ValueFitsSmi() ? LocationSummary::kNoCall
3426 : LocationSummary::kCallOnSlowPath); 3426 : LocationSummary::kCallOnSlowPath);
3427 summary->set_in(0, Location::Pair(Location::RequiresRegister(), 3427 summary->set_in(0, Location::Pair(Location::RequiresRegister(),
3428 Location::RequiresRegister())); 3428 Location::RequiresRegister()));
3429 if (!ValueFitsSmi()) { 3429 if (!ValueFitsSmi()) {
3430 summary->set_temp(0, Location::RequiresRegister()); 3430 summary->set_temp(0, Location::RequiresRegister());
3431 } 3431 }
3432 summary->set_out(0, Location::RequiresRegister()); 3432 summary->set_out(0, Location::RequiresRegister());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3464 out_reg, 3464 out_reg,
3465 tmp); 3465 tmp);
3466 __ StoreToOffset(value_lo, out_reg, Mint::value_offset() - kHeapObjectTag); 3466 __ StoreToOffset(value_lo, out_reg, Mint::value_offset() - kHeapObjectTag);
3467 __ StoreToOffset(value_hi, 3467 __ StoreToOffset(value_hi,
3468 out_reg, 3468 out_reg,
3469 Mint::value_offset() - kHeapObjectTag + kWordSize); 3469 Mint::value_offset() - kHeapObjectTag + kWordSize);
3470 __ Bind(&done); 3470 __ Bind(&done);
3471 } 3471 }
3472 3472
3473 3473
3474 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Isolate* isolate, 3474 LocationSummary* UnboxInteger32Instr::MakeLocationSummary(Zone* zone,
3475 bool opt) const { 3475 bool opt) const {
3476 ASSERT((representation() == kUnboxedInt32) || 3476 ASSERT((representation() == kUnboxedInt32) ||
3477 (representation() == kUnboxedUint32)); 3477 (representation() == kUnboxedUint32));
3478 const intptr_t kNumInputs = 1; 3478 const intptr_t kNumInputs = 1;
3479 const intptr_t kNumTemps = 0; 3479 const intptr_t kNumTemps = 0;
3480 LocationSummary* summary = new(isolate) LocationSummary( 3480 LocationSummary* summary = new(zone) LocationSummary(
3481 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3481 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3482 summary->set_in(0, Location::RequiresRegister()); 3482 summary->set_in(0, Location::RequiresRegister());
3483 summary->set_out(0, Location::RequiresRegister()); 3483 summary->set_out(0, Location::RequiresRegister());
3484 return summary; 3484 return summary;
3485 } 3485 }
3486 3486
3487 3487
3488 static void LoadInt32FromMint(FlowGraphCompiler* compiler, 3488 static void LoadInt32FromMint(FlowGraphCompiler* compiler,
3489 Register mint, 3489 Register mint,
3490 Register result, 3490 Register result,
3491 Label* deopt) { 3491 Label* deopt) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
3526 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); 3526 __ andi(CMPRES1, value, Immediate(kSmiTagMask));
3527 __ beq(CMPRES1, ZR, &done); 3527 __ beq(CMPRES1, ZR, &done);
3528 __ LoadClassId(CMPRES1, value); 3528 __ LoadClassId(CMPRES1, value);
3529 __ BranchNotEqual(CMPRES1, Immediate(kMintCid), deopt); 3529 __ BranchNotEqual(CMPRES1, Immediate(kMintCid), deopt);
3530 LoadInt32FromMint(compiler, value, out, out_of_range); 3530 LoadInt32FromMint(compiler, value, out, out_of_range);
3531 __ Bind(&done); 3531 __ Bind(&done);
3532 } 3532 }
3533 } 3533 }
3534 3534
3535 3535
3536 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, 3536 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
3537 bool opt) const { 3537 bool opt) const {
3538 const intptr_t kNumInputs = 2; 3538 const intptr_t kNumInputs = 2;
3539 const intptr_t kNumTemps = 0; 3539 const intptr_t kNumTemps = 0;
3540 LocationSummary* summary = new(isolate) LocationSummary( 3540 LocationSummary* summary = new(zone) LocationSummary(
3541 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3541 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3542 summary->set_in(0, Location::RequiresFpuRegister()); 3542 summary->set_in(0, Location::RequiresFpuRegister());
3543 summary->set_in(1, Location::RequiresFpuRegister()); 3543 summary->set_in(1, Location::RequiresFpuRegister());
3544 summary->set_out(0, Location::RequiresFpuRegister()); 3544 summary->set_out(0, Location::RequiresFpuRegister());
3545 return summary; 3545 return summary;
3546 } 3546 }
3547 3547
3548 3548
3549 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3549 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3550 DRegister left = locs()->in(0).fpu_reg(); 3550 DRegister left = locs()->in(0).fpu_reg();
3551 DRegister right = locs()->in(1).fpu_reg(); 3551 DRegister right = locs()->in(1).fpu_reg();
3552 DRegister result = locs()->out(0).fpu_reg(); 3552 DRegister result = locs()->out(0).fpu_reg();
3553 switch (op_kind()) { 3553 switch (op_kind()) {
3554 case Token::kADD: __ addd(result, left, right); break; 3554 case Token::kADD: __ addd(result, left, right); break;
3555 case Token::kSUB: __ subd(result, left, right); break; 3555 case Token::kSUB: __ subd(result, left, right); break;
3556 case Token::kMUL: __ muld(result, left, right); break; 3556 case Token::kMUL: __ muld(result, left, right); break;
3557 case Token::kDIV: __ divd(result, left, right); break; 3557 case Token::kDIV: __ divd(result, left, right); break;
3558 default: UNREACHABLE(); 3558 default: UNREACHABLE();
3559 } 3559 }
3560 } 3560 }
3561 3561
3562 3562
3563 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Isolate* isolate, 3563 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
3564 bool opt) const { 3564 bool opt) const {
3565 UNIMPLEMENTED(); 3565 UNIMPLEMENTED();
3566 return NULL; 3566 return NULL;
3567 } 3567 }
3568 3568
3569 3569
3570 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3570 void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3571 UNIMPLEMENTED(); 3571 UNIMPLEMENTED();
3572 } 3572 }
3573 3573
3574 3574
3575 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Isolate* isolate, 3575 LocationSummary* BinaryFloat64x2OpInstr::MakeLocationSummary(Zone* zone,
3576 bool opt) const { 3576 bool opt) const {
3577 UNIMPLEMENTED(); 3577 UNIMPLEMENTED();
3578 return NULL; 3578 return NULL;
3579 } 3579 }
3580 3580
3581 3581
3582 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3582 void BinaryFloat64x2OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3583 UNIMPLEMENTED(); 3583 UNIMPLEMENTED();
3584 } 3584 }
3585 3585
3586 3586
3587 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Isolate* isolate, 3587 LocationSummary* Simd32x4ShuffleInstr::MakeLocationSummary(Zone* zone,
3588 bool opt) const { 3588 bool opt) const {
3589 UNIMPLEMENTED(); 3589 UNIMPLEMENTED();
3590 return NULL; 3590 return NULL;
3591 } 3591 }
3592 3592
3593 3593
3594 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3594 void Simd32x4ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3595 UNIMPLEMENTED(); 3595 UNIMPLEMENTED();
3596 } 3596 }
3597 3597
3598 3598
3599 3599
3600 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Isolate* isolate, 3600 LocationSummary* Simd32x4ShuffleMixInstr::MakeLocationSummary(Zone* zone,
3601 bool opt) const { 3601 bool opt) const {
3602 UNIMPLEMENTED(); 3602 UNIMPLEMENTED();
3603 return NULL; 3603 return NULL;
3604 } 3604 }
3605 3605
3606 3606
3607 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3607 void Simd32x4ShuffleMixInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3608 UNIMPLEMENTED(); 3608 UNIMPLEMENTED();
3609 } 3609 }
3610 3610
3611 3611
3612 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary( 3612 LocationSummary* Float32x4ConstructorInstr::MakeLocationSummary(
3613 Isolate* isolate, bool opt) const { 3613 Zone* zone, bool opt) const {
3614 UNIMPLEMENTED(); 3614 UNIMPLEMENTED();
3615 return NULL; 3615 return NULL;
3616 } 3616 }
3617 3617
3618 3618
3619 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3619 void Float32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3620 UNIMPLEMENTED(); 3620 UNIMPLEMENTED();
3621 } 3621 }
3622 3622
3623 3623
3624 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Isolate* isolate, 3624 LocationSummary* Float32x4ZeroInstr::MakeLocationSummary(Zone* zone,
3625 bool opt) const { 3625 bool opt) const {
3626 UNIMPLEMENTED(); 3626 UNIMPLEMENTED();
3627 return NULL; 3627 return NULL;
3628 } 3628 }
3629 3629
3630 3630
3631 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3631 void Float32x4ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3632 UNIMPLEMENTED(); 3632 UNIMPLEMENTED();
3633 } 3633 }
3634 3634
3635 3635
3636 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Isolate* isolate, 3636 LocationSummary* Float32x4SplatInstr::MakeLocationSummary(Zone* zone,
3637 bool opt) const { 3637 bool opt) const {
3638 UNIMPLEMENTED(); 3638 UNIMPLEMENTED();
3639 return NULL; 3639 return NULL;
3640 } 3640 }
3641 3641
3642 3642
3643 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3643 void Float32x4SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3644 UNIMPLEMENTED(); 3644 UNIMPLEMENTED();
3645 } 3645 }
3646 3646
3647 3647
3648 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Isolate* isolate, 3648 LocationSummary* Float32x4ComparisonInstr::MakeLocationSummary(Zone* zone,
3649 bool opt) const { 3649 bool opt) const {
3650 UNIMPLEMENTED(); 3650 UNIMPLEMENTED();
3651 return NULL; 3651 return NULL;
3652 } 3652 }
3653 3653
3654 3654
3655 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3655 void Float32x4ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3656 UNIMPLEMENTED(); 3656 UNIMPLEMENTED();
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 UNIMPLEMENTED(); 3662 UNIMPLEMENTED();
3663 return NULL; 3663 return NULL;
3664 } 3664 }
3665 3665
3666 3666
3667 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3667 void Float32x4MinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3668 UNIMPLEMENTED(); 3668 UNIMPLEMENTED();
3669 } 3669 }
3670 3670
3671 3671
3672 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Isolate* isolate, 3672 LocationSummary* Float32x4SqrtInstr::MakeLocationSummary(Zone* zone,
3673 bool opt) const { 3673 bool opt) const {
3674 UNIMPLEMENTED(); 3674 UNIMPLEMENTED();
3675 return NULL; 3675 return NULL;
3676 } 3676 }
3677 3677
3678 3678
3679 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3679 void Float32x4SqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3680 UNIMPLEMENTED(); 3680 UNIMPLEMENTED();
3681 } 3681 }
3682 3682
3683 3683
3684 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Isolate* isolate, 3684 LocationSummary* Float32x4ScaleInstr::MakeLocationSummary(Zone* zone,
3685 bool opt) const { 3685 bool opt) const {
3686 UNIMPLEMENTED(); 3686 UNIMPLEMENTED();
3687 return NULL; 3687 return NULL;
3688 } 3688 }
3689 3689
3690 3690
3691 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3691 void Float32x4ScaleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3692 UNIMPLEMENTED(); 3692 UNIMPLEMENTED();
3693 } 3693 }
3694 3694
3695 3695
3696 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Isolate* isolate, 3696 LocationSummary* Float32x4ZeroArgInstr::MakeLocationSummary(Zone* zone,
3697 bool opt) const { 3697 bool opt) const {
3698 UNIMPLEMENTED(); 3698 UNIMPLEMENTED();
3699 return NULL; 3699 return NULL;
3700 } 3700 }
3701 3701
3702 3702
3703 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3703 void Float32x4ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3704 UNIMPLEMENTED(); 3704 UNIMPLEMENTED();
3705 } 3705 }
3706 3706
3707 3707
3708 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Isolate* isolate, 3708 LocationSummary* Float32x4ClampInstr::MakeLocationSummary(Zone* zone,
3709 bool opt) const { 3709 bool opt) const {
3710 UNIMPLEMENTED(); 3710 UNIMPLEMENTED();
3711 return NULL; 3711 return NULL;
3712 } 3712 }
3713 3713
3714 3714
3715 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3715 void Float32x4ClampInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3716 UNIMPLEMENTED(); 3716 UNIMPLEMENTED();
3717 } 3717 }
3718 3718
3719 3719
3720 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Isolate* isolate, 3720 LocationSummary* Float32x4WithInstr::MakeLocationSummary(Zone* zone,
3721 bool opt) const { 3721 bool opt) const {
3722 UNIMPLEMENTED(); 3722 UNIMPLEMENTED();
3723 return NULL; 3723 return NULL;
3724 } 3724 }
3725 3725
3726 3726
3727 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3727 void Float32x4WithInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3728 UNIMPLEMENTED(); 3728 UNIMPLEMENTED();
3729 } 3729 }
3730 3730
3731 3731
3732 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Isolate* isolate, 3732 LocationSummary* Float32x4ToInt32x4Instr::MakeLocationSummary(Zone* zone,
3733 bool opt) const { 3733 bool opt) const {
3734 UNIMPLEMENTED(); 3734 UNIMPLEMENTED();
3735 return NULL; 3735 return NULL;
3736 } 3736 }
3737 3737
3738 3738
3739 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3739 void Float32x4ToInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3740 UNIMPLEMENTED(); 3740 UNIMPLEMENTED();
3741 } 3741 }
3742 3742
3743 3743
3744 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Isolate* isolate, 3744 LocationSummary* Simd64x2ShuffleInstr::MakeLocationSummary(Zone* zone,
3745 bool opt) const { 3745 bool opt) const {
3746 UNIMPLEMENTED(); 3746 UNIMPLEMENTED();
3747 return NULL; 3747 return NULL;
3748 } 3748 }
3749 3749
3750 3750
3751 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3751 void Simd64x2ShuffleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3752 UNIMPLEMENTED(); 3752 UNIMPLEMENTED();
3753 } 3753 }
3754 3754
3755 3755
3756 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Isolate* isolate, 3756 LocationSummary* Float64x2ZeroInstr::MakeLocationSummary(Zone* zone,
3757 bool opt) const { 3757 bool opt) const {
3758 UNIMPLEMENTED(); 3758 UNIMPLEMENTED();
3759 return NULL; 3759 return NULL;
3760 } 3760 }
3761 3761
3762 3762
3763 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3763 void Float64x2ZeroInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3764 UNIMPLEMENTED(); 3764 UNIMPLEMENTED();
3765 } 3765 }
3766 3766
3767 3767
3768 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Isolate* isolate, 3768 LocationSummary* Float64x2SplatInstr::MakeLocationSummary(Zone* zone,
3769 bool opt) const { 3769 bool opt) const {
3770 UNIMPLEMENTED(); 3770 UNIMPLEMENTED();
3771 return NULL; 3771 return NULL;
3772 } 3772 }
3773 3773
3774 3774
3775 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3775 void Float64x2SplatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3776 UNIMPLEMENTED(); 3776 UNIMPLEMENTED();
3777 } 3777 }
3778 3778
3779 3779
3780 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary( 3780 LocationSummary* Float64x2ConstructorInstr::MakeLocationSummary(
3781 Isolate* isolate, bool opt) const { 3781 Zone* zone, bool opt) const {
3782 UNIMPLEMENTED(); 3782 UNIMPLEMENTED();
3783 return NULL; 3783 return NULL;
3784 } 3784 }
3785 3785
3786 3786
3787 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3787 void Float64x2ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3788 UNIMPLEMENTED(); 3788 UNIMPLEMENTED();
3789 } 3789 }
3790 3790
3791 3791
3792 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary( 3792 LocationSummary* Float64x2ToFloat32x4Instr::MakeLocationSummary(
3793 Isolate* isolate, bool opt) const { 3793 Zone* zone, bool opt) const {
3794 UNIMPLEMENTED(); 3794 UNIMPLEMENTED();
3795 return NULL; 3795 return NULL;
3796 } 3796 }
3797 3797
3798 3798
3799 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3799 void Float64x2ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3800 UNIMPLEMENTED(); 3800 UNIMPLEMENTED();
3801 } 3801 }
3802 3802
3803 3803
3804 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary( 3804 LocationSummary* Float32x4ToFloat64x2Instr::MakeLocationSummary(
3805 Isolate* isolate, bool opt) const { 3805 Zone* zone, bool opt) const {
3806 UNIMPLEMENTED(); 3806 UNIMPLEMENTED();
3807 return NULL; 3807 return NULL;
3808 } 3808 }
3809 3809
3810 3810
3811 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3811 void Float32x4ToFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3812 UNIMPLEMENTED(); 3812 UNIMPLEMENTED();
3813 } 3813 }
3814 3814
3815 3815
3816 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Isolate* isolate, 3816 LocationSummary* Float64x2ZeroArgInstr::MakeLocationSummary(Zone* zone,
3817 bool opt) const { 3817 bool opt) const {
3818 UNIMPLEMENTED(); 3818 UNIMPLEMENTED();
3819 return NULL; 3819 return NULL;
3820 } 3820 }
3821 3821
3822 3822
3823 void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3823 void Float64x2ZeroArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3824 UNIMPLEMENTED(); 3824 UNIMPLEMENTED();
3825 } 3825 }
3826 3826
3827 3827
3828 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Isolate* isolate, 3828 LocationSummary* Float64x2OneArgInstr::MakeLocationSummary(Zone* zone,
3829 bool opt) const { 3829 bool opt) const {
3830 UNIMPLEMENTED(); 3830 UNIMPLEMENTED();
3831 return NULL; 3831 return NULL;
3832 } 3832 }
3833 3833
3834 3834
3835 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3835 void Float64x2OneArgInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3836 UNIMPLEMENTED(); 3836 UNIMPLEMENTED();
3837 } 3837 }
3838 3838
3839 3839
3840 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary( 3840 LocationSummary* Int32x4ConstructorInstr::MakeLocationSummary(
3841 Isolate* isolate, bool opt) const { 3841 Zone* zone, bool opt) const {
3842 UNIMPLEMENTED(); 3842 UNIMPLEMENTED();
3843 return NULL; 3843 return NULL;
3844 } 3844 }
3845 3845
3846 3846
3847 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3847 void Int32x4ConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3848 UNIMPLEMENTED(); 3848 UNIMPLEMENTED();
3849 } 3849 }
3850 3850
3851 3851
3852 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary( 3852 LocationSummary* Int32x4BoolConstructorInstr::MakeLocationSummary(
3853 Isolate* isolate, bool opt) const { 3853 Zone* zone, bool opt) const {
3854 UNIMPLEMENTED(); 3854 UNIMPLEMENTED();
3855 return NULL; 3855 return NULL;
3856 } 3856 }
3857 3857
3858 3858
3859 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3859 void Int32x4BoolConstructorInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3860 UNIMPLEMENTED(); 3860 UNIMPLEMENTED();
3861 } 3861 }
3862 3862
3863 3863
3864 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Isolate* isolate, 3864 LocationSummary* Int32x4GetFlagInstr::MakeLocationSummary(Zone* zone,
3865 bool opt) const { 3865 bool opt) const {
3866 UNIMPLEMENTED(); 3866 UNIMPLEMENTED();
3867 return NULL; 3867 return NULL;
3868 } 3868 }
3869 3869
3870 3870
3871 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3871 void Int32x4GetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3872 UNIMPLEMENTED(); 3872 UNIMPLEMENTED();
3873 } 3873 }
3874 3874
3875 3875
3876 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Isolate* isolate, 3876 LocationSummary* Simd32x4GetSignMaskInstr::MakeLocationSummary(Zone* zone,
3877 bool opt) const { 3877 bool opt) const {
3878 UNIMPLEMENTED(); 3878 UNIMPLEMENTED();
3879 return NULL; 3879 return NULL;
3880 } 3880 }
3881 3881
3882 3882
3883 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3883 void Simd32x4GetSignMaskInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3884 UNIMPLEMENTED(); 3884 UNIMPLEMENTED();
3885 } 3885 }
3886 3886
3887 3887
3888 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Isolate* isolate, 3888 LocationSummary* Int32x4SelectInstr::MakeLocationSummary(Zone* zone,
3889 bool opt) const { 3889 bool opt) const {
3890 UNIMPLEMENTED(); 3890 UNIMPLEMENTED();
3891 return NULL; 3891 return NULL;
3892 } 3892 }
3893 3893
3894 3894
3895 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3895 void Int32x4SelectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3896 UNIMPLEMENTED(); 3896 UNIMPLEMENTED();
3897 } 3897 }
3898 3898
3899 3899
3900 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Isolate* isolate, 3900 LocationSummary* Int32x4SetFlagInstr::MakeLocationSummary(Zone* zone,
3901 bool opt) const { 3901 bool opt) const {
3902 UNIMPLEMENTED(); 3902 UNIMPLEMENTED();
3903 return NULL; 3903 return NULL;
3904 } 3904 }
3905 3905
3906 3906
3907 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3907 void Int32x4SetFlagInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3908 UNIMPLEMENTED(); 3908 UNIMPLEMENTED();
3909 } 3909 }
3910 3910
3911 3911
3912 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Isolate* isolate, 3912 LocationSummary* Int32x4ToFloat32x4Instr::MakeLocationSummary(Zone* zone,
3913 bool opt) const { 3913 bool opt) const {
3914 UNIMPLEMENTED(); 3914 UNIMPLEMENTED();
3915 return NULL; 3915 return NULL;
3916 } 3916 }
3917 3917
3918 3918
3919 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3919 void Int32x4ToFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3920 UNIMPLEMENTED(); 3920 UNIMPLEMENTED();
3921 } 3921 }
3922 3922
3923 3923
3924 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Isolate* isolate, 3924 LocationSummary* BinaryInt32x4OpInstr::MakeLocationSummary(Zone* zone,
3925 bool opt) const { 3925 bool opt) const {
3926 UNIMPLEMENTED(); 3926 UNIMPLEMENTED();
3927 return NULL; 3927 return NULL;
3928 } 3928 }
3929 3929
3930 3930
3931 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3931 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3932 UNIMPLEMENTED(); 3932 UNIMPLEMENTED();
3933 } 3933 }
3934 3934
3935 3935
3936 LocationSummary* MathUnaryInstr::MakeLocationSummary(Isolate* isolate, 3936 LocationSummary* MathUnaryInstr::MakeLocationSummary(Zone* zone,
3937 bool opt) const { 3937 bool opt) const {
3938 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { 3938 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) {
3939 const intptr_t kNumInputs = 1; 3939 const intptr_t kNumInputs = 1;
3940 const intptr_t kNumTemps = 0; 3940 const intptr_t kNumTemps = 0;
3941 LocationSummary* summary = new(isolate) LocationSummary( 3941 LocationSummary* summary = new(zone) LocationSummary(
3942 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 3942 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
3943 summary->set_in(0, Location::FpuRegisterLocation(D6)); 3943 summary->set_in(0, Location::FpuRegisterLocation(D6));
3944 summary->set_out(0, Location::FpuRegisterLocation(D0)); 3944 summary->set_out(0, Location::FpuRegisterLocation(D0));
3945 return summary; 3945 return summary;
3946 } 3946 }
3947 ASSERT((kind() == MathUnaryInstr::kSqrt) || 3947 ASSERT((kind() == MathUnaryInstr::kSqrt) ||
3948 (kind() == MathUnaryInstr::kDoubleSquare)); 3948 (kind() == MathUnaryInstr::kDoubleSquare));
3949 const intptr_t kNumInputs = 1; 3949 const intptr_t kNumInputs = 1;
3950 const intptr_t kNumTemps = 0; 3950 const intptr_t kNumTemps = 0;
3951 LocationSummary* summary = new(isolate) LocationSummary( 3951 LocationSummary* summary = new(zone) LocationSummary(
3952 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3952 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3953 summary->set_in(0, Location::RequiresFpuRegister()); 3953 summary->set_in(0, Location::RequiresFpuRegister());
3954 summary->set_out(0, Location::RequiresFpuRegister()); 3954 summary->set_out(0, Location::RequiresFpuRegister());
3955 return summary; 3955 return summary;
3956 } 3956 }
3957 3957
3958 3958
3959 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3959 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3960 if (kind() == MathUnaryInstr::kSqrt) { 3960 if (kind() == MathUnaryInstr::kSqrt) {
3961 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); 3961 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg());
3962 } else if (kind() == MathUnaryInstr::kDoubleSquare) { 3962 } else if (kind() == MathUnaryInstr::kDoubleSquare) {
3963 DRegister val = locs()->in(0).fpu_reg(); 3963 DRegister val = locs()->in(0).fpu_reg();
3964 DRegister result = locs()->out(0).fpu_reg(); 3964 DRegister result = locs()->out(0).fpu_reg();
3965 __ muld(result, val, val); 3965 __ muld(result, val, val);
3966 } else { 3966 } else {
3967 __ CallRuntime(TargetFunction(), InputCount()); 3967 __ CallRuntime(TargetFunction(), InputCount());
3968 } 3968 }
3969 } 3969 }
3970 3970
3971 3971
3972 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary( 3972 LocationSummary* CaseInsensitiveCompareUC16Instr::MakeLocationSummary(
3973 Isolate* isolate, bool opt) const { 3973 Zone* zone, bool opt) const {
3974 const intptr_t kNumTemps = 0; 3974 const intptr_t kNumTemps = 0;
3975 LocationSummary* summary = new(isolate) LocationSummary( 3975 LocationSummary* summary = new(zone) LocationSummary(
3976 isolate, InputCount(), kNumTemps, LocationSummary::kCall); 3976 zone, InputCount(), kNumTemps, LocationSummary::kCall);
3977 summary->set_in(0, Location::RegisterLocation(A0)); 3977 summary->set_in(0, Location::RegisterLocation(A0));
3978 summary->set_in(1, Location::RegisterLocation(A1)); 3978 summary->set_in(1, Location::RegisterLocation(A1));
3979 summary->set_in(2, Location::RegisterLocation(A2)); 3979 summary->set_in(2, Location::RegisterLocation(A2));
3980 summary->set_in(3, Location::RegisterLocation(A3)); 3980 summary->set_in(3, Location::RegisterLocation(A3));
3981 summary->set_out(0, Location::RegisterLocation(V0)); 3981 summary->set_out(0, Location::RegisterLocation(V0));
3982 return summary; 3982 return summary;
3983 } 3983 }
3984 3984
3985 3985
3986 void CaseInsensitiveCompareUC16Instr::EmitNativeCode( 3986 void CaseInsensitiveCompareUC16Instr::EmitNativeCode(
3987 FlowGraphCompiler* compiler) { 3987 FlowGraphCompiler* compiler) {
3988 3988
3989 // Call the function. 3989 // Call the function.
3990 __ CallRuntime(TargetFunction(), TargetFunction().argument_count()); 3990 __ CallRuntime(TargetFunction(), TargetFunction().argument_count());
3991 } 3991 }
3992 3992
3993 3993
3994 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Isolate* isolate, 3994 LocationSummary* MathMinMaxInstr::MakeLocationSummary(Zone* zone,
3995 bool opt) const { 3995 bool opt) const {
3996 if (result_cid() == kDoubleCid) { 3996 if (result_cid() == kDoubleCid) {
3997 const intptr_t kNumInputs = 2; 3997 const intptr_t kNumInputs = 2;
3998 const intptr_t kNumTemps = 1; 3998 const intptr_t kNumTemps = 1;
3999 LocationSummary* summary = new(isolate) LocationSummary( 3999 LocationSummary* summary = new(zone) LocationSummary(
4000 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4000 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4001 summary->set_in(0, Location::RequiresFpuRegister()); 4001 summary->set_in(0, Location::RequiresFpuRegister());
4002 summary->set_in(1, Location::RequiresFpuRegister()); 4002 summary->set_in(1, Location::RequiresFpuRegister());
4003 // Reuse the left register so that code can be made shorter. 4003 // Reuse the left register so that code can be made shorter.
4004 summary->set_out(0, Location::SameAsFirstInput()); 4004 summary->set_out(0, Location::SameAsFirstInput());
4005 summary->set_temp(0, Location::RequiresRegister()); 4005 summary->set_temp(0, Location::RequiresRegister());
4006 return summary; 4006 return summary;
4007 } 4007 }
4008 ASSERT(result_cid() == kSmiCid); 4008 ASSERT(result_cid() == kSmiCid);
4009 const intptr_t kNumInputs = 2; 4009 const intptr_t kNumInputs = 2;
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 summary->set_in(0, Location::RequiresRegister()); 4013 summary->set_in(0, Location::RequiresRegister());
4014 summary->set_in(1, Location::RequiresRegister()); 4014 summary->set_in(1, Location::RequiresRegister());
4015 // Reuse the left register so that code can be made shorter. 4015 // Reuse the left register so that code can be made shorter.
4016 summary->set_out(0, Location::SameAsFirstInput()); 4016 summary->set_out(0, Location::SameAsFirstInput());
4017 return summary; 4017 return summary;
4018 } 4018 }
4019 4019
4020 4020
4021 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4021 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4022 ASSERT((op_kind() == MethodRecognizer::kMathMin) || 4022 ASSERT((op_kind() == MethodRecognizer::kMathMin) ||
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
4076 if (is_min) { 4076 if (is_min) {
4077 __ BranchSignedLessEqual(left, right, &done); 4077 __ BranchSignedLessEqual(left, right, &done);
4078 } else { 4078 } else {
4079 __ BranchSignedGreaterEqual(left, right, &done); 4079 __ BranchSignedGreaterEqual(left, right, &done);
4080 } 4080 }
4081 __ mov(result, right); 4081 __ mov(result, right);
4082 __ Bind(&done); 4082 __ Bind(&done);
4083 } 4083 }
4084 4084
4085 4085
4086 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Isolate* isolate, 4086 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(Zone* zone,
4087 bool opt) const { 4087 bool opt) const {
4088 const intptr_t kNumInputs = 1; 4088 const intptr_t kNumInputs = 1;
4089 const intptr_t kNumTemps = 0; 4089 const intptr_t kNumTemps = 0;
4090 LocationSummary* summary = new(isolate) LocationSummary( 4090 LocationSummary* summary = new(zone) LocationSummary(
4091 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4091 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4092 summary->set_in(0, Location::RequiresRegister()); 4092 summary->set_in(0, Location::RequiresRegister());
4093 // We make use of 3-operand instructions by not requiring result register 4093 // We make use of 3-operand instructions by not requiring result register
4094 // to be identical to first input register as on Intel. 4094 // to be identical to first input register as on Intel.
4095 summary->set_out(0, Location::RequiresRegister()); 4095 summary->set_out(0, Location::RequiresRegister());
4096 return summary; 4096 return summary;
4097 } 4097 }
4098 4098
4099 4099
4100 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4100 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4101 Register value = locs()->in(0).reg(); 4101 Register value = locs()->in(0).reg();
4102 Register result = locs()->out(0).reg(); 4102 Register result = locs()->out(0).reg();
4103 switch (op_kind()) { 4103 switch (op_kind()) {
4104 case Token::kNEGATE: { 4104 case Token::kNEGATE: {
4105 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp); 4105 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp);
4106 __ SubuDetectOverflow(result, ZR, value, CMPRES1); 4106 __ SubuDetectOverflow(result, ZR, value, CMPRES1);
4107 __ bltz(CMPRES1, deopt); 4107 __ bltz(CMPRES1, deopt);
4108 break; 4108 break;
4109 } 4109 }
4110 case Token::kBIT_NOT: 4110 case Token::kBIT_NOT:
4111 __ nor(result, value, ZR); 4111 __ nor(result, value, ZR);
4112 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag. 4112 __ addiu(result, result, Immediate(-1)); // Remove inverted smi-tag.
4113 break; 4113 break;
4114 default: 4114 default:
4115 UNREACHABLE(); 4115 UNREACHABLE();
4116 } 4116 }
4117 } 4117 }
4118 4118
4119 4119
4120 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Isolate* isolate, 4120 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
4121 bool opt) const { 4121 bool opt) const {
4122 const intptr_t kNumInputs = 1; 4122 const intptr_t kNumInputs = 1;
4123 const intptr_t kNumTemps = 1; 4123 const intptr_t kNumTemps = 1;
4124 LocationSummary* summary = new(isolate) LocationSummary( 4124 LocationSummary* summary = new(zone) LocationSummary(
4125 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4125 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4126 summary->set_in(0, Location::RequiresFpuRegister()); 4126 summary->set_in(0, Location::RequiresFpuRegister());
4127 summary->set_out(0, Location::RequiresFpuRegister()); 4127 summary->set_out(0, Location::RequiresFpuRegister());
4128 summary->set_temp(0, Location::RequiresFpuRegister()); 4128 summary->set_temp(0, Location::RequiresFpuRegister());
4129 return summary; 4129 return summary;
4130 } 4130 }
4131 4131
4132 4132
4133 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4133 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4134 // TODO(zra): Implement vneg. 4134 // TODO(zra): Implement vneg.
4135 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); 4135 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1));
4136 __ LoadObject(TMP, minus_one); 4136 __ LoadObject(TMP, minus_one);
4137 FpuRegister result = locs()->out(0).fpu_reg(); 4137 FpuRegister result = locs()->out(0).fpu_reg();
4138 FpuRegister value = locs()->in(0).fpu_reg(); 4138 FpuRegister value = locs()->in(0).fpu_reg();
4139 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); 4139 FpuRegister temp_fp = locs()->temp(0).fpu_reg();
4140 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); 4140 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag);
4141 __ muld(result, value, temp_fp); 4141 __ muld(result, value, temp_fp);
4142 } 4142 }
4143 4143
4144 4144
4145 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Isolate* isolate, 4145 LocationSummary* Int32ToDoubleInstr::MakeLocationSummary(Zone* zone,
4146 bool opt) const { 4146 bool opt) const {
4147 const intptr_t kNumInputs = 1; 4147 const intptr_t kNumInputs = 1;
4148 const intptr_t kNumTemps = 0; 4148 const intptr_t kNumTemps = 0;
4149 LocationSummary* result = new(isolate) LocationSummary( 4149 LocationSummary* result = new(zone) LocationSummary(
4150 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4150 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4151 result->set_in(0, Location::RequiresRegister()); 4151 result->set_in(0, Location::RequiresRegister());
4152 result->set_out(0, Location::RequiresFpuRegister()); 4152 result->set_out(0, Location::RequiresFpuRegister());
4153 return result; 4153 return result;
4154 } 4154 }
4155 4155
4156 4156
4157 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4157 void Int32ToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4158 Register value = locs()->in(0).reg(); 4158 Register value = locs()->in(0).reg();
4159 FpuRegister result = locs()->out(0).fpu_reg(); 4159 FpuRegister result = locs()->out(0).fpu_reg();
4160 __ mtc1(value, STMP1); 4160 __ mtc1(value, STMP1);
4161 __ cvtdw(result, STMP1); 4161 __ cvtdw(result, STMP1);
4162 } 4162 }
4163 4163
4164 4164
4165 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Isolate* isolate, 4165 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(Zone* zone,
4166 bool opt) const { 4166 bool opt) const {
4167 const intptr_t kNumInputs = 1; 4167 const intptr_t kNumInputs = 1;
4168 const intptr_t kNumTemps = 0; 4168 const intptr_t kNumTemps = 0;
4169 LocationSummary* result = new(isolate) LocationSummary( 4169 LocationSummary* result = new(zone) LocationSummary(
4170 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4170 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4171 result->set_in(0, Location::RequiresRegister()); 4171 result->set_in(0, Location::RequiresRegister());
4172 result->set_out(0, Location::RequiresFpuRegister()); 4172 result->set_out(0, Location::RequiresFpuRegister());
4173 return result; 4173 return result;
4174 } 4174 }
4175 4175
4176 4176
4177 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4177 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4178 Register value = locs()->in(0).reg(); 4178 Register value = locs()->in(0).reg();
4179 FpuRegister result = locs()->out(0).fpu_reg(); 4179 FpuRegister result = locs()->out(0).fpu_reg();
4180 __ SmiUntag(TMP, value); 4180 __ SmiUntag(TMP, value);
4181 __ mtc1(TMP, STMP1); 4181 __ mtc1(TMP, STMP1);
4182 __ cvtdw(result, STMP1); 4182 __ cvtdw(result, STMP1);
4183 } 4183 }
4184 4184
4185 4185
4186 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Isolate* isolate, 4186 LocationSummary* MintToDoubleInstr::MakeLocationSummary(Zone* zone,
4187 bool opt) const { 4187 bool opt) const {
4188 UNIMPLEMENTED(); 4188 UNIMPLEMENTED();
4189 return NULL; 4189 return NULL;
4190 } 4190 }
4191 4191
4192 4192
4193 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4193 void MintToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4194 UNIMPLEMENTED(); 4194 UNIMPLEMENTED();
4195 } 4195 }
4196 4196
4197 4197
4198 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Isolate* isolate, 4198 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(Zone* zone,
4199 bool opt) const { 4199 bool opt) const {
4200 const intptr_t kNumInputs = 1; 4200 const intptr_t kNumInputs = 1;
4201 const intptr_t kNumTemps = 0; 4201 const intptr_t kNumTemps = 0;
4202 LocationSummary* result = new(isolate) LocationSummary( 4202 LocationSummary* result = new(zone) LocationSummary(
4203 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 4203 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
4204 result->set_in(0, Location::RegisterLocation(T1)); 4204 result->set_in(0, Location::RegisterLocation(T1));
4205 result->set_out(0, Location::RegisterLocation(V0)); 4205 result->set_out(0, Location::RegisterLocation(V0));
4206 return result; 4206 return result;
4207 } 4207 }
4208 4208
4209 4209
4210 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4210 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4211 Register result = locs()->out(0).reg(); 4211 Register result = locs()->out(0).reg();
4212 Register value_obj = locs()->in(0).reg(); 4212 Register value_obj = locs()->in(0).reg();
4213 ASSERT(result == V0); 4213 ASSERT(result == V0);
(...skipping 22 matching lines...) Expand all
4236 instance_call()->token_pos(), 4236 instance_call()->token_pos(),
4237 target, 4237 target,
4238 kNumberOfArguments, 4238 kNumberOfArguments,
4239 Object::null_array(), // No argument names., 4239 Object::null_array(), // No argument names.,
4240 locs(), 4240 locs(),
4241 ICData::Handle()); 4241 ICData::Handle());
4242 __ Bind(&done); 4242 __ Bind(&done);
4243 } 4243 }
4244 4244
4245 4245
4246 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Isolate* isolate, 4246 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
4247 bool opt) const { 4247 bool opt) const {
4248 const intptr_t kNumInputs = 1; 4248 const intptr_t kNumInputs = 1;
4249 const intptr_t kNumTemps = 0; 4249 const intptr_t kNumTemps = 0;
4250 LocationSummary* result = new(isolate) LocationSummary( 4250 LocationSummary* result = new(zone) LocationSummary(
4251 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4251 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4252 result->set_in(0, Location::RequiresFpuRegister()); 4252 result->set_in(0, Location::RequiresFpuRegister());
4253 result->set_out(0, Location::RequiresRegister()); 4253 result->set_out(0, Location::RequiresRegister());
4254 return result; 4254 return result;
4255 } 4255 }
4256 4256
4257 4257
4258 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4258 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4259 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); 4259 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi);
4260 Register result = locs()->out(0).reg(); 4260 Register result = locs()->out(0).reg();
4261 DRegister value = locs()->in(0).fpu_reg(); 4261 DRegister value = locs()->in(0).fpu_reg();
4262 __ cvtwd(STMP1, value); 4262 __ cvtwd(STMP1, value);
4263 __ mfc1(result, STMP1); 4263 __ mfc1(result, STMP1);
4264 4264
4265 // Check for overflow and that it fits into Smi. 4265 // Check for overflow and that it fits into Smi.
4266 __ LoadImmediate(TMP, 0xC0000000); 4266 __ LoadImmediate(TMP, 0xC0000000);
4267 __ subu(CMPRES1, result, TMP); 4267 __ subu(CMPRES1, result, TMP);
4268 __ bltz(CMPRES1, deopt); 4268 __ bltz(CMPRES1, deopt);
4269 __ SmiTag(result); 4269 __ SmiTag(result);
4270 } 4270 }
4271 4271
4272 4272
4273 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Isolate* isolate, 4273 LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Zone* zone,
4274 bool opt) const { 4274 bool opt) const {
4275 UNIMPLEMENTED(); 4275 UNIMPLEMENTED();
4276 return NULL; 4276 return NULL;
4277 } 4277 }
4278 4278
4279 4279
4280 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4280 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4281 UNIMPLEMENTED(); 4281 UNIMPLEMENTED();
4282 } 4282 }
4283 4283
4284 4284
4285 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Isolate* isolate, 4285 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(Zone* zone,
4286 bool opt) const { 4286 bool opt) const {
4287 const intptr_t kNumInputs = 1; 4287 const intptr_t kNumInputs = 1;
4288 const intptr_t kNumTemps = 0; 4288 const intptr_t kNumTemps = 0;
4289 LocationSummary* result = new(isolate) LocationSummary( 4289 LocationSummary* result = new(zone) LocationSummary(
4290 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4290 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4291 result->set_in(0, Location::RequiresFpuRegister()); 4291 result->set_in(0, Location::RequiresFpuRegister());
4292 result->set_out(0, Location::SameAsFirstInput()); 4292 result->set_out(0, Location::SameAsFirstInput());
4293 return result; 4293 return result;
4294 } 4294 }
4295 4295
4296 4296
4297 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4297 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4298 DRegister value = locs()->in(0).fpu_reg(); 4298 DRegister value = locs()->in(0).fpu_reg();
4299 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg()); 4299 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg());
4300 __ cvtsd(result, value); 4300 __ cvtsd(result, value);
4301 } 4301 }
4302 4302
4303 4303
4304 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Isolate* isolate, 4304 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(Zone* zone,
4305 bool opt) const { 4305 bool opt) const {
4306 const intptr_t kNumInputs = 1; 4306 const intptr_t kNumInputs = 1;
4307 const intptr_t kNumTemps = 0; 4307 const intptr_t kNumTemps = 0;
4308 LocationSummary* result = new(isolate) LocationSummary( 4308 LocationSummary* result = new(zone) LocationSummary(
4309 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4309 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4310 result->set_in(0, Location::RequiresFpuRegister()); 4310 result->set_in(0, Location::RequiresFpuRegister());
4311 result->set_out(0, Location::SameAsFirstInput()); 4311 result->set_out(0, Location::SameAsFirstInput());
4312 return result; 4312 return result;
4313 } 4313 }
4314 4314
4315 4315
4316 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4316 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4317 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg()); 4317 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg());
4318 DRegister result = locs()->out(0).fpu_reg(); 4318 DRegister result = locs()->out(0).fpu_reg();
4319 __ cvtds(result, value); 4319 __ cvtds(result, value);
4320 } 4320 }
4321 4321
4322 4322
4323 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Isolate* isolate, 4323 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(Zone* zone,
4324 bool opt) const { 4324 bool opt) const {
4325 // Calling convention on MIPS uses D6 and D7 to pass the first two 4325 // Calling convention on MIPS uses D6 and D7 to pass the first two
4326 // double arguments. 4326 // double arguments.
4327 ASSERT((InputCount() == 1) || (InputCount() == 2)); 4327 ASSERT((InputCount() == 1) || (InputCount() == 2));
4328 const intptr_t kNumTemps = 0; 4328 const intptr_t kNumTemps = 0;
4329 LocationSummary* result = new(isolate) LocationSummary( 4329 LocationSummary* result = new(zone) LocationSummary(
4330 isolate, InputCount(), kNumTemps, LocationSummary::kCall); 4330 zone, InputCount(), kNumTemps, LocationSummary::kCall);
4331 result->set_in(0, Location::FpuRegisterLocation(D6)); 4331 result->set_in(0, Location::FpuRegisterLocation(D6));
4332 if (InputCount() == 2) { 4332 if (InputCount() == 2) {
4333 result->set_in(1, Location::FpuRegisterLocation(D7)); 4333 result->set_in(1, Location::FpuRegisterLocation(D7));
4334 } 4334 }
4335 result->set_out(0, Location::FpuRegisterLocation(D0)); 4335 result->set_out(0, Location::FpuRegisterLocation(D0));
4336 return result; 4336 return result;
4337 } 4337 }
4338 4338
4339 4339
4340 // Pseudo code: 4340 // Pseudo code:
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
4454 // For pow-function return NaN if exponent is NaN. 4454 // For pow-function return NaN if exponent is NaN.
4455 if (recognized_kind() == MethodRecognizer::kMathDoublePow) { 4455 if (recognized_kind() == MethodRecognizer::kMathDoublePow) {
4456 InvokeDoublePow(compiler, this); 4456 InvokeDoublePow(compiler, this);
4457 return; 4457 return;
4458 } 4458 }
4459 // double values are passed and returned in vfp registers. 4459 // double values are passed and returned in vfp registers.
4460 __ CallRuntime(TargetFunction(), InputCount()); 4460 __ CallRuntime(TargetFunction(), InputCount());
4461 } 4461 }
4462 4462
4463 4463
4464 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Isolate* isolate, 4464 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(Zone* zone,
4465 bool opt) const { 4465 bool opt) const {
4466 // Only use this instruction in optimized code. 4466 // Only use this instruction in optimized code.
4467 ASSERT(opt); 4467 ASSERT(opt);
4468 const intptr_t kNumInputs = 1; 4468 const intptr_t kNumInputs = 1;
4469 LocationSummary* summary = new(isolate) LocationSummary( 4469 LocationSummary* summary = new(zone) LocationSummary(
4470 isolate, kNumInputs, 0, LocationSummary::kNoCall); 4470 zone, kNumInputs, 0, LocationSummary::kNoCall);
4471 if (representation() == kUnboxedDouble) { 4471 if (representation() == kUnboxedDouble) {
4472 if (index() == 0) { 4472 if (index() == 0) {
4473 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), 4473 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(),
4474 Location::Any())); 4474 Location::Any()));
4475 } else { 4475 } else {
4476 ASSERT(index() == 1); 4476 ASSERT(index() == 1);
4477 summary->set_in(0, Location::Pair(Location::Any(), 4477 summary->set_in(0, Location::Pair(Location::Any(),
4478 Location::RequiresFpuRegister())); 4478 Location::RequiresFpuRegister()));
4479 } 4479 }
4480 summary->set_out(0, Location::RequiresFpuRegister()); 4480 summary->set_out(0, Location::RequiresFpuRegister());
(...skipping 23 matching lines...) Expand all
4504 __ movd(out, in); 4504 __ movd(out, in);
4505 } else { 4505 } else {
4506 ASSERT(representation() == kTagged); 4506 ASSERT(representation() == kTagged);
4507 Register out = locs()->out(0).reg(); 4507 Register out = locs()->out(0).reg();
4508 Register in = in_loc.reg(); 4508 Register in = in_loc.reg();
4509 __ mov(out, in); 4509 __ mov(out, in);
4510 } 4510 }
4511 } 4511 }
4512 4512
4513 4513
4514 LocationSummary* MergedMathInstr::MakeLocationSummary(Isolate* isolate, 4514 LocationSummary* MergedMathInstr::MakeLocationSummary(Zone* zone,
4515 bool opt) const { 4515 bool opt) const {
4516 if (kind() == MergedMathInstr::kTruncDivMod) { 4516 if (kind() == MergedMathInstr::kTruncDivMod) {
4517 const intptr_t kNumInputs = 2; 4517 const intptr_t kNumInputs = 2;
4518 const intptr_t kNumTemps = 1; 4518 const intptr_t kNumTemps = 1;
4519 LocationSummary* summary = new(isolate) LocationSummary( 4519 LocationSummary* summary = new(zone) LocationSummary(
4520 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4520 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4521 summary->set_in(0, Location::RequiresRegister()); 4521 summary->set_in(0, Location::RequiresRegister());
4522 summary->set_in(1, Location::RequiresRegister()); 4522 summary->set_in(1, Location::RequiresRegister());
4523 summary->set_temp(0, Location::RequiresRegister()); 4523 summary->set_temp(0, Location::RequiresRegister());
4524 // Output is a pair of registers. 4524 // Output is a pair of registers.
4525 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 4525 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
4526 Location::RequiresRegister())); 4526 Location::RequiresRegister()));
4527 return summary; 4527 return summary;
4528 } 4528 }
4529 UNIMPLEMENTED(); 4529 UNIMPLEMENTED();
4530 return NULL; 4530 return NULL;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4585 4585
4586 __ SmiTag(result_div); 4586 __ SmiTag(result_div);
4587 __ SmiTag(result_mod); 4587 __ SmiTag(result_mod);
4588 return; 4588 return;
4589 } 4589 }
4590 UNIMPLEMENTED(); 4590 UNIMPLEMENTED();
4591 } 4591 }
4592 4592
4593 4593
4594 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary( 4594 LocationSummary* PolymorphicInstanceCallInstr::MakeLocationSummary(
4595 Isolate* isolate, bool opt) const { 4595 Zone* zone, bool opt) const {
4596 return MakeCallSummary(isolate); 4596 return MakeCallSummary(zone);
4597 } 4597 }
4598 4598
4599 4599
4600 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4600 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4601 __ TraceSimMsg("PolymorphicInstanceCallInstr"); 4601 __ TraceSimMsg("PolymorphicInstanceCallInstr");
4602 ASSERT(ic_data().NumArgsTested() == 1); 4602 ASSERT(ic_data().NumArgsTested() == 1);
4603 if (!with_checks()) { 4603 if (!with_checks()) {
4604 ASSERT(ic_data().HasOneTarget()); 4604 ASSERT(ic_data().HasOneTarget());
4605 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); 4605 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0));
4606 compiler->GenerateStaticCall(deopt_id(), 4606 compiler->GenerateStaticCall(deopt_id(),
(...skipping 18 matching lines...) Expand all
4625 T2, // Class id register. 4625 T2, // Class id register.
4626 instance_call()->ArgumentCount(), 4626 instance_call()->ArgumentCount(),
4627 instance_call()->argument_names(), 4627 instance_call()->argument_names(),
4628 deopt, 4628 deopt,
4629 deopt_id(), 4629 deopt_id(),
4630 instance_call()->token_pos(), 4630 instance_call()->token_pos(),
4631 locs()); 4631 locs());
4632 } 4632 }
4633 4633
4634 4634
4635 LocationSummary* BranchInstr::MakeLocationSummary(Isolate* isolate, 4635 LocationSummary* BranchInstr::MakeLocationSummary(Zone* zone,
4636 bool opt) const { 4636 bool opt) const {
4637 comparison()->InitializeLocationSummary(isolate, opt); 4637 comparison()->InitializeLocationSummary(zone, opt);
4638 // Branches don't produce a result. 4638 // Branches don't produce a result.
4639 comparison()->locs()->set_out(0, Location::NoLocation()); 4639 comparison()->locs()->set_out(0, Location::NoLocation());
4640 return comparison()->locs(); 4640 return comparison()->locs();
4641 } 4641 }
4642 4642
4643 4643
4644 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4644 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4645 __ TraceSimMsg("BranchInstr"); 4645 __ TraceSimMsg("BranchInstr");
4646 comparison()->EmitBranchCode(compiler, this); 4646 comparison()->EmitBranchCode(compiler, this);
4647 } 4647 }
4648 4648
4649 4649
4650 LocationSummary* CheckClassInstr::MakeLocationSummary(Isolate* isolate, 4650 LocationSummary* CheckClassInstr::MakeLocationSummary(Zone* zone,
4651 bool opt) const { 4651 bool opt) const {
4652 const intptr_t kNumInputs = 1; 4652 const intptr_t kNumInputs = 1;
4653 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask()); 4653 const bool need_mask_temp = IsDenseSwitch() && !IsDenseMask(ComputeCidMask());
4654 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0; 4654 const intptr_t kNumTemps = !IsNullCheck() ? (need_mask_temp ? 2 : 1) : 0;
4655 LocationSummary* summary = new(isolate) LocationSummary( 4655 LocationSummary* summary = new(zone) LocationSummary(
4656 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4656 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4657 summary->set_in(0, Location::RequiresRegister()); 4657 summary->set_in(0, Location::RequiresRegister());
4658 if (!IsNullCheck()) { 4658 if (!IsNullCheck()) {
4659 summary->set_temp(0, Location::RequiresRegister()); 4659 summary->set_temp(0, Location::RequiresRegister());
4660 if (need_mask_temp) { 4660 if (need_mask_temp) {
4661 summary->set_temp(1, Location::RequiresRegister()); 4661 summary->set_temp(1, Location::RequiresRegister());
4662 } 4662 }
4663 } 4663 }
4664 return summary; 4664 return summary;
4665 } 4665 }
4666 4666
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 __ bne(CMPRES1, ZR, deopt); 4717 __ bne(CMPRES1, ZR, deopt);
4718 } else { 4718 } else {
4719 __ beq(CMPRES1, ZR, &is_ok); 4719 __ beq(CMPRES1, ZR, &is_ok);
4720 } 4720 }
4721 } 4721 }
4722 } 4722 }
4723 __ Bind(&is_ok); 4723 __ Bind(&is_ok);
4724 } 4724 }
4725 4725
4726 4726
4727 LocationSummary* CheckSmiInstr::MakeLocationSummary(Isolate* isolate, 4727 LocationSummary* CheckSmiInstr::MakeLocationSummary(Zone* zone,
4728 bool opt) const { 4728 bool opt) const {
4729 const intptr_t kNumInputs = 1; 4729 const intptr_t kNumInputs = 1;
4730 const intptr_t kNumTemps = 0; 4730 const intptr_t kNumTemps = 0;
4731 LocationSummary* summary = new(isolate) LocationSummary( 4731 LocationSummary* summary = new(zone) LocationSummary(
4732 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4732 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4733 summary->set_in(0, Location::RequiresRegister()); 4733 summary->set_in(0, Location::RequiresRegister());
4734 return summary; 4734 return summary;
4735 } 4735 }
4736 4736
4737 4737
4738 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4738 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4739 __ TraceSimMsg("CheckSmiInstr"); 4739 __ TraceSimMsg("CheckSmiInstr");
4740 Register value = locs()->in(0).reg(); 4740 Register value = locs()->in(0).reg();
4741 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4741 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4742 ICData::kDeoptCheckSmi, 4742 ICData::kDeoptCheckSmi,
4743 licm_hoisted_ ? ICData::kHoisted : 0); 4743 licm_hoisted_ ? ICData::kHoisted : 0);
4744 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); 4744 __ andi(CMPRES1, value, Immediate(kSmiTagMask));
4745 __ bne(CMPRES1, ZR, deopt); 4745 __ bne(CMPRES1, ZR, deopt);
4746 } 4746 }
4747 4747
4748 4748
4749 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Isolate* isolate, 4749 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Zone* zone,
4750 bool opt) const { 4750 bool opt) const {
4751 const intptr_t kNumInputs = 1; 4751 const intptr_t kNumInputs = 1;
4752 const intptr_t kNumTemps = 0; 4752 const intptr_t kNumTemps = 0;
4753 LocationSummary* summary = new(isolate) LocationSummary( 4753 LocationSummary* summary = new(zone) LocationSummary(
4754 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4754 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4755 summary->set_in(0, Location::RequiresRegister()); 4755 summary->set_in(0, Location::RequiresRegister());
4756 return summary; 4756 return summary;
4757 } 4757 }
4758 4758
4759 4759
4760 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4760 void CheckClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4761 Register value = locs()->in(0).reg(); 4761 Register value = locs()->in(0).reg();
4762 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass); 4762 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckClass);
4763 __ BranchNotEqual(value, Immediate(Smi::RawValue(cid_)), deopt); 4763 __ BranchNotEqual(value, Immediate(Smi::RawValue(cid_)), deopt);
4764 } 4764 }
4765 4765
4766 4766
4767 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Isolate* isolate, 4767 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(Zone* zone,
4768 bool opt) const { 4768 bool opt) const {
4769 const intptr_t kNumInputs = 2; 4769 const intptr_t kNumInputs = 2;
4770 const intptr_t kNumTemps = 0; 4770 const intptr_t kNumTemps = 0;
4771 LocationSummary* locs = new(isolate) LocationSummary( 4771 LocationSummary* locs = new(zone) LocationSummary(
4772 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4772 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4773 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); 4773 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length()));
4774 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); 4774 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index()));
4775 return locs; 4775 return locs;
4776 } 4776 }
4777 4777
4778 4778
4779 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4779 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4780 uint32_t flags = generalized_ ? ICData::kGeneralized : 0; 4780 uint32_t flags = generalized_ ? ICData::kGeneralized : 0;
4781 flags |= licm_hoisted_ ? ICData::kHoisted : 0; 4781 flags |= licm_hoisted_ ? ICData::kHoisted : 0;
4782 Label* deopt = compiler->AddDeoptStub( 4782 Label* deopt = compiler->AddDeoptStub(
(...skipping 28 matching lines...) Expand all
4811 __ BranchUnsignedGreaterEqual( 4811 __ BranchUnsignedGreaterEqual(
4812 index, Immediate(reinterpret_cast<int32_t>(length.raw())), deopt); 4812 index, Immediate(reinterpret_cast<int32_t>(length.raw())), deopt);
4813 } 4813 }
4814 } else { 4814 } else {
4815 Register length = length_loc.reg(); 4815 Register length = length_loc.reg();
4816 Register index = index_loc.reg(); 4816 Register index = index_loc.reg();
4817 __ BranchUnsignedGreaterEqual(index, length, deopt); 4817 __ BranchUnsignedGreaterEqual(index, length, deopt);
4818 } 4818 }
4819 } 4819 }
4820 4820
4821 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Isolate* isolate, 4821 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Zone* zone,
4822 bool opt) const { 4822 bool opt) const {
4823 const intptr_t kNumInputs = 2; 4823 const intptr_t kNumInputs = 2;
4824 const intptr_t kNumTemps = 0; 4824 const intptr_t kNumTemps = 0;
4825 LocationSummary* summary = new(isolate) LocationSummary( 4825 LocationSummary* summary = new(zone) LocationSummary(
4826 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4826 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4827 summary->set_in(0, Location::Pair(Location::RequiresRegister(), 4827 summary->set_in(0, Location::Pair(Location::RequiresRegister(),
4828 Location::RequiresRegister())); 4828 Location::RequiresRegister()));
4829 summary->set_in(1, Location::Pair(Location::RequiresRegister(), 4829 summary->set_in(1, Location::Pair(Location::RequiresRegister(),
4830 Location::RequiresRegister())); 4830 Location::RequiresRegister()));
4831 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 4831 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
4832 Location::RequiresRegister())); 4832 Location::RequiresRegister()));
4833 return summary; 4833 return summary;
4834 } 4834 }
4835 4835
4836 4836
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
4905 __ mflo(out_lo); 4905 __ mflo(out_lo);
4906 __ mfhi(out_hi); 4906 __ mfhi(out_hi);
4907 break; 4907 break;
4908 } 4908 }
4909 default: 4909 default:
4910 UNREACHABLE(); 4910 UNREACHABLE();
4911 } 4911 }
4912 } 4912 }
4913 4913
4914 4914
4915 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Isolate* isolate, 4915 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Zone* zone,
4916 bool opt) const { 4916 bool opt) const {
4917 const intptr_t kNumInputs = 2; 4917 const intptr_t kNumInputs = 2;
4918 const intptr_t kNumTemps = 0; 4918 const intptr_t kNumTemps = 0;
4919 LocationSummary* summary = new(isolate) LocationSummary( 4919 LocationSummary* summary = new(zone) LocationSummary(
4920 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 4920 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
4921 summary->set_in(0, Location::Pair(Location::RequiresRegister(), 4921 summary->set_in(0, Location::Pair(Location::RequiresRegister(),
4922 Location::RequiresRegister())); 4922 Location::RequiresRegister()));
4923 summary->set_in(1, Location::WritableRegisterOrSmiConstant(right())); 4923 summary->set_in(1, Location::WritableRegisterOrSmiConstant(right()));
4924 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 4924 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
4925 Location::RequiresRegister())); 4925 Location::RequiresRegister()));
4926 return summary; 4926 return summary;
4927 } 4927 }
4928 4928
4929 4929
4930 static const intptr_t kMintShiftCountLimit = 63; 4930 static const intptr_t kMintShiftCountLimit = 63;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
5077 __ Bind(&done); 5077 __ Bind(&done);
5078 break; 5078 break;
5079 } 5079 }
5080 default: 5080 default:
5081 UNREACHABLE(); 5081 UNREACHABLE();
5082 } 5082 }
5083 } 5083 }
5084 } 5084 }
5085 5085
5086 5086
5087 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Isolate* isolate, 5087 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Zone* zone,
5088 bool opt) const { 5088 bool opt) const {
5089 const intptr_t kNumInputs = 1; 5089 const intptr_t kNumInputs = 1;
5090 const intptr_t kNumTemps = 0; 5090 const intptr_t kNumTemps = 0;
5091 LocationSummary* summary = new(isolate) LocationSummary( 5091 LocationSummary* summary = new(zone) LocationSummary(
5092 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5092 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5093 summary->set_in(0, Location::Pair(Location::RequiresRegister(), 5093 summary->set_in(0, Location::Pair(Location::RequiresRegister(),
5094 Location::RequiresRegister())); 5094 Location::RequiresRegister()));
5095 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 5095 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
5096 Location::RequiresRegister())); 5096 Location::RequiresRegister()));
5097 return summary; 5097 return summary;
5098 } 5098 }
5099 5099
5100 5100
5101 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5101 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5102 ASSERT(op_kind() == Token::kBIT_NOT); 5102 ASSERT(op_kind() == Token::kBIT_NOT);
(...skipping 18 matching lines...) Expand all
5121 CompileType ShiftUint32OpInstr::ComputeType() const { 5121 CompileType ShiftUint32OpInstr::ComputeType() const {
5122 return CompileType::Int(); 5122 return CompileType::Int();
5123 } 5123 }
5124 5124
5125 5125
5126 CompileType UnaryUint32OpInstr::ComputeType() const { 5126 CompileType UnaryUint32OpInstr::ComputeType() const {
5127 return CompileType::Int(); 5127 return CompileType::Int();
5128 } 5128 }
5129 5129
5130 5130
5131 LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, 5131 LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Zone* zone,
5132 bool opt) const { 5132 bool opt) const {
5133 const intptr_t kNumInputs = 2; 5133 const intptr_t kNumInputs = 2;
5134 const intptr_t kNumTemps = 0; 5134 const intptr_t kNumTemps = 0;
5135 LocationSummary* summary = new(isolate) LocationSummary( 5135 LocationSummary* summary = new(zone) LocationSummary(
5136 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5136 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5137 summary->set_in(0, Location::RequiresRegister()); 5137 summary->set_in(0, Location::RequiresRegister());
5138 summary->set_in(1, Location::RequiresRegister()); 5138 summary->set_in(1, Location::RequiresRegister());
5139 summary->set_out(0, Location::RequiresRegister()); 5139 summary->set_out(0, Location::RequiresRegister());
5140 return summary; 5140 return summary;
5141 } 5141 }
5142 5142
5143 5143
5144 void BinaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5144 void BinaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5145 Register left = locs()->in(0).reg(); 5145 Register left = locs()->in(0).reg();
5146 Register right = locs()->in(1).reg(); 5146 Register right = locs()->in(1).reg();
(...skipping 18 matching lines...) Expand all
5165 case Token::kMUL: 5165 case Token::kMUL:
5166 __ multu(left, right); 5166 __ multu(left, right);
5167 __ mflo(out); 5167 __ mflo(out);
5168 break; 5168 break;
5169 default: 5169 default:
5170 UNREACHABLE(); 5170 UNREACHABLE();
5171 } 5171 }
5172 } 5172 }
5173 5173
5174 5174
5175 LocationSummary* ShiftUint32OpInstr::MakeLocationSummary(Isolate* isolate, 5175 LocationSummary* ShiftUint32OpInstr::MakeLocationSummary(Zone* zone,
5176 bool opt) const { 5176 bool opt) const {
5177 const intptr_t kNumInputs = 2; 5177 const intptr_t kNumInputs = 2;
5178 const intptr_t kNumTemps = 1; 5178 const intptr_t kNumTemps = 1;
5179 LocationSummary* summary = new(isolate) LocationSummary( 5179 LocationSummary* summary = new(zone) LocationSummary(
5180 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5180 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5181 summary->set_in(0, Location::RequiresRegister()); 5181 summary->set_in(0, Location::RequiresRegister());
5182 summary->set_in(1, Location::RegisterOrSmiConstant(right())); 5182 summary->set_in(1, Location::RegisterOrSmiConstant(right()));
5183 summary->set_temp(0, Location::RequiresRegister()); 5183 summary->set_temp(0, Location::RequiresRegister());
5184 summary->set_out(0, Location::RequiresRegister()); 5184 summary->set_out(0, Location::RequiresRegister());
5185 return summary; 5185 return summary;
5186 } 5186 }
5187 5187
5188 5188
5189 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5189 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5190 const intptr_t kShifterLimit = 31; 5190 const intptr_t kShifterLimit = 31;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
5234 break; 5234 break;
5235 case Token::kSHL: 5235 case Token::kSHL:
5236 __ sllv(out, out, temp); 5236 __ sllv(out, out, temp);
5237 break; 5237 break;
5238 default: 5238 default:
5239 UNREACHABLE(); 5239 UNREACHABLE();
5240 } 5240 }
5241 } 5241 }
5242 5242
5243 5243
5244 LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Isolate* isolate, 5244 LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Zone* zone,
5245 bool opt) const { 5245 bool opt) const {
5246 const intptr_t kNumInputs = 1; 5246 const intptr_t kNumInputs = 1;
5247 const intptr_t kNumTemps = 0; 5247 const intptr_t kNumTemps = 0;
5248 LocationSummary* summary = new(isolate) LocationSummary( 5248 LocationSummary* summary = new(zone) LocationSummary(
5249 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5249 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5250 summary->set_in(0, Location::RequiresRegister()); 5250 summary->set_in(0, Location::RequiresRegister());
5251 summary->set_out(0, Location::RequiresRegister()); 5251 summary->set_out(0, Location::RequiresRegister());
5252 return summary; 5252 return summary;
5253 } 5253 }
5254 5254
5255 5255
5256 void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5256 void UnaryUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5257 Register left = locs()->in(0).reg(); 5257 Register left = locs()->in(0).reg();
5258 Register out = locs()->out(0).reg(); 5258 Register out = locs()->out(0).reg();
5259 ASSERT(left != out); 5259 ASSERT(left != out);
5260 5260
5261 ASSERT(op_kind() == Token::kBIT_NOT); 5261 ASSERT(op_kind() == Token::kBIT_NOT);
5262 5262
5263 __ nor(out, ZR, left); 5263 __ nor(out, ZR, left);
5264 } 5264 }
5265 5265
5266 5266
5267 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) 5267 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr)
5268 5268
5269 5269
5270 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Isolate* isolate, 5270 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone,
5271 bool opt) const { 5271 bool opt) const {
5272 const intptr_t kNumInputs = 1; 5272 const intptr_t kNumInputs = 1;
5273 const intptr_t kNumTemps = 0; 5273 const intptr_t kNumTemps = 0;
5274 LocationSummary* summary = new(isolate) LocationSummary( 5274 LocationSummary* summary = new(zone) LocationSummary(
5275 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5275 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5276 if (from() == kUnboxedMint) { 5276 if (from() == kUnboxedMint) {
5277 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); 5277 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32));
5278 summary->set_in(0, Location::Pair(Location::RequiresRegister(), 5278 summary->set_in(0, Location::Pair(Location::RequiresRegister(),
5279 Location::RequiresRegister())); 5279 Location::RequiresRegister()));
5280 summary->set_out(0, Location::RequiresRegister()); 5280 summary->set_out(0, Location::RequiresRegister());
5281 } else if (to() == kUnboxedMint) { 5281 } else if (to() == kUnboxedMint) {
5282 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); 5282 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32));
5283 summary->set_in(0, Location::RequiresRegister()); 5283 summary->set_in(0, Location::RequiresRegister());
5284 summary->set_out(0, Location::Pair(Location::RequiresRegister(), 5284 summary->set_out(0, Location::Pair(Location::RequiresRegister(),
5285 Location::RequiresRegister())); 5285 Location::RequiresRegister()));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
5335 } else { 5335 } else {
5336 ASSERT(from() == kUnboxedInt32); 5336 ASSERT(from() == kUnboxedInt32);
5337 __ sra(out_hi, in, 31); 5337 __ sra(out_hi, in, 31);
5338 } 5338 }
5339 } else { 5339 } else {
5340 UNREACHABLE(); 5340 UNREACHABLE();
5341 } 5341 }
5342 } 5342 }
5343 5343
5344 5344
5345 LocationSummary* ThrowInstr::MakeLocationSummary(Isolate* isolate, 5345 LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone,
5346 bool opt) const { 5346 bool opt) const {
5347 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); 5347 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
5348 } 5348 }
5349 5349
5350 5350
5351 5351
5352 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5352 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5353 compiler->GenerateRuntimeCall(token_pos(), 5353 compiler->GenerateRuntimeCall(token_pos(),
5354 deopt_id(), 5354 deopt_id(),
5355 kThrowRuntimeEntry, 5355 kThrowRuntimeEntry,
5356 1, 5356 1,
5357 locs()); 5357 locs());
5358 __ break_(0); 5358 __ break_(0);
5359 } 5359 }
5360 5360
5361 5361
5362 LocationSummary* ReThrowInstr::MakeLocationSummary(Isolate* isolate, 5362 LocationSummary* ReThrowInstr::MakeLocationSummary(Zone* zone,
5363 bool opt) const { 5363 bool opt) const {
5364 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); 5364 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kCall);
5365 } 5365 }
5366 5366
5367 5367
5368 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5368 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5369 compiler->SetNeedsStacktrace(catch_try_index()); 5369 compiler->SetNeedsStacktrace(catch_try_index());
5370 compiler->GenerateRuntimeCall(token_pos(), 5370 compiler->GenerateRuntimeCall(token_pos(),
5371 deopt_id(), 5371 deopt_id(),
5372 kReThrowRuntimeEntry, 5372 kReThrowRuntimeEntry,
5373 2, 5373 2,
5374 locs()); 5374 locs());
5375 __ break_(0); 5375 __ break_(0);
5376 } 5376 }
5377 5377
5378 5378
5379 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5379 void GraphEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5380 if (!compiler->CanFallThroughTo(normal_entry())) { 5380 if (!compiler->CanFallThroughTo(normal_entry())) {
5381 __ b(compiler->GetJumpLabel(normal_entry())); 5381 __ b(compiler->GetJumpLabel(normal_entry()));
5382 } 5382 }
5383 } 5383 }
5384 5384
5385 5385
5386 LocationSummary* GotoInstr::MakeLocationSummary(Isolate* isolate, 5386 LocationSummary* GotoInstr::MakeLocationSummary(Zone* zone,
5387 bool opt) const { 5387 bool opt) const {
5388 return new(isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); 5388 return new(zone) LocationSummary(zone, 0, 0, LocationSummary::kNoCall);
5389 } 5389 }
5390 5390
5391 5391
5392 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5392 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5393 __ TraceSimMsg("GotoInstr"); 5393 __ TraceSimMsg("GotoInstr");
5394 if (!compiler->is_optimizing()) { 5394 if (!compiler->is_optimizing()) {
5395 if (FLAG_emit_edge_counters) { 5395 if (FLAG_emit_edge_counters) {
5396 compiler->EmitEdgeCounter(); 5396 compiler->EmitEdgeCounter();
5397 } 5397 }
5398 // Add a deoptimization descriptor for deoptimizing instructions that 5398 // Add a deoptimization descriptor for deoptimizing instructions that
(...skipping 10 matching lines...) Expand all
5409 } 5409 }
5410 5410
5411 // We can fall through if the successor is the next block in the list. 5411 // We can fall through if the successor is the next block in the list.
5412 // Otherwise, we need a jump. 5412 // Otherwise, we need a jump.
5413 if (!compiler->CanFallThroughTo(successor())) { 5413 if (!compiler->CanFallThroughTo(successor())) {
5414 __ b(compiler->GetJumpLabel(successor())); 5414 __ b(compiler->GetJumpLabel(successor()));
5415 } 5415 }
5416 } 5416 }
5417 5417
5418 5418
5419 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Isolate* isolate, 5419 LocationSummary* IndirectGotoInstr::MakeLocationSummary(Zone* zone,
5420 bool opt) const { 5420 bool opt) const {
5421 const intptr_t kNumInputs = 1; 5421 const intptr_t kNumInputs = 1;
5422 const intptr_t kNumTemps = 1; 5422 const intptr_t kNumTemps = 1;
5423 5423
5424 LocationSummary* summary = new(isolate) LocationSummary( 5424 LocationSummary* summary = new(zone) LocationSummary(
5425 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5425 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5426 5426
5427 summary->set_in(0, Location::RequiresRegister()); 5427 summary->set_in(0, Location::RequiresRegister());
5428 summary->set_temp(0, Location::RequiresRegister()); 5428 summary->set_temp(0, Location::RequiresRegister());
5429 5429
5430 return summary; 5430 return summary;
5431 } 5431 }
5432 5432
5433 5433
5434 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5434 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5435 Register target_address_reg = locs()->temp_slot(0)->reg(); 5435 Register target_address_reg = locs()->temp_slot(0)->reg();
5436 5436
5437 // Load from [current frame pointer] + kPcMarkerSlotFromFp. 5437 // Load from [current frame pointer] + kPcMarkerSlotFromFp.
5438 __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize)); 5438 __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
5439 5439
5440 // Add the offset. 5440 // Add the offset.
5441 Register offset_reg = locs()->in(0).reg(); 5441 Register offset_reg = locs()->in(0).reg();
5442 if (offset()->definition()->representation() == kTagged) { 5442 if (offset()->definition()->representation() == kTagged) {
5443 __ SmiUntag(offset_reg); 5443 __ SmiUntag(offset_reg);
5444 } 5444 }
5445 __ addu(target_address_reg, target_address_reg, offset_reg); 5445 __ addu(target_address_reg, target_address_reg, offset_reg);
5446 5446
5447 // Jump to the absolute address. 5447 // Jump to the absolute address.
5448 __ jr(target_address_reg); 5448 __ jr(target_address_reg);
5449 } 5449 }
5450 5450
5451 5451
5452 LocationSummary* StrictCompareInstr::MakeLocationSummary(Isolate* isolate, 5452 LocationSummary* StrictCompareInstr::MakeLocationSummary(Zone* zone,
5453 bool opt) const { 5453 bool opt) const {
5454 const intptr_t kNumInputs = 2; 5454 const intptr_t kNumInputs = 2;
5455 const intptr_t kNumTemps = 0; 5455 const intptr_t kNumTemps = 0;
5456 if (needs_number_check()) { 5456 if (needs_number_check()) {
5457 LocationSummary* locs = new(isolate) LocationSummary( 5457 LocationSummary* locs = new(zone) LocationSummary(
5458 isolate, kNumInputs, kNumTemps, LocationSummary::kCall); 5458 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
5459 locs->set_in(0, Location::RegisterLocation(A0)); 5459 locs->set_in(0, Location::RegisterLocation(A0));
5460 locs->set_in(1, Location::RegisterLocation(A1)); 5460 locs->set_in(1, Location::RegisterLocation(A1));
5461 locs->set_out(0, Location::RegisterLocation(A0)); 5461 locs->set_out(0, Location::RegisterLocation(A0));
5462 return locs; 5462 return locs;
5463 } 5463 }
5464 LocationSummary* locs = new(isolate) LocationSummary( 5464 LocationSummary* locs = new(zone) LocationSummary(
5465 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5465 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5466 locs->set_in(0, Location::RegisterOrConstant(left())); 5466 locs->set_in(0, Location::RegisterOrConstant(left()));
5467 // Only one of the inputs can be a constant. Choose register if the first one 5467 // Only one of the inputs can be a constant. Choose register if the first one
5468 // is a constant. 5468 // is a constant.
5469 locs->set_in(1, locs->in(0).IsConstant() 5469 locs->set_in(1, locs->in(0).IsConstant()
5470 ? Location::RequiresRegister() 5470 ? Location::RequiresRegister()
5471 : Location::RegisterOrConstant(right())); 5471 : Location::RegisterOrConstant(right()));
5472 locs->set_out(0, Location::RequiresRegister()); 5472 locs->set_out(0, Location::RequiresRegister());
5473 return locs; 5473 return locs;
5474 } 5474 }
5475 5475
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
5529 BranchInstr* branch) { 5529 BranchInstr* branch) {
5530 __ TraceSimMsg("StrictCompareInstr::EmitBranchCode"); 5530 __ TraceSimMsg("StrictCompareInstr::EmitBranchCode");
5531 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); 5531 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT);
5532 5532
5533 BranchLabels labels = compiler->CreateBranchLabels(branch); 5533 BranchLabels labels = compiler->CreateBranchLabels(branch);
5534 Condition true_condition = EmitComparisonCode(compiler, labels); 5534 Condition true_condition = EmitComparisonCode(compiler, labels);
5535 EmitBranchOnCondition(compiler, true_condition, labels); 5535 EmitBranchOnCondition(compiler, true_condition, labels);
5536 } 5536 }
5537 5537
5538 5538
5539 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Isolate* isolate, 5539 LocationSummary* BooleanNegateInstr::MakeLocationSummary(Zone* zone,
5540 bool opt) const { 5540 bool opt) const {
5541 return LocationSummary::Make(isolate, 5541 return LocationSummary::Make(zone,
5542 1, 5542 1,
5543 Location::RequiresRegister(), 5543 Location::RequiresRegister(),
5544 LocationSummary::kNoCall); 5544 LocationSummary::kNoCall);
5545 } 5545 }
5546 5546
5547 5547
5548 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5548 void BooleanNegateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5549 Register value = locs()->in(0).reg(); 5549 Register value = locs()->in(0).reg();
5550 Register result = locs()->out(0).reg(); 5550 Register result = locs()->out(0).reg();
5551 5551
5552 __ LoadObject(result, Bool::True()); 5552 __ LoadObject(result, Bool::True());
5553 __ LoadObject(TMP, Bool::False()); 5553 __ LoadObject(TMP, Bool::False());
5554 __ subu(CMPRES1, value, result); 5554 __ subu(CMPRES1, value, result);
5555 __ movz(result, TMP, CMPRES1); // If value is True, move False into result. 5555 __ movz(result, TMP, CMPRES1); // If value is True, move False into result.
5556 } 5556 }
5557 5557
5558 5558
5559 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Isolate* isolate, 5559 LocationSummary* AllocateObjectInstr::MakeLocationSummary(Zone* zone,
5560 bool opt) const { 5560 bool opt) const {
5561 return MakeCallSummary(isolate); 5561 return MakeCallSummary(zone);
5562 } 5562 }
5563 5563
5564 5564
5565 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5565 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5566 __ TraceSimMsg("AllocateObjectInstr"); 5566 __ TraceSimMsg("AllocateObjectInstr");
5567 __ Comment("AllocateObjectInstr"); 5567 __ Comment("AllocateObjectInstr");
5568 Isolate* isolate = compiler->isolate(); 5568 Isolate* isolate = compiler->isolate();
5569 StubCode* stub_code = isolate->stub_code(); 5569 StubCode* stub_code = isolate->stub_code();
5570 const Code& stub = Code::Handle(isolate, 5570 const Code& stub = Code::Handle(isolate,
5571 stub_code->GetAllocationStubForClass(cls())); 5571 stub_code->GetAllocationStubForClass(cls()));
(...skipping 14 matching lines...) Expand all
5586 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 5586 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
5587 #if defined(DEBUG) 5587 #if defined(DEBUG)
5588 __ LoadImmediate(S4, kInvalidObjectPointer); 5588 __ LoadImmediate(S4, kInvalidObjectPointer);
5589 __ LoadImmediate(S5, kInvalidObjectPointer); 5589 __ LoadImmediate(S5, kInvalidObjectPointer);
5590 #endif 5590 #endif
5591 } 5591 }
5592 5592
5593 } // namespace dart 5593 } // namespace dart
5594 5594
5595 #endif // defined TARGET_ARCH_MIPS 5595 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698