Index: src/compiler/access-builder.cc |
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc |
index df8cf5e15c44079878404082f7acbf87336b7f2c..bf9e694ce71748ea1c74dded4febe21a306970fe 100644 |
--- a/src/compiler/access-builder.cc |
+++ b/src/compiler/access-builder.cc |
@@ -74,6 +74,20 @@ FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() { |
// static |
+FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) { |
+ TypeCache const& type_cache = TypeCache::Get(); |
+ FieldAccess access = {kTaggedBase, JSArray::kLengthOffset, Handle<Name>(), |
+ type_cache.kJSArrayLengthType, kMachAnyTagged}; |
+ if (IsFastDoubleElementsKind(elements_kind)) { |
+ access.type = type_cache.kFixedDoubleArrayLengthType; |
+ } else if (IsFastElementsKind(elements_kind)) { |
+ access.type = type_cache.kFixedArrayLengthType; |
+ } |
+ return access; |
+} |
+ |
+ |
+// static |
FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() { |
FieldAccess access = {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, |
MaybeHandle<Name>(), Type::UntaggedPointer(), kMachPtr}; |