Index: src/compiler/access-builder.cc |
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc |
index d6fc2263baaa7ac950122a7cd7c69e1f2ed35ab8..d4187faaaddd512d3f6bf4eb51d16d2515e425cc 100644 |
--- a/src/compiler/access-builder.cc |
+++ b/src/compiler/access-builder.cc |
@@ -16,36 +16,39 @@ namespace compiler { |
// static |
FieldAccess AccessBuilder::ForMap() { |
- FieldAccess access = {kTaggedBase, HeapObject::kMapOffset, |
- MaybeHandle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, HeapObject::kMapOffset, MaybeHandle<Name>(), |
+ Type::Any(), MachineType::AnyTagged(), kMapWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForHeapNumberValue() { |
- FieldAccess access = {kTaggedBase, HeapNumber::kValueOffset, |
- MaybeHandle<Name>(), TypeCache::Get().kFloat64, |
- MachineType::Float64()}; |
+ FieldAccess access = {kTaggedBase, |
+ HeapNumber::kValueOffset, |
+ MaybeHandle<Name>(), |
+ TypeCache::Get().kFloat64, |
+ MachineType::Float64(), |
+ kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSObjectProperties() { |
- FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset, |
- MaybeHandle<Name>(), Type::Internal(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSObject::kPropertiesOffset, MaybeHandle<Name>(), |
+ Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSObjectElements() { |
- FieldAccess access = {kTaggedBase, JSObject::kElementsOffset, |
- MaybeHandle<Name>(), Type::Internal(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSObject::kElementsOffset, MaybeHandle<Name>(), |
+ Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
@@ -54,70 +57,93 @@ FieldAccess AccessBuilder::ForJSObjectElements() { |
FieldAccess AccessBuilder::ForJSObjectInObjectProperty(Handle<Map> map, |
int index) { |
int const offset = map->GetInObjectPropertyOffset(index); |
- FieldAccess access = {kTaggedBase, offset, MaybeHandle<Name>(), |
- Type::Tagged(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ offset, |
+ MaybeHandle<Name>(), |
+ Type::Tagged(), |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() { |
- FieldAccess access = {kTaggedBase, JSFunction::kPrototypeOrInitialMapOffset, |
- MaybeHandle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSFunction::kPrototypeOrInitialMapOffset, |
+ MaybeHandle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionContext() { |
- FieldAccess access = {kTaggedBase, JSFunction::kContextOffset, |
- MaybeHandle<Name>(), Type::Internal(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSFunction::kContextOffset, MaybeHandle<Name>(), |
+ Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { |
- FieldAccess access = {kTaggedBase, JSFunction::kSharedFunctionInfoOffset, |
- Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSFunction::kSharedFunctionInfoOffset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionLiterals() { |
- FieldAccess access = {kTaggedBase, JSFunction::kLiteralsOffset, |
- Handle<Name>(), Type::Internal(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSFunction::kLiteralsOffset, Handle<Name>(), |
+ Type::Internal(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionCodeEntry() { |
- FieldAccess access = {kTaggedBase, JSFunction::kCodeEntryOffset, |
- Handle<Name>(), Type::UntaggedPointer(), |
- MachineType::Pointer()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSFunction::kCodeEntryOffset, |
+ Handle<Name>(), |
+ Type::UntaggedPointer(), |
+ MachineType::Pointer(), |
+ kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSFunctionNextFunctionLink() { |
- FieldAccess access = {kTaggedBase, JSFunction::kNextFunctionLinkOffset, |
- Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSFunction::kNextFunctionLinkOffset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { |
TypeCache const& type_cache = TypeCache::Get(); |
- FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), |
+ FieldAccess access = {kTaggedBase, |
+ JSArray::kLengthOffset, |
+ Handle<Name>(), |
type_cache.kJSArrayLengthType, |
- MachineType::AnyTagged()}; |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
if (IsFastDoubleElementsKind(elements_kind)) { |
access.type = type_cache.kFixedDoubleArrayLengthType; |
+ access.write_barrier_kind = kNoWriteBarrier; |
} else if (IsFastElementsKind(elements_kind)) { |
access.type = type_cache.kFixedArrayLengthType; |
+ access.write_barrier_kind = kNoWriteBarrier; |
} |
return access; |
} |
@@ -125,190 +151,228 @@ FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { |
// static |
FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { |
- FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, |
- MaybeHandle<Name>(), Type::UntaggedPointer(), |
- MachineType::Pointer()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSArrayBuffer::kBackingStoreOffset, |
+ MaybeHandle<Name>(), |
+ Type::UntaggedPointer(), |
+ MachineType::Pointer(), |
+ kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSArrayBufferBitField() { |
- FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, |
+ FieldAccess access = {kTaggedBase, JSArrayBuffer::kBitFieldOffset, |
MaybeHandle<Name>(), TypeCache::Get().kInt8, |
- MachineType::Int8()}; |
+ MachineType::Int8(), kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() { |
- FieldAccess access = {kTaggedBase, JSArrayBufferView::kBufferOffset, |
- MaybeHandle<Name>(), Type::TaggedPointer(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSArrayBufferView::kBufferOffset, |
+ MaybeHandle<Name>(), |
+ Type::TaggedPointer(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) { |
- FieldAccess access = { |
- kTaggedBase, JSDate::kValueOffset + index * kPointerSize, |
- MaybeHandle<Name>(), Type::Number(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSDate::kValueOffset + index * kPointerSize, |
+ MaybeHandle<Name>(), |
+ Type::Number(), |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSIteratorResultDone() { |
- FieldAccess access = {kTaggedBase, JSIteratorResult::kDoneOffset, |
- MaybeHandle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSIteratorResult::kDoneOffset, MaybeHandle<Name>(), |
+ Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSIteratorResultValue() { |
- FieldAccess access = {kTaggedBase, JSIteratorResult::kValueOffset, |
- MaybeHandle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSIteratorResult::kValueOffset, MaybeHandle<Name>(), |
+ Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSRegExpFlags() { |
- FieldAccess access = {kTaggedBase, JSRegExp::kFlagsOffset, |
- MaybeHandle<Name>(), Type::Tagged(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSRegExp::kFlagsOffset, MaybeHandle<Name>(), |
+ Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSRegExpSource() { |
- FieldAccess access = {kTaggedBase, JSRegExp::kSourceOffset, |
- MaybeHandle<Name>(), Type::Tagged(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSRegExp::kSourceOffset, MaybeHandle<Name>(), |
+ Type::Tagged(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForFixedArrayLength() { |
- FieldAccess access = { |
- kTaggedBase, FixedArray::kLengthOffset, MaybeHandle<Name>(), |
- TypeCache::Get().kFixedArrayLengthType, MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ FixedArray::kLengthOffset, |
+ MaybeHandle<Name>(), |
+ TypeCache::Get().kFixedArrayLengthType, |
+ MachineType::AnyTagged(), |
+ kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() { |
- FieldAccess access = {kTaggedBase, DescriptorArray::kEnumCacheOffset, |
- Handle<Name>(), Type::TaggedPointer(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ DescriptorArray::kEnumCacheOffset, |
+ Handle<Name>(), |
+ Type::TaggedPointer(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForDescriptorArrayEnumCacheBridgeCache() { |
- FieldAccess access = { |
- kTaggedBase, DescriptorArray::kEnumCacheBridgeCacheOffset, Handle<Name>(), |
- Type::TaggedPointer(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ DescriptorArray::kEnumCacheBridgeCacheOffset, |
+ Handle<Name>(), |
+ Type::TaggedPointer(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForMapBitField() { |
- FieldAccess access = {kTaggedBase, Map::kBitFieldOffset, Handle<Name>(), |
- TypeCache::Get().kUint8, MachineType::Uint8()}; |
+ FieldAccess access = {kTaggedBase, Map::kBitFieldOffset, |
+ Handle<Name>(), TypeCache::Get().kUint8, |
+ MachineType::Uint8(), kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForMapBitField3() { |
- FieldAccess access = {kTaggedBase, Map::kBitField3Offset, Handle<Name>(), |
- TypeCache::Get().kInt32, MachineType::Int32()}; |
+ FieldAccess access = {kTaggedBase, Map::kBitField3Offset, |
+ Handle<Name>(), TypeCache::Get().kInt32, |
+ MachineType::Int32(), kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForMapDescriptors() { |
- FieldAccess access = {kTaggedBase, Map::kDescriptorsOffset, Handle<Name>(), |
- Type::TaggedPointer(), MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, Map::kDescriptorsOffset, Handle<Name>(), |
+ Type::TaggedPointer(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForMapInstanceType() { |
- FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, Handle<Name>(), |
- TypeCache::Get().kUint8, MachineType::Uint8()}; |
+ FieldAccess access = {kTaggedBase, Map::kInstanceTypeOffset, |
+ Handle<Name>(), TypeCache::Get().kUint8, |
+ MachineType::Uint8(), kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForMapPrototype() { |
- FieldAccess access = {kTaggedBase, Map::kPrototypeOffset, Handle<Name>(), |
- Type::TaggedPointer(), MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, Map::kPrototypeOffset, Handle<Name>(), |
+ Type::TaggedPointer(), MachineType::AnyTagged(), kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForStringLength() { |
- FieldAccess access = {kTaggedBase, String::kLengthOffset, Handle<Name>(), |
+ FieldAccess access = {kTaggedBase, |
+ String::kLengthOffset, |
+ Handle<Name>(), |
TypeCache::Get().kStringLengthType, |
- MachineType::AnyTagged()}; |
+ MachineType::AnyTagged(), |
+ kNoWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSGlobalObjectGlobalProxy() { |
- FieldAccess access = {kTaggedBase, JSGlobalObject::kGlobalProxyOffset, |
- Handle<Name>(), Type::Receiver(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSGlobalObject::kGlobalProxyOffset, |
+ Handle<Name>(), |
+ Type::Receiver(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForJSGlobalObjectNativeContext() { |
- FieldAccess access = {kTaggedBase, JSGlobalObject::kNativeContextOffset, |
- Handle<Name>(), Type::Internal(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSGlobalObject::kNativeContextOffset, |
+ Handle<Name>(), |
+ Type::Internal(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForValue() { |
- FieldAccess access = {kTaggedBase, JSValue::kValueOffset, Handle<Name>(), |
- Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSValue::kValueOffset, Handle<Name>(), |
+ Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForArgumentsLength() { |
- FieldAccess access = {kTaggedBase, JSArgumentsObject::kLengthOffset, |
- Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, JSArgumentsObject::kLengthOffset, Handle<Name>(), |
+ Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForArgumentsCallee() { |
- FieldAccess access = {kTaggedBase, JSSloppyArgumentsObject::kCalleeOffset, |
- Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ JSSloppyArgumentsObject::kCalleeOffset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
@@ -316,8 +380,12 @@ FieldAccess AccessBuilder::ForArgumentsCallee() { |
// static |
FieldAccess AccessBuilder::ForFixedArraySlot(size_t index) { |
int offset = FixedArray::OffsetOfElementAt(static_cast<int>(index)); |
- FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ offset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
return access; |
} |
@@ -327,8 +395,12 @@ FieldAccess AccessBuilder::ForContextSlot(size_t index) { |
int offset = Context::kHeaderSize + static_cast<int>(index) * kPointerSize; |
DCHECK_EQ(offset, |
Context::SlotOffset(static_cast<int>(index)) + kHeapObjectTag); |
- FieldAccess access = {kTaggedBase, offset, Handle<Name>(), Type::Any(), |
- MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ offset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kFullWriteBarrier}; |
return access; |
} |
@@ -341,16 +413,21 @@ FieldAccess AccessBuilder::ForPropertyCellValue() { |
// static |
FieldAccess AccessBuilder::ForPropertyCellValue(Type* type) { |
- FieldAccess access = {kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), |
- type, MachineType::AnyTagged()}; |
+ FieldAccess access = { |
+ kTaggedBase, PropertyCell::kValueOffset, Handle<Name>(), |
+ type, MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
// static |
FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() { |
- FieldAccess access = {kTaggedBase, SharedFunctionInfo::kFeedbackVectorOffset, |
- Handle<Name>(), Type::Any(), MachineType::AnyTagged()}; |
+ FieldAccess access = {kTaggedBase, |
+ SharedFunctionInfo::kFeedbackVectorOffset, |
+ Handle<Name>(), |
+ Type::Any(), |
+ MachineType::AnyTagged(), |
+ kPointerWriteBarrier}; |
return access; |
} |
@@ -358,7 +435,7 @@ FieldAccess AccessBuilder::ForSharedFunctionInfoTypeFeedbackVector() { |
// static |
ElementAccess AccessBuilder::ForFixedArrayElement() { |
ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Tagged(), |
- MachineType::AnyTagged()}; |
+ MachineType::AnyTagged(), kFullWriteBarrier}; |
return access; |
} |
@@ -366,7 +443,8 @@ ElementAccess AccessBuilder::ForFixedArrayElement() { |
// static |
ElementAccess AccessBuilder::ForFixedDoubleArrayElement() { |
ElementAccess access = {kTaggedBase, FixedDoubleArray::kHeaderSize, |
- TypeCache::Get().kFloat64, MachineType::Float64()}; |
+ TypeCache::Get().kFloat64, MachineType::Float64(), |
+ kNoWriteBarrier}; |
return access; |
} |
@@ -379,56 +457,49 @@ ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type, |
switch (type) { |
case kExternalInt8Array: { |
ElementAccess access = {taggedness, header_size, Type::Signed32(), |
- MachineType::Int8()}; |
+ MachineType::Int8(), kNoWriteBarrier}; |
return access; |
} |
case kExternalUint8Array: |
case kExternalUint8ClampedArray: { |
ElementAccess access = {taggedness, header_size, Type::Unsigned32(), |
- MachineType::Uint8()}; |
+ MachineType::Uint8(), kNoWriteBarrier}; |
return access; |
} |
case kExternalInt16Array: { |
ElementAccess access = {taggedness, header_size, Type::Signed32(), |
- MachineType::Int16()}; |
+ MachineType::Int16(), kNoWriteBarrier}; |
return access; |
} |
case kExternalUint16Array: { |
ElementAccess access = {taggedness, header_size, Type::Unsigned32(), |
- MachineType::Uint16()}; |
+ MachineType::Uint16(), kNoWriteBarrier}; |
return access; |
} |
case kExternalInt32Array: { |
ElementAccess access = {taggedness, header_size, Type::Signed32(), |
- MachineType::Int32()}; |
+ MachineType::Int32(), kNoWriteBarrier}; |
return access; |
} |
case kExternalUint32Array: { |
ElementAccess access = {taggedness, header_size, Type::Unsigned32(), |
- MachineType::Uint32()}; |
+ MachineType::Uint32(), kNoWriteBarrier}; |
return access; |
} |
case kExternalFloat32Array: { |
ElementAccess access = {taggedness, header_size, Type::Number(), |
- MachineType::Float32()}; |
+ MachineType::Float32(), kNoWriteBarrier}; |
return access; |
} |
case kExternalFloat64Array: { |
ElementAccess access = {taggedness, header_size, Type::Number(), |
- MachineType::Float64()}; |
+ MachineType::Float64(), kNoWriteBarrier}; |
return access; |
} |
} |
UNREACHABLE(); |
- ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None()}; |
- return access; |
-} |
- |
- |
-// static |
-FieldAccess AccessBuilder::ForStatsCounter() { |
- FieldAccess access = {kUntaggedBase, 0, MaybeHandle<Name>(), |
- TypeCache::Get().kInt32, MachineType::Int32()}; |
+ ElementAccess access = {kUntaggedBase, 0, Type::None(), MachineType::None(), |
+ kNoWriteBarrier}; |
return access; |
} |