| Index: src/full-codegen.cc
|
| diff --git a/src/full-codegen.cc b/src/full-codegen.cc
|
| index 8aa763405aba574ef234f31999e8ae694f295382..96e0e8b200a55991cb2179a092f6e9286ce331e6 100644
|
| --- a/src/full-codegen.cc
|
| +++ b/src/full-codegen.cc
|
| @@ -818,9 +818,19 @@ void FullCodeGenerator::VisitBlock(Block* stmt) {
|
| if (stmt->block_scope() != NULL) {
|
| { Comment cmnt(masm_, "[ Extend block context");
|
| scope_ = stmt->block_scope();
|
| - __ Push(scope_->GetSerializedScopeInfo());
|
| + Handle<SerializedScopeInfo> scope_info = scope_->GetSerializedScopeInfo();
|
| + int heap_slots =
|
| + scope_info->NumberOfContextSlots() - Context::MIN_CONTEXT_SLOTS;
|
| + __ Push(scope_info);
|
| PushFunctionArgumentForContextAllocation(result_register());
|
| - __ CallRuntime(Runtime::kPushBlockContext, 2);
|
| + if (heap_slots <= FastNewBlockContextStub::kMaximumSlots) {
|
| + FastNewBlockContextStub stub(heap_slots);
|
| + __ CallStub(&stub);
|
| + } else {
|
| + __ CallRuntime(Runtime::kPushBlockContext, 2);
|
| + }
|
| +
|
| + // Replace the context stored in the frame.
|
| StoreToFrameField(StandardFrameConstants::kContextOffset,
|
| context_register());
|
| }
|
|
|