| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_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 20 matching lines...) Expand all Loading... |
| 31 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); | 31 LocationSummary* result = new LocationSummary(0, 0, LocationSummary::kCall); |
| 32 result->set_out(0, Location::RegisterLocation(V0)); | 32 result->set_out(0, Location::RegisterLocation(V0)); |
| 33 return result; | 33 return result; |
| 34 } | 34 } |
| 35 | 35 |
| 36 | 36 |
| 37 LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const { | 37 LocationSummary* PushArgumentInstr::MakeLocationSummary(bool opt) const { |
| 38 const intptr_t kNumInputs = 1; | 38 const intptr_t kNumInputs = 1; |
| 39 const intptr_t kNumTemps= 0; | 39 const intptr_t kNumTemps= 0; |
| 40 LocationSummary* locs = | 40 LocationSummary* locs = |
| 41 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 41 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 42 locs->set_in(0, Location::AnyOrConstant(value())); | 42 locs->set_in(0, Location::AnyOrConstant(value())); |
| 43 return locs; | 43 return locs; |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 47 void PushArgumentInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 48 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode | 48 // In SSA mode, we need an explicit push. Nothing to do in non-SSA mode |
| 49 // where PushArgument is handled by BindInstr::EmitNativeCode. | 49 // where PushArgument is handled by BindInstr::EmitNativeCode. |
| 50 __ TraceSimMsg("PushArgumentInstr"); | 50 __ TraceSimMsg("PushArgumentInstr"); |
| 51 if (compiler->is_optimizing()) { | 51 if (compiler->is_optimizing()) { |
| 52 Location value = locs()->in(0); | 52 Location value = locs()->in(0); |
| 53 if (value.IsRegister()) { | 53 if (value.IsRegister()) { |
| 54 __ Push(value.reg()); | 54 __ Push(value.reg()); |
| 55 } else if (value.IsConstant()) { | 55 } else if (value.IsConstant()) { |
| 56 __ PushObject(value.constant()); | 56 __ PushObject(value.constant()); |
| 57 } else { | 57 } else { |
| 58 ASSERT(value.IsStackSlot()); | 58 ASSERT(value.IsStackSlot()); |
| 59 const intptr_t value_offset = value.ToStackSlotOffset(); | 59 const intptr_t value_offset = value.ToStackSlotOffset(); |
| 60 __ LoadFromOffset(TMP, FP, value_offset); | 60 __ LoadFromOffset(TMP, FP, value_offset); |
| 61 __ Push(TMP); | 61 __ Push(TMP); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const { | 67 LocationSummary* ReturnInstr::MakeLocationSummary(bool opt) const { |
| 68 const intptr_t kNumInputs = 1; | 68 const intptr_t kNumInputs = 1; |
| 69 const intptr_t kNumTemps = 0; | 69 const intptr_t kNumTemps = 0; |
| 70 LocationSummary* locs = | 70 LocationSummary* locs = |
| 71 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 71 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 72 locs->set_in(0, Location::RegisterLocation(V0)); | 72 locs->set_in(0, Location::RegisterLocation(V0)); |
| 73 return locs; | 73 return locs; |
| 74 } | 74 } |
| 75 | 75 |
| 76 | 76 |
| 77 // Attempt optimized compilation at return instruction instead of at the entry. | 77 // Attempt optimized compilation at return instruction instead of at the entry. |
| 78 // The entry needs to be patchable, no inlined objects are allowed in the area | 78 // The entry needs to be patchable, no inlined objects are allowed in the area |
| 79 // that will be overwritten by the patch instructions: a branch macro sequence. | 79 // that will be overwritten by the patch instructions: a branch macro sequence. |
| 80 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 80 void ReturnInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 81 __ TraceSimMsg("ReturnInstr"); | 81 __ TraceSimMsg("ReturnInstr"); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 __ AddImmediate(result, result, Smi::RawValue(false_value)); | 201 __ AddImmediate(result, result, Smi::RawValue(false_value)); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 } | 204 } |
| 205 | 205 |
| 206 | 206 |
| 207 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { | 207 LocationSummary* ClosureCallInstr::MakeLocationSummary(bool opt) const { |
| 208 const intptr_t kNumInputs = 1; | 208 const intptr_t kNumInputs = 1; |
| 209 const intptr_t kNumTemps = 0; | 209 const intptr_t kNumTemps = 0; |
| 210 LocationSummary* summary = | 210 LocationSummary* summary = |
| 211 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 211 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 212 summary->set_in(0, Location::RegisterLocation(T0)); // Function. | 212 summary->set_in(0, Location::RegisterLocation(T0)); // Function. |
| 213 summary->set_out(0, Location::RegisterLocation(V0)); | 213 summary->set_out(0, Location::RegisterLocation(V0)); |
| 214 return summary; | 214 return summary; |
| 215 } | 215 } |
| 216 | 216 |
| 217 | 217 |
| 218 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 218 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 219 // Load arguments descriptor in S4. | 219 // Load arguments descriptor in S4. |
| 220 int argument_count = ArgumentCount(); | 220 int argument_count = ArgumentCount(); |
| 221 const Array& arguments_descriptor = | 221 const Array& arguments_descriptor = |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 Register result = locs()->out(0).reg(); | 296 Register result = locs()->out(0).reg(); |
| 297 __ LoadObject(result, value()); | 297 __ LoadObject(result, value()); |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 | 301 |
| 302 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { | 302 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { |
| 303 const intptr_t kNumInputs = 0; | 303 const intptr_t kNumInputs = 0; |
| 304 const intptr_t kNumTemps = 1; | 304 const intptr_t kNumTemps = 1; |
| 305 LocationSummary* locs = | 305 LocationSummary* locs = |
| 306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 306 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 307 locs->set_out(0, Location::RequiresFpuRegister()); | 307 locs->set_out(0, Location::RequiresFpuRegister()); |
| 308 locs->set_temp(0, Location::RequiresRegister()); | 308 locs->set_temp(0, Location::RequiresRegister()); |
| 309 return locs; | 309 return locs; |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 313 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 314 // The register allocator drops constant definitions that have no uses. | 314 // The register allocator drops constant definitions that have no uses. |
| 315 if (!locs()->out(0).IsInvalid()) { | 315 if (!locs()->out(0).IsInvalid()) { |
| 316 ASSERT(value().IsDouble()); | 316 ASSERT(value().IsDouble()); |
| 317 const Register const_value = locs()->temp(0).reg(); | 317 const Register const_value = locs()->temp(0).reg(); |
| 318 const DRegister result = locs()->out(0).fpu_reg(); | 318 const DRegister result = locs()->out(0).fpu_reg(); |
| 319 __ LoadObject(const_value, value()); | 319 __ LoadObject(const_value, value()); |
| 320 __ LoadDFromOffset(result, const_value, | 320 __ LoadDFromOffset(result, const_value, |
| 321 Double::value_offset() - kHeapObjectTag); | 321 Double::value_offset() - kHeapObjectTag); |
| 322 } | 322 } |
| 323 } | 323 } |
| 324 | 324 |
| 325 | 325 |
| 326 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { | 326 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { |
| 327 const intptr_t kNumInputs = 3; | 327 const intptr_t kNumInputs = 3; |
| 328 const intptr_t kNumTemps = 0; | 328 const intptr_t kNumTemps = 0; |
| 329 LocationSummary* summary = | 329 LocationSummary* summary = |
| 330 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 330 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 331 summary->set_in(0, Location::RegisterLocation(A0)); // Value. | 331 summary->set_in(0, Location::RegisterLocation(A0)); // Value. |
| 332 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator. | 332 summary->set_in(1, Location::RegisterLocation(A2)); // Instantiator. |
| 333 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments. | 333 summary->set_in(2, Location::RegisterLocation(A1)); // Type arguments. |
| 334 summary->set_out(0, Location::RegisterLocation(A0)); | 334 summary->set_out(0, Location::RegisterLocation(A0)); |
| 335 return summary; | 335 return summary; |
| 336 } | 336 } |
| 337 | 337 |
| 338 | 338 |
| 339 LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const { | 339 LocationSummary* AssertBooleanInstr::MakeLocationSummary(bool opt) const { |
| 340 const intptr_t kNumInputs = 1; | 340 const intptr_t kNumInputs = 1; |
| 341 const intptr_t kNumTemps = 0; | 341 const intptr_t kNumTemps = 0; |
| 342 LocationSummary* locs = | 342 LocationSummary* locs = |
| 343 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 343 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 344 locs->set_in(0, Location::RegisterLocation(A0)); | 344 locs->set_in(0, Location::RegisterLocation(A0)); |
| 345 locs->set_out(0, Location::RegisterLocation(A0)); | 345 locs->set_out(0, Location::RegisterLocation(A0)); |
| 346 return locs; | 346 return locs; |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| 350 static void EmitAssertBoolean(Register reg, | 350 static void EmitAssertBoolean(Register reg, |
| 351 intptr_t token_pos, | 351 intptr_t token_pos, |
| 352 intptr_t deopt_id, | 352 intptr_t deopt_id, |
| 353 LocationSummary* locs, | 353 LocationSummary* locs, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 379 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); | 379 EmitAssertBoolean(obj, token_pos(), deopt_id(), locs(), compiler); |
| 380 ASSERT(obj == result); | 380 ASSERT(obj == result); |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const { | 384 LocationSummary* EqualityCompareInstr::MakeLocationSummary(bool opt) const { |
| 385 const intptr_t kNumInputs = 2; | 385 const intptr_t kNumInputs = 2; |
| 386 if (operation_cid() == kMintCid) { | 386 if (operation_cid() == kMintCid) { |
| 387 const intptr_t kNumTemps = 1; | 387 const intptr_t kNumTemps = 1; |
| 388 LocationSummary* locs = | 388 LocationSummary* locs = |
| 389 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 389 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 390 locs->set_in(0, Location::RequiresFpuRegister()); | 390 locs->set_in(0, Location::RequiresFpuRegister()); |
| 391 locs->set_in(1, Location::RequiresFpuRegister()); | 391 locs->set_in(1, Location::RequiresFpuRegister()); |
| 392 locs->set_temp(0, Location::RequiresRegister()); | 392 locs->set_temp(0, Location::RequiresRegister()); |
| 393 locs->set_out(0, Location::RequiresRegister()); | 393 locs->set_out(0, Location::RequiresRegister()); |
| 394 return locs; | 394 return locs; |
| 395 } | 395 } |
| 396 if (operation_cid() == kDoubleCid) { | 396 if (operation_cid() == kDoubleCid) { |
| 397 const intptr_t kNumTemps = 0; | 397 const intptr_t kNumTemps = 0; |
| 398 LocationSummary* locs = | 398 LocationSummary* locs = |
| 399 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 399 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 400 locs->set_in(0, Location::RequiresFpuRegister()); | 400 locs->set_in(0, Location::RequiresFpuRegister()); |
| 401 locs->set_in(1, Location::RequiresFpuRegister()); | 401 locs->set_in(1, Location::RequiresFpuRegister()); |
| 402 locs->set_out(0, Location::RequiresRegister()); | 402 locs->set_out(0, Location::RequiresRegister()); |
| 403 return locs; | 403 return locs; |
| 404 } | 404 } |
| 405 if (operation_cid() == kSmiCid) { | 405 if (operation_cid() == kSmiCid) { |
| 406 const intptr_t kNumTemps = 0; | 406 const intptr_t kNumTemps = 0; |
| 407 LocationSummary* locs = | 407 LocationSummary* locs = |
| 408 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 408 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 409 locs->set_in(0, Location::RegisterOrConstant(left())); | 409 locs->set_in(0, Location::RegisterOrConstant(left())); |
| 410 // Only one input can be a constant operand. The case of two constant | 410 // Only one input can be a constant operand. The case of two constant |
| 411 // operands should be handled by constant propagation. | 411 // operands should be handled by constant propagation. |
| 412 locs->set_in(1, locs->in(0).IsConstant() | 412 locs->set_in(1, locs->in(0).IsConstant() |
| 413 ? Location::RequiresRegister() | 413 ? Location::RequiresRegister() |
| 414 : Location::RegisterOrConstant(right())); | 414 : Location::RegisterOrConstant(right())); |
| 415 locs->set_out(0, Location::RequiresRegister()); | 415 locs->set_out(0, Location::RequiresRegister()); |
| 416 return locs; | 416 return locs; |
| 417 } | 417 } |
| 418 UNREACHABLE(); | 418 UNREACHABLE(); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 BranchLabels labels = compiler->CreateBranchLabels(branch); | 630 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 631 Condition true_condition = EmitComparisonCode(compiler, labels); | 631 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 632 EmitBranchOnCondition(compiler, true_condition, labels); | 632 EmitBranchOnCondition(compiler, true_condition, labels); |
| 633 } | 633 } |
| 634 | 634 |
| 635 | 635 |
| 636 LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const { | 636 LocationSummary* TestSmiInstr::MakeLocationSummary(bool opt) const { |
| 637 const intptr_t kNumInputs = 2; | 637 const intptr_t kNumInputs = 2; |
| 638 const intptr_t kNumTemps = 0; | 638 const intptr_t kNumTemps = 0; |
| 639 LocationSummary* locs = | 639 LocationSummary* locs = |
| 640 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 640 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 641 locs->set_in(0, Location::RequiresRegister()); | 641 locs->set_in(0, Location::RequiresRegister()); |
| 642 // Only one input can be a constant operand. The case of two constant | 642 // Only one input can be a constant operand. The case of two constant |
| 643 // operands should be handled by constant propagation. | 643 // operands should be handled by constant propagation. |
| 644 locs->set_in(1, Location::RegisterOrConstant(right())); | 644 locs->set_in(1, Location::RegisterOrConstant(right())); |
| 645 return locs; | 645 return locs; |
| 646 } | 646 } |
| 647 | 647 |
| 648 | 648 |
| 649 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 649 Condition TestSmiInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 650 BranchLabels labels) { | 650 BranchLabels labels) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 675 BranchLabels labels = compiler->CreateBranchLabels(branch); | 675 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 676 Condition true_condition = EmitComparisonCode(compiler, labels); | 676 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 677 EmitBranchOnCondition(compiler, true_condition, labels); | 677 EmitBranchOnCondition(compiler, true_condition, labels); |
| 678 } | 678 } |
| 679 | 679 |
| 680 | 680 |
| 681 LocationSummary* TestCidsInstr::MakeLocationSummary(bool opt) const { | 681 LocationSummary* TestCidsInstr::MakeLocationSummary(bool opt) const { |
| 682 const intptr_t kNumInputs = 1; | 682 const intptr_t kNumInputs = 1; |
| 683 const intptr_t kNumTemps = 1; | 683 const intptr_t kNumTemps = 1; |
| 684 LocationSummary* locs = | 684 LocationSummary* locs = |
| 685 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 685 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 686 locs->set_in(0, Location::RequiresRegister()); | 686 locs->set_in(0, Location::RequiresRegister()); |
| 687 locs->set_temp(0, Location::RequiresRegister()); | 687 locs->set_temp(0, Location::RequiresRegister()); |
| 688 locs->set_out(0, Location::RequiresRegister()); | 688 locs->set_out(0, Location::RequiresRegister()); |
| 689 return locs; | 689 return locs; |
| 690 } | 690 } |
| 691 | 691 |
| 692 | 692 |
| 693 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 693 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 694 BranchLabels labels) { | 694 BranchLabels labels) { |
| 695 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 695 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 __ Bind(&done); | 749 __ Bind(&done); |
| 750 } | 750 } |
| 751 | 751 |
| 752 | 752 |
| 753 LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const { | 753 LocationSummary* RelationalOpInstr::MakeLocationSummary(bool opt) const { |
| 754 const intptr_t kNumInputs = 2; | 754 const intptr_t kNumInputs = 2; |
| 755 const intptr_t kNumTemps = 0; | 755 const intptr_t kNumTemps = 0; |
| 756 if (operation_cid() == kMintCid) { | 756 if (operation_cid() == kMintCid) { |
| 757 const intptr_t kNumTemps = 2; | 757 const intptr_t kNumTemps = 2; |
| 758 LocationSummary* locs = | 758 LocationSummary* locs = |
| 759 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 759 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 760 locs->set_in(0, Location::RequiresFpuRegister()); | 760 locs->set_in(0, Location::RequiresFpuRegister()); |
| 761 locs->set_in(1, Location::RequiresFpuRegister()); | 761 locs->set_in(1, Location::RequiresFpuRegister()); |
| 762 locs->set_temp(0, Location::RequiresRegister()); | 762 locs->set_temp(0, Location::RequiresRegister()); |
| 763 locs->set_temp(1, Location::RequiresRegister()); | 763 locs->set_temp(1, Location::RequiresRegister()); |
| 764 locs->set_out(0, Location::RequiresRegister()); | 764 locs->set_out(0, Location::RequiresRegister()); |
| 765 return locs; | 765 return locs; |
| 766 } | 766 } |
| 767 if (operation_cid() == kDoubleCid) { | 767 if (operation_cid() == kDoubleCid) { |
| 768 LocationSummary* summary = | 768 LocationSummary* summary = |
| 769 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 769 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 770 summary->set_in(0, Location::RequiresFpuRegister()); | 770 summary->set_in(0, Location::RequiresFpuRegister()); |
| 771 summary->set_in(1, Location::RequiresFpuRegister()); | 771 summary->set_in(1, Location::RequiresFpuRegister()); |
| 772 summary->set_out(0, Location::RequiresRegister()); | 772 summary->set_out(0, Location::RequiresRegister()); |
| 773 return summary; | 773 return summary; |
| 774 } | 774 } |
| 775 ASSERT(operation_cid() == kSmiCid); | 775 ASSERT(operation_cid() == kSmiCid); |
| 776 LocationSummary* summary = | 776 LocationSummary* summary = |
| 777 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 777 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 778 summary->set_in(0, Location::RegisterOrConstant(left())); | 778 summary->set_in(0, Location::RegisterOrConstant(left())); |
| 779 // Only one input can be a constant operand. The case of two constant | 779 // Only one input can be a constant operand. The case of two constant |
| 780 // operands should be handled by constant propagation. | 780 // operands should be handled by constant propagation. |
| 781 summary->set_in(1, summary->in(0).IsConstant() | 781 summary->set_in(1, summary->in(0).IsConstant() |
| 782 ? Location::RequiresRegister() | 782 ? Location::RequiresRegister() |
| 783 : Location::RegisterOrConstant(right())); | 783 : Location::RegisterOrConstant(right())); |
| 784 summary->set_out(0, Location::RequiresRegister()); | 784 summary->set_out(0, Location::RequiresRegister()); |
| 785 return summary; | 785 return summary; |
| 786 } | 786 } |
| 787 | 787 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 823 BranchLabels labels = compiler->CreateBranchLabels(branch); | 823 BranchLabels labels = compiler->CreateBranchLabels(branch); |
| 824 Condition true_condition = EmitComparisonCode(compiler, labels); | 824 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 825 EmitBranchOnCondition(compiler, true_condition, labels); | 825 EmitBranchOnCondition(compiler, true_condition, labels); |
| 826 } | 826 } |
| 827 | 827 |
| 828 | 828 |
| 829 LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const { | 829 LocationSummary* NativeCallInstr::MakeLocationSummary(bool opt) const { |
| 830 const intptr_t kNumInputs = 0; | 830 const intptr_t kNumInputs = 0; |
| 831 const intptr_t kNumTemps = 3; | 831 const intptr_t kNumTemps = 3; |
| 832 LocationSummary* locs = | 832 LocationSummary* locs = |
| 833 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 833 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 834 locs->set_temp(0, Location::RegisterLocation(A1)); | 834 locs->set_temp(0, Location::RegisterLocation(A1)); |
| 835 locs->set_temp(1, Location::RegisterLocation(A2)); | 835 locs->set_temp(1, Location::RegisterLocation(A2)); |
| 836 locs->set_temp(2, Location::RegisterLocation(T5)); | 836 locs->set_temp(2, Location::RegisterLocation(T5)); |
| 837 locs->set_out(0, Location::RegisterLocation(V0)); | 837 locs->set_out(0, Location::RegisterLocation(V0)); |
| 838 return locs; | 838 return locs; |
| 839 } | 839 } |
| 840 | 840 |
| 841 | 841 |
| 842 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 842 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 843 __ TraceSimMsg("NativeCallInstr"); | 843 __ TraceSimMsg("NativeCallInstr"); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 __ lbu(result, FieldAddress(str, OneByteString::data_offset())); | 935 __ lbu(result, FieldAddress(str, OneByteString::data_offset())); |
| 936 __ SmiTag(result); | 936 __ SmiTag(result); |
| 937 __ Bind(&done); | 937 __ Bind(&done); |
| 938 } | 938 } |
| 939 | 939 |
| 940 | 940 |
| 941 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { | 941 LocationSummary* StringInterpolateInstr::MakeLocationSummary(bool opt) const { |
| 942 const intptr_t kNumInputs = 1; | 942 const intptr_t kNumInputs = 1; |
| 943 const intptr_t kNumTemps = 0; | 943 const intptr_t kNumTemps = 0; |
| 944 LocationSummary* summary = | 944 LocationSummary* summary = |
| 945 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 945 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 946 summary->set_in(0, Location::RegisterLocation(A0)); | 946 summary->set_in(0, Location::RegisterLocation(A0)); |
| 947 summary->set_out(0, Location::RegisterLocation(V0)); | 947 summary->set_out(0, Location::RegisterLocation(V0)); |
| 948 return summary; | 948 return summary; |
| 949 } | 949 } |
| 950 | 950 |
| 951 | 951 |
| 952 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 952 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 953 Register array = locs()->in(0).reg(); | 953 Register array = locs()->in(0).reg(); |
| 954 __ Push(array); | 954 __ Push(array); |
| 955 const int kNumberOfArguments = 1; | 955 const int kNumberOfArguments = 1; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 UNIMPLEMENTED(); | 1072 UNIMPLEMENTED(); |
| 1073 return kTagged; | 1073 return kTagged; |
| 1074 } | 1074 } |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 | 1077 |
| 1078 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { | 1078 LocationSummary* LoadIndexedInstr::MakeLocationSummary(bool opt) const { |
| 1079 const intptr_t kNumInputs = 2; | 1079 const intptr_t kNumInputs = 2; |
| 1080 const intptr_t kNumTemps = 0; | 1080 const intptr_t kNumTemps = 0; |
| 1081 LocationSummary* locs = | 1081 LocationSummary* locs = |
| 1082 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1082 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 1083 locs->set_in(0, Location::RequiresRegister()); | 1083 locs->set_in(0, Location::RequiresRegister()); |
| 1084 // The smi index is either untagged (element size == 1), or it is left smi | 1084 // The smi index is either untagged (element size == 1), or it is left smi |
| 1085 // tagged (for all element sizes > 1). | 1085 // tagged (for all element sizes > 1). |
| 1086 // TODO(regis): Revisit and see if the index can be immediate. | 1086 // TODO(regis): Revisit and see if the index can be immediate. |
| 1087 locs->set_in(1, Location::WritableRegister()); | 1087 locs->set_in(1, Location::WritableRegister()); |
| 1088 if ((representation() == kUnboxedDouble) || | 1088 if ((representation() == kUnboxedDouble) || |
| 1089 (representation() == kUnboxedFloat32x4) || | 1089 (representation() == kUnboxedFloat32x4) || |
| 1090 (representation() == kUnboxedInt32x4)) { | 1090 (representation() == kUnboxedInt32x4)) { |
| 1091 locs->set_out(0, Location::RequiresFpuRegister()); | 1091 locs->set_out(0, Location::RequiresFpuRegister()); |
| 1092 } else { | 1092 } else { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 UNIMPLEMENTED(); | 1256 UNIMPLEMENTED(); |
| 1257 return kTagged; | 1257 return kTagged; |
| 1258 } | 1258 } |
| 1259 } | 1259 } |
| 1260 | 1260 |
| 1261 | 1261 |
| 1262 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { | 1262 LocationSummary* StoreIndexedInstr::MakeLocationSummary(bool opt) const { |
| 1263 const intptr_t kNumInputs = 3; | 1263 const intptr_t kNumInputs = 3; |
| 1264 const intptr_t kNumTemps = 0; | 1264 const intptr_t kNumTemps = 0; |
| 1265 LocationSummary* locs = | 1265 LocationSummary* locs = |
| 1266 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1266 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 1267 locs->set_in(0, Location::RequiresRegister()); | 1267 locs->set_in(0, Location::RequiresRegister()); |
| 1268 // The smi index is either untagged (element size == 1), or it is left smi | 1268 // The smi index is either untagged (element size == 1), or it is left smi |
| 1269 // tagged (for all element sizes > 1). | 1269 // tagged (for all element sizes > 1). |
| 1270 // TODO(regis): Revisit and see if the index can be immediate. | 1270 // TODO(regis): Revisit and see if the index can be immediate. |
| 1271 locs->set_in(1, Location::WritableRegister()); | 1271 locs->set_in(1, Location::WritableRegister()); |
| 1272 switch (class_id()) { | 1272 switch (class_id()) { |
| 1273 case kArrayCid: | 1273 case kArrayCid: |
| 1274 locs->set_in(2, ShouldEmitStoreBarrier() | 1274 locs->set_in(2, ShouldEmitStoreBarrier() |
| 1275 ? Location::WritableRegister() | 1275 ? Location::WritableRegister() |
| 1276 : Location::RegisterOrConstant(value())); | 1276 : Location::RegisterOrConstant(value())); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1438 break; | 1438 break; |
| 1439 default: | 1439 default: |
| 1440 UNREACHABLE(); | 1440 UNREACHABLE(); |
| 1441 } | 1441 } |
| 1442 } | 1442 } |
| 1443 | 1443 |
| 1444 | 1444 |
| 1445 LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const { | 1445 LocationSummary* GuardFieldInstr::MakeLocationSummary(bool opt) const { |
| 1446 const intptr_t kNumInputs = 1; | 1446 const intptr_t kNumInputs = 1; |
| 1447 LocationSummary* summary = | 1447 LocationSummary* summary = |
| 1448 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 1448 new (isolate) LocationSummary(isolate, kNumInputs, 0, LocationSummary::kNo
Call); |
| 1449 summary->set_in(0, Location::RequiresRegister()); | 1449 summary->set_in(0, Location::RequiresRegister()); |
| 1450 const bool field_has_length = field().needs_length_check(); | 1450 const bool field_has_length = field().needs_length_check(); |
| 1451 const bool need_value_temp_reg = | 1451 const bool need_value_temp_reg = |
| 1452 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) && | 1452 (field_has_length || ((value()->Type()->ToCid() == kDynamicCid) && |
| 1453 (field().guarded_cid() != kSmiCid))); | 1453 (field().guarded_cid() != kSmiCid))); |
| 1454 if (need_value_temp_reg) { | 1454 if (need_value_temp_reg) { |
| 1455 summary->AddTemp(Location::RequiresRegister()); | 1455 summary->AddTemp(Location::RequiresRegister()); |
| 1456 } | 1456 } |
| 1457 const bool need_field_temp_reg = | 1457 const bool need_field_temp_reg = |
| 1458 field_has_length || (field().guarded_cid() == kIllegalCid); | 1458 field_has_length || (field().guarded_cid() == kIllegalCid); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1800 private: | 1800 private: |
| 1801 StoreInstanceFieldInstr* instruction_; | 1801 StoreInstanceFieldInstr* instruction_; |
| 1802 const Class& cls_; | 1802 const Class& cls_; |
| 1803 }; | 1803 }; |
| 1804 | 1804 |
| 1805 | 1805 |
| 1806 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const { | 1806 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(bool opt) const { |
| 1807 const intptr_t kNumInputs = 2; | 1807 const intptr_t kNumInputs = 2; |
| 1808 const intptr_t kNumTemps = 0; | 1808 const intptr_t kNumTemps = 0; |
| 1809 LocationSummary* summary = | 1809 LocationSummary* summary = |
| 1810 new LocationSummary(kNumInputs, kNumTemps, | 1810 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, |
| 1811 !field().IsNull() && | 1811 !field().IsNull() && |
| 1812 ((field().guarded_cid() == kIllegalCid) || is_initialization_) | 1812 ((field().guarded_cid() == kIllegalCid) || is_initialization_) |
| 1813 ? LocationSummary::kCallOnSlowPath | 1813 ? LocationSummary::kCallOnSlowPath |
| 1814 : LocationSummary::kNoCall); | 1814 : LocationSummary::kNoCall); |
| 1815 | 1815 |
| 1816 summary->set_in(0, Location::RequiresRegister()); | 1816 summary->set_in(0, Location::RequiresRegister()); |
| 1817 if (IsUnboxedStore() && opt) { | 1817 if (IsUnboxedStore() && opt) { |
| 1818 summary->set_in(1, Location::RequiresFpuRegister()); | 1818 summary->set_in(1, Location::RequiresFpuRegister()); |
| 1819 summary->AddTemp(Location::RequiresRegister()); | 1819 summary->AddTemp(Location::RequiresRegister()); |
| 1820 summary->AddTemp(Location::RequiresRegister()); | 1820 summary->AddTemp(Location::RequiresRegister()); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1964 } | 1964 } |
| 1965 } | 1965 } |
| 1966 __ Bind(&skip_store); | 1966 __ Bind(&skip_store); |
| 1967 } | 1967 } |
| 1968 | 1968 |
| 1969 | 1969 |
| 1970 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const { | 1970 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(bool opt) const { |
| 1971 const intptr_t kNumInputs = 1; | 1971 const intptr_t kNumInputs = 1; |
| 1972 const intptr_t kNumTemps = 0; | 1972 const intptr_t kNumTemps = 0; |
| 1973 LocationSummary* summary = | 1973 LocationSummary* summary = |
| 1974 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 1974 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 1975 summary->set_in(0, Location::RequiresRegister()); | 1975 summary->set_in(0, Location::RequiresRegister()); |
| 1976 summary->set_out(0, Location::RequiresRegister()); | 1976 summary->set_out(0, Location::RequiresRegister()); |
| 1977 return summary; | 1977 return summary; |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 | 1980 |
| 1981 // When the parser is building an implicit static getter for optimization, | 1981 // When the parser is building an implicit static getter for optimization, |
| 1982 // it can generate a function body where deoptimization ids do not line up | 1982 // it can generate a function body where deoptimization ids do not line up |
| 1983 // with the unoptimized code. | 1983 // with the unoptimized code. |
| 1984 // | 1984 // |
| 1985 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 1985 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
| 1986 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1986 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1987 __ TraceSimMsg("LoadStaticFieldInstr"); | 1987 __ TraceSimMsg("LoadStaticFieldInstr"); |
| 1988 Register field = locs()->in(0).reg(); | 1988 Register field = locs()->in(0).reg(); |
| 1989 Register result = locs()->out(0).reg(); | 1989 Register result = locs()->out(0).reg(); |
| 1990 __ lw(result, FieldAddress(field, Field::value_offset())); | 1990 __ lw(result, FieldAddress(field, Field::value_offset())); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const { | 1994 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(bool opt) const { |
| 1995 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); | 1995 LocationSummary* locs = new (isolate) LocationSummary(isolate, 1, 1, LocationS
ummary::kNoCall); |
| 1996 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 1996 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
| 1997 : Location::RequiresRegister()); | 1997 : Location::RequiresRegister()); |
| 1998 locs->set_temp(0, Location::RequiresRegister()); | 1998 locs->set_temp(0, Location::RequiresRegister()); |
| 1999 return locs; | 1999 return locs; |
| 2000 } | 2000 } |
| 2001 | 2001 |
| 2002 | 2002 |
| 2003 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2003 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2004 __ TraceSimMsg("StoreStaticFieldInstr"); | 2004 __ TraceSimMsg("StoreStaticFieldInstr"); |
| 2005 Register value = locs()->in(0).reg(); | 2005 Register value = locs()->in(0).reg(); |
| 2006 Register temp = locs()->temp(0).reg(); | 2006 Register temp = locs()->temp(0).reg(); |
| 2007 | 2007 |
| 2008 __ LoadObject(temp, field()); | 2008 __ LoadObject(temp, field()); |
| 2009 if (this->value()->NeedsStoreBuffer()) { | 2009 if (this->value()->NeedsStoreBuffer()) { |
| 2010 __ StoreIntoObject(temp, | 2010 __ StoreIntoObject(temp, |
| 2011 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 2011 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); |
| 2012 } else { | 2012 } else { |
| 2013 __ StoreIntoObjectNoBarrier( | 2013 __ StoreIntoObjectNoBarrier( |
| 2014 temp, FieldAddress(temp, Field::value_offset()), value); | 2014 temp, FieldAddress(temp, Field::value_offset()), value); |
| 2015 } | 2015 } |
| 2016 } | 2016 } |
| 2017 | 2017 |
| 2018 | 2018 |
| 2019 LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const { | 2019 LocationSummary* InstanceOfInstr::MakeLocationSummary(bool opt) const { |
| 2020 const intptr_t kNumInputs = 3; | 2020 const intptr_t kNumInputs = 3; |
| 2021 const intptr_t kNumTemps = 0; | 2021 const intptr_t kNumTemps = 0; |
| 2022 LocationSummary* summary = | 2022 LocationSummary* summary = |
| 2023 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2023 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2024 summary->set_in(0, Location::RegisterLocation(A0)); | 2024 summary->set_in(0, Location::RegisterLocation(A0)); |
| 2025 summary->set_in(1, Location::RegisterLocation(A2)); | 2025 summary->set_in(1, Location::RegisterLocation(A2)); |
| 2026 summary->set_in(2, Location::RegisterLocation(A1)); | 2026 summary->set_in(2, Location::RegisterLocation(A1)); |
| 2027 summary->set_out(0, Location::RegisterLocation(V0)); | 2027 summary->set_out(0, Location::RegisterLocation(V0)); |
| 2028 return summary; | 2028 return summary; |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 | 2031 |
| 2032 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2032 void InstanceOfInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2033 ASSERT(locs()->in(0).reg() == A0); // Value. | 2033 ASSERT(locs()->in(0).reg() == A0); // Value. |
| 2034 ASSERT(locs()->in(1).reg() == A2); // Instantiator. | 2034 ASSERT(locs()->in(1).reg() == A2); // Instantiator. |
| 2035 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments. | 2035 ASSERT(locs()->in(2).reg() == A1); // Instantiator type arguments. |
| 2036 | 2036 |
| 2037 __ Comment("InstanceOfInstr"); | 2037 __ Comment("InstanceOfInstr"); |
| 2038 compiler->GenerateInstanceOf(token_pos(), | 2038 compiler->GenerateInstanceOf(token_pos(), |
| 2039 deopt_id(), | 2039 deopt_id(), |
| 2040 type(), | 2040 type(), |
| 2041 negate_result(), | 2041 negate_result(), |
| 2042 locs()); | 2042 locs()); |
| 2043 ASSERT(locs()->out(0).reg() == V0); | 2043 ASSERT(locs()->out(0).reg() == V0); |
| 2044 } | 2044 } |
| 2045 | 2045 |
| 2046 | 2046 |
| 2047 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { | 2047 LocationSummary* CreateArrayInstr::MakeLocationSummary(bool opt) const { |
| 2048 const intptr_t kNumInputs = 2; | 2048 const intptr_t kNumInputs = 2; |
| 2049 const intptr_t kNumTemps = 0; | 2049 const intptr_t kNumTemps = 0; |
| 2050 LocationSummary* locs = | 2050 LocationSummary* locs = |
| 2051 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2051 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2052 locs->set_in(0, Location::RegisterLocation(A0)); | 2052 locs->set_in(0, Location::RegisterLocation(A0)); |
| 2053 locs->set_in(1, Location::RegisterLocation(A1)); | 2053 locs->set_in(1, Location::RegisterLocation(A1)); |
| 2054 locs->set_out(0, Location::RegisterLocation(V0)); | 2054 locs->set_out(0, Location::RegisterLocation(V0)); |
| 2055 return locs; | 2055 return locs; |
| 2056 } | 2056 } |
| 2057 | 2057 |
| 2058 | 2058 |
| 2059 // Inlines array allocation for known constant values. | 2059 // Inlines array allocation for known constant values. |
| 2060 static void InlineArrayAllocation(FlowGraphCompiler* compiler, | 2060 static void InlineArrayAllocation(FlowGraphCompiler* compiler, |
| 2061 intptr_t num_elements, | 2061 intptr_t num_elements, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 | 2201 |
| 2202 private: | 2202 private: |
| 2203 Instruction* instruction_; | 2203 Instruction* instruction_; |
| 2204 }; | 2204 }; |
| 2205 | 2205 |
| 2206 | 2206 |
| 2207 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { | 2207 LocationSummary* LoadFieldInstr::MakeLocationSummary(bool opt) const { |
| 2208 const intptr_t kNumInputs = 1; | 2208 const intptr_t kNumInputs = 1; |
| 2209 const intptr_t kNumTemps = 0; | 2209 const intptr_t kNumTemps = 0; |
| 2210 LocationSummary* locs = | 2210 LocationSummary* locs = |
| 2211 new LocationSummary( | 2211 new (isolate) LocationSummary(isolate, |
| 2212 kNumInputs, kNumTemps, | 2212 kNumInputs, kNumTemps, |
| 2213 (opt && !IsPotentialUnboxedLoad()) | 2213 (opt && !IsPotentialUnboxedLoad()) |
| 2214 ? LocationSummary::kNoCall | 2214 ? LocationSummary::kNoCall |
| 2215 : LocationSummary::kCallOnSlowPath); | 2215 : LocationSummary::kCallOnSlowPath); |
| 2216 | 2216 |
| 2217 locs->set_in(0, Location::RequiresRegister()); | 2217 locs->set_in(0, Location::RequiresRegister()); |
| 2218 | 2218 |
| 2219 if (IsUnboxedLoad() && opt) { | 2219 if (IsUnboxedLoad() && opt) { |
| 2220 locs->AddTemp(Location::RequiresRegister()); | 2220 locs->AddTemp(Location::RequiresRegister()); |
| 2221 } else if (IsPotentialUnboxedLoad()) { | 2221 } else if (IsPotentialUnboxedLoad()) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2296 } | 2296 } |
| 2297 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); | 2297 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); |
| 2298 __ Bind(&done); | 2298 __ Bind(&done); |
| 2299 } | 2299 } |
| 2300 | 2300 |
| 2301 | 2301 |
| 2302 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const { | 2302 LocationSummary* InstantiateTypeInstr::MakeLocationSummary(bool opt) const { |
| 2303 const intptr_t kNumInputs = 1; | 2303 const intptr_t kNumInputs = 1; |
| 2304 const intptr_t kNumTemps = 0; | 2304 const intptr_t kNumTemps = 0; |
| 2305 LocationSummary* locs = | 2305 LocationSummary* locs = |
| 2306 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2306 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2307 locs->set_in(0, Location::RegisterLocation(T0)); | 2307 locs->set_in(0, Location::RegisterLocation(T0)); |
| 2308 locs->set_out(0, Location::RegisterLocation(T0)); | 2308 locs->set_out(0, Location::RegisterLocation(T0)); |
| 2309 return locs; | 2309 return locs; |
| 2310 } | 2310 } |
| 2311 | 2311 |
| 2312 | 2312 |
| 2313 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2313 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2314 __ TraceSimMsg("InstantiateTypeInstr"); | 2314 __ TraceSimMsg("InstantiateTypeInstr"); |
| 2315 Register instantiator_reg = locs()->in(0).reg(); | 2315 Register instantiator_reg = locs()->in(0).reg(); |
| 2316 Register result_reg = locs()->out(0).reg(); | 2316 Register result_reg = locs()->out(0).reg(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2336 __ addiu(SP, SP, Immediate(3 * kWordSize)); | 2336 __ addiu(SP, SP, Immediate(3 * kWordSize)); |
| 2337 ASSERT(instantiator_reg == result_reg); | 2337 ASSERT(instantiator_reg == result_reg); |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 | 2340 |
| 2341 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( | 2341 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary( |
| 2342 bool opt) const { | 2342 bool opt) const { |
| 2343 const intptr_t kNumInputs = 1; | 2343 const intptr_t kNumInputs = 1; |
| 2344 const intptr_t kNumTemps = 0; | 2344 const intptr_t kNumTemps = 0; |
| 2345 LocationSummary* locs = | 2345 LocationSummary* locs = |
| 2346 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2346 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2347 locs->set_in(0, Location::RegisterLocation(T0)); | 2347 locs->set_in(0, Location::RegisterLocation(T0)); |
| 2348 locs->set_out(0, Location::RegisterLocation(T0)); | 2348 locs->set_out(0, Location::RegisterLocation(T0)); |
| 2349 return locs; | 2349 return locs; |
| 2350 } | 2350 } |
| 2351 | 2351 |
| 2352 | 2352 |
| 2353 void InstantiateTypeArgumentsInstr::EmitNativeCode( | 2353 void InstantiateTypeArgumentsInstr::EmitNativeCode( |
| 2354 FlowGraphCompiler* compiler) { | 2354 FlowGraphCompiler* compiler) { |
| 2355 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); | 2355 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); |
| 2356 Register instantiator_reg = locs()->in(0).reg(); | 2356 Register instantiator_reg = locs()->in(0).reg(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2409 // Drop instantiator and uninstantiated type arguments. | 2409 // Drop instantiator and uninstantiated type arguments. |
| 2410 __ addiu(SP, SP, Immediate(3 * kWordSize)); | 2410 __ addiu(SP, SP, Immediate(3 * kWordSize)); |
| 2411 __ Bind(&type_arguments_instantiated); | 2411 __ Bind(&type_arguments_instantiated); |
| 2412 } | 2412 } |
| 2413 | 2413 |
| 2414 | 2414 |
| 2415 LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const { | 2415 LocationSummary* AllocateContextInstr::MakeLocationSummary(bool opt) const { |
| 2416 const intptr_t kNumInputs = 0; | 2416 const intptr_t kNumInputs = 0; |
| 2417 const intptr_t kNumTemps = 1; | 2417 const intptr_t kNumTemps = 1; |
| 2418 LocationSummary* locs = | 2418 LocationSummary* locs = |
| 2419 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2419 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2420 locs->set_temp(0, Location::RegisterLocation(T1)); | 2420 locs->set_temp(0, Location::RegisterLocation(T1)); |
| 2421 locs->set_out(0, Location::RegisterLocation(V0)); | 2421 locs->set_out(0, Location::RegisterLocation(V0)); |
| 2422 return locs; | 2422 return locs; |
| 2423 } | 2423 } |
| 2424 | 2424 |
| 2425 | 2425 |
| 2426 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2426 void AllocateContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2427 Register temp = T1; | 2427 Register temp = T1; |
| 2428 ASSERT(locs()->temp(0).reg() == temp); | 2428 ASSERT(locs()->temp(0).reg() == temp); |
| 2429 ASSERT(locs()->out(0).reg() == V0); | 2429 ASSERT(locs()->out(0).reg() == V0); |
| 2430 | 2430 |
| 2431 __ TraceSimMsg("AllocateContextInstr"); | 2431 __ TraceSimMsg("AllocateContextInstr"); |
| 2432 __ LoadImmediate(temp, num_context_variables()); | 2432 __ LoadImmediate(temp, num_context_variables()); |
| 2433 const ExternalLabel label("alloc_context", | 2433 const ExternalLabel label("alloc_context", |
| 2434 StubCode::AllocateContextEntryPoint()); | 2434 StubCode::AllocateContextEntryPoint()); |
| 2435 compiler->GenerateCall(token_pos(), | 2435 compiler->GenerateCall(token_pos(), |
| 2436 &label, | 2436 &label, |
| 2437 PcDescriptors::kOther, | 2437 PcDescriptors::kOther, |
| 2438 locs()); | 2438 locs()); |
| 2439 } | 2439 } |
| 2440 | 2440 |
| 2441 | 2441 |
| 2442 LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const { | 2442 LocationSummary* CloneContextInstr::MakeLocationSummary(bool opt) const { |
| 2443 const intptr_t kNumInputs = 1; | 2443 const intptr_t kNumInputs = 1; |
| 2444 const intptr_t kNumTemps = 0; | 2444 const intptr_t kNumTemps = 0; |
| 2445 LocationSummary* locs = | 2445 LocationSummary* locs = |
| 2446 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 2446 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 2447 locs->set_in(0, Location::RegisterLocation(T0)); | 2447 locs->set_in(0, Location::RegisterLocation(T0)); |
| 2448 locs->set_out(0, Location::RegisterLocation(T0)); | 2448 locs->set_out(0, Location::RegisterLocation(T0)); |
| 2449 return locs; | 2449 return locs; |
| 2450 } | 2450 } |
| 2451 | 2451 |
| 2452 | 2452 |
| 2453 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2453 void CloneContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2454 Register context_value = locs()->in(0).reg(); | 2454 Register context_value = locs()->in(0).reg(); |
| 2455 Register result = locs()->out(0).reg(); | 2455 Register result = locs()->out(0).reg(); |
| 2456 | 2456 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2508 Address(FP, exception_var().index() * kWordSize)); | 2508 Address(FP, exception_var().index() * kWordSize)); |
| 2509 __ sw(kStackTraceObjectReg, | 2509 __ sw(kStackTraceObjectReg, |
| 2510 Address(FP, stacktrace_var().index() * kWordSize)); | 2510 Address(FP, stacktrace_var().index() * kWordSize)); |
| 2511 } | 2511 } |
| 2512 | 2512 |
| 2513 | 2513 |
| 2514 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const { | 2514 LocationSummary* CheckStackOverflowInstr::MakeLocationSummary(bool opt) const { |
| 2515 const intptr_t kNumInputs = 0; | 2515 const intptr_t kNumInputs = 0; |
| 2516 const intptr_t kNumTemps = 1; | 2516 const intptr_t kNumTemps = 1; |
| 2517 LocationSummary* summary = | 2517 LocationSummary* summary = |
| 2518 new LocationSummary(kNumInputs, | 2518 new (isolate) LocationSummary(isolate, kNumInputs, |
| 2519 kNumTemps, | 2519 kNumTemps, |
| 2520 LocationSummary::kCallOnSlowPath); | 2520 LocationSummary::kCallOnSlowPath); |
| 2521 summary->set_temp(0, Location::RequiresRegister()); | 2521 summary->set_temp(0, Location::RequiresRegister()); |
| 2522 return summary; | 2522 return summary; |
| 2523 } | 2523 } |
| 2524 | 2524 |
| 2525 | 2525 |
| 2526 class CheckStackOverflowSlowPath : public SlowPathCode { | 2526 class CheckStackOverflowSlowPath : public SlowPathCode { |
| 2527 public: | 2527 public: |
| 2528 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2528 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2715 // Shift for result now we know there is no overflow. | 2715 // Shift for result now we know there is no overflow. |
| 2716 __ sllv(result, left, temp); | 2716 __ sllv(result, left, temp); |
| 2717 } | 2717 } |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 | 2720 |
| 2721 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const { | 2721 LocationSummary* BinarySmiOpInstr::MakeLocationSummary(bool opt) const { |
| 2722 const intptr_t kNumInputs = 2; | 2722 const intptr_t kNumInputs = 2; |
| 2723 const intptr_t kNumTemps = op_kind() == Token::kADD ? 1 : 0; | 2723 const intptr_t kNumTemps = op_kind() == Token::kADD ? 1 : 0; |
| 2724 LocationSummary* summary = | 2724 LocationSummary* summary = |
| 2725 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 2725 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 2726 if (op_kind() == Token::kTRUNCDIV) { | 2726 if (op_kind() == Token::kTRUNCDIV) { |
| 2727 summary->set_in(0, Location::RequiresRegister()); | 2727 summary->set_in(0, Location::RequiresRegister()); |
| 2728 if (RightIsPowerOfTwoConstant()) { | 2728 if (RightIsPowerOfTwoConstant()) { |
| 2729 ConstantInstr* right_constant = right()->definition()->AsConstant(); | 2729 ConstantInstr* right_constant = right()->definition()->AsConstant(); |
| 2730 summary->set_in(1, Location::Constant(right_constant->value())); | 2730 summary->set_in(1, Location::Constant(right_constant->value())); |
| 2731 } else { | 2731 } else { |
| 2732 summary->set_in(1, Location::RequiresRegister()); | 2732 summary->set_in(1, Location::RequiresRegister()); |
| 2733 } | 2733 } |
| 2734 summary->AddTemp(Location::RequiresRegister()); | 2734 summary->AddTemp(Location::RequiresRegister()); |
| 2735 summary->set_out(0, Location::RequiresRegister()); | 2735 summary->set_out(0, Location::RequiresRegister()); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3066 } | 3066 } |
| 3067 | 3067 |
| 3068 | 3068 |
| 3069 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const { | 3069 LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(bool opt) const { |
| 3070 intptr_t left_cid = left()->Type()->ToCid(); | 3070 intptr_t left_cid = left()->Type()->ToCid(); |
| 3071 intptr_t right_cid = right()->Type()->ToCid(); | 3071 intptr_t right_cid = right()->Type()->ToCid(); |
| 3072 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); | 3072 ASSERT((left_cid != kDoubleCid) && (right_cid != kDoubleCid)); |
| 3073 const intptr_t kNumInputs = 2; | 3073 const intptr_t kNumInputs = 2; |
| 3074 const intptr_t kNumTemps = 0; | 3074 const intptr_t kNumTemps = 0; |
| 3075 LocationSummary* summary = | 3075 LocationSummary* summary = |
| 3076 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3076 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSummar
y::kNoCall); |
| 3077 summary->set_in(0, Location::RequiresRegister()); | 3077 summary->set_in(0, Location::RequiresRegister()); |
| 3078 summary->set_in(1, Location::RequiresRegister()); | 3078 summary->set_in(1, Location::RequiresRegister()); |
| 3079 return summary; | 3079 return summary; |
| 3080 } | 3080 } |
| 3081 | 3081 |
| 3082 | 3082 |
| 3083 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3083 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3084 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3084 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| 3085 ICData::kDeoptBinaryDoubleOp); | 3085 ICData::kDeoptBinaryDoubleOp); |
| 3086 intptr_t left_cid = left()->Type()->ToCid(); | 3086 intptr_t left_cid = left()->Type()->ToCid(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3098 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); | 3098 __ andi(CMPRES1, TMP, Immediate(kSmiTagMask)); |
| 3099 } | 3099 } |
| 3100 __ beq(CMPRES1, ZR, deopt); | 3100 __ beq(CMPRES1, ZR, deopt); |
| 3101 } | 3101 } |
| 3102 | 3102 |
| 3103 | 3103 |
| 3104 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { | 3104 LocationSummary* BoxDoubleInstr::MakeLocationSummary(bool opt) const { |
| 3105 const intptr_t kNumInputs = 1; | 3105 const intptr_t kNumInputs = 1; |
| 3106 const intptr_t kNumTemps = 1; | 3106 const intptr_t kNumTemps = 1; |
| 3107 LocationSummary* summary = | 3107 LocationSummary* summary = |
| 3108 new LocationSummary(kNumInputs, | 3108 new (isolate) LocationSummary(isolate, kNumInputs, |
| 3109 kNumTemps, | 3109 kNumTemps, |
| 3110 LocationSummary::kCallOnSlowPath); | 3110 LocationSummary::kCallOnSlowPath); |
| 3111 summary->set_in(0, Location::RequiresFpuRegister()); | 3111 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3112 summary->set_temp(0, Location::RequiresRegister()); | 3112 summary->set_temp(0, Location::RequiresRegister()); |
| 3113 summary->set_out(0, Location::RequiresRegister()); | 3113 summary->set_out(0, Location::RequiresRegister()); |
| 3114 return summary; | 3114 return summary; |
| 3115 } | 3115 } |
| 3116 | 3116 |
| 3117 | 3117 |
| 3118 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3118 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3130 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); | 3130 __ StoreDToOffset(value, out_reg, Double::value_offset() - kHeapObjectTag); |
| 3131 } | 3131 } |
| 3132 | 3132 |
| 3133 | 3133 |
| 3134 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { | 3134 LocationSummary* UnboxDoubleInstr::MakeLocationSummary(bool opt) const { |
| 3135 const intptr_t kNumInputs = 1; | 3135 const intptr_t kNumInputs = 1; |
| 3136 const intptr_t value_cid = value()->Type()->ToCid(); | 3136 const intptr_t value_cid = value()->Type()->ToCid(); |
| 3137 const bool needs_writable_input = (value_cid == kSmiCid); | 3137 const bool needs_writable_input = (value_cid == kSmiCid); |
| 3138 const intptr_t kNumTemps = 0; | 3138 const intptr_t kNumTemps = 0; |
| 3139 LocationSummary* summary = | 3139 LocationSummary* summary = |
| 3140 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3140 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3141 summary->set_in(0, needs_writable_input | 3141 summary->set_in(0, needs_writable_input |
| 3142 ? Location::WritableRegister() | 3142 ? Location::WritableRegister() |
| 3143 : Location::RequiresRegister()); | 3143 : Location::RequiresRegister()); |
| 3144 summary->set_out(0, Location::RequiresFpuRegister()); | 3144 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3145 return summary; | 3145 return summary; |
| 3146 } | 3146 } |
| 3147 | 3147 |
| 3148 | 3148 |
| 3149 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3149 void UnboxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3150 CompileType* value_type = value()->Type(); | 3150 CompileType* value_type = value()->Type(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 | 3251 |
| 3252 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3252 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3253 UNIMPLEMENTED(); | 3253 UNIMPLEMENTED(); |
| 3254 } | 3254 } |
| 3255 | 3255 |
| 3256 | 3256 |
| 3257 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 3257 LocationSummary* BinaryDoubleOpInstr::MakeLocationSummary(bool opt) const { |
| 3258 const intptr_t kNumInputs = 2; | 3258 const intptr_t kNumInputs = 2; |
| 3259 const intptr_t kNumTemps = 0; | 3259 const intptr_t kNumTemps = 0; |
| 3260 LocationSummary* summary = | 3260 LocationSummary* summary = |
| 3261 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3261 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3262 summary->set_in(0, Location::RequiresFpuRegister()); | 3262 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3263 summary->set_in(1, Location::RequiresFpuRegister()); | 3263 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3264 summary->set_out(0, Location::RequiresFpuRegister()); | 3264 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3265 return summary; | 3265 return summary; |
| 3266 } | 3266 } |
| 3267 | 3267 |
| 3268 | 3268 |
| 3269 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3269 void BinaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3270 DRegister left = locs()->in(0).fpu_reg(); | 3270 DRegister left = locs()->in(0).fpu_reg(); |
| 3271 DRegister right = locs()->in(1).fpu_reg(); | 3271 DRegister right = locs()->in(1).fpu_reg(); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3614 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3614 void BinaryInt32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3615 UNIMPLEMENTED(); | 3615 UNIMPLEMENTED(); |
| 3616 } | 3616 } |
| 3617 | 3617 |
| 3618 | 3618 |
| 3619 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { | 3619 LocationSummary* MathUnaryInstr::MakeLocationSummary(bool opt) const { |
| 3620 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { | 3620 if ((kind() == MathUnaryInstr::kSin) || (kind() == MathUnaryInstr::kCos)) { |
| 3621 const intptr_t kNumInputs = 1; | 3621 const intptr_t kNumInputs = 1; |
| 3622 const intptr_t kNumTemps = 0; | 3622 const intptr_t kNumTemps = 0; |
| 3623 LocationSummary* summary = | 3623 LocationSummary* summary = |
| 3624 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 3624 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kCall); |
| 3625 summary->set_in(0, Location::FpuRegisterLocation(D6)); | 3625 summary->set_in(0, Location::FpuRegisterLocation(D6)); |
| 3626 summary->set_out(0, Location::FpuRegisterLocation(D0)); | 3626 summary->set_out(0, Location::FpuRegisterLocation(D0)); |
| 3627 return summary; | 3627 return summary; |
| 3628 } | 3628 } |
| 3629 ASSERT((kind() == MathUnaryInstr::kSqrt) || | 3629 ASSERT((kind() == MathUnaryInstr::kSqrt) || |
| 3630 (kind() == MathUnaryInstr::kDoubleSquare)); | 3630 (kind() == MathUnaryInstr::kDoubleSquare)); |
| 3631 const intptr_t kNumInputs = 1; | 3631 const intptr_t kNumInputs = 1; |
| 3632 const intptr_t kNumTemps = 0; | 3632 const intptr_t kNumTemps = 0; |
| 3633 LocationSummary* summary = | 3633 LocationSummary* summary = |
| 3634 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3634 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3635 summary->set_in(0, Location::RequiresFpuRegister()); | 3635 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3636 summary->set_out(0, Location::RequiresFpuRegister()); | 3636 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3637 return summary; | 3637 return summary; |
| 3638 } | 3638 } |
| 3639 | 3639 |
| 3640 | 3640 |
| 3641 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3641 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3642 if (kind() == MathUnaryInstr::kSqrt) { | 3642 if (kind() == MathUnaryInstr::kSqrt) { |
| 3643 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); | 3643 __ sqrtd(locs()->out(0).fpu_reg(), locs()->in(0).fpu_reg()); |
| 3644 } else if (kind() == MathUnaryInstr::kDoubleSquare) { | 3644 } else if (kind() == MathUnaryInstr::kDoubleSquare) { |
| 3645 DRegister val = locs()->in(0).fpu_reg(); | 3645 DRegister val = locs()->in(0).fpu_reg(); |
| 3646 DRegister result = locs()->out(0).fpu_reg(); | 3646 DRegister result = locs()->out(0).fpu_reg(); |
| 3647 __ muld(result, val, val); | 3647 __ muld(result, val, val); |
| 3648 } else { | 3648 } else { |
| 3649 __ CallRuntime(TargetFunction(), InputCount()); | 3649 __ CallRuntime(TargetFunction(), InputCount()); |
| 3650 } | 3650 } |
| 3651 } | 3651 } |
| 3652 | 3652 |
| 3653 | 3653 |
| 3654 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { | 3654 LocationSummary* MathMinMaxInstr::MakeLocationSummary(bool opt) const { |
| 3655 if (result_cid() == kDoubleCid) { | 3655 if (result_cid() == kDoubleCid) { |
| 3656 const intptr_t kNumInputs = 2; | 3656 const intptr_t kNumInputs = 2; |
| 3657 const intptr_t kNumTemps = 1; | 3657 const intptr_t kNumTemps = 1; |
| 3658 LocationSummary* summary = | 3658 LocationSummary* summary = |
| 3659 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3659 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 3660 summary->set_in(0, Location::RequiresFpuRegister()); | 3660 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3661 summary->set_in(1, Location::RequiresFpuRegister()); | 3661 summary->set_in(1, Location::RequiresFpuRegister()); |
| 3662 // Reuse the left register so that code can be made shorter. | 3662 // Reuse the left register so that code can be made shorter. |
| 3663 summary->set_out(0, Location::SameAsFirstInput()); | 3663 summary->set_out(0, Location::SameAsFirstInput()); |
| 3664 summary->set_temp(0, Location::RequiresRegister()); | 3664 summary->set_temp(0, Location::RequiresRegister()); |
| 3665 return summary; | 3665 return summary; |
| 3666 } | 3666 } |
| 3667 ASSERT(result_cid() == kSmiCid); | 3667 ASSERT(result_cid() == kSmiCid); |
| 3668 const intptr_t kNumInputs = 2; | 3668 const intptr_t kNumInputs = 2; |
| 3669 const intptr_t kNumTemps = 0; | 3669 const intptr_t kNumTemps = 0; |
| 3670 LocationSummary* summary = | 3670 LocationSummary* summary = |
| 3671 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3671 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3672 summary->set_in(0, Location::RequiresRegister()); | 3672 summary->set_in(0, Location::RequiresRegister()); |
| 3673 summary->set_in(1, Location::RequiresRegister()); | 3673 summary->set_in(1, Location::RequiresRegister()); |
| 3674 // Reuse the left register so that code can be made shorter. | 3674 // Reuse the left register so that code can be made shorter. |
| 3675 summary->set_out(0, Location::SameAsFirstInput()); | 3675 summary->set_out(0, Location::SameAsFirstInput()); |
| 3676 return summary; | 3676 return summary; |
| 3677 } | 3677 } |
| 3678 | 3678 |
| 3679 | 3679 |
| 3680 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3680 void MathMinMaxInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3681 ASSERT((op_kind() == MethodRecognizer::kMathMin) || | 3681 ASSERT((op_kind() == MethodRecognizer::kMathMin) || |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3739 } | 3739 } |
| 3740 __ mov(result, right); | 3740 __ mov(result, right); |
| 3741 __ Bind(&done); | 3741 __ Bind(&done); |
| 3742 } | 3742 } |
| 3743 | 3743 |
| 3744 | 3744 |
| 3745 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const { | 3745 LocationSummary* UnarySmiOpInstr::MakeLocationSummary(bool opt) const { |
| 3746 const intptr_t kNumInputs = 1; | 3746 const intptr_t kNumInputs = 1; |
| 3747 const intptr_t kNumTemps = 0; | 3747 const intptr_t kNumTemps = 0; |
| 3748 LocationSummary* summary = | 3748 LocationSummary* summary = |
| 3749 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3749 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3750 summary->set_in(0, Location::RequiresRegister()); | 3750 summary->set_in(0, Location::RequiresRegister()); |
| 3751 // We make use of 3-operand instructions by not requiring result register | 3751 // We make use of 3-operand instructions by not requiring result register |
| 3752 // to be identical to first input register as on Intel. | 3752 // to be identical to first input register as on Intel. |
| 3753 summary->set_out(0, Location::RequiresRegister()); | 3753 summary->set_out(0, Location::RequiresRegister()); |
| 3754 return summary; | 3754 return summary; |
| 3755 } | 3755 } |
| 3756 | 3756 |
| 3757 | 3757 |
| 3758 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3758 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3759 Register value = locs()->in(0).reg(); | 3759 Register value = locs()->in(0).reg(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 3772 default: | 3772 default: |
| 3773 UNREACHABLE(); | 3773 UNREACHABLE(); |
| 3774 } | 3774 } |
| 3775 } | 3775 } |
| 3776 | 3776 |
| 3777 | 3777 |
| 3778 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const { | 3778 LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(bool opt) const { |
| 3779 const intptr_t kNumInputs = 1; | 3779 const intptr_t kNumInputs = 1; |
| 3780 const intptr_t kNumTemps = 1; | 3780 const intptr_t kNumTemps = 1; |
| 3781 LocationSummary* summary = | 3781 LocationSummary* summary = |
| 3782 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3782 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3783 summary->set_in(0, Location::RequiresFpuRegister()); | 3783 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3784 summary->set_out(0, Location::RequiresFpuRegister()); | 3784 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3785 summary->set_temp(0, Location::RequiresFpuRegister()); | 3785 summary->set_temp(0, Location::RequiresFpuRegister()); |
| 3786 return summary; | 3786 return summary; |
| 3787 } | 3787 } |
| 3788 | 3788 |
| 3789 | 3789 |
| 3790 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3790 void UnaryDoubleOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3791 // TODO(zra): Implement vneg. | 3791 // TODO(zra): Implement vneg. |
| 3792 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); | 3792 const Double& minus_one = Double::ZoneHandle(Double::NewCanonical(-1)); |
| 3793 __ LoadObject(TMP, minus_one); | 3793 __ LoadObject(TMP, minus_one); |
| 3794 FpuRegister result = locs()->out(0).fpu_reg(); | 3794 FpuRegister result = locs()->out(0).fpu_reg(); |
| 3795 FpuRegister value = locs()->in(0).fpu_reg(); | 3795 FpuRegister value = locs()->in(0).fpu_reg(); |
| 3796 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); | 3796 FpuRegister temp_fp = locs()->temp(0).fpu_reg(); |
| 3797 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); | 3797 __ LoadDFromOffset(temp_fp, TMP, Double::value_offset() - kHeapObjectTag); |
| 3798 __ muld(result, value, temp_fp); | 3798 __ muld(result, value, temp_fp); |
| 3799 } | 3799 } |
| 3800 | 3800 |
| 3801 | 3801 |
| 3802 | 3802 |
| 3803 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const { | 3803 LocationSummary* SmiToDoubleInstr::MakeLocationSummary(bool opt) const { |
| 3804 const intptr_t kNumInputs = 1; | 3804 const intptr_t kNumInputs = 1; |
| 3805 const intptr_t kNumTemps = 0; | 3805 const intptr_t kNumTemps = 0; |
| 3806 LocationSummary* result = | 3806 LocationSummary* result = |
| 3807 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3807 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3808 result->set_in(0, Location::WritableRegister()); | 3808 result->set_in(0, Location::WritableRegister()); |
| 3809 result->set_out(0, Location::RequiresFpuRegister()); | 3809 result->set_out(0, Location::RequiresFpuRegister()); |
| 3810 return result; | 3810 return result; |
| 3811 } | 3811 } |
| 3812 | 3812 |
| 3813 | 3813 |
| 3814 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3814 void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3815 Register value = locs()->in(0).reg(); | 3815 Register value = locs()->in(0).reg(); |
| 3816 FpuRegister result = locs()->out(0).fpu_reg(); | 3816 FpuRegister result = locs()->out(0).fpu_reg(); |
| 3817 __ SmiUntag(value); | 3817 __ SmiUntag(value); |
| 3818 __ mtc1(value, STMP1); | 3818 __ mtc1(value, STMP1); |
| 3819 __ cvtdw(result, STMP1); | 3819 __ cvtdw(result, STMP1); |
| 3820 } | 3820 } |
| 3821 | 3821 |
| 3822 | 3822 |
| 3823 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const { | 3823 LocationSummary* DoubleToIntegerInstr::MakeLocationSummary(bool opt) const { |
| 3824 const intptr_t kNumInputs = 1; | 3824 const intptr_t kNumInputs = 1; |
| 3825 const intptr_t kNumTemps = 0; | 3825 const intptr_t kNumTemps = 0; |
| 3826 LocationSummary* result = | 3826 LocationSummary* result = |
| 3827 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 3827 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kCall); |
| 3828 result->set_in(0, Location::RegisterLocation(T1)); | 3828 result->set_in(0, Location::RegisterLocation(T1)); |
| 3829 result->set_out(0, Location::RegisterLocation(V0)); | 3829 result->set_out(0, Location::RegisterLocation(V0)); |
| 3830 return result; | 3830 return result; |
| 3831 } | 3831 } |
| 3832 | 3832 |
| 3833 | 3833 |
| 3834 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3834 void DoubleToIntegerInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3835 Register result = locs()->out(0).reg(); | 3835 Register result = locs()->out(0).reg(); |
| 3836 Register value_obj = locs()->in(0).reg(); | 3836 Register value_obj = locs()->in(0).reg(); |
| 3837 ASSERT(result == V0); | 3837 ASSERT(result == V0); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 3862 kNumberOfArguments, | 3862 kNumberOfArguments, |
| 3863 Object::null_array(), // No argument names., | 3863 Object::null_array(), // No argument names., |
| 3864 locs()); | 3864 locs()); |
| 3865 __ Bind(&done); | 3865 __ Bind(&done); |
| 3866 } | 3866 } |
| 3867 | 3867 |
| 3868 | 3868 |
| 3869 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const { | 3869 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(bool opt) const { |
| 3870 const intptr_t kNumInputs = 1; | 3870 const intptr_t kNumInputs = 1; |
| 3871 const intptr_t kNumTemps = 0; | 3871 const intptr_t kNumTemps = 0; |
| 3872 LocationSummary* result = new LocationSummary( | 3872 LocationSummary* result = new (isolate) LocationSummary(isolate, |
| 3873 kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3873 kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3874 result->set_in(0, Location::RequiresFpuRegister()); | 3874 result->set_in(0, Location::RequiresFpuRegister()); |
| 3875 result->set_out(0, Location::RequiresRegister()); | 3875 result->set_out(0, Location::RequiresRegister()); |
| 3876 return result; | 3876 return result; |
| 3877 } | 3877 } |
| 3878 | 3878 |
| 3879 | 3879 |
| 3880 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3880 void DoubleToSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3881 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); | 3881 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptDoubleToSmi); |
| 3882 Register result = locs()->out(0).reg(); | 3882 Register result = locs()->out(0).reg(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3900 | 3900 |
| 3901 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3901 void DoubleToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3902 UNIMPLEMENTED(); | 3902 UNIMPLEMENTED(); |
| 3903 } | 3903 } |
| 3904 | 3904 |
| 3905 | 3905 |
| 3906 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const { | 3906 LocationSummary* DoubleToFloatInstr::MakeLocationSummary(bool opt) const { |
| 3907 const intptr_t kNumInputs = 1; | 3907 const intptr_t kNumInputs = 1; |
| 3908 const intptr_t kNumTemps = 0; | 3908 const intptr_t kNumTemps = 0; |
| 3909 LocationSummary* result = | 3909 LocationSummary* result = |
| 3910 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3910 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3911 result->set_in(0, Location::RequiresFpuRegister()); | 3911 result->set_in(0, Location::RequiresFpuRegister()); |
| 3912 result->set_out(0, Location::SameAsFirstInput()); | 3912 result->set_out(0, Location::SameAsFirstInput()); |
| 3913 return result; | 3913 return result; |
| 3914 } | 3914 } |
| 3915 | 3915 |
| 3916 | 3916 |
| 3917 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3917 void DoubleToFloatInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3918 DRegister value = locs()->in(0).fpu_reg(); | 3918 DRegister value = locs()->in(0).fpu_reg(); |
| 3919 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg()); | 3919 FRegister result = EvenFRegisterOf(locs()->out(0).fpu_reg()); |
| 3920 __ cvtsd(result, value); | 3920 __ cvtsd(result, value); |
| 3921 } | 3921 } |
| 3922 | 3922 |
| 3923 | 3923 |
| 3924 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const { | 3924 LocationSummary* FloatToDoubleInstr::MakeLocationSummary(bool opt) const { |
| 3925 const intptr_t kNumInputs = 1; | 3925 const intptr_t kNumInputs = 1; |
| 3926 const intptr_t kNumTemps = 0; | 3926 const intptr_t kNumTemps = 0; |
| 3927 LocationSummary* result = | 3927 LocationSummary* result = |
| 3928 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3928 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 3929 result->set_in(0, Location::RequiresFpuRegister()); | 3929 result->set_in(0, Location::RequiresFpuRegister()); |
| 3930 result->set_out(0, Location::SameAsFirstInput()); | 3930 result->set_out(0, Location::SameAsFirstInput()); |
| 3931 return result; | 3931 return result; |
| 3932 } | 3932 } |
| 3933 | 3933 |
| 3934 | 3934 |
| 3935 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3935 void FloatToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3936 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg()); | 3936 FRegister value = EvenFRegisterOf(locs()->in(0).fpu_reg()); |
| 3937 DRegister result = locs()->out(0).fpu_reg(); | 3937 DRegister result = locs()->out(0).fpu_reg(); |
| 3938 __ cvtds(result, value); | 3938 __ cvtds(result, value); |
| 3939 } | 3939 } |
| 3940 | 3940 |
| 3941 | 3941 |
| 3942 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { | 3942 LocationSummary* InvokeMathCFunctionInstr::MakeLocationSummary(bool opt) const { |
| 3943 // Calling convention on MIPS uses D6 and D7 to pass the first two | 3943 // Calling convention on MIPS uses D6 and D7 to pass the first two |
| 3944 // double arguments. | 3944 // double arguments. |
| 3945 ASSERT((InputCount() == 1) || (InputCount() == 2)); | 3945 ASSERT((InputCount() == 1) || (InputCount() == 2)); |
| 3946 const intptr_t kNumTemps = 0; | 3946 const intptr_t kNumTemps = 0; |
| 3947 LocationSummary* result = | 3947 LocationSummary* result = |
| 3948 new LocationSummary(InputCount(), kNumTemps, LocationSummary::kCall); | 3948 new (isolate) LocationSummary(isolate, InputCount(), kNumTemps, LocationSu
mmary::kCall); |
| 3949 result->set_in(0, Location::FpuRegisterLocation(D6)); | 3949 result->set_in(0, Location::FpuRegisterLocation(D6)); |
| 3950 if (InputCount() == 2) { | 3950 if (InputCount() == 2) { |
| 3951 result->set_in(1, Location::FpuRegisterLocation(D7)); | 3951 result->set_in(1, Location::FpuRegisterLocation(D7)); |
| 3952 } | 3952 } |
| 3953 result->set_out(0, Location::FpuRegisterLocation(D0)); | 3953 result->set_out(0, Location::FpuRegisterLocation(D0)); |
| 3954 return result; | 3954 return result; |
| 3955 } | 3955 } |
| 3956 | 3956 |
| 3957 | 3957 |
| 3958 // Pseudo code: | 3958 // Pseudo code: |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4077 // double values are passed and returned in vfp registers. | 4077 // double values are passed and returned in vfp registers. |
| 4078 __ CallRuntime(TargetFunction(), InputCount()); | 4078 __ CallRuntime(TargetFunction(), InputCount()); |
| 4079 } | 4079 } |
| 4080 | 4080 |
| 4081 | 4081 |
| 4082 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(bool opt) const { | 4082 LocationSummary* ExtractNthOutputInstr::MakeLocationSummary(bool opt) const { |
| 4083 // Only use this instruction in optimized code. | 4083 // Only use this instruction in optimized code. |
| 4084 ASSERT(opt); | 4084 ASSERT(opt); |
| 4085 const intptr_t kNumInputs = 1; | 4085 const intptr_t kNumInputs = 1; |
| 4086 LocationSummary* summary = | 4086 LocationSummary* summary = |
| 4087 new LocationSummary(kNumInputs, 0, LocationSummary::kNoCall); | 4087 new (isolate) LocationSummary(isolate, kNumInputs, 0, LocationSummary::kNo
Call); |
| 4088 if (representation() == kUnboxedDouble) { | 4088 if (representation() == kUnboxedDouble) { |
| 4089 if (index() == 0) { | 4089 if (index() == 0) { |
| 4090 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), | 4090 summary->set_in(0, Location::Pair(Location::RequiresFpuRegister(), |
| 4091 Location::Any())); | 4091 Location::Any())); |
| 4092 } else { | 4092 } else { |
| 4093 ASSERT(index() == 1); | 4093 ASSERT(index() == 1); |
| 4094 summary->set_in(0, Location::Pair(Location::Any(), | 4094 summary->set_in(0, Location::Pair(Location::Any(), |
| 4095 Location::RequiresFpuRegister())); | 4095 Location::RequiresFpuRegister())); |
| 4096 } | 4096 } |
| 4097 summary->set_out(0, Location::RequiresFpuRegister()); | 4097 summary->set_out(0, Location::RequiresFpuRegister()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 4126 __ mov(out, in); | 4126 __ mov(out, in); |
| 4127 } | 4127 } |
| 4128 } | 4128 } |
| 4129 | 4129 |
| 4130 | 4130 |
| 4131 LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const { | 4131 LocationSummary* MergedMathInstr::MakeLocationSummary(bool opt) const { |
| 4132 if (kind() == MergedMathInstr::kTruncDivMod) { | 4132 if (kind() == MergedMathInstr::kTruncDivMod) { |
| 4133 const intptr_t kNumInputs = 2; | 4133 const intptr_t kNumInputs = 2; |
| 4134 const intptr_t kNumTemps = 1; | 4134 const intptr_t kNumTemps = 1; |
| 4135 LocationSummary* summary = | 4135 LocationSummary* summary = |
| 4136 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4136 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kNoCall); |
| 4137 summary->set_in(0, Location::RequiresRegister()); | 4137 summary->set_in(0, Location::RequiresRegister()); |
| 4138 summary->set_in(1, Location::RequiresRegister()); | 4138 summary->set_in(1, Location::RequiresRegister()); |
| 4139 summary->set_temp(0, Location::RequiresRegister()); | 4139 summary->set_temp(0, Location::RequiresRegister()); |
| 4140 // Output is a pair of registers. | 4140 // Output is a pair of registers. |
| 4141 summary->set_out(0, Location::Pair(Location::RequiresRegister(), | 4141 summary->set_out(0, Location::Pair(Location::RequiresRegister(), |
| 4142 Location::RequiresRegister())); | 4142 Location::RequiresRegister())); |
| 4143 return summary; | 4143 return summary; |
| 4144 } | 4144 } |
| 4145 UNIMPLEMENTED(); | 4145 UNIMPLEMENTED(); |
| 4146 return NULL; | 4146 return NULL; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4262 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4262 void BranchInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4263 __ TraceSimMsg("BranchInstr"); | 4263 __ TraceSimMsg("BranchInstr"); |
| 4264 comparison()->EmitBranchCode(compiler, this); | 4264 comparison()->EmitBranchCode(compiler, this); |
| 4265 } | 4265 } |
| 4266 | 4266 |
| 4267 | 4267 |
| 4268 LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const { | 4268 LocationSummary* CheckClassInstr::MakeLocationSummary(bool opt) const { |
| 4269 const intptr_t kNumInputs = 1; | 4269 const intptr_t kNumInputs = 1; |
| 4270 const intptr_t kNumTemps = 0; | 4270 const intptr_t kNumTemps = 0; |
| 4271 LocationSummary* summary = | 4271 LocationSummary* summary = |
| 4272 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4272 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 4273 summary->set_in(0, Location::RequiresRegister()); | 4273 summary->set_in(0, Location::RequiresRegister()); |
| 4274 if (!IsNullCheck()) { | 4274 if (!IsNullCheck()) { |
| 4275 summary->AddTemp(Location::RequiresRegister()); | 4275 summary->AddTemp(Location::RequiresRegister()); |
| 4276 } | 4276 } |
| 4277 return summary; | 4277 return summary; |
| 4278 } | 4278 } |
| 4279 | 4279 |
| 4280 | 4280 |
| 4281 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4281 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4282 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? | 4282 const ICData::DeoptReasonId deopt_reason = licm_hoisted_ ? |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4316 } | 4316 } |
| 4317 } | 4317 } |
| 4318 __ Bind(&is_ok); | 4318 __ Bind(&is_ok); |
| 4319 } | 4319 } |
| 4320 | 4320 |
| 4321 | 4321 |
| 4322 LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const { | 4322 LocationSummary* CheckSmiInstr::MakeLocationSummary(bool opt) const { |
| 4323 const intptr_t kNumInputs = 1; | 4323 const intptr_t kNumInputs = 1; |
| 4324 const intptr_t kNumTemps = 0; | 4324 const intptr_t kNumTemps = 0; |
| 4325 LocationSummary* summary = | 4325 LocationSummary* summary = |
| 4326 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4326 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 4327 summary->set_in(0, Location::RequiresRegister()); | 4327 summary->set_in(0, Location::RequiresRegister()); |
| 4328 return summary; | 4328 return summary; |
| 4329 } | 4329 } |
| 4330 | 4330 |
| 4331 | 4331 |
| 4332 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4332 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4333 __ TraceSimMsg("CheckSmiInstr"); | 4333 __ TraceSimMsg("CheckSmiInstr"); |
| 4334 Register value = locs()->in(0).reg(); | 4334 Register value = locs()->in(0).reg(); |
| 4335 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); | 4335 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); |
| 4336 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); | 4336 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); |
| 4337 __ bne(CMPRES1, ZR, deopt); | 4337 __ bne(CMPRES1, ZR, deopt); |
| 4338 } | 4338 } |
| 4339 | 4339 |
| 4340 | 4340 |
| 4341 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { | 4341 LocationSummary* CheckArrayBoundInstr::MakeLocationSummary(bool opt) const { |
| 4342 const intptr_t kNumInputs = 2; | 4342 const intptr_t kNumInputs = 2; |
| 4343 const intptr_t kNumTemps = 0; | 4343 const intptr_t kNumTemps = 0; |
| 4344 LocationSummary* locs = | 4344 LocationSummary* locs = |
| 4345 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4345 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 4346 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); | 4346 locs->set_in(kLengthPos, Location::RegisterOrSmiConstant(length())); |
| 4347 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); | 4347 locs->set_in(kIndexPos, Location::RegisterOrSmiConstant(index())); |
| 4348 return locs; | 4348 return locs; |
| 4349 } | 4349 } |
| 4350 | 4350 |
| 4351 | 4351 |
| 4352 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4352 void CheckArrayBoundInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4353 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 4353 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| 4354 ICData::kDeoptCheckArrayBound); | 4354 ICData::kDeoptCheckArrayBound); |
| 4355 | 4355 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4433 return NULL; | 4433 return NULL; |
| 4434 } | 4434 } |
| 4435 | 4435 |
| 4436 | 4436 |
| 4437 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4437 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4438 UNIMPLEMENTED(); | 4438 UNIMPLEMENTED(); |
| 4439 } | 4439 } |
| 4440 | 4440 |
| 4441 | 4441 |
| 4442 LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const { | 4442 LocationSummary* ThrowInstr::MakeLocationSummary(bool opt) const { |
| 4443 return new LocationSummary(0, 0, LocationSummary::kCall); | 4443 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); |
| 4444 } | 4444 } |
| 4445 | 4445 |
| 4446 | 4446 |
| 4447 | 4447 |
| 4448 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4448 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4449 compiler->GenerateRuntimeCall(token_pos(), | 4449 compiler->GenerateRuntimeCall(token_pos(), |
| 4450 deopt_id(), | 4450 deopt_id(), |
| 4451 kThrowRuntimeEntry, | 4451 kThrowRuntimeEntry, |
| 4452 1, | 4452 1, |
| 4453 locs()); | 4453 locs()); |
| 4454 __ break_(0); | 4454 __ break_(0); |
| 4455 } | 4455 } |
| 4456 | 4456 |
| 4457 | 4457 |
| 4458 LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const { | 4458 LocationSummary* ReThrowInstr::MakeLocationSummary(bool opt) const { |
| 4459 return new LocationSummary(0, 0, LocationSummary::kCall); | 4459 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kCall); |
| 4460 } | 4460 } |
| 4461 | 4461 |
| 4462 | 4462 |
| 4463 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4463 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4464 compiler->SetNeedsStacktrace(catch_try_index()); | 4464 compiler->SetNeedsStacktrace(catch_try_index()); |
| 4465 compiler->GenerateRuntimeCall(token_pos(), | 4465 compiler->GenerateRuntimeCall(token_pos(), |
| 4466 deopt_id(), | 4466 deopt_id(), |
| 4467 kReThrowRuntimeEntry, | 4467 kReThrowRuntimeEntry, |
| 4468 2, | 4468 2, |
| 4469 locs()); | 4469 locs()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4489 deopt_id_, | 4489 deopt_id_, |
| 4490 Scanner::kNoSourcePos); | 4490 Scanner::kNoSourcePos); |
| 4491 } | 4491 } |
| 4492 if (HasParallelMove()) { | 4492 if (HasParallelMove()) { |
| 4493 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 4493 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 4494 } | 4494 } |
| 4495 } | 4495 } |
| 4496 | 4496 |
| 4497 | 4497 |
| 4498 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { | 4498 LocationSummary* GotoInstr::MakeLocationSummary(bool opt) const { |
| 4499 return new LocationSummary(0, 0, LocationSummary::kNoCall); | 4499 return new (isolate) LocationSummary(isolate, 0, 0, LocationSummary::kNoCall); |
| 4500 } | 4500 } |
| 4501 | 4501 |
| 4502 | 4502 |
| 4503 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4503 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4504 __ TraceSimMsg("GotoInstr"); | 4504 __ TraceSimMsg("GotoInstr"); |
| 4505 if (!compiler->is_optimizing()) { | 4505 if (!compiler->is_optimizing()) { |
| 4506 compiler->EmitEdgeCounter(); | 4506 compiler->EmitEdgeCounter(); |
| 4507 // Add a deoptimization descriptor for deoptimizing instructions that | 4507 // Add a deoptimization descriptor for deoptimizing instructions that |
| 4508 // may be inserted before this instruction. On MIPS this descriptor | 4508 // may be inserted before this instruction. On MIPS this descriptor |
| 4509 // points after the edge counter code so that we can reuse the same | 4509 // points after the edge counter code so that we can reuse the same |
| (...skipping 25 matching lines...) Expand all Loading... |
| 4535 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 4535 void CurrentContextInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 4536 __ mov(locs()->out(0).reg(), CTX); | 4536 __ mov(locs()->out(0).reg(), CTX); |
| 4537 } | 4537 } |
| 4538 | 4538 |
| 4539 | 4539 |
| 4540 LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const { | 4540 LocationSummary* StrictCompareInstr::MakeLocationSummary(bool opt) const { |
| 4541 const intptr_t kNumInputs = 2; | 4541 const intptr_t kNumInputs = 2; |
| 4542 const intptr_t kNumTemps = 0; | 4542 const intptr_t kNumTemps = 0; |
| 4543 if (needs_number_check()) { | 4543 if (needs_number_check()) { |
| 4544 LocationSummary* locs = | 4544 LocationSummary* locs = |
| 4545 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 4545 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSu
mmary::kCall); |
| 4546 locs->set_in(0, Location::RegisterLocation(A0)); | 4546 locs->set_in(0, Location::RegisterLocation(A0)); |
| 4547 locs->set_in(1, Location::RegisterLocation(A1)); | 4547 locs->set_in(1, Location::RegisterLocation(A1)); |
| 4548 locs->set_out(0, Location::RegisterLocation(A0)); | 4548 locs->set_out(0, Location::RegisterLocation(A0)); |
| 4549 return locs; | 4549 return locs; |
| 4550 } | 4550 } |
| 4551 LocationSummary* locs = | 4551 LocationSummary* locs = |
| 4552 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 4552 new (isolate) LocationSummary(isolate, kNumInputs, kNumTemps, LocationSumm
ary::kNoCall); |
| 4553 locs->set_in(0, Location::RegisterOrConstant(left())); | 4553 locs->set_in(0, Location::RegisterOrConstant(left())); |
| 4554 // Only one of the inputs can be a constant. Choose register if the first one | 4554 // Only one of the inputs can be a constant. Choose register if the first one |
| 4555 // is a constant. | 4555 // is a constant. |
| 4556 locs->set_in(1, locs->in(0).IsConstant() | 4556 locs->set_in(1, locs->in(0).IsConstant() |
| 4557 ? Location::RequiresRegister() | 4557 ? Location::RequiresRegister() |
| 4558 : Location::RegisterOrConstant(right())); | 4558 : Location::RegisterOrConstant(right())); |
| 4559 locs->set_out(0, Location::RequiresRegister()); | 4559 locs->set_out(0, Location::RequiresRegister()); |
| 4560 return locs; | 4560 return locs; |
| 4561 } | 4561 } |
| 4562 | 4562 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4650 compiler->GenerateCall(token_pos(), | 4650 compiler->GenerateCall(token_pos(), |
| 4651 &label, | 4651 &label, |
| 4652 PcDescriptors::kOther, | 4652 PcDescriptors::kOther, |
| 4653 locs()); | 4653 locs()); |
| 4654 __ Drop(ArgumentCount()); // Discard arguments. | 4654 __ Drop(ArgumentCount()); // Discard arguments. |
| 4655 } | 4655 } |
| 4656 | 4656 |
| 4657 } // namespace dart | 4657 } // namespace dart |
| 4658 | 4658 |
| 4659 #endif // defined TARGET_ARCH_MIPS | 4659 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |