Chromium Code Reviews| Index: src/arm/codegen-arm.cc |
| =================================================================== |
| --- src/arm/codegen-arm.cc (revision 5865) |
| +++ src/arm/codegen-arm.cc (working copy) |
| @@ -3103,10 +3103,13 @@ |
| void CodeGenerator::InstantiateFunction( |
| - Handle<SharedFunctionInfo> function_info) { |
| + Handle<SharedFunctionInfo> function_info, |
| + bool pretenure) { |
|
Søren Thygesen Gjesse
2010/11/19 13:31:04
bool -> PretenureFlag?
Mads Ager (chromium)
2010/11/22 09:56:24
Right. I didn't find a better way of doing this. I
|
| // 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(Operand(function_info)); |
| frame_->SpillAll(); |
| @@ -3116,7 +3119,10 @@ |
| // Create a new closure. |
| frame_->EmitPush(cp); |
| frame_->EmitPush(Operand(function_info)); |
| - frame_->CallRuntime(Runtime::kNewClosure, 2); |
| + frame_->EmitPush(Operand(pretenure |
| + ? Factory::true_value() |
| + : Factory::false_value())); |
| + frame_->CallRuntime(Runtime::kNewClosure, 3); |
| frame_->EmitPush(r0); |
| } |
| } |
| @@ -3136,7 +3142,7 @@ |
| ASSERT(frame_->height() == original_height); |
| return; |
| } |
| - InstantiateFunction(function_info); |
| + InstantiateFunction(function_info, node->pretenure()); |
| ASSERT_EQ(original_height + 1, frame_->height()); |
| } |
| @@ -3147,7 +3153,7 @@ |
| int original_height = frame_->height(); |
| #endif |
| Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); |
| - InstantiateFunction(node->shared_function_info()); |
| + InstantiateFunction(node->shared_function_info(), false); |
| ASSERT_EQ(original_height + 1, frame_->height()); |
| } |