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

Unified Diff: runtime/vm/locations.cc

Issue 504143003: Support Int32 representation for selected binary operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/locations.cc
diff --git a/runtime/vm/locations.cc b/runtime/vm/locations.cc
index 0024b68028613d260aec6bb35ee5703cb8eb3d5c..c0ef26eb45da68f255f52516be7c44b94b312ef9 100644
--- a/runtime/vm/locations.cc
+++ b/runtime/vm/locations.cc
@@ -71,7 +71,7 @@ PairLocation* Location::AsPairLocation() const {
Location Location::RegisterOrConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafe(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::RequiresRegister();
}
@@ -79,7 +79,7 @@ Location Location::RegisterOrConstant(Value* value) {
Location Location::RegisterOrSmiConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::RequiresRegister();
}
@@ -87,7 +87,7 @@ Location Location::RegisterOrSmiConstant(Value* value) {
Location Location::WritableRegisterOrSmiConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::WritableRegister();
}
@@ -95,7 +95,7 @@ Location Location::WritableRegisterOrSmiConstant(Value* value) {
Location Location::FixedRegisterOrConstant(Value* value, Register reg) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafe(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::RegisterLocation(reg);
}
@@ -103,7 +103,7 @@ Location Location::FixedRegisterOrConstant(Value* value, Register reg) {
Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::RegisterLocation(reg);
}
@@ -111,7 +111,7 @@ Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
Location Location::AnyOrConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
return ((constant != NULL) && Assembler::IsSafe(constant->value()))
- ? Location::Constant(constant->value())
+ ? Location::Constant(constant)
: Location::Any();
}
@@ -140,6 +140,11 @@ intptr_t Location::ToStackSlotOffset() const {
}
+const Object& Location::constant() const {
+ return constant_instruction()->value();
+}
+
+
const char* Location::Name() const {
switch (kind()) {
case kInvalid: return "?";

Powered by Google App Engine
This is Rietveld 408576698