OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast.h" | 5 #include "src/ast.h" |
6 #include "src/ast-numbering.h" | 6 #include "src/ast-numbering.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1541 FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded( | 1541 FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded( |
1542 FullCodeGenerator* codegen, Scope* scope, BailoutId entry_id, | 1542 FullCodeGenerator* codegen, Scope* scope, BailoutId entry_id, |
1543 BailoutId declarations_id, BailoutId exit_id) | 1543 BailoutId declarations_id, BailoutId exit_id) |
1544 : codegen_(codegen), exit_id_(exit_id) { | 1544 : codegen_(codegen), exit_id_(exit_id) { |
1545 saved_scope_ = codegen_->scope(); | 1545 saved_scope_ = codegen_->scope(); |
1546 | 1546 |
1547 if (scope == NULL) { | 1547 if (scope == NULL) { |
1548 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); | 1548 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); |
1549 needs_block_context_ = false; | 1549 needs_block_context_ = false; |
1550 } else { | 1550 } else { |
1551 needs_block_context_ = scope->ContextLocalCount() > 0; | 1551 needs_block_context_ = scope->NeedsContext(); |
1552 codegen_->scope_ = scope; | 1552 codegen_->scope_ = scope; |
1553 { | 1553 { |
1554 if (needs_block_context_) { | 1554 if (needs_block_context_) { |
1555 Comment cmnt(masm(), "[ Extend block context"); | 1555 Comment cmnt(masm(), "[ Extend block context"); |
1556 __ Push(scope->GetScopeInfo(codegen->isolate())); | 1556 __ Push(scope->GetScopeInfo(codegen->isolate())); |
1557 codegen_->PushFunctionArgumentForContextAllocation(); | 1557 codegen_->PushFunctionArgumentForContextAllocation(); |
1558 __ CallRuntime(Runtime::kPushBlockContext, 2); | 1558 __ CallRuntime(Runtime::kPushBlockContext, 2); |
1559 | 1559 |
1560 // Replace the context stored in the frame. | 1560 // Replace the context stored in the frame. |
1561 codegen_->StoreToFrameField(StandardFrameConstants::kContextOffset, | 1561 codegen_->StoreToFrameField(StandardFrameConstants::kContextOffset, |
(...skipping 22 matching lines...) Expand all Loading... |
1584 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1584 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1585 codegen_->scope_ = saved_scope_; | 1585 codegen_->scope_ = saved_scope_; |
1586 } | 1586 } |
1587 | 1587 |
1588 | 1588 |
1589 #undef __ | 1589 #undef __ |
1590 | 1590 |
1591 | 1591 |
1592 } // namespace internal | 1592 } // namespace internal |
1593 } // namespace v8 | 1593 } // namespace v8 |
OLD | NEW |