Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 1c13e839fcadcbaee885eff59f06409cc4b7be52..0800823fdb3e2401d9cda7c6d34eb26fa7f1500a 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -561,29 +561,34 @@ LOperand* LChunkBuilder::UseAtStart(HValue* value) { |
} |
+static inline bool CanBeImmediateConstant(HValue* value) { |
+ return value->IsConstant() && HConstant::cast(value)->NotInNewSpace(); |
+} |
+ |
+ |
LOperand* LChunkBuilder::UseOrConstant(HValue* value) { |
- return value->IsConstant() |
+ return CanBeImmediateConstant(value) |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
: Use(value); |
} |
LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) { |
- return value->IsConstant() |
+ return CanBeImmediateConstant(value) |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
: UseAtStart(value); |
} |
LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) { |
- return value->IsConstant() |
+ return CanBeImmediateConstant(value) |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
: UseRegister(value); |
} |
LOperand* LChunkBuilder::UseRegisterOrConstantAtStart(HValue* value) { |
- return value->IsConstant() |
+ return CanBeImmediateConstant(value) |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
: UseRegisterAtStart(value); |
} |