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

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: Merged to trunk 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
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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 Handle<ModuleInfo> ModuleInfo::Create( 551 Handle<ModuleInfo> ModuleInfo::Create(
552 Isolate* isolate, Interface* interface, Scope* scope) { 552 Isolate* isolate, Interface* interface, Scope* scope) {
553 Handle<ModuleInfo> info = Allocate(isolate, interface->Length()); 553 Handle<ModuleInfo> info = Allocate(isolate, interface->Length());
554 info->set_host_index(interface->Index()); 554 info->set_host_index(interface->Index());
555 int i = 0; 555 int i = 0;
556 for (Interface::Iterator it = interface->iterator(); 556 for (Interface::Iterator it = interface->iterator();
557 !it.done(); it.Advance(), ++i) { 557 !it.done(); it.Advance(), ++i) {
558 Variable* var = scope->LookupLocal(it.name()); 558 Variable* var = scope->LookupLocal(it.name());
559 info->set_name(i, *(it.name()->string())); 559 info->set_name(i, *(it.name()->string()));
560 info->set_mode(i, var->mode()); 560 info->set_mode(i, var->mode());
561 DCHECK((var->mode() == MODULE) == (it.interface()->IsModule())); 561 DCHECK(var->index() >= 0);
562 if (var->mode() == MODULE) { 562 info->set_index(i, var->index());
563 DCHECK(it.interface()->IsFrozen());
564 DCHECK(it.interface()->Index() >= 0);
565 info->set_index(i, it.interface()->Index());
566 } else {
567 DCHECK(var->index() >= 0);
568 info->set_index(i, var->index());
569 }
570 } 563 }
571 DCHECK(i == info->length()); 564 DCHECK(i == info->length());
572 return info; 565 return info;
573 } 566 }
574 567
575 } } // namespace v8::internal 568 } } // namespace v8::internal
OLDNEW
« src/interface.cc ('K') | « src/scopeinfo.h ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698