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

Side by Side Diff: src/scopeinfo.cc

Issue 918373002: Strip Interface class of most of its logic, make it all about Module exports (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Properly freeze interface at the end of ParseModule 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/scopeinfo.h ('k') | src/scopes.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/scopeinfo.h" 9 #include "src/scopeinfo.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 Handle<ModuleInfo> ModuleInfo::Create( 555 Handle<ModuleInfo> ModuleInfo::Create(
556 Isolate* isolate, Interface* interface, Scope* scope) { 556 Isolate* isolate, Interface* interface, Scope* scope) {
557 Handle<ModuleInfo> info = Allocate(isolate, interface->Length()); 557 Handle<ModuleInfo> info = Allocate(isolate, interface->Length());
558 info->set_host_index(interface->Index()); 558 info->set_host_index(interface->Index());
559 int i = 0; 559 int i = 0;
560 for (Interface::Iterator it = interface->iterator(); 560 for (Interface::Iterator it = interface->iterator();
561 !it.done(); it.Advance(), ++i) { 561 !it.done(); it.Advance(), ++i) {
562 Variable* var = scope->LookupLocal(it.name()); 562 Variable* var = scope->LookupLocal(it.name());
563 info->set_name(i, *(it.name()->string())); 563 info->set_name(i, *(it.name()->string()));
564 info->set_mode(i, var->mode()); 564 info->set_mode(i, var->mode());
565 DCHECK((var->mode() == MODULE) == (it.interface()->IsModule())); 565 DCHECK(var->index() >= 0);
566 if (var->mode() == MODULE) { 566 info->set_index(i, var->index());
567 DCHECK(it.interface()->IsFrozen());
568 DCHECK(it.interface()->Index() >= 0);
569 info->set_index(i, it.interface()->Index());
570 } else {
571 DCHECK(var->index() >= 0);
572 info->set_index(i, var->index());
573 }
574 } 567 }
575 DCHECK(i == info->length()); 568 DCHECK(i == info->length());
576 return info; 569 return info;
577 } 570 }
578 571
579 } } // namespace v8::internal 572 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scopeinfo.h ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698