| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 void FullCodeGenerator::VisitBlock(Block* stmt) { | 809 void FullCodeGenerator::VisitBlock(Block* stmt) { |
| 810 Comment cmnt(masm_, "[ Block"); | 810 Comment cmnt(masm_, "[ Block"); |
| 811 NestedBlock nested_block(this, stmt); | 811 NestedBlock nested_block(this, stmt); |
| 812 SetStatementPosition(stmt); | 812 SetStatementPosition(stmt); |
| 813 | 813 |
| 814 Scope* saved_scope = scope(); | 814 Scope* saved_scope = scope(); |
| 815 // Push a block context when entering a block with block scoped variables. | 815 // Push a block context when entering a block with block scoped variables. |
| 816 if (stmt->block_scope() != NULL) { | 816 if (stmt->block_scope() != NULL) { |
| 817 { Comment cmnt(masm_, "[ Extend block context"); | 817 { Comment cmnt(masm_, "[ Extend block context"); |
| 818 scope_ = stmt->block_scope(); | 818 scope_ = stmt->block_scope(); |
| 819 Handle<SerializedScopeInfo> scope_info = scope_->GetSerializedScopeInfo(); | 819 Handle<ScopeInfo> scope_info = scope_->GetScopeInfo(); |
| 820 int heap_slots = | 820 int heap_slots = |
| 821 scope_info->NumberOfContextSlots() - Context::MIN_CONTEXT_SLOTS; | 821 scope_info->NumberOfContextSlots() - Context::MIN_CONTEXT_SLOTS; |
| 822 __ Push(scope_info); | 822 __ Push(scope_info); |
| 823 PushFunctionArgumentForContextAllocation(); | 823 PushFunctionArgumentForContextAllocation(); |
| 824 if (heap_slots <= FastNewBlockContextStub::kMaximumSlots) { | 824 if (heap_slots <= FastNewBlockContextStub::kMaximumSlots) { |
| 825 FastNewBlockContextStub stub(heap_slots); | 825 FastNewBlockContextStub stub(heap_slots); |
| 826 __ CallStub(&stub); | 826 __ CallStub(&stub); |
| 827 } else { | 827 } else { |
| 828 __ CallRuntime(Runtime::kPushBlockContext, 2); | 828 __ CallRuntime(Runtime::kPushBlockContext, 2); |
| 829 } | 829 } |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 return false; | 1331 return false; |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 | 1334 |
| 1335 #undef __ | 1335 #undef __ |
| 1336 | 1336 |
| 1337 | 1337 |
| 1338 } } // namespace v8::internal | 1338 } } // namespace v8::internal |
| OLD | NEW |