| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 3294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3305 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3305 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3306 summary->set_in(0, Location::RequiresRegister()); | 3306 summary->set_in(0, Location::RequiresRegister()); |
| 3307 summary->set_out(0, Location::RequiresFpuRegister()); | 3307 summary->set_out(0, Location::RequiresFpuRegister()); |
| 3308 return summary; | 3308 return summary; |
| 3309 } | 3309 } |
| 3310 | 3310 |
| 3311 void UnboxInstr::EmitLoadFromBox(FlowGraphCompiler* compiler) { | 3311 void UnboxInstr::EmitLoadFromBox(FlowGraphCompiler* compiler) { |
| 3312 const Register box = locs()->in(0).reg(); | 3312 const Register box = locs()->in(0).reg(); |
| 3313 | 3313 |
| 3314 switch (representation()) { | 3314 switch (representation()) { |
| 3315 case kUnboxedMint: { | 3315 case kUnboxedInt64: { |
| 3316 UNIMPLEMENTED(); | 3316 UNIMPLEMENTED(); |
| 3317 break; | 3317 break; |
| 3318 } | 3318 } |
| 3319 | 3319 |
| 3320 case kUnboxedDouble: { | 3320 case kUnboxedDouble: { |
| 3321 const VRegister result = locs()->out(0).fpu_reg(); | 3321 const VRegister result = locs()->out(0).fpu_reg(); |
| 3322 __ LoadDFieldFromOffset(result, box, ValueOffset()); | 3322 __ LoadDFieldFromOffset(result, box, ValueOffset()); |
| 3323 break; | 3323 break; |
| 3324 } | 3324 } |
| 3325 | 3325 |
| 3326 case kUnboxedFloat32x4: | 3326 case kUnboxedFloat32x4: |
| 3327 case kUnboxedFloat64x2: | 3327 case kUnboxedFloat64x2: |
| 3328 case kUnboxedInt32x4: { | 3328 case kUnboxedInt32x4: { |
| 3329 const VRegister result = locs()->out(0).fpu_reg(); | 3329 const VRegister result = locs()->out(0).fpu_reg(); |
| 3330 __ LoadQFieldFromOffset(result, box, ValueOffset()); | 3330 __ LoadQFieldFromOffset(result, box, ValueOffset()); |
| 3331 break; | 3331 break; |
| 3332 } | 3332 } |
| 3333 | 3333 |
| 3334 default: | 3334 default: |
| 3335 UNREACHABLE(); | 3335 UNREACHABLE(); |
| 3336 break; | 3336 break; |
| 3337 } | 3337 } |
| 3338 } | 3338 } |
| 3339 | 3339 |
| 3340 void UnboxInstr::EmitSmiConversion(FlowGraphCompiler* compiler) { | 3340 void UnboxInstr::EmitSmiConversion(FlowGraphCompiler* compiler) { |
| 3341 const Register box = locs()->in(0).reg(); | 3341 const Register box = locs()->in(0).reg(); |
| 3342 | 3342 |
| 3343 switch (representation()) { | 3343 switch (representation()) { |
| 3344 case kUnboxedMint: { | 3344 case kUnboxedInt64: { |
| 3345 UNIMPLEMENTED(); | 3345 UNIMPLEMENTED(); |
| 3346 break; | 3346 break; |
| 3347 } | 3347 } |
| 3348 | 3348 |
| 3349 case kUnboxedDouble: { | 3349 case kUnboxedDouble: { |
| 3350 const VRegister result = locs()->out(0).fpu_reg(); | 3350 const VRegister result = locs()->out(0).fpu_reg(); |
| 3351 __ SmiUntag(TMP, box); | 3351 __ SmiUntag(TMP, box); |
| 3352 __ scvtfdx(result, TMP); | 3352 __ scvtfdx(result, TMP); |
| 3353 break; | 3353 break; |
| 3354 } | 3354 } |
| (...skipping 2007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5362 const Register length = length_loc.reg(); | 5362 const Register length = length_loc.reg(); |
| 5363 const Register index = index_loc.reg(); | 5363 const Register index = index_loc.reg(); |
| 5364 if (index_cid != kSmiCid) { | 5364 if (index_cid != kSmiCid) { |
| 5365 __ BranchIfNotSmi(index, deopt); | 5365 __ BranchIfNotSmi(index, deopt); |
| 5366 } | 5366 } |
| 5367 __ CompareRegisters(index, length); | 5367 __ CompareRegisters(index, length); |
| 5368 __ b(deopt, CS); | 5368 __ b(deopt, CS); |
| 5369 } | 5369 } |
| 5370 } | 5370 } |
| 5371 | 5371 |
| 5372 LocationSummary* BinaryMintOpInstr::MakeLocationSummary(Zone* zone, | 5372 LocationSummary* BinaryInt64OpInstr::MakeLocationSummary(Zone* zone, |
| 5373 bool opt) const { |
| 5374 UNIMPLEMENTED(); |
| 5375 return NULL; |
| 5376 } |
| 5377 |
| 5378 void BinaryInt64OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5379 UNIMPLEMENTED(); |
| 5380 } |
| 5381 |
| 5382 LocationSummary* ShiftInt64OpInstr::MakeLocationSummary(Zone* zone, |
| 5373 bool opt) const { | 5383 bool opt) const { |
| 5374 UNIMPLEMENTED(); | 5384 UNIMPLEMENTED(); |
| 5375 return NULL; | 5385 return NULL; |
| 5376 } | 5386 } |
| 5377 | 5387 |
| 5378 void BinaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5388 void ShiftInt64OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5379 UNIMPLEMENTED(); | 5389 UNIMPLEMENTED(); |
| 5380 } | 5390 } |
| 5381 | 5391 |
| 5382 LocationSummary* ShiftMintOpInstr::MakeLocationSummary(Zone* zone, | 5392 LocationSummary* UnaryInt64OpInstr::MakeLocationSummary(Zone* zone, |
| 5383 bool opt) const { | 5393 bool opt) const { |
| 5384 UNIMPLEMENTED(); | 5394 UNIMPLEMENTED(); |
| 5385 return NULL; | 5395 return NULL; |
| 5386 } | 5396 } |
| 5387 | 5397 |
| 5388 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5398 void UnaryInt64OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5389 UNIMPLEMENTED(); | 5399 UNIMPLEMENTED(); |
| 5390 } | 5400 } |
| 5391 | 5401 |
| 5392 LocationSummary* UnaryMintOpInstr::MakeLocationSummary(Zone* zone, | |
| 5393 bool opt) const { | |
| 5394 UNIMPLEMENTED(); | |
| 5395 return NULL; | |
| 5396 } | |
| 5397 | |
| 5398 void UnaryMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 5399 UNIMPLEMENTED(); | |
| 5400 } | |
| 5401 | |
| 5402 CompileType BinaryUint32OpInstr::ComputeType() const { | 5402 CompileType BinaryUint32OpInstr::ComputeType() const { |
| 5403 return CompileType::FromCid(kSmiCid); | 5403 return CompileType::FromCid(kSmiCid); |
| 5404 } | 5404 } |
| 5405 | 5405 |
| 5406 CompileType ShiftUint32OpInstr::ComputeType() const { | 5406 CompileType ShiftUint32OpInstr::ComputeType() const { |
| 5407 return CompileType::FromCid(kSmiCid); | 5407 return CompileType::FromCid(kSmiCid); |
| 5408 } | 5408 } |
| 5409 | 5409 |
| 5410 CompileType UnaryUint32OpInstr::ComputeType() const { | 5410 CompileType UnaryUint32OpInstr::ComputeType() const { |
| 5411 return CompileType::FromCid(kSmiCid); | 5411 return CompileType::FromCid(kSmiCid); |
| 5412 } | 5412 } |
| 5413 | 5413 |
| 5414 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryUint32OpInstr) | 5414 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryUint32OpInstr) |
| 5415 DEFINE_UNIMPLEMENTED_INSTRUCTION(ShiftUint32OpInstr) | 5415 DEFINE_UNIMPLEMENTED_INSTRUCTION(ShiftUint32OpInstr) |
| 5416 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnaryUint32OpInstr) | 5416 DEFINE_UNIMPLEMENTED_INSTRUCTION(UnaryUint32OpInstr) |
| 5417 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) | 5417 DEFINE_UNIMPLEMENTED_INSTRUCTION(BinaryInt32OpInstr) |
| 5418 | 5418 |
| 5419 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone, | 5419 LocationSummary* UnboxedIntConverterInstr::MakeLocationSummary(Zone* zone, |
| 5420 bool opt) const { | 5420 bool opt) const { |
| 5421 const intptr_t kNumInputs = 1; | 5421 const intptr_t kNumInputs = 1; |
| 5422 const intptr_t kNumTemps = 0; | 5422 const intptr_t kNumTemps = 0; |
| 5423 LocationSummary* summary = new (zone) | 5423 LocationSummary* summary = new (zone) |
| 5424 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 5424 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 5425 if (from() == kUnboxedMint) { | 5425 if (from() == kUnboxedInt64) { |
| 5426 UNREACHABLE(); | 5426 UNREACHABLE(); |
| 5427 } else if (to() == kUnboxedMint) { | 5427 } else if (to() == kUnboxedInt64) { |
| 5428 UNREACHABLE(); | 5428 UNREACHABLE(); |
| 5429 } else { | 5429 } else { |
| 5430 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); | 5430 ASSERT((to() == kUnboxedUint32) || (to() == kUnboxedInt32)); |
| 5431 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); | 5431 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); |
| 5432 summary->set_in(0, Location::RequiresRegister()); | 5432 summary->set_in(0, Location::RequiresRegister()); |
| 5433 summary->set_out(0, Location::RequiresRegister()); | 5433 summary->set_out(0, Location::RequiresRegister()); |
| 5434 } | 5434 } |
| 5435 return summary; | 5435 return summary; |
| 5436 } | 5436 } |
| 5437 | 5437 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5454 const Register value = locs()->in(0).reg(); | 5454 const Register value = locs()->in(0).reg(); |
| 5455 const Register out = locs()->out(0).reg(); | 5455 const Register out = locs()->out(0).reg(); |
| 5456 __ LslImmediate(out, value, 32); | 5456 __ LslImmediate(out, value, 32); |
| 5457 __ AsrImmediate(out, out, 32); | 5457 __ AsrImmediate(out, out, 32); |
| 5458 if (CanDeoptimize()) { | 5458 if (CanDeoptimize()) { |
| 5459 Label* deopt = | 5459 Label* deopt = |
| 5460 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnboxInteger); | 5460 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnboxInteger); |
| 5461 __ cmp(out, Operand(value, UXTW, 0)); | 5461 __ cmp(out, Operand(value, UXTW, 0)); |
| 5462 __ b(deopt, NE); | 5462 __ b(deopt, NE); |
| 5463 } | 5463 } |
| 5464 } else if (from() == kUnboxedMint) { | 5464 } else if (from() == kUnboxedInt64) { |
| 5465 UNREACHABLE(); | 5465 UNREACHABLE(); |
| 5466 } else if (to() == kUnboxedMint) { | 5466 } else if (to() == kUnboxedInt64) { |
| 5467 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); | 5467 ASSERT((from() == kUnboxedUint32) || (from() == kUnboxedInt32)); |
| 5468 UNREACHABLE(); | 5468 UNREACHABLE(); |
| 5469 } else { | 5469 } else { |
| 5470 UNREACHABLE(); | 5470 UNREACHABLE(); |
| 5471 } | 5471 } |
| 5472 } | 5472 } |
| 5473 | 5473 |
| 5474 LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const { | 5474 LocationSummary* ThrowInstr::MakeLocationSummary(Zone* zone, bool opt) const { |
| 5475 return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); | 5475 return new (zone) LocationSummary(zone, 0, 0, LocationSummary::kCall); |
| 5476 } | 5476 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5679 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5679 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5680 ASSERT(!compiler->is_optimizing()); | 5680 ASSERT(!compiler->is_optimizing()); |
| 5681 __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry()); | 5681 __ BranchLinkPatchable(*StubCode::DebugStepCheck_entry()); |
| 5682 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); | 5682 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); |
| 5683 compiler->RecordSafepoint(locs()); | 5683 compiler->RecordSafepoint(locs()); |
| 5684 } | 5684 } |
| 5685 | 5685 |
| 5686 } // namespace dart | 5686 } // namespace dart |
| 5687 | 5687 |
| 5688 #endif // defined TARGET_ARCH_ARM64 | 5688 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |