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

Side by Side Diff: src/objects.h

Issue 2623573003: objects.h splitting: move ModuleInfo (Closed)
Patch Set: ditto Created 3 years, 11 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 | « src/factory.cc ('k') | src/objects-inl.h » ('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
11 #include "src/assert-scope.h" 11 #include "src/assert-scope.h"
12 #include "src/bailout-reason.h" 12 #include "src/bailout-reason.h"
13 #include "src/base/bits.h" 13 #include "src/base/bits.h"
14 #include "src/base/flags.h" 14 #include "src/base/flags.h"
15 #include "src/builtins/builtins.h" 15 #include "src/builtins/builtins.h"
16 #include "src/checks.h" 16 #include "src/checks.h"
17 #include "src/elements-kind.h" 17 #include "src/elements-kind.h"
18 #include "src/field-index.h" 18 #include "src/field-index.h"
19 #include "src/flags.h" 19 #include "src/flags.h"
20 #include "src/list.h" 20 #include "src/list.h"
21 #include "src/messages.h" 21 #include "src/messages.h"
22 #include "src/objects/object-macros.h"
23 #include "src/property-details.h" 22 #include "src/property-details.h"
24 #include "src/unicode-decoder.h" 23 #include "src/unicode-decoder.h"
25 #include "src/unicode.h" 24 #include "src/unicode.h"
26 #include "src/zone/zone.h" 25 #include "src/zone/zone.h"
27 26
28 #if V8_TARGET_ARCH_ARM 27 #if V8_TARGET_ARCH_ARM
29 #include "src/arm/constants-arm.h" // NOLINT 28 #include "src/arm/constants-arm.h" // NOLINT
30 #elif V8_TARGET_ARCH_ARM64 29 #elif V8_TARGET_ARCH_ARM64
31 #include "src/arm64/constants-arm64.h" // NOLINT 30 #include "src/arm64/constants-arm64.h" // NOLINT
32 #elif V8_TARGET_ARCH_MIPS 31 #elif V8_TARGET_ARCH_MIPS
33 #include "src/mips/constants-mips.h" // NOLINT 32 #include "src/mips/constants-mips.h" // NOLINT
34 #elif V8_TARGET_ARCH_MIPS64 33 #elif V8_TARGET_ARCH_MIPS64
35 #include "src/mips64/constants-mips64.h" // NOLINT 34 #include "src/mips64/constants-mips64.h" // NOLINT
36 #elif V8_TARGET_ARCH_PPC 35 #elif V8_TARGET_ARCH_PPC
37 #include "src/ppc/constants-ppc.h" // NOLINT 36 #include "src/ppc/constants-ppc.h" // NOLINT
38 #elif V8_TARGET_ARCH_S390 37 #elif V8_TARGET_ARCH_S390
39 #include "src/s390/constants-s390.h" // NOLINT 38 #include "src/s390/constants-s390.h" // NOLINT
40 #endif 39 #endif
41 40
41 // Has to be the last include (doesn't have include guards):
42 #include "src/objects/object-macros.h"
42 43
43 // 44 //
44 // Most object types in the V8 JavaScript are described in this file. 45 // Most object types in the V8 JavaScript are described in this file.
45 // 46 //
46 // Inheritance hierarchy: 47 // Inheritance hierarchy:
47 // - Object 48 // - Object
48 // - Smi (immediate small integer) 49 // - Smi (immediate small integer)
49 // - HeapObject (superclass for everything allocated in the heap) 50 // - HeapObject (superclass for everything allocated in the heap)
50 // - JSReceiver (suitable for property access) 51 // - JSReceiver (suitable for property access)
51 // - JSObject 52 // - JSObject
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // - ModuleInfoEntry 162 // - ModuleInfoEntry
162 // - WeakCell 163 // - WeakCell
163 // 164 //
164 // Formats of Object*: 165 // Formats of Object*:
165 // Smi: [31 bit signed int] 0 166 // Smi: [31 bit signed int] 0
166 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 167 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01
167 168
168 namespace v8 { 169 namespace v8 {
169 namespace internal { 170 namespace internal {
170 171
172 class ModuleInfo;
171 struct InliningPosition; 173 struct InliningPosition;
172 174
173 enum KeyedAccessStoreMode { 175 enum KeyedAccessStoreMode {
174 STANDARD_STORE, 176 STANDARD_STORE,
175 STORE_TRANSITION_TO_OBJECT, 177 STORE_TRANSITION_TO_OBJECT,
176 STORE_TRANSITION_TO_DOUBLE, 178 STORE_TRANSITION_TO_DOUBLE,
177 STORE_AND_GROW_NO_TRANSITION, 179 STORE_AND_GROW_NO_TRANSITION,
178 STORE_AND_GROW_TRANSITION_TO_OBJECT, 180 STORE_AND_GROW_TRANSITION_TO_OBJECT,
179 STORE_AND_GROW_TRANSITION_TO_DOUBLE, 181 STORE_AND_GROW_TRANSITION_TO_DOUBLE,
180 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, 182 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS,
(...skipping 7774 matching lines...) Expand 10 before | Expand all | Expand 10 after
7955 static const int kModuleRequestOffset = kImportNameOffset + kPointerSize; 7957 static const int kModuleRequestOffset = kImportNameOffset + kPointerSize;
7956 static const int kCellIndexOffset = kModuleRequestOffset + kPointerSize; 7958 static const int kCellIndexOffset = kModuleRequestOffset + kPointerSize;
7957 static const int kBegPosOffset = kCellIndexOffset + kPointerSize; 7959 static const int kBegPosOffset = kCellIndexOffset + kPointerSize;
7958 static const int kEndPosOffset = kBegPosOffset + kPointerSize; 7960 static const int kEndPosOffset = kBegPosOffset + kPointerSize;
7959 static const int kSize = kEndPosOffset + kPointerSize; 7961 static const int kSize = kEndPosOffset + kPointerSize;
7960 7962
7961 private: 7963 private:
7962 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfoEntry); 7964 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfoEntry);
7963 }; 7965 };
7964 7966
7965 // ModuleInfo is to ModuleDescriptor what ScopeInfo is to Scope.
7966 class ModuleInfo : public FixedArray {
7967 public:
7968 DECLARE_CAST(ModuleInfo)
7969
7970 static Handle<ModuleInfo> New(Isolate* isolate, Zone* zone,
7971 ModuleDescriptor* descr);
7972
7973 inline FixedArray* module_requests() const;
7974 inline FixedArray* special_exports() const;
7975 inline FixedArray* regular_exports() const;
7976 inline FixedArray* namespace_imports() const;
7977 inline FixedArray* regular_imports() const;
7978
7979 // Accessors for [regular_exports].
7980 int RegularExportCount() const;
7981 String* RegularExportLocalName(int i) const;
7982 int RegularExportCellIndex(int i) const;
7983 FixedArray* RegularExportExportNames(int i) const;
7984
7985 static Handle<ModuleInfoEntry> LookupRegularImport(Handle<ModuleInfo> info,
7986 Handle<String> local_name);
7987
7988 #ifdef DEBUG
7989 inline bool Equals(ModuleInfo* other) const;
7990 #endif
7991
7992 private:
7993 friend class Factory;
7994 friend class ModuleDescriptor;
7995 enum {
7996 kModuleRequestsIndex,
7997 kSpecialExportsIndex,
7998 kRegularExportsIndex,
7999 kNamespaceImportsIndex,
8000 kRegularImportsIndex,
8001 kLength
8002 };
8003 enum {
8004 kRegularExportLocalNameOffset,
8005 kRegularExportCellIndexOffset,
8006 kRegularExportExportNamesOffset,
8007 kRegularExportLength
8008 };
8009 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfo);
8010 };
8011 // When importing a module namespace (import * as foo from "bar"), a 7967 // When importing a module namespace (import * as foo from "bar"), a
8012 // JSModuleNamespace object (representing module "bar") is created and bound to 7968 // JSModuleNamespace object (representing module "bar") is created and bound to
8013 // the declared variable (foo). A module can have at most one namespace object. 7969 // the declared variable (foo). A module can have at most one namespace object.
8014 class JSModuleNamespace : public JSObject { 7970 class JSModuleNamespace : public JSObject {
8015 public: 7971 public:
8016 DECLARE_CAST(JSModuleNamespace) 7972 DECLARE_CAST(JSModuleNamespace)
8017 DECLARE_PRINTER(JSModuleNamespace) 7973 DECLARE_PRINTER(JSModuleNamespace)
8018 DECLARE_VERIFIER(JSModuleNamespace) 7974 DECLARE_VERIFIER(JSModuleNamespace)
8019 7975
8020 // The actual module whose namespace is being represented. 7976 // The actual module whose namespace is being represented.
(...skipping 3735 matching lines...) Expand 10 before | Expand all | Expand 10 after
11756 } 11712 }
11757 }; 11713 };
11758 11714
11759 11715
11760 } // NOLINT, false-positive due to second-order macros. 11716 } // NOLINT, false-positive due to second-order macros.
11761 } // NOLINT, false-positive due to second-order macros. 11717 } // NOLINT, false-positive due to second-order macros.
11762 11718
11763 #include "src/objects/object-macros-undef.h" 11719 #include "src/objects/object-macros-undef.h"
11764 11720
11765 #endif // V8_OBJECTS_H_ 11721 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698