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

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

Issue 12335102: Compile and simulate first dart function on arm generated from ast. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 668
669 void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) { 669 void FlowGraphCompiler::AllocateRegistersLocally(Instruction* instr) {
670 ASSERT(!is_optimizing()); 670 ASSERT(!is_optimizing());
671 671
672 LocationSummary* locs = instr->locs(); 672 LocationSummary* locs = instr->locs();
673 673
674 bool blocked_registers[kNumberOfCpuRegisters]; 674 bool blocked_registers[kNumberOfCpuRegisters];
675 675
676 // Mark all available registers free. 676 // Mark all available registers free.
677 for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) { 677 for (intptr_t i = 0; i < kFirstFreeCpuRegister; i++) {
678 blocked_registers[i] = true;
679 }
680 for (intptr_t i = kFirstFreeCpuRegister; i <= kLastFreeCpuRegister; i++) {
678 blocked_registers[i] = false; 681 blocked_registers[i] = false;
679 } 682 }
683 for (intptr_t i = kLastFreeCpuRegister + 1; i < kNumberOfCpuRegisters; i++) {
684 blocked_registers[i] = true;
685 }
680 686
681 // Mark all fixed input, temp and output registers as used. 687 // Mark all fixed input, temp and output registers as used.
682 for (intptr_t i = 0; i < locs->input_count(); i++) { 688 for (intptr_t i = 0; i < locs->input_count(); i++) {
683 Location loc = locs->in(i); 689 Location loc = locs->in(i);
684 if (loc.IsRegister()) { 690 if (loc.IsRegister()) {
685 ASSERT(!blocked_registers[loc.reg()]); 691 ASSERT(!blocked_registers[loc.reg()]);
686 blocked_registers[loc.reg()] = true; 692 blocked_registers[loc.reg()] = true;
687 } 693 }
688 } 694 }
689 695
(...skipping 11 matching lines...) Expand all
701 blocked_registers[locs->out().reg()] = true; 707 blocked_registers[locs->out().reg()] = true;
702 } 708 }
703 709
704 // Do not allocate known registers. 710 // Do not allocate known registers.
705 blocked_registers[CTX] = true; 711 blocked_registers[CTX] = true;
706 blocked_registers[SPREG] = true; 712 blocked_registers[SPREG] = true;
707 blocked_registers[FPREG] = true; 713 blocked_registers[FPREG] = true;
708 if (TMP != kNoRegister) { 714 if (TMP != kNoRegister) {
709 blocked_registers[TMP] = true; 715 blocked_registers[TMP] = true;
710 } 716 }
717 if (PP != kNoRegister) {
718 blocked_registers[PP] = true;
719 }
711 720
712 // Allocate all unallocated input locations. 721 // Allocate all unallocated input locations.
713 const bool should_pop = !instr->IsPushArgument(); 722 const bool should_pop = !instr->IsPushArgument();
714 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) { 723 for (intptr_t i = locs->input_count() - 1; i >= 0; i--) {
715 Location loc = locs->in(i); 724 Location loc = locs->in(i);
716 Register reg = kNoRegister; 725 Register reg = kNoRegister;
717 if (loc.IsRegister()) { 726 if (loc.IsRegister()) {
718 reg = loc.reg(); 727 reg = loc.reg();
719 } else if (loc.IsUnallocated() || loc.IsConstant()) { 728 } else if (loc.IsUnallocated() || loc.IsConstant()) {
720 ASSERT(loc.IsConstant() || 729 ASSERT(loc.IsConstant() ||
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 if (i != largest_ix) { 1008 if (i != largest_ix) {
1000 // Swap. 1009 // Swap.
1001 CidTarget temp = (*sorted)[i]; 1010 CidTarget temp = (*sorted)[i];
1002 (*sorted)[i] = (*sorted)[largest_ix]; 1011 (*sorted)[i] = (*sorted)[largest_ix];
1003 (*sorted)[largest_ix] = temp; 1012 (*sorted)[largest_ix] = temp;
1004 } 1013 }
1005 } 1014 }
1006 } 1015 }
1007 1016
1008 } // namespace dart 1017 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698