OLD | NEW |
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 #ifndef V8_MODULES_H_ | 5 #ifndef V8_MODULES_H_ |
6 #define V8_MODULES_H_ | 6 #define V8_MODULES_H_ |
7 | 7 |
8 #include "src/zone.h" | 8 #include "src/zone.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ZoneHashMap* exports = exports_; | 51 ZoneHashMap* exports = exports_; |
52 return exports ? exports->occupancy() : 0; | 52 return exports ? exports->occupancy() : 0; |
53 } | 53 } |
54 | 54 |
55 // The context slot in the hosting script context pointing to this module. | 55 // The context slot in the hosting script context pointing to this module. |
56 int Index() { | 56 int Index() { |
57 DCHECK(IsFrozen()); | 57 DCHECK(IsFrozen()); |
58 return index_; | 58 return index_; |
59 } | 59 } |
60 | 60 |
| 61 const AstRawString* LookupLocalExport(const AstRawString* export_name, |
| 62 Zone* zone); |
| 63 |
61 // --------------------------------------------------------------------------- | 64 // --------------------------------------------------------------------------- |
62 // Iterators. | 65 // Iterators. |
63 | 66 |
64 // Use like: | 67 // Use like: |
65 // for (auto it = descriptor->iterator(); !it.done(); it.Advance()) { | 68 // for (auto it = descriptor->iterator(); !it.done(); it.Advance()) { |
66 // ... it.name() ... | 69 // ... it.name() ... |
67 // } | 70 // } |
68 class Iterator { | 71 class Iterator { |
69 public: | 72 public: |
70 bool done() const { return entry_ == NULL; } | 73 bool done() const { return entry_ == NULL; } |
(...skipping 24 matching lines...) Expand all Loading... |
95 bool frozen_; | 98 bool frozen_; |
96 ZoneHashMap* exports_; // Module exports and their types (allocated lazily) | 99 ZoneHashMap* exports_; // Module exports and their types (allocated lazily) |
97 int index_; | 100 int index_; |
98 | 101 |
99 ModuleDescriptor() : frozen_(false), exports_(NULL), index_(-1) {} | 102 ModuleDescriptor() : frozen_(false), exports_(NULL), index_(-1) {} |
100 }; | 103 }; |
101 | 104 |
102 } } // namespace v8::internal | 105 } } // namespace v8::internal |
103 | 106 |
104 #endif // V8_MODULES_H_ | 107 #endif // V8_MODULES_H_ |
OLD | NEW |