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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 | 78 |
79 Location Location::RegisterOrSmiConstant(Value* value) { | 79 Location Location::RegisterOrSmiConstant(Value* value) { |
80 ConstantInstr* constant = value->definition()->AsConstant(); | 80 ConstantInstr* constant = value->definition()->AsConstant(); |
81 return ((constant != NULL) && Assembler::IsSafeSmi(constant->value())) | 81 return ((constant != NULL) && Assembler::IsSafeSmi(constant->value())) |
82 ? Location::Constant(constant->value()) | 82 ? Location::Constant(constant->value()) |
83 : Location::RequiresRegister(); | 83 : Location::RequiresRegister(); |
84 } | 84 } |
85 | 85 |
86 | 86 |
| 87 Location Location::WritableRegisterOrSmiConstant(Value* value) { |
| 88 ConstantInstr* constant = value->definition()->AsConstant(); |
| 89 return ((constant != NULL) && Assembler::IsSafeSmi(constant->value())) |
| 90 ? Location::Constant(constant->value()) |
| 91 : Location::WritableRegister(); |
| 92 } |
| 93 |
| 94 |
87 Location Location::FixedRegisterOrConstant(Value* value, Register reg) { | 95 Location Location::FixedRegisterOrConstant(Value* value, Register reg) { |
88 ConstantInstr* constant = value->definition()->AsConstant(); | 96 ConstantInstr* constant = value->definition()->AsConstant(); |
89 return ((constant != NULL) && Assembler::IsSafe(constant->value())) | 97 return ((constant != NULL) && Assembler::IsSafe(constant->value())) |
90 ? Location::Constant(constant->value()) | 98 ? Location::Constant(constant->value()) |
91 : Location::RegisterLocation(reg); | 99 : Location::RegisterLocation(reg); |
92 } | 100 } |
93 | 101 |
94 | 102 |
95 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { | 103 Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { |
96 ConstantInstr* constant = value->definition()->AsConstant(); | 104 ConstantInstr* constant = value->definition()->AsConstant(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 246 |
239 if (!out(0).IsInvalid()) { | 247 if (!out(0).IsInvalid()) { |
240 f->Print(" => "); | 248 f->Print(" => "); |
241 out(0).PrintTo(f); | 249 out(0).PrintTo(f); |
242 } | 250 } |
243 | 251 |
244 if (always_calls()) f->Print(" C"); | 252 if (always_calls()) f->Print(" C"); |
245 } | 253 } |
246 | 254 |
247 } // namespace dart | 255 } // namespace dart |
OLD | NEW |