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

Side by Side Diff: src/objects.h

Issue 2964943002: [wasm] Introduce instance types for WebAssembly.* objects. (Closed)
Patch Set: Address rossberg comments. Created 3 years, 5 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/heap/heap.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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // - JSWeakSet 66 // - JSWeakSet
67 // - JSRegExp 67 // - JSRegExp
68 // - JSFunction 68 // - JSFunction
69 // - JSGeneratorObject 69 // - JSGeneratorObject
70 // - JSGlobalObject 70 // - JSGlobalObject
71 // - JSGlobalProxy 71 // - JSGlobalProxy
72 // - JSValue 72 // - JSValue
73 // - JSDate 73 // - JSDate
74 // - JSMessageObject 74 // - JSMessageObject
75 // - JSModuleNamespace 75 // - JSModuleNamespace
76 // - WasmInstanceObject
77 // - WasmMemoryObject
78 // - WasmModuleObject
79 // - WasmTableObject
76 // - JSProxy 80 // - JSProxy
77 // - FixedArrayBase 81 // - FixedArrayBase
78 // - ByteArray 82 // - ByteArray
79 // - BytecodeArray 83 // - BytecodeArray
80 // - FixedArray 84 // - FixedArray
81 // - DescriptorArray 85 // - DescriptorArray
82 // - FrameArray 86 // - FrameArray
83 // - HashTable 87 // - HashTable
84 // - Dictionary 88 // - Dictionary
85 // - StringTable 89 // - StringTable
86 // - StringSet 90 // - StringSet
87 // - CompilationCacheTable 91 // - CompilationCacheTable
88 // - CodeCacheHashTable 92 // - CodeCacheHashTable
89 // - MapCache 93 // - MapCache
90 // - OrderedHashTable 94 // - OrderedHashTable
91 // - OrderedHashSet 95 // - OrderedHashSet
92 // - OrderedHashMap 96 // - OrderedHashMap
93 // - Context 97 // - Context
94 // - FeedbackMetadata 98 // - FeedbackMetadata
95 // - FeedbackVector 99 // - FeedbackVector
96 // - TemplateList 100 // - TemplateList
97 // - TransitionArray 101 // - TransitionArray
98 // - ScopeInfo 102 // - ScopeInfo
99 // - ModuleInfo 103 // - ModuleInfo
100 // - ScriptContextTable 104 // - ScriptContextTable
101 // - WeakFixedArray 105 // - WeakFixedArray
106 // - WasmSharedModuleData
107 // - WasmCompiledModule
102 // - FixedDoubleArray 108 // - FixedDoubleArray
103 // - Name 109 // - Name
104 // - String 110 // - String
105 // - SeqString 111 // - SeqString
106 // - SeqOneByteString 112 // - SeqOneByteString
107 // - SeqTwoByteString 113 // - SeqTwoByteString
108 // - SlicedString 114 // - SlicedString
109 // - ConsString 115 // - ConsString
110 // - ThinString 116 // - ThinString
111 // - ExternalString 117 // - ExternalString
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 V(JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE) \ 444 V(JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE) \
439 \ 445 \
440 V(JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE) \ 446 V(JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE) \
441 V(JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE) \ 447 V(JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE) \
442 V(JS_FAST_ARRAY_VALUE_ITERATOR_TYPE) \ 448 V(JS_FAST_ARRAY_VALUE_ITERATOR_TYPE) \
443 V(JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE) \ 449 V(JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE) \
444 V(JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \ 450 V(JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \
445 V(JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \ 451 V(JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE) \
446 V(JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE) \ 452 V(JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE) \
447 \ 453 \
454 V(WASM_INSTANCE_TYPE) \
455 V(WASM_MEMORY_TYPE) \
456 V(WASM_MODULE_TYPE) \
457 V(WASM_TABLE_TYPE) \
448 V(JS_BOUND_FUNCTION_TYPE) \ 458 V(JS_BOUND_FUNCTION_TYPE) \
449 V(JS_FUNCTION_TYPE) 459 V(JS_FUNCTION_TYPE)
450 460
451 // Since string types are not consecutive, this macro is used to 461 // Since string types are not consecutive, this macro is used to
452 // iterate over them. 462 // iterate over them.
453 #define STRING_TYPE_LIST(V) \ 463 #define STRING_TYPE_LIST(V) \
454 V(STRING_TYPE, kVariableSizeSentinel, string, String) \ 464 V(STRING_TYPE, kVariableSizeSentinel, string, String) \
455 V(ONE_BYTE_STRING_TYPE, kVariableSizeSentinel, one_byte_string, \ 465 V(ONE_BYTE_STRING_TYPE, kVariableSizeSentinel, one_byte_string, \
456 OneByteString) \ 466 OneByteString) \
457 V(CONS_STRING_TYPE, ConsString::kSize, cons_string, ConsString) \ 467 V(CONS_STRING_TYPE, ConsString::kSize, cons_string, ConsString) \
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE, 801 JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE,
792 802
793 JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE, 803 JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE,
794 JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE, 804 JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE,
795 JS_FAST_ARRAY_VALUE_ITERATOR_TYPE, 805 JS_FAST_ARRAY_VALUE_ITERATOR_TYPE,
796 JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE, 806 JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE,
797 JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE, 807 JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE,
798 JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE, 808 JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE,
799 JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE, 809 JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE,
800 810
811 WASM_INSTANCE_TYPE,
812 WASM_MEMORY_TYPE,
813 WASM_MODULE_TYPE,
814 WASM_TABLE_TYPE,
801 JS_BOUND_FUNCTION_TYPE, 815 JS_BOUND_FUNCTION_TYPE,
802 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE 816 JS_FUNCTION_TYPE, // LAST_JS_OBJECT_TYPE, LAST_JS_RECEIVER_TYPE
803 817
804 // Pseudo-types 818 // Pseudo-types
805 FIRST_TYPE = 0x0, 819 FIRST_TYPE = 0x0,
806 LAST_TYPE = JS_FUNCTION_TYPE, 820 LAST_TYPE = JS_FUNCTION_TYPE,
807 FIRST_NAME_TYPE = FIRST_TYPE, 821 FIRST_NAME_TYPE = FIRST_TYPE,
808 LAST_NAME_TYPE = SYMBOL_TYPE, 822 LAST_NAME_TYPE = SYMBOL_TYPE,
809 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE, 823 FIRST_UNIQUE_NAME_TYPE = INTERNALIZED_STRING_TYPE,
810 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE, 824 LAST_UNIQUE_NAME_TYPE = SYMBOL_TYPE,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 V(JSDate) \ 1060 V(JSDate) \
1047 V(JSError) \ 1061 V(JSError) \
1048 V(JSFunction) \ 1062 V(JSFunction) \
1049 V(JSGeneratorObject) \ 1063 V(JSGeneratorObject) \
1050 V(JSGlobalObject) \ 1064 V(JSGlobalObject) \
1051 V(JSGlobalProxy) \ 1065 V(JSGlobalProxy) \
1052 V(JSMap) \ 1066 V(JSMap) \
1053 V(JSMapIterator) \ 1067 V(JSMapIterator) \
1054 V(JSMessageObject) \ 1068 V(JSMessageObject) \
1055 V(JSModuleNamespace) \ 1069 V(JSModuleNamespace) \
1070 V(WasmInstanceObject) \
1071 V(WasmMemoryObject) \
1072 V(WasmModuleObject) \
1073 V(WasmTableObject) \
1056 V(JSObject) \ 1074 V(JSObject) \
1057 V(JSPromise) \ 1075 V(JSPromise) \
1058 V(JSPromiseCapability) \ 1076 V(JSPromiseCapability) \
1059 V(JSProxy) \ 1077 V(JSProxy) \
1060 V(JSReceiver) \ 1078 V(JSReceiver) \
1061 V(JSRegExp) \ 1079 V(JSRegExp) \
1062 V(JSSet) \ 1080 V(JSSet) \
1063 V(JSSetIterator) \ 1081 V(JSSetIterator) \
1064 V(JSSloppyArgumentsObject) \ 1082 V(JSSloppyArgumentsObject) \
1065 V(JSStringIterator) \ 1083 V(JSStringIterator) \
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 // Support functions for v8 api (needed for correct interceptor behavior). 2400 // Support functions for v8 api (needed for correct interceptor behavior).
2383 MUST_USE_RESULT static Maybe<bool> HasRealNamedProperty( 2401 MUST_USE_RESULT static Maybe<bool> HasRealNamedProperty(
2384 Handle<JSObject> object, Handle<Name> name); 2402 Handle<JSObject> object, Handle<Name> name);
2385 MUST_USE_RESULT static Maybe<bool> HasRealElementProperty( 2403 MUST_USE_RESULT static Maybe<bool> HasRealElementProperty(
2386 Handle<JSObject> object, uint32_t index); 2404 Handle<JSObject> object, uint32_t index);
2387 MUST_USE_RESULT static Maybe<bool> HasRealNamedCallbackProperty( 2405 MUST_USE_RESULT static Maybe<bool> HasRealNamedCallbackProperty(
2388 Handle<JSObject> object, Handle<Name> name); 2406 Handle<JSObject> object, Handle<Name> name);
2389 2407
2390 // Get the header size for a JSObject. Used to compute the index of 2408 // Get the header size for a JSObject. Used to compute the index of
2391 // embedder fields as well as the number of embedder fields. 2409 // embedder fields as well as the number of embedder fields.
2392 static inline int GetHeaderSize(InstanceType instance_type); 2410 static int GetHeaderSize(InstanceType instance_type);
2393 inline int GetHeaderSize(); 2411 inline int GetHeaderSize();
2394 2412
2395 static inline int GetEmbedderFieldCount(const Map* map); 2413 static inline int GetEmbedderFieldCount(const Map* map);
2396 inline int GetEmbedderFieldCount() const; 2414 inline int GetEmbedderFieldCount() const;
2397 inline int GetEmbedderFieldOffset(int index); 2415 inline int GetEmbedderFieldOffset(int index);
2398 inline Object* GetEmbedderField(int index); 2416 inline Object* GetEmbedderField(int index);
2399 inline void SetEmbedderField(int index, Object* value); 2417 inline void SetEmbedderField(int index, Object* value);
2400 inline void SetEmbedderField(int index, Smi* value); 2418 inline void SetEmbedderField(int index, Smi* value);
2401 bool WasConstructedFromApiFunction(); 2419 bool WasConstructedFromApiFunction();
2402 2420
(...skipping 4934 matching lines...) Expand 10 before | Expand all | Expand 10 after
7337 } 7355 }
7338 }; 7356 };
7339 7357
7340 7358
7341 } // NOLINT, false-positive due to second-order macros. 7359 } // NOLINT, false-positive due to second-order macros.
7342 } // NOLINT, false-positive due to second-order macros. 7360 } // NOLINT, false-positive due to second-order macros.
7343 7361
7344 #include "src/objects/object-macros-undef.h" 7362 #include "src/objects/object-macros-undef.h"
7345 7363
7346 #endif // V8_OBJECTS_H_ 7364 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698