Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index a55788d10668a6ee9a97d57d3789f4ed5e5867c8..050c0d657ef91fcfc476c870f3d3ce0b17241569 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -504,12 +504,20 @@ void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const { |
void FullCodeGenerator::AccumulatorValueContext::Plug( |
Handle<Object> lit) const { |
- __ Move(result_register(), lit); |
+ if (lit->IsSmi()) { |
+ __ SafeMove(result_register(), Smi::cast(*lit)); |
+ } else { |
+ __ Move(result_register(), lit); |
+ } |
} |
void FullCodeGenerator::StackValueContext::Plug(Handle<Object> lit) const { |
- __ Push(lit); |
+ if (lit->IsSmi()) { |
+ __ SafePush(Smi::cast(*lit)); |
+ } else { |
+ __ Push(lit); |
+ } |
} |