| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (TryIntrinsify()) { | 391 if (TryIntrinsify()) { |
| 392 // Skip regular code generation. | 392 // Skip regular code generation. |
| 393 return; | 393 return; |
| 394 } | 394 } |
| 395 | 395 |
| 396 EmitFrameEntry(); | 396 EmitFrameEntry(); |
| 397 VisitBlocks(); | 397 VisitBlocks(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 | 400 |
| 401 uint16_t FlowGraphCompiler::ToEmbeddableCid(intptr_t cid, |
| 402 Instruction* instruction) { |
| 403 if (!Utils::IsUint(16, cid)) { |
| 404 instruction->Unsupported(); |
| 405 UNREACHABLE(); |
| 406 } |
| 407 return static_cast<uint16_t>(cid); |
| 408 } |
| 409 |
| 410 |
| 401 #undef __ | 411 #undef __ |
| 402 #define __ compiler_->assembler()-> | 412 #define __ compiler_->assembler()-> |
| 403 | 413 |
| 404 | 414 |
| 405 void ParallelMoveResolver::EmitMove(int index) { | 415 void ParallelMoveResolver::EmitMove(int index) { |
| 406 MoveOperands* move = moves_[index]; | 416 MoveOperands* move = moves_[index]; |
| 407 const Location source = move->src(); | 417 const Location source = move->src(); |
| 408 const Location destination = move->dest(); | 418 const Location destination = move->dest(); |
| 409 if (source.IsStackSlot() && destination.IsRegister()) { | 419 if (source.IsStackSlot() && destination.IsRegister()) { |
| 410 // Only allow access to the arguments. | 420 // Only allow access to the arguments. |
| 411 ASSERT(source.base_reg() == FPREG); | 421 ASSERT(source.base_reg() == FPREG); |
| 412 ASSERT(source.stack_index() < 0); | 422 ASSERT(source.stack_index() < 0); |
| 413 __ Move(destination.reg(), -kParamEndSlotFromFp + source.stack_index()); | 423 __ Move(destination.reg(), -kParamEndSlotFromFp + source.stack_index()); |
| 414 } else if (source.IsRegister() && destination.IsRegister()) { | 424 } else if (source.IsRegister() && destination.IsRegister()) { |
| 415 __ Move(destination.reg(), source.reg()); | 425 __ Move(destination.reg(), source.reg()); |
| 416 } else if (source.IsConstant() && destination.IsRegister()) { | 426 } else if (source.IsConstant() && destination.IsRegister()) { |
| 417 __ LoadConstant(destination.reg(), source.constant()); | 427 __ LoadConstant(destination.reg(), source.constant()); |
| 418 } else { | 428 } else { |
| 419 compiler_->Bailout("Unsupported move"); | 429 compiler_->Bailout("Unsupported move"); |
| 430 UNREACHABLE(); |
| 420 } | 431 } |
| 421 | 432 |
| 422 move->Eliminate(); | 433 move->Eliminate(); |
| 423 } | 434 } |
| 424 | 435 |
| 425 | 436 |
| 426 void ParallelMoveResolver::EmitSwap(int index) { | 437 void ParallelMoveResolver::EmitSwap(int index) { |
| 427 MoveOperands* move = moves_[index]; | 438 MoveOperands* move = moves_[index]; |
| 428 const Location source = move->src(); | 439 const Location source = move->src(); |
| 429 const Location destination = move->dest(); | 440 const Location destination = move->dest(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 517 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 507 UNIMPLEMENTED(); | 518 UNIMPLEMENTED(); |
| 508 } | 519 } |
| 509 | 520 |
| 510 | 521 |
| 511 #undef __ | 522 #undef __ |
| 512 | 523 |
| 513 } // namespace dart | 524 } // namespace dart |
| 514 | 525 |
| 515 #endif // defined TARGET_ARCH_DBC | 526 #endif // defined TARGET_ARCH_DBC |
| OLD | NEW |