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

[cleanup] Specialize and clean up accesses

There were some accesses that could be specialized to Pointer
instead of Any.

Also updated the WriteBarrierKind to match. Any -> full barrier,
Pointer -> Pointer barrier, Signed -> no barrier.

There were some accesses that were not used, and therefore got deleted.

Bug: v8:9396
Change-Id: Ie249e6571080fa6e24d9022344775de679966144
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1733070Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63096}
parent f97a68bf
......@@ -31,18 +31,6 @@ FieldAccess AccessBuilder::ForExternalTaggedValue() {
return access;
}
// static
FieldAccess AccessBuilder::ForExternalUint8Value() {
FieldAccess access = {kUntaggedBase,
0,
MaybeHandle<Name>(),
MaybeHandle<Map>(),
TypeCache::Get()->kUint8,
MachineType::Uint8(),
kNoWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForMap() {
FieldAccess access = {
......@@ -94,10 +82,10 @@ FieldAccess AccessBuilder::ForBigIntLeastSignificantDigit64() {
// static
FieldAccess AccessBuilder::ForJSObjectPropertiesOrHash() {
FieldAccess access = {
kTaggedBase, JSObject::kPropertiesOrHashOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::Any(), MachineType::TypeCompressedTagged(),
kPointerWriteBarrier, LoadSensitivity::kCritical};
kTaggedBase, JSObject::kPropertiesOrHashOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::Any(), MachineType::TypeCompressedTagged(),
kFullWriteBarrier, LoadSensitivity::kCritical};
return access;
}
......@@ -172,8 +160,8 @@ FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {
FieldAccess access = {
kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::Any(), MachineType::TypeCompressedTagged(),
kFullWriteBarrier};
Type::Any(), MachineType::TypeCompressedTaggedPointer(),
kPointerWriteBarrier};
return access;
}
......@@ -182,7 +170,7 @@ FieldAccess AccessBuilder::ForJSFunctionContext() {
FieldAccess access = {
kTaggedBase, JSFunction::kContextOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::Internal(), MachineType::TypeCompressedTagged(),
Type::Internal(), MachineType::TypeCompressedTaggedPointer(),
kPointerWriteBarrier};
return access;
}
......@@ -325,7 +313,7 @@ FieldAccess AccessBuilder::ForJSAsyncFunctionObjectPromise() {
kTaggedBase, JSAsyncFunctionObject::kPromiseOffset,
Handle<Name>(), MaybeHandle<Map>(),
Type::OtherObject(), MachineType::TypeCompressedTaggedPointer(),
kFullWriteBarrier};
kPointerWriteBarrier};
return access;
}
......@@ -357,29 +345,20 @@ FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {
Handle<Name>(),
MaybeHandle<Map>(),
type_cache->kJSArrayLengthType,
MachineType::TypeCompressedTaggedSigned(),
MachineType::TypeCompressedTagged(),
kFullWriteBarrier};
if (IsDoubleElementsKind(elements_kind)) {
access.type = type_cache->kFixedDoubleArrayLengthType;
access.machine_type = MachineType::TypeCompressedTaggedSigned();
access.write_barrier_kind = kNoWriteBarrier;
} else if (IsFastElementsKind(elements_kind)) {
access.type = type_cache->kFixedArrayLengthType;
access.machine_type = MachineType::TypeCompressedTaggedSigned();
access.write_barrier_kind = kNoWriteBarrier;
}
return access;
}
// static
FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() {
FieldAccess access = {
kTaggedBase, JSArrayBuffer::kBackingStoreOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::OtherInternal(), MachineType::Pointer(),
kNoWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForJSArrayBufferBitField() {
FieldAccess access = {
......@@ -441,7 +420,7 @@ FieldAccess AccessBuilder::ForJSTypedArrayBasePointer() {
kTaggedBase, JSTypedArray::kBasePointerOffset,
MaybeHandle<Name>(), MaybeHandle<Map>(),
Type::OtherInternal(), MachineType::TypeCompressedTagged(),
kPointerWriteBarrier, LoadSensitivity::kCritical};
kFullWriteBarrier, LoadSensitivity::kCritical};
return access;
}
......@@ -746,20 +725,6 @@ FieldAccess AccessBuilder::ForExternalStringResourceData() {
return access;
}
// static
ElementAccess AccessBuilder::ForExternalOneByteStringCharacter() {
ElementAccess access = {kUntaggedBase, 0, TypeCache::Get()->kUint8,
MachineType::Uint8(), kNoWriteBarrier};
return access;
}
// static
ElementAccess AccessBuilder::ForExternalTwoByteStringCharacter() {
ElementAccess access = {kUntaggedBase, 0, TypeCache::Get()->kUint16,
MachineType::Uint16(), kNoWriteBarrier};
return access;
}
// static
ElementAccess AccessBuilder::ForSeqOneByteStringCharacter() {
ElementAccess access = {kTaggedBase, SeqOneByteString::kHeaderSize,
......@@ -776,26 +741,6 @@ ElementAccess AccessBuilder::ForSeqTwoByteStringCharacter() {
return access;
}
// static
FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() {
FieldAccess access = {
kTaggedBase, JSGlobalObject::kGlobalProxyOffset,
Handle<Name>(), MaybeHandle<Map>(),
Type::Receiver(), MachineType::TypeCompressedTaggedPointer(),
kPointerWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() {
FieldAccess access = {
kTaggedBase, JSGlobalObject::kNativeContextOffset,
Handle<Name>(), MaybeHandle<Map>(),
Type::Internal(), MachineType::TypeCompressedTaggedPointer(),
kPointerWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForJSGlobalProxyNativeContext() {
FieldAccess access = {
......@@ -864,17 +809,6 @@ FieldAccess AccessBuilder::ForJSStringIteratorIndex() {
return access;
}
// static
FieldAccess AccessBuilder::ForValue() {
FieldAccess access = {
kTaggedBase, JSPrimitiveWrapper::kValueOffset,
Handle<Name>(), MaybeHandle<Map>(),
Type::NonInternal(), MachineType::TypeCompressedTagged(),
kFullWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForArgumentsLength() {
FieldAccess access = {
......@@ -892,7 +826,7 @@ FieldAccess AccessBuilder::ForArgumentsCallee() {
kTaggedBase, JSSloppyArgumentsObject::kCalleeOffset,
Handle<Name>(), MaybeHandle<Map>(),
Type::NonInternal(), MachineType::TypeCompressedTagged(),
kPointerWriteBarrier};
kFullWriteBarrier};
return access;
}
......@@ -1188,19 +1122,6 @@ ElementAccess AccessBuilder::ForOrderedHashMapEntryValue() {
return access;
}
// static
FieldAccess AccessBuilder::ForDictionaryMaxNumberKey() {
FieldAccess access = {
kTaggedBase,
FixedArray::OffsetOfElementAt(NumberDictionary::kMaxNumberKeyIndex),
MaybeHandle<Name>(),
MaybeHandle<Map>(),
Type::Any(),
MachineType::TypeCompressedTagged(),
kNoWriteBarrier};
return access;
}
// static
FieldAccess AccessBuilder::ForDictionaryNextEnumerationIndex() {
FieldAccess access = {
......
......@@ -128,9 +128,6 @@ class V8_EXPORT_PRIVATE AccessBuilder final
// Provides access to JSArray::length() field.
static FieldAccess ForJSArrayLength(ElementsKind elements_kind);
// Provides access to JSArrayBuffer::backing_store() field.
static FieldAccess ForJSArrayBufferBackingStore();
// Provides access to JSArrayBuffer::bit_field() field.
static FieldAccess ForJSArrayBufferBitField();
......@@ -236,24 +233,12 @@ class V8_EXPORT_PRIVATE AccessBuilder final
// Provides access to ExternalString::resource_data() field.
static FieldAccess ForExternalStringResourceData();
// Provides access to ExternalOneByteString characters.
static ElementAccess ForExternalOneByteStringCharacter();
// Provides access to ExternalTwoByteString characters.
static ElementAccess ForExternalTwoByteStringCharacter();
// Provides access to SeqOneByteString characters.
static ElementAccess ForSeqOneByteStringCharacter();
// Provides access to SeqTwoByteString characters.
static ElementAccess ForSeqTwoByteStringCharacter();
// Provides access to JSGlobalObject::global_proxy() field.
static FieldAccess ForJSGlobalObjectGlobalProxy();
// Provides access to JSGlobalObject::native_context() field.
static FieldAccess ForJSGlobalObjectNativeContext();
// Provides access to JSGlobalProxy::native_context() field.
static FieldAccess ForJSGlobalProxyNativeContext();
......@@ -272,9 +257,6 @@ class V8_EXPORT_PRIVATE AccessBuilder final
// Provides access to JSStringIterator::index() field.
static FieldAccess ForJSStringIteratorIndex();
// Provides access to JSPrimitiveWrapper::value() field.
static FieldAccess ForValue();
// Provides access to Cell::value() field.
static FieldAccess ForCellValue();
......@@ -327,7 +309,6 @@ class V8_EXPORT_PRIVATE AccessBuilder final
static ElementAccess ForOrderedHashMapEntryValue();
// Provides access to Dictionary fields.
static FieldAccess ForDictionaryMaxNumberKey();
static FieldAccess ForDictionaryNextEnumerationIndex();
static FieldAccess ForDictionaryObjectHashIndex();
......
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