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

Unified Diff: runtime/vm/locations.cc

Issue 48743002: Do not directly load smi constants larger than a 16 bit payload on ia32. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« runtime/vm/assembler_ia32.h ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/locations.cc
diff --git a/runtime/vm/locations.cc b/runtime/vm/locations.cc
index 265b198ff776454f23f39b9eea3c17dfe748f7db..e751ff963cbb34cd76800b1975017f2ff9b7ed3f 100644
--- a/runtime/vm/locations.cc
+++ b/runtime/vm/locations.cc
@@ -60,7 +60,7 @@ LocationSummary* LocationSummary::Make(
Location Location::RegisterOrConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
- return (constant != NULL)
+ return ((constant != NULL) && Assembler::IsSafe(constant->value()))
? Location::Constant(constant->value())
: Location::RequiresRegister();
}
@@ -68,7 +68,7 @@ Location Location::RegisterOrConstant(Value* value) {
Location Location::RegisterOrSmiConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
- return ((constant != NULL) && constant->value().IsSmi())
+ return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
? Location::Constant(constant->value())
: Location::RequiresRegister();
}
@@ -76,7 +76,7 @@ Location Location::RegisterOrSmiConstant(Value* value) {
Location Location::FixedRegisterOrConstant(Value* value, Register reg) {
ConstantInstr* constant = value->definition()->AsConstant();
- return (constant != NULL)
+ return ((constant != NULL) && Assembler::IsSafe(constant->value()))
? Location::Constant(constant->value())
: Location::RegisterLocation(reg);
}
@@ -84,7 +84,7 @@ Location Location::FixedRegisterOrConstant(Value* value, Register reg) {
Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
ConstantInstr* constant = value->definition()->AsConstant();
- return ((constant != NULL) && constant->value().IsSmi())
+ return ((constant != NULL) && Assembler::IsSafeSmi(constant->value()))
? Location::Constant(constant->value())
: Location::RegisterLocation(reg);
}
@@ -92,7 +92,7 @@ Location Location::FixedRegisterOrSmiConstant(Value* value, Register reg) {
Location Location::AnyOrConstant(Value* value) {
ConstantInstr* constant = value->definition()->AsConstant();
- return (constant != NULL)
+ return ((constant != NULL) && Assembler::IsSafe(constant->value()))
? Location::Constant(constant->value())
: Location::Any();
}
« runtime/vm/assembler_ia32.h ('K') | « runtime/vm/intermediate_language_ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698