Index: src/ia32/codegen-ia32.cc |
=================================================================== |
--- src/ia32/codegen-ia32.cc (revision 5865) |
+++ src/ia32/codegen-ia32.cc (working copy) |
@@ -4897,7 +4897,8 @@ |
Result CodeGenerator::InstantiateFunction( |
- Handle<SharedFunctionInfo> function_info) { |
+ Handle<SharedFunctionInfo> function_info, |
+ bool pretenure) { |
// The inevitable call will sync frame elements to memory anyway, so |
// we do it eagerly to allow us to push the arguments directly into |
// place. |
@@ -4905,7 +4906,9 @@ |
// Use the fast case closure allocation code that allocates in new |
// space for nested functions that don't need literals cloning. |
- if (scope()->is_function_scope() && function_info->num_literals() == 0) { |
+ if (scope()->is_function_scope() && |
+ function_info->num_literals() == 0 && |
+ !pretenure) { |
FastNewClosureStub stub; |
frame()->EmitPush(Immediate(function_info)); |
return frame()->CallStub(&stub, 1); |
@@ -4914,7 +4917,10 @@ |
// shared function info. |
frame()->EmitPush(esi); |
frame()->EmitPush(Immediate(function_info)); |
- return frame()->CallRuntime(Runtime::kNewClosure, 2); |
+ frame()->EmitPush(Immediate(pretenure |
+ ? Factory::true_value() |
+ : Factory::false_value())); |
+ return frame()->CallRuntime(Runtime::kNewClosure, 3); |
} |
} |
@@ -4930,7 +4936,7 @@ |
SetStackOverflow(); |
return; |
} |
- Result result = InstantiateFunction(function_info); |
+ Result result = InstantiateFunction(function_info, node->pretenure()); |
frame()->Push(&result); |
} |
@@ -4939,7 +4945,7 @@ |
SharedFunctionInfoLiteral* node) { |
ASSERT(!in_safe_int32_mode()); |
Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); |
- Result result = InstantiateFunction(node->shared_function_info()); |
+ Result result = InstantiateFunction(node->shared_function_info(), false); |
frame()->Push(&result); |
} |