Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: runtime/vm/flow_graph_compiler.cc

Issue 10909169: Add support for WritableRegister policy in the register allocator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't use non-volatile EBX in a test Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 } 648 }
649 649
650 // Allocate all unallocated input locations. 650 // Allocate all unallocated input locations.
651 const bool should_pop = !instr->IsPushArgument(); 651 const bool should_pop = !instr->IsPushArgument();
652 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { 652 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) {
653 Location loc = locs->in(i); 653 Location loc = locs->in(i);
654 Register reg = kNoRegister; 654 Register reg = kNoRegister;
655 if (loc.IsRegister()) { 655 if (loc.IsRegister()) {
656 reg = loc.reg(); 656 reg = loc.reg();
657 } else if (loc.IsUnallocated()) { 657 } else if (loc.IsUnallocated()) {
658 ASSERT(loc.policy() == Location::kRequiresRegister); 658 ASSERT((loc.policy() == Location::kRequiresRegister) ||
659 (loc.policy() == Location::kWritableRegister));
659 reg = AllocateFreeRegister(blocked_registers); 660 reg = AllocateFreeRegister(blocked_registers);
660 locs->set_in(i, Location::RegisterLocation(reg)); 661 locs->set_in(i, Location::RegisterLocation(reg));
661 } 662 }
662 663
663 // Inputs are consumed from the simulated frame. In case of a call argument 664 // Inputs are consumed from the simulated frame. In case of a call argument
664 // we leave it until the call instruction. 665 // we leave it until the call instruction.
665 if (should_pop) { 666 if (should_pop) {
666 assembler()->PopRegister(reg); 667 assembler()->PopRegister(reg);
667 } 668 }
668 } 669 }
669 670
670 // Allocate all unallocated temp locations. 671 // Allocate all unallocated temp locations.
671 for (intptr_t i = 0; i < locs->temp_count(); i++) { 672 for (intptr_t i = 0; i < locs->temp_count(); i++) {
672 Location loc = locs->temp(i); 673 Location loc = locs->temp(i);
673 if (loc.IsUnallocated()) { 674 if (loc.IsUnallocated()) {
674 ASSERT(loc.policy() == Location::kRequiresRegister); 675 ASSERT(loc.policy() == Location::kRequiresRegister);
675 loc = Location::RegisterLocation( 676 loc = Location::RegisterLocation(
676 AllocateFreeRegister(blocked_registers)); 677 AllocateFreeRegister(blocked_registers));
677 locs->set_temp(i, loc); 678 locs->set_temp(i, loc);
678 } 679 }
679 } 680 }
680 681
681 Location result_location = locs->out(); 682 Location result_location = locs->out();
682 if (result_location.IsUnallocated()) { 683 if (result_location.IsUnallocated()) {
683 switch (result_location.policy()) { 684 switch (result_location.policy()) {
684 case Location::kAny: 685 case Location::kAny:
685 case Location::kPrefersRegister: 686 case Location::kPrefersRegister:
686 case Location::kRequiresRegister: 687 case Location::kRequiresRegister:
688 case Location::kWritableRegister:
687 result_location = Location::RegisterLocation( 689 result_location = Location::RegisterLocation(
688 AllocateFreeRegister(blocked_registers)); 690 AllocateFreeRegister(blocked_registers));
689 break; 691 break;
690 case Location::kSameAsFirstInput: 692 case Location::kSameAsFirstInput:
691 result_location = locs->in(0); 693 result_location = locs->in(0);
692 break; 694 break;
693 case Location::kRequiresXmmRegister: 695 case Location::kRequiresXmmRegister:
694 UNREACHABLE(); 696 UNREACHABLE();
695 break; 697 break;
696 } 698 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 case ABOVE: return unsigned_left > unsigned_right; 845 case ABOVE: return unsigned_left > unsigned_right;
844 case ABOVE_EQUAL: return unsigned_left >= unsigned_right; 846 case ABOVE_EQUAL: return unsigned_left >= unsigned_right;
845 default: 847 default:
846 UNIMPLEMENTED(); 848 UNIMPLEMENTED();
847 return false; 849 return false;
848 } 850 }
849 } 851 }
850 852
851 853
852 } // namespace dart 854 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_allocator.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698