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

Side by Side Diff: src/modules.h

Issue 960793003: Allow lookup of module exports by export name. (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 | « no previous file | src/modules.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 #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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698