OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 reg = AllocateFreeRegister(blocked_registers); | 544 reg = AllocateFreeRegister(blocked_registers); |
545 } | 545 } |
546 locs->set_in(i, Location::RegisterLocation(reg)); | 546 locs->set_in(i, Location::RegisterLocation(reg)); |
547 } | 547 } |
548 | 548 |
549 Pop(reg, instr->InputAt(i)); | 549 Pop(reg, instr->InputAt(i)); |
550 } | 550 } |
551 | 551 |
552 // If this instruction is call spill everything that was not consumed by | 552 // If this instruction is call spill everything that was not consumed by |
553 // input locations. | 553 // input locations. |
554 if (locs->is_call() || locs->is_branch()) { | 554 if (locs->is_call() || instr->IsBranch()) { |
555 Spill(); | 555 Spill(); |
556 } | 556 } |
557 | 557 |
558 // Allocate all unallocated temp locations. | 558 // Allocate all unallocated temp locations. |
559 for (intptr_t i = 0; i < locs->temp_count(); i++) { | 559 for (intptr_t i = 0; i < locs->temp_count(); i++) { |
560 Location loc = locs->temp(i); | 560 Location loc = locs->temp(i); |
561 if (loc.kind() == Location::kUnallocated) { | 561 if (loc.kind() == Location::kUnallocated) { |
562 ASSERT(loc.policy() == Location::kRequiresRegister); | 562 ASSERT(loc.policy() == Location::kRequiresRegister); |
563 loc = Location::RegisterLocation( | 563 loc = Location::RegisterLocation( |
564 AllocateFreeRegister(blocked_registers)); | 564 AllocateFreeRegister(blocked_registers)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 623 |
624 | 624 |
625 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { | 625 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { |
626 for (int i = 0; i < stack_.length(); i++) { | 626 for (int i = 0; i < stack_.length(); i++) { |
627 stub->Push(stack_[i]); | 627 stub->Push(stack_[i]); |
628 } | 628 } |
629 } | 629 } |
630 | 630 |
631 | 631 |
632 } // namespace dart | 632 } // namespace dart |
OLD | NEW |