Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: src/full-codegen.cc

Issue 909093003: Parsing: Make Scope not know about Isolate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 Comment cmnt(masm_, "[ Link nested modules"); 615 Comment cmnt(masm_, "[ Link nested modules");
616 Scope* scope = module->body()->scope(); 616 Scope* scope = module->body()->scope();
617 Interface* interface = scope->interface(); 617 Interface* interface = scope->interface();
618 DCHECK(interface->IsModule() && interface->IsFrozen()); 618 DCHECK(interface->IsModule() && interface->IsFrozen());
619 619
620 interface->Allocate(scope->module_var()->index()); 620 interface->Allocate(scope->module_var()->index());
621 621
622 // Set up module context. 622 // Set up module context.
623 DCHECK(scope->interface()->Index() >= 0); 623 DCHECK(scope->interface()->Index() >= 0);
624 __ Push(Smi::FromInt(scope->interface()->Index())); 624 __ Push(Smi::FromInt(scope->interface()->Index()));
625 __ Push(scope->GetScopeInfo()); 625 __ Push(scope->GetScopeInfo(isolate()));
626 __ CallRuntime(Runtime::kPushModuleContext, 2); 626 __ CallRuntime(Runtime::kPushModuleContext, 2);
627 StoreToFrameField(StandardFrameConstants::kContextOffset, 627 StoreToFrameField(StandardFrameConstants::kContextOffset,
628 context_register()); 628 context_register());
629 629
630 AllocateModules(scope->declarations()); 630 AllocateModules(scope->declarations());
631 631
632 // Pop module context. 632 // Pop module context.
633 LoadContextField(context_register(), Context::PREVIOUS_INDEX); 633 LoadContextField(context_register(), Context::PREVIOUS_INDEX);
634 // Update local stack frame context field. 634 // Update local stack frame context field.
635 StoreToFrameField(StandardFrameConstants::kContextOffset, 635 StoreToFrameField(StandardFrameConstants::kContextOffset,
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 BailoutId declarations_id, BailoutId exit_id) 1794 BailoutId declarations_id, BailoutId exit_id)
1795 : codegen_(codegen), scope_(scope), exit_id_(exit_id) { 1795 : codegen_(codegen), scope_(scope), exit_id_(exit_id) {
1796 saved_scope_ = codegen_->scope(); 1796 saved_scope_ = codegen_->scope();
1797 1797
1798 if (scope == NULL) { 1798 if (scope == NULL) {
1799 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); 1799 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS);
1800 } else { 1800 } else {
1801 codegen_->scope_ = scope; 1801 codegen_->scope_ = scope;
1802 { 1802 {
1803 Comment cmnt(masm(), "[ Extend block context"); 1803 Comment cmnt(masm(), "[ Extend block context");
1804 __ Push(scope->GetScopeInfo()); 1804 __ Push(scope->GetScopeInfo(codegen->isolate()));
1805 codegen_->PushFunctionArgumentForContextAllocation(); 1805 codegen_->PushFunctionArgumentForContextAllocation();
1806 __ CallRuntime(Runtime::kPushBlockContext, 2); 1806 __ CallRuntime(Runtime::kPushBlockContext, 2);
1807 1807
1808 // Replace the context stored in the frame. 1808 // Replace the context stored in the frame.
1809 codegen_->StoreToFrameField(StandardFrameConstants::kContextOffset, 1809 codegen_->StoreToFrameField(StandardFrameConstants::kContextOffset,
1810 codegen_->context_register()); 1810 codegen_->context_register());
1811 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); 1811 codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS);
1812 } 1812 }
1813 { 1813 {
1814 Comment cmnt(masm(), "[ Declarations"); 1814 Comment cmnt(masm(), "[ Declarations");
(...skipping 14 matching lines...) Expand all
1829 } 1829 }
1830 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1830 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1831 codegen_->scope_ = saved_scope_; 1831 codegen_->scope_ = saved_scope_;
1832 } 1832 }
1833 1833
1834 1834
1835 #undef __ 1835 #undef __
1836 1836
1837 1837
1838 } } // namespace v8::internal 1838 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698