Index: runtime/vm/locations.cc |
=================================================================== |
--- runtime/vm/locations.cc (revision 14796) |
+++ runtime/vm/locations.cc (working copy) |
@@ -53,6 +53,14 @@ |
} |
+Location Location::RegisterOrSmiConstant(Value* value) { |
+ ConstantInstr* constant = value->definition()->AsConstant(); |
+ return ((constant != NULL) && constant->value().IsSmi()) |
+ ? Location::Constant(constant->value()) |
+ : Location::RequiresRegister(); |
+} |
+ |
+ |
Location Location::FixedRegisterOrConstant(Value* value, Register reg) { |
ConstantInstr* constant = value->definition()->AsConstant(); |
return (constant != NULL) |
@@ -61,6 +69,14 @@ |
} |
+Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) { |
+ ConstantInstr* constant = value->definition()->AsConstant(); |
+ return ((constant != NULL) && constant->value().IsSmi()) |
+ ? Location::Constant(constant->value()) |
+ : Location::RegisterLocation(reg); |
+} |
+ |
+ |
const char* Location::Name() const { |
switch (kind()) { |
case kInvalid: return "?"; |