OLD | NEW |
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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 this); | 545 this); |
546 | 546 |
547 PrintF("}\n"); | 547 PrintF("}\n"); |
548 } | 548 } |
549 #endif // DEBUG | 549 #endif // DEBUG |
550 | 550 |
551 | 551 |
552 //--------------------------------------------------------------------------- | 552 //--------------------------------------------------------------------------- |
553 // ModuleInfo. | 553 // ModuleInfo. |
554 | 554 |
555 Handle<ModuleInfo> ModuleInfo::Create( | 555 Handle<ModuleInfo> ModuleInfo::Create(Isolate* isolate, |
556 Isolate* isolate, Interface* interface, Scope* scope) { | 556 ModuleDescriptor* descriptor, |
557 Handle<ModuleInfo> info = Allocate(isolate, interface->Length()); | 557 Scope* scope) { |
558 info->set_host_index(interface->Index()); | 558 Handle<ModuleInfo> info = Allocate(isolate, descriptor->Length()); |
| 559 info->set_host_index(descriptor->Index()); |
559 int i = 0; | 560 int i = 0; |
560 for (Interface::Iterator it = interface->iterator(); | 561 for (ModuleDescriptor::Iterator it = descriptor->iterator(); !it.done(); |
561 !it.done(); it.Advance(), ++i) { | 562 it.Advance(), ++i) { |
562 Variable* var = scope->LookupLocal(it.name()); | 563 Variable* var = scope->LookupLocal(it.name()); |
563 info->set_name(i, *(it.name()->string())); | 564 info->set_name(i, *(it.name()->string())); |
564 info->set_mode(i, var->mode()); | 565 info->set_mode(i, var->mode()); |
565 DCHECK(var->index() >= 0); | 566 DCHECK(var->index() >= 0); |
566 info->set_index(i, var->index()); | 567 info->set_index(i, var->index()); |
567 } | 568 } |
568 DCHECK(i == info->length()); | 569 DCHECK(i == info->length()); |
569 return info; | 570 return info; |
570 } | 571 } |
571 | 572 |
572 } } // namespace v8::internal | 573 } } // namespace v8::internal |
OLD | NEW |