Index: src/ia32/codegen-ia32.cc |
diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc |
index ae544dc63b211ac43ea618e7d1ecde9178e2daaa..538361fa51c05a5da31eca949a385c434948103c 100644 |
--- a/src/ia32/codegen-ia32.cc |
+++ b/src/ia32/codegen-ia32.cc |
@@ -5360,10 +5360,21 @@ void CodeGenerator::VisitVariableProxy(VariableProxy* node) { |
void CodeGenerator::VisitLiteral(Literal* node) { |
Comment cmnt(masm_, "[ Literal"); |
- if (in_safe_int32_mode()) { |
- frame_->PushUntaggedElement(node->handle()); |
+ if (frame_->ConstantPoolOverflowed()) { |
+ Result temp = allocator_->Allocate(); |
+ ASSERT(temp.is_valid()); |
+ if (node->handle()->IsSmi()) { |
+ __ Set(temp.reg(), Immediate(Smi::cast(*node->handle()))); |
+ } else { |
+ __ mov(temp.reg(), node->handle()); |
+ } |
+ frame_->Push(&temp); |
fschneider
2011/02/25 19:01:02
You may need to check for in_safe_int32_mode() her
|
} else { |
- frame_->Push(node->handle()); |
+ if (in_safe_int32_mode()) { |
+ frame_->PushUntaggedElement(node->handle()); |
+ } else { |
+ frame_->Push(node->handle()); |
+ } |
} |
} |