Commit 48406979 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Perform GetFieldIndexFor concurrently through Refs

Bug: v8:7790
Change-Id: I8ff80b109381b339864879e8e4e0dc0d5e418262
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2682636Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73074}
parent 63dc18c0
...@@ -3117,12 +3117,12 @@ FeedbackCellRef FeedbackVectorRef::GetClosureFeedbackCell(int index) const { ...@@ -3117,12 +3117,12 @@ FeedbackCellRef FeedbackVectorRef::GetClosureFeedbackCell(int index) const {
} }
ObjectRef JSObjectRef::RawFastPropertyAt(FieldIndex index) const { ObjectRef JSObjectRef::RawFastPropertyAt(FieldIndex index) const {
CHECK(index.is_inobject());
if (data_->should_access_heap()) { if (data_->should_access_heap()) {
return ObjectRef(broker(), broker()->CanonicalPersistentHandle( return ObjectRef(broker(), broker()->CanonicalPersistentHandle(
object()->RawFastPropertyAt(index))); object()->RawFastPropertyAt(index)));
} }
JSObjectData* object_data = data()->AsJSObject(); JSObjectData* object_data = data()->AsJSObject();
CHECK(index.is_inobject());
return ObjectRef(broker(), return ObjectRef(broker(),
object_data->GetInobjectField(index.property_index())); object_data->GetInobjectField(index.property_index()));
} }
...@@ -3167,12 +3167,16 @@ void JSObjectRef::EnsureElementsTenured() { ...@@ -3167,12 +3167,16 @@ void JSObjectRef::EnsureElementsTenured() {
FieldIndex MapRef::GetFieldIndexFor(InternalIndex descriptor_index) const { FieldIndex MapRef::GetFieldIndexFor(InternalIndex descriptor_index) const {
CHECK_LT(descriptor_index.as_int(), NumberOfOwnDescriptors()); CHECK_LT(descriptor_index.as_int(), NumberOfOwnDescriptors());
if (data_->should_access_heap()) { if (data_->should_access_heap() || FLAG_turbo_direct_heap_access) {
return FieldIndex::ForDescriptor(*object(), descriptor_index); FieldIndex result = FieldIndex::ForDescriptor(*object(), descriptor_index);
DCHECK(result.is_inobject());
return result;
} }
DescriptorArrayData* descriptors = DescriptorArrayData* descriptors =
data()->AsMap()->instance_descriptors()->AsDescriptorArray(); data()->AsMap()->instance_descriptors()->AsDescriptorArray();
return descriptors->GetFieldIndexFor(descriptor_index); FieldIndex result = descriptors->GetFieldIndexFor(descriptor_index);
DCHECK(result.is_inobject());
return result;
} }
int MapRef::GetInObjectPropertyOffset(int i) const { int MapRef::GetInObjectPropertyOffset(int i) 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