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

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

Issue 12776006: Make allocation of Dart parameters and local variables architecture independent. (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/locations.h" 5 #include "vm/locations.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/il_printer.h" 8 #include "vm/il_printer.h"
9 #include "vm/intermediate_language.h" 9 #include "vm/intermediate_language.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ConstantInstr* constant = value->definition()->AsConstant(); 82 ConstantInstr* constant = value->definition()->AsConstant();
83 return (constant != NULL) 83 return (constant != NULL)
84 ? Location::Constant(constant->value()) 84 ? Location::Constant(constant->value())
85 : Location::Any(); 85 : Location::Any();
86 } 86 }
87 87
88 88
89 Address Location::ToStackSlotAddress() const { 89 Address Location::ToStackSlotAddress() const {
90 const intptr_t index = stack_index(); 90 const intptr_t index = stack_index();
91 if (index < 0) { 91 if (index < 0) {
92 const intptr_t offset = (1 - index) * kWordSize; 92 const intptr_t offset = (kLastParamSlotIndex - index - 1) * kWordSize;
93 return Address(FPREG, offset); 93 return Address(FPREG, offset);
94 } else { 94 } else {
95 const intptr_t offset = 95 const intptr_t offset = (kFirstLocalSlotIndex - index) * kWordSize;
96 (ParsedFunction::kFirstLocalSlotIndex - index) * kWordSize;
97 return Address(FPREG, offset); 96 return Address(FPREG, offset);
98 } 97 }
99 } 98 }
100 99
101 100
102 const char* Location::Name() const { 101 const char* Location::Name() const {
103 switch (kind()) { 102 switch (kind()) {
104 case kInvalid: return "?"; 103 case kInvalid: return "?";
105 case kRegister: return Assembler::RegisterName(reg()); 104 case kRegister: return Assembler::RegisterName(reg());
106 case kFpuRegister: return Assembler::FpuRegisterName(fpu_reg()); 105 case kFpuRegister: return Assembler::FpuRegisterName(fpu_reg());
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 170
172 if (!out().IsInvalid()) { 171 if (!out().IsInvalid()) {
173 f->Print(" => "); 172 f->Print(" => ");
174 out().PrintTo(f); 173 out().PrintTo(f);
175 } 174 }
176 175
177 if (always_calls()) f->Print(" C"); 176 if (always_calls()) f->Print(" C");
178 } 177 }
179 178
180 } // namespace dart 179 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698