| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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_DBC. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_DBC. |
| 6 #if defined(TARGET_ARCH_DBC) | 6 #if defined(TARGET_ARCH_DBC) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 const Location source = move->src(); | 420 const Location source = move->src(); |
| 421 const Location destination = move->dest(); | 421 const Location destination = move->dest(); |
| 422 if (source.IsStackSlot() && destination.IsRegister()) { | 422 if (source.IsStackSlot() && destination.IsRegister()) { |
| 423 // Only allow access to the arguments. | 423 // Only allow access to the arguments. |
| 424 ASSERT(source.base_reg() == FPREG); | 424 ASSERT(source.base_reg() == FPREG); |
| 425 ASSERT(source.stack_index() < 0); | 425 ASSERT(source.stack_index() < 0); |
| 426 __ Move(destination.reg(), -kParamEndSlotFromFp + source.stack_index()); | 426 __ Move(destination.reg(), -kParamEndSlotFromFp + source.stack_index()); |
| 427 } else if (source.IsRegister() && destination.IsRegister()) { | 427 } else if (source.IsRegister() && destination.IsRegister()) { |
| 428 __ Move(destination.reg(), source.reg()); | 428 __ Move(destination.reg(), source.reg()); |
| 429 } else if (source.IsConstant() && destination.IsRegister()) { | 429 } else if (source.IsConstant() && destination.IsRegister()) { |
| 430 __ LoadConstant(destination.reg(), source.constant()); | 430 if (source.constant_instruction()->representation() == kUnboxedDouble) { |
| 431 const Register result = destination.reg(); |
| 432 const Object& constant = source.constant(); |
| 433 if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0)) { |
| 434 __ BitXor(result, result, result); |
| 435 } else { |
| 436 __ LoadConstant(result, constant); |
| 437 __ UnboxDouble(result, result); |
| 438 } |
| 439 } else { |
| 440 __ LoadConstant(destination.reg(), source.constant()); |
| 441 } |
| 431 } else { | 442 } else { |
| 432 compiler_->Bailout("Unsupported move"); | 443 compiler_->Bailout("Unsupported move"); |
| 433 UNREACHABLE(); | 444 UNREACHABLE(); |
| 434 } | 445 } |
| 435 | 446 |
| 436 move->Eliminate(); | 447 move->Eliminate(); |
| 437 } | 448 } |
| 438 | 449 |
| 439 | 450 |
| 440 void ParallelMoveResolver::EmitSwap(int index) { | 451 void ParallelMoveResolver::EmitSwap(int index) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 531 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 521 UNIMPLEMENTED(); | 532 UNIMPLEMENTED(); |
| 522 } | 533 } |
| 523 | 534 |
| 524 | 535 |
| 525 #undef __ | 536 #undef __ |
| 526 | 537 |
| 527 } // namespace dart | 538 } // namespace dart |
| 528 | 539 |
| 529 #endif // defined TARGET_ARCH_DBC | 540 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |