| OLD | NEW |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 ConstantInstr* constant = value->definition()->AsConstant(); | 83 ConstantInstr* constant = value->definition()->AsConstant(); |
| 84 return (constant != NULL) | 84 return (constant != NULL) |
| 85 ? Location::Constant(constant->value()) | 85 ? Location::Constant(constant->value()) |
| 86 : Location::Any(); | 86 : Location::Any(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 Address Location::ToStackSlotAddress() const { | 90 Address Location::ToStackSlotAddress() const { |
| 91 const intptr_t index = stack_index(); | 91 const intptr_t index = stack_index(); |
| 92 if (index < 0) { | 92 if (index < 0) { |
| 93 const intptr_t offset = (kLastParamSlotIndex - index - 1) * kWordSize; | 93 const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize; |
| 94 return Address(FPREG, offset); | 94 return Address(FPREG, offset); |
| 95 } else { | 95 } else { |
| 96 const intptr_t offset = (kFirstLocalSlotIndex - index) * kWordSize; | 96 const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize; |
| 97 return Address(FPREG, offset); | 97 return Address(FPREG, offset); |
| 98 } | 98 } |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 const char* Location::Name() const { | 102 const char* Location::Name() const { |
| 103 switch (kind()) { | 103 switch (kind()) { |
| 104 case kInvalid: return "?"; | 104 case kInvalid: return "?"; |
| 105 case kRegister: return Assembler::RegisterName(reg()); | 105 case kRegister: return Assembler::RegisterName(reg()); |
| 106 case kFpuRegister: return Assembler::FpuRegisterName(fpu_reg()); | 106 case kFpuRegister: return Assembler::FpuRegisterName(fpu_reg()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 if (!out().IsInvalid()) { | 173 if (!out().IsInvalid()) { |
| 174 f->Print(" => "); | 174 f->Print(" => "); |
| 175 out().PrintTo(f); | 175 out().PrintTo(f); |
| 176 } | 176 } |
| 177 | 177 |
| 178 if (always_calls()) f->Print(" C"); | 178 if (always_calls()) f->Print(" C"); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace dart | 181 } // namespace dart |
| OLD | NEW |