diff options
Diffstat (limited to 'deps/v8/src/objects/heap-object.h')
-rw-r--r-- | deps/v8/src/objects/heap-object.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/deps/v8/src/objects/heap-object.h b/deps/v8/src/objects/heap-object.h index 3214135e48..759cda3cab 100644 --- a/deps/v8/src/objects/heap-object.h +++ b/deps/v8/src/objects/heap-object.h @@ -60,8 +60,8 @@ class HeapObject : public Object { // Compare-and-swaps map word using release store, returns true if the map // word was actually swapped. - inline bool release_compare_and_swap_map_word(MapWord old_map_word, - MapWord new_map_word); + inline bool release_compare_and_swap_map_word_forwarded( + MapWord old_map_word, HeapObject new_target_object); // Initialize the map immediately after the object is allocated. // Do not use this outside Heap. @@ -71,11 +71,13 @@ class HeapObject : public Object { // During garbage collection, the map word of a heap object does not // necessarily contain a map pointer. DECL_RELAXED_GETTER(map_word, MapWord) - inline void set_map_word(MapWord map_word, RelaxedStoreTag); + inline void set_map_word(Map map, RelaxedStoreTag); + inline void set_map_word_forwarded(HeapObject target_object, RelaxedStoreTag); // Access the map word using acquire load and release store. DECL_ACQUIRE_GETTER(map_word, MapWord) - inline void set_map_word(MapWord map_word, ReleaseStoreTag); + inline void set_map_word(Map map, ReleaseStoreTag); + inline void set_map_word_forwarded(HeapObject target_object, ReleaseStoreTag); // This method exists to help remove GetIsolate/GetHeap from HeapObject, in a // way that doesn't require passing Isolate/Heap down huge call chains or to @@ -84,12 +86,16 @@ class HeapObject : public Object { // This version is intended to be used for the isolate values produced by // i::GetPtrComprCageBase(HeapObject) function which may return nullptr. inline ReadOnlyRoots GetReadOnlyRoots(PtrComprCageBase cage_base) const; + // This is slower, but safe to call during bootstrapping. + inline ReadOnlyRoots EarlyGetReadOnlyRoots() const; // Whether the object is in the RO heap and the RO heap is shared, or in the // writable shared heap. - V8_INLINE bool InSharedHeap() const; + V8_INLINE bool InAnySharedSpace() const; - V8_INLINE bool InSharedWritableHeap() const; + V8_INLINE bool InWritableSharedSpace() const; + + V8_INLINE bool InReadOnlySpace() const; #define IS_TYPE_FUNCTION_DECL(Type) \ V8_INLINE bool Is##Type() const; \ @@ -97,18 +103,17 @@ class HeapObject : public Object { HEAP_OBJECT_TYPE_LIST(IS_TYPE_FUNCTION_DECL) IS_TYPE_FUNCTION_DECL(HashTableBase) IS_TYPE_FUNCTION_DECL(SmallOrderedHashTable) - IS_TYPE_FUNCTION_DECL(CodeT) #undef IS_TYPE_FUNCTION_DECL // Oddball checks are faster when they are raw pointer comparisons, so the // isolate/read-only roots overloads should be preferred where possible. -#define IS_TYPE_FUNCTION_DECL(Type, Value) \ +#define IS_TYPE_FUNCTION_DECL(Type, Value, _) \ V8_INLINE bool Is##Type(Isolate* isolate) const; \ V8_INLINE bool Is##Type(LocalIsolate* isolate) const; \ V8_INLINE bool Is##Type(ReadOnlyRoots roots) const; \ V8_INLINE bool Is##Type() const; ODDBALL_LIST(IS_TYPE_FUNCTION_DECL) - IS_TYPE_FUNCTION_DECL(NullOrUndefined, /* unused */) + IS_TYPE_FUNCTION_DECL(NullOrUndefined, , /* unused */) #undef IS_TYPE_FUNCTION_DECL #define DECL_STRUCT_PREDICATE(NAME, Name, name) \ @@ -117,6 +122,8 @@ class HeapObject : public Object { STRUCT_LIST(DECL_STRUCT_PREDICATE) #undef DECL_STRUCT_PREDICATE + V8_INLINE bool IsJSObjectThatCanBeTrackedAsPrototype() const; + // Converts an address to a HeapObject pointer. static inline HeapObject FromAddress(Address address) { DCHECK_TAG_ALIGNED(address); |