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

Side by Side Diff: src/objects.h

Issue 2473993002: [modules] Make handling of module info's regular exports more robust. (Closed)
Patch Set: cast size_t Created 4 years, 1 month 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/factory.cc ('k') | src/objects.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 8088 matching lines...) Expand 10 before | Expand all | Expand 10 after
8099 8099
8100 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone, 8100 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone,
8101 ModuleDescriptor* descr); 8101 ModuleDescriptor* descr);
8102 8102
8103 inline FixedArray* module_requests() const; 8103 inline FixedArray* module_requests() const;
8104 inline FixedArray* special_exports() const; 8104 inline FixedArray* special_exports() const;
8105 inline FixedArray* regular_exports() const; 8105 inline FixedArray* regular_exports() const;
8106 inline FixedArray* namespace_imports() const; 8106 inline FixedArray* namespace_imports() const;
8107 inline FixedArray* regular_imports() const; 8107 inline FixedArray* regular_imports() const;
8108 8108
8109 // Accessors for [regular_exports].
8110 int RegularExportCount() const;
8111 String* RegularExportLocalName(int i) const;
8112 int RegularExportCellIndex(int i) const;
8113 FixedArray* RegularExportExportNames(int i) const;
8114
8109 static Handle<ModuleInfoEntry> LookupRegularImport(Handle<ModuleInfo> info, 8115 static Handle<ModuleInfoEntry> LookupRegularImport(Handle<ModuleInfo> info,
8110 Handle<String> local_name); 8116 Handle<String> local_name);
8111 8117
8112 #ifdef DEBUG 8118 #ifdef DEBUG
8113 inline bool Equals(ModuleInfo* other) const; 8119 inline bool Equals(ModuleInfo* other) const;
8114 #endif 8120 #endif
8115 8121
8116 private: 8122 private:
8117 friend class Factory; 8123 friend class Factory;
8124 friend class ModuleDescriptor;
8118 enum { 8125 enum {
8119 kModuleRequestsIndex, 8126 kModuleRequestsIndex,
8120 kSpecialExportsIndex, 8127 kSpecialExportsIndex,
8121 kRegularExportsIndex, 8128 kRegularExportsIndex,
8122 kNamespaceImportsIndex, 8129 kNamespaceImportsIndex,
8123 kRegularImportsIndex, 8130 kRegularImportsIndex,
8124 kLength 8131 kLength
8125 }; 8132 };
8133 enum {
8134 kRegularExportLocalNameOffset,
8135 kRegularExportCellIndexOffset,
8136 kRegularExportExportNamesOffset,
8137 kRegularExportLength
8138 };
8126 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfo); 8139 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfo);
8127 }; 8140 };
8128 // When importing a module namespace (import * as foo from "bar"), a 8141 // When importing a module namespace (import * as foo from "bar"), a
8129 // JSModuleNamespace object (representing module "bar") is created and bound to 8142 // JSModuleNamespace object (representing module "bar") is created and bound to
8130 // the declared variable (foo). A module can have at most one namespace object. 8143 // the declared variable (foo). A module can have at most one namespace object.
8131 class JSModuleNamespace : public JSObject { 8144 class JSModuleNamespace : public JSObject {
8132 public: 8145 public:
8133 DECLARE_CAST(JSModuleNamespace) 8146 DECLARE_CAST(JSModuleNamespace)
8134 DECLARE_PRINTER(JSModuleNamespace) 8147 DECLARE_PRINTER(JSModuleNamespace)
8135 DECLARE_VERIFIER(JSModuleNamespace) 8148 DECLARE_VERIFIER(JSModuleNamespace)
(...skipping 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
11772 } 11785 }
11773 return value; 11786 return value;
11774 } 11787 }
11775 }; 11788 };
11776 11789
11777 11790
11778 } // NOLINT, false-positive due to second-order macros. 11791 } // NOLINT, false-positive due to second-order macros.
11779 } // NOLINT, false-positive due to second-order macros. 11792 } // NOLINT, false-positive due to second-order macros.
11780 11793
11781 #endif // V8_OBJECTS_H_ 11794 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698