summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/map.h')
-rw-r--r--deps/v8/src/objects/map.h61
1 files changed, 22 insertions, 39 deletions
diff --git a/deps/v8/src/objects/map.h b/deps/v8/src/objects/map.h
index e31bb9a51f..83e5dfa365 100644
--- a/deps/v8/src/objects/map.h
+++ b/deps/v8/src/objects/map.h
@@ -68,9 +68,12 @@ enum InstanceType : uint16_t;
V(Symbol) \
V(SyntheticModule) \
V(TransitionArray) \
+ IF_WASM(V, WasmArray) \
+ IF_WASM(V, WasmExportedFunctionData) \
+ IF_WASM(V, WasmFunctionData) \
IF_WASM(V, WasmIndirectFunctionTable) \
IF_WASM(V, WasmInstanceObject) \
- IF_WASM(V, WasmArray) \
+ IF_WASM(V, WasmJSFunctionData) \
IF_WASM(V, WasmStruct) \
IF_WASM(V, WasmTypeInfo) \
V(WeakCell)
@@ -148,8 +151,7 @@ using MapHandles = std::vector<Handle<Map>>;
// | Byte | [bit_field2] |
// | | - new_target_is_base (bit 0) |
// | | - is_immutable_proto (bit 1) |
-// | | - unused bit (bit 2) |
-// | | - elements_kind (bits 3..7) |
+// | | - elements_kind (bits 2..7) |
// +----+----------+-------------------------------------------------+
// | Int | [bit_field3] |
// | | - enum_length (bit 0..9) |
@@ -211,8 +213,8 @@ class Map : public HeapObject {
static const int kNoConstructorFunctionIndex = 0;
inline int GetConstructorFunctionIndex() const;
inline void SetConstructorFunctionIndex(int value);
- static MaybeHandle<JSFunction> GetConstructorFunction(
- Handle<Map> map, Handle<Context> native_context);
+ static base::Optional<JSFunction> GetConstructorFunction(
+ Map map, Context native_context);
// Retrieve interceptors.
DECL_GETTER(GetNamedInterceptor, InterceptorInfo)
@@ -244,7 +246,12 @@ class Map : public HeapObject {
//
// Bit field.
//
+ // The setter in this pair calls the relaxed setter if concurrent marking is
+ // on, or performs the write non-atomically if it's off. The read is always
+ // non-atomically. This is done to have wider TSAN coverage on the cases where
+ // it's possible.
DECL_PRIMITIVE_ACCESSORS(bit_field, byte)
+
// Atomic accessors, used for allowlisting legitimate concurrent accesses.
DECL_PRIMITIVE_ACCESSORS(relaxed_bit_field, byte)
@@ -266,8 +273,14 @@ class Map : public HeapObject {
//
// Bit field 3.
//
+ // {bit_field3} calls the relaxed accessors if concurrent marking is on, or
+ // performs the read/write non-atomically if it's off. This is done to have
+ // wider TSAN coverage on the cases where it's possible.
DECL_PRIMITIVE_ACCESSORS(bit_field3, uint32_t)
+ DECL_PRIMITIVE_ACCESSORS(relaxed_bit_field3, uint32_t)
+ DECL_PRIMITIVE_ACCESSORS(release_acquire_bit_field3, uint32_t)
+
// Clear uninitialized padding space. This ensures that the snapshot content
// is deterministic. Depending on the V8 build mode there could be no padding.
V8_INLINE void clear_padding();
@@ -402,6 +415,8 @@ class Map : public HeapObject {
inline bool has_fast_sloppy_arguments_elements() const;
inline bool has_fast_string_wrapper_elements() const;
inline bool has_typed_array_elements() const;
+ inline bool has_rab_gsab_typed_array_elements() const;
+ inline bool has_typed_array_or_rab_gsab_typed_array_elements() const;
inline bool has_dictionary_elements() const;
inline bool has_any_nonextensible_elements() const;
inline bool has_nonextensible_elements() const;
@@ -488,18 +503,11 @@ class Map : public HeapObject {
bool InstancesNeedRewriting(Map target, int target_number_of_fields,
int target_inobject, int target_unused,
int* old_number_of_fields) const;
- V8_WARN_UNUSED_RESULT static Handle<FieldType> GeneralizeFieldType(
- Representation rep1, Handle<FieldType> type1, Representation rep2,
- Handle<FieldType> type2, Isolate* isolate);
- static void GeneralizeField(Isolate* isolate, Handle<Map> map,
- InternalIndex modify_index,
- PropertyConstness new_constness,
- Representation new_representation,
- Handle<FieldType> new_field_type);
// Returns true if the |field_type| is the most general one for
// given |representation|.
static inline bool IsMostGeneralFieldType(Representation representation,
FieldType field_type);
+ static inline bool FieldTypeIsCleared(Representation rep, FieldType type);
// Generalizes representation and field_type if objects with given
// instance type can have fast elements that can be transitioned by
@@ -554,6 +562,7 @@ class Map : public HeapObject {
// and with the Wasm type info for WebAssembly object maps.
DECL_ACCESSORS(constructor_or_back_pointer, Object)
DECL_ACCESSORS(native_context, NativeContext)
+ DECL_ACCESSORS(native_context_or_null, Object)
DECL_ACCESSORS(wasm_type_info, WasmTypeInfo)
DECL_GETTER(GetConstructor, Object)
DECL_GETTER(GetFunctionTemplateInfo, FunctionTemplateInfo)
@@ -716,10 +725,6 @@ class Map : public HeapObject {
Isolate* isolate, Handle<Map> map, Handle<Name> name,
InternalIndex descriptor, Handle<Object> getter, Handle<Object> setter,
PropertyAttributes attributes);
- V8_EXPORT_PRIVATE static Handle<Map> ReconfigureExistingProperty(
- Isolate* isolate, Handle<Map> map, InternalIndex descriptor,
- PropertyKind kind, PropertyAttributes attributes,
- PropertyConstness constness);
inline void AppendDescriptor(Isolate* isolate, Descriptor* desc);
@@ -912,28 +917,6 @@ class Map : public HeapObject {
void ReplaceDescriptors(Isolate* isolate, DescriptorArray new_descriptors);
- // Update field type of the given descriptor to new representation and new
- // type. The type must be prepared for storing in descriptor array:
- // it must be either a simple type or a map wrapped in a weak cell.
- void UpdateFieldType(Isolate* isolate, InternalIndex descriptor_number,
- Handle<Name> name, PropertyConstness new_constness,
- Representation new_representation,
- const MaybeObjectHandle& new_wrapped_type);
-
- // TODO(ishell): Move to MapUpdater.
- void PrintReconfiguration(Isolate* isolate, FILE* file,
- InternalIndex modify_index, PropertyKind kind,
- PropertyAttributes attributes);
- // TODO(ishell): Move to MapUpdater.
- void PrintGeneralization(
- Isolate* isolate, FILE* file, const char* reason,
- InternalIndex modify_index, int split, int descriptors,
- bool constant_to_field, Representation old_representation,
- Representation new_representation, PropertyConstness old_constness,
- PropertyConstness new_constness, MaybeHandle<FieldType> old_field_type,
- MaybeHandle<Object> old_value, MaybeHandle<FieldType> new_field_type,
- MaybeHandle<Object> new_value);
-
// This is the equivalent of IsMap() but avoids reading the instance type so
// it can be used concurrently without acquire load.
V8_INLINE bool ConcurrentIsMap(PtrComprCageBase cage_base,