| OLD | NEW |
| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // - ModuleInfoEntry | 162 // - ModuleInfoEntry |
| 163 // - WeakCell | 163 // - WeakCell |
| 164 // | 164 // |
| 165 // Formats of Object*: | 165 // Formats of Object*: |
| 166 // Smi: [31 bit signed int] 0 | 166 // Smi: [31 bit signed int] 0 |
| 167 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 | 167 // HeapObject: [32 bit direct pointer] (4 byte aligned) | 01 |
| 168 | 168 |
| 169 namespace v8 { | 169 namespace v8 { |
| 170 namespace internal { | 170 namespace internal { |
| 171 | 171 |
| 172 class ModuleInfo; | |
| 173 struct InliningPosition; | 172 struct InliningPosition; |
| 174 | 173 |
| 175 enum KeyedAccessStoreMode { | 174 enum KeyedAccessStoreMode { |
| 176 STANDARD_STORE, | 175 STANDARD_STORE, |
| 177 STORE_TRANSITION_TO_OBJECT, | 176 STORE_TRANSITION_TO_OBJECT, |
| 178 STORE_TRANSITION_TO_DOUBLE, | 177 STORE_TRANSITION_TO_DOUBLE, |
| 179 STORE_AND_GROW_NO_TRANSITION, | 178 STORE_AND_GROW_NO_TRANSITION, |
| 180 STORE_AND_GROW_TRANSITION_TO_OBJECT, | 179 STORE_AND_GROW_TRANSITION_TO_OBJECT, |
| 181 STORE_AND_GROW_TRANSITION_TO_DOUBLE, | 180 STORE_AND_GROW_TRANSITION_TO_DOUBLE, |
| 182 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, | 181 STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS, |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 class TypeFeedbackInfo; | 976 class TypeFeedbackInfo; |
| 978 class TypeFeedbackMetadata; | 977 class TypeFeedbackMetadata; |
| 979 class TypeFeedbackVector; | 978 class TypeFeedbackVector; |
| 980 class WeakCell; | 979 class WeakCell; |
| 981 class TransitionArray; | 980 class TransitionArray; |
| 982 class TemplateList; | 981 class TemplateList; |
| 983 | 982 |
| 984 // A template-ized version of the IsXXX functions. | 983 // A template-ized version of the IsXXX functions. |
| 985 template <class C> inline bool Is(Object* obj); | 984 template <class C> inline bool Is(Object* obj); |
| 986 | 985 |
| 987 #ifdef VERIFY_HEAP | |
| 988 #define DECLARE_VERIFIER(Name) void Name##Verify(); | |
| 989 #else | |
| 990 #define DECLARE_VERIFIER(Name) | |
| 991 #endif | |
| 992 | |
| 993 #ifdef OBJECT_PRINT | 986 #ifdef OBJECT_PRINT |
| 994 #define DECLARE_PRINTER(Name) void Name##Print(std::ostream& os); // NOLINT | 987 #define DECLARE_PRINTER(Name) void Name##Print(std::ostream& os); // NOLINT |
| 995 #else | 988 #else |
| 996 #define DECLARE_PRINTER(Name) | 989 #define DECLARE_PRINTER(Name) |
| 997 #endif | 990 #endif |
| 998 | 991 |
| 999 #define OBJECT_TYPE_LIST(V) \ | 992 #define OBJECT_TYPE_LIST(V) \ |
| 1000 V(Smi) \ | 993 V(Smi) \ |
| 1001 V(LayoutDescriptor) \ | 994 V(LayoutDescriptor) \ |
| 1002 V(HeapObject) \ | 995 V(HeapObject) \ |
| (...skipping 6896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7899 static const int kInputOrDebugPosOffset = kReceiverOffset + kPointerSize; | 7892 static const int kInputOrDebugPosOffset = kReceiverOffset + kPointerSize; |
| 7900 static const int kResumeModeOffset = kInputOrDebugPosOffset + kPointerSize; | 7893 static const int kResumeModeOffset = kInputOrDebugPosOffset + kPointerSize; |
| 7901 static const int kContinuationOffset = kResumeModeOffset + kPointerSize; | 7894 static const int kContinuationOffset = kResumeModeOffset + kPointerSize; |
| 7902 static const int kRegisterFileOffset = kContinuationOffset + kPointerSize; | 7895 static const int kRegisterFileOffset = kContinuationOffset + kPointerSize; |
| 7903 static const int kSize = kRegisterFileOffset + kPointerSize; | 7896 static const int kSize = kRegisterFileOffset + kPointerSize; |
| 7904 | 7897 |
| 7905 private: | 7898 private: |
| 7906 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); | 7899 DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject); |
| 7907 }; | 7900 }; |
| 7908 | 7901 |
| 7909 class ModuleInfoEntry : public Struct { | |
| 7910 public: | |
| 7911 DECLARE_CAST(ModuleInfoEntry) | |
| 7912 DECLARE_PRINTER(ModuleInfoEntry) | |
| 7913 DECLARE_VERIFIER(ModuleInfoEntry) | |
| 7914 | |
| 7915 DECL_ACCESSORS(export_name, Object) | |
| 7916 DECL_ACCESSORS(local_name, Object) | |
| 7917 DECL_ACCESSORS(import_name, Object) | |
| 7918 DECL_INT_ACCESSORS(module_request) | |
| 7919 DECL_INT_ACCESSORS(cell_index) | |
| 7920 DECL_INT_ACCESSORS(beg_pos) | |
| 7921 DECL_INT_ACCESSORS(end_pos) | |
| 7922 | |
| 7923 static Handle<ModuleInfoEntry> New(Isolate* isolate, | |
| 7924 Handle<Object> export_name, | |
| 7925 Handle<Object> local_name, | |
| 7926 Handle<Object> import_name, | |
| 7927 int module_request, int cell_index, | |
| 7928 int beg_pos, int end_pos); | |
| 7929 | |
| 7930 static const int kExportNameOffset = HeapObject::kHeaderSize; | |
| 7931 static const int kLocalNameOffset = kExportNameOffset + kPointerSize; | |
| 7932 static const int kImportNameOffset = kLocalNameOffset + kPointerSize; | |
| 7933 static const int kModuleRequestOffset = kImportNameOffset + kPointerSize; | |
| 7934 static const int kCellIndexOffset = kModuleRequestOffset + kPointerSize; | |
| 7935 static const int kBegPosOffset = kCellIndexOffset + kPointerSize; | |
| 7936 static const int kEndPosOffset = kBegPosOffset + kPointerSize; | |
| 7937 static const int kSize = kEndPosOffset + kPointerSize; | |
| 7938 | |
| 7939 private: | |
| 7940 DISALLOW_IMPLICIT_CONSTRUCTORS(ModuleInfoEntry); | |
| 7941 }; | |
| 7942 | |
| 7943 // When importing a module namespace (import * as foo from "bar"), a | 7902 // When importing a module namespace (import * as foo from "bar"), a |
| 7944 // JSModuleNamespace object (representing module "bar") is created and bound to | 7903 // JSModuleNamespace object (representing module "bar") is created and bound to |
| 7945 // the declared variable (foo). A module can have at most one namespace object. | 7904 // the declared variable (foo). A module can have at most one namespace object. |
| 7946 class JSModuleNamespace : public JSObject { | 7905 class JSModuleNamespace : public JSObject { |
| 7947 public: | 7906 public: |
| 7948 DECLARE_CAST(JSModuleNamespace) | 7907 DECLARE_CAST(JSModuleNamespace) |
| 7949 DECLARE_PRINTER(JSModuleNamespace) | 7908 DECLARE_PRINTER(JSModuleNamespace) |
| 7950 DECLARE_VERIFIER(JSModuleNamespace) | 7909 DECLARE_VERIFIER(JSModuleNamespace) |
| 7951 | 7910 |
| 7952 // The actual module whose namespace is being represented. | 7911 // The actual module whose namespace is being represented. |
| (...skipping 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11569 static const int kSourcePositionIndex = Struct::kHeaderSize; | 11528 static const int kSourcePositionIndex = Struct::kHeaderSize; |
| 11570 static const int kBreakPointObjectsIndex = | 11529 static const int kBreakPointObjectsIndex = |
| 11571 kSourcePositionIndex + kPointerSize; | 11530 kSourcePositionIndex + kPointerSize; |
| 11572 static const int kSize = kBreakPointObjectsIndex + kPointerSize; | 11531 static const int kSize = kBreakPointObjectsIndex + kPointerSize; |
| 11573 | 11532 |
| 11574 private: | 11533 private: |
| 11575 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); | 11534 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo); |
| 11576 }; | 11535 }; |
| 11577 | 11536 |
| 11578 | 11537 |
| 11579 #undef DECL_BOOLEAN_ACCESSORS | |
| 11580 #undef DECL_ACCESSORS | |
| 11581 #undef DECLARE_CAST | |
| 11582 #undef DECLARE_VERIFIER | |
| 11583 | |
| 11584 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \ | 11538 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \ |
| 11585 V(kStringTable, "string_table", "(Internalized strings)") \ | 11539 V(kStringTable, "string_table", "(Internalized strings)") \ |
| 11586 V(kExternalStringsTable, "external_strings_table", "(External strings)") \ | 11540 V(kExternalStringsTable, "external_strings_table", "(External strings)") \ |
| 11587 V(kStrongRootList, "strong_root_list", "(Strong roots)") \ | 11541 V(kStrongRootList, "strong_root_list", "(Strong roots)") \ |
| 11588 V(kSmiRootList, "smi_root_list", "(Smi roots)") \ | 11542 V(kSmiRootList, "smi_root_list", "(Smi roots)") \ |
| 11589 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \ | 11543 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \ |
| 11590 V(kTop, "top", "(Isolate)") \ | 11544 V(kTop, "top", "(Isolate)") \ |
| 11591 V(kRelocatable, "relocatable", "(Relocatable)") \ | 11545 V(kRelocatable, "relocatable", "(Relocatable)") \ |
| 11592 V(kDebug, "debug", "(Debugger)") \ | 11546 V(kDebug, "debug", "(Debugger)") \ |
| 11593 V(kCompilationCache, "compilationcache", "(Compilation cache)") \ | 11547 V(kCompilationCache, "compilationcache", "(Compilation cache)") \ |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11696 } | 11650 } |
| 11697 }; | 11651 }; |
| 11698 | 11652 |
| 11699 | 11653 |
| 11700 } // NOLINT, false-positive due to second-order macros. | 11654 } // NOLINT, false-positive due to second-order macros. |
| 11701 } // NOLINT, false-positive due to second-order macros. | 11655 } // NOLINT, false-positive due to second-order macros. |
| 11702 | 11656 |
| 11703 #include "src/objects/object-macros-undef.h" | 11657 #include "src/objects/object-macros-undef.h" |
| 11704 | 11658 |
| 11705 #endif // V8_OBJECTS_H_ | 11659 #endif // V8_OBJECTS_H_ |
| OLD | NEW |