Commit 8e735324 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Set/Get the Map's inobject properties start non-atomically

The property kInObjectPropertiesStartOrConstructorFunctionIndexOffset
was set as relaxed due to races with the layout_descriptor
(https://chromium-review.googlesource.com/c/v8/v8/+/555210/). The
layout_descriptor was removed with the removal of double field unboxing.

We are able to turn those property's accessors into non-atomic ones
since they are set at construction time.

Bug: v8:7790
Change-Id: I25c53f0e00718cca72ba86f8475af9ecefb7ba3d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843359
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74174}
parent 84e144fe
...@@ -3109,7 +3109,7 @@ FieldIndex MapRef::GetFieldIndexFor(InternalIndex descriptor_index) const { ...@@ -3109,7 +3109,7 @@ FieldIndex MapRef::GetFieldIndexFor(InternalIndex descriptor_index) const {
} }
int MapRef::GetInObjectPropertyOffset(int i) const { int MapRef::GetInObjectPropertyOffset(int i) const {
if (data_->should_access_heap()) { if (data_->should_access_heap() || broker()->is_concurrent_inlining()) {
return object()->GetInObjectPropertyOffset(i); return object()->GetInObjectPropertyOffset(i);
} }
return (GetInObjectPropertiesStartInWords() + i) * kTaggedSize; return (GetInObjectPropertiesStartInWords() + i) * kTaggedSize;
...@@ -3699,7 +3699,7 @@ bool MapRef::IsInobjectSlackTrackingInProgress() const { ...@@ -3699,7 +3699,7 @@ bool MapRef::IsInobjectSlackTrackingInProgress() const {
} }
int MapRef::constructor_function_index() const { int MapRef::constructor_function_index() const {
IF_ACCESS_FROM_HEAP_C(GetConstructorFunctionIndex); IF_ACCESS_FROM_HEAP_WITH_FLAG_C(GetConstructorFunctionIndex);
CHECK(IsPrimitiveMap()); CHECK(IsPrimitiveMap());
return data()->AsMap()->constructor_function_index(); return data()->AsMap()->constructor_function_index();
} }
...@@ -3721,7 +3721,7 @@ bool MapRef::CanTransition() const { ...@@ -3721,7 +3721,7 @@ bool MapRef::CanTransition() const {
} }
int MapRef::GetInObjectPropertiesStartInWords() const { int MapRef::GetInObjectPropertiesStartInWords() const {
IF_ACCESS_FROM_HEAP_C(GetInObjectPropertiesStartInWords); IF_ACCESS_FROM_HEAP_WITH_FLAG_C(GetInObjectPropertiesStartInWords);
return data()->AsMap()->in_object_properties_start_in_words(); return data()->AsMap()->in_object_properties_start_in_words();
} }
......
...@@ -277,16 +277,15 @@ void Map::set_instance_size(int value) { ...@@ -277,16 +277,15 @@ void Map::set_instance_size(int value) {
} }
int Map::inobject_properties_start_or_constructor_function_index() const { int Map::inobject_properties_start_or_constructor_function_index() const {
return RELAXED_READ_BYTE_FIELD( return ReadField<byte>(
*this, kInObjectPropertiesStartOrConstructorFunctionIndexOffset); kInObjectPropertiesStartOrConstructorFunctionIndexOffset);
} }
void Map::set_inobject_properties_start_or_constructor_function_index( void Map::set_inobject_properties_start_or_constructor_function_index(
int value) { int value) {
CHECK_LT(static_cast<unsigned>(value), 256); CHECK_LT(static_cast<unsigned>(value), 256);
RELAXED_WRITE_BYTE_FIELD( WriteField<byte>(kInObjectPropertiesStartOrConstructorFunctionIndexOffset,
*this, kInObjectPropertiesStartOrConstructorFunctionIndexOffset, static_cast<byte>(value));
static_cast<byte>(value));
} }
int Map::GetInObjectPropertiesStartInWords() const { int Map::GetInObjectPropertiesStartInWords() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment