chromium/v8/src/compiler/access-builder.cc

// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/compiler/access-builder.h"

#include "src/compiler/type-cache.h"
#include "src/handles/handles-inl.h"
#include "src/objects/arguments.h"
#include "src/objects/contexts.h"
#include "src/objects/heap-number.h"
#include "src/objects/js-collection.h"
#include "src/objects/js-generator.h"
#include "src/objects/js-objects.h"
#include "src/objects/objects-inl.h"
#include "src/objects/ordered-hash-table.h"
#include "src/objects/source-text-module.h"
#include "src/objects/tagged-field.h"

namespace v8 {
namespace internal {
namespace compiler {

// static
FieldAccess AccessBuilder::ForExternalIntPtr() {}

// static
FieldAccess AccessBuilder::ForMap(WriteBarrierKind write_barrier) {}

// static
FieldAccess AccessBuilder::ForHeapNumberValue() {}

// static
FieldAccess AccessBuilder::ForHeapNumberOrOddballOrHoleValue() {}

// static
FieldAccess AccessBuilder::ForBigIntBitfield() {}

#ifdef BIGINT_NEEDS_PADDING
// static
FieldAccess AccessBuilder::ForBigIntOptionalPadding() {
  static_assert(arraysize(BigInt::padding_) == sizeof(uint32_t));
  FieldAccess access = {
      kTaggedBase,      offsetof(BigInt, padding_), MaybeHandle<Name>(),
      OptionalMapRef(), TypeCache::Get()->kInt32,   MachineType::Uint32(),
      kNoWriteBarrier,  "BigIntOptionalPadding"};
  return access;
}
#endif

// static
FieldAccess AccessBuilder::ForBigIntLeastSignificantDigit64() {}

// static
FieldAccess AccessBuilder::ForJSObjectPropertiesOrHash() {}

// static
FieldAccess AccessBuilder::ForJSObjectPropertiesOrHashKnownPointer() {}

// static
FieldAccess AccessBuilder::ForJSObjectElements() {}

// static
FieldAccess AccessBuilder::ForJSObjectInObjectProperty(
    MapRef map, int index, MachineType machine_type) {}

// static
FieldAccess AccessBuilder::ForJSObjectOffset(
    int offset, WriteBarrierKind write_barrier_kind) {}

// static
FieldAccess AccessBuilder::ForJSCollectionTable() {}

// static
FieldAccess AccessBuilder::ForJSCollectionIteratorTable() {}

// static
FieldAccess AccessBuilder::ForJSCollectionIteratorIndex() {}

// static
FieldAccess AccessBuilder::ForJSExternalObjectValue() {}

#ifdef V8_ENABLE_SANDBOX
// static
FieldAccess AccessBuilder::ForJSExternalObjectPointerHandle() {}
#endif

// static
FieldAccess AccessBuilder::ForJSFunctionPrototypeOrInitialMap() {}

// static
FieldAccess AccessBuilder::ForJSFunctionContext() {}

// static
FieldAccess AccessBuilder::ForJSFunctionSharedFunctionInfo() {}

// static
FieldAccess AccessBuilder::ForJSFunctionFeedbackCell() {}

#ifdef V8_ENABLE_LEAPTIERING
// static
FieldAccess AccessBuilder::ForJSFunctionDispatchHandleNoWriteBarrier() {
  // We currently don't require write barriers when writing dispatch handles of
  // JSFunctions because they are loaded from the function's FeedbackCell and
  // so must already be reachable. If this ever changes, we'll need to
  // implement write barrier support for dispatch handles in generated code.
  FieldAccess access = {
      kTaggedBase,      JSFunction::kDispatchHandleOffset, Handle<Name>(),
      OptionalMapRef(), TypeCache::Get()->kInt32,          MachineType::Int32(),
      kNoWriteBarrier,  "JSFunctionDispatchHandle"};
  return access;
}
#else
#ifdef V8_ENABLE_SANDBOX
// static
FieldAccess AccessBuilder::ForJSFunctionCode() {}
#else
// static
FieldAccess AccessBuilder::ForJSFunctionCode() {
  FieldAccess access = {kTaggedBase,           JSFunction::kCodeOffset,
                        Handle<Name>(),        OptionalMapRef(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier,  "JSFunctionCode"};
  return access;
}
#endif  // V8_ENABLE_SANDBOX
#endif  // V8_ENABLE_LEAPTIERING

// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundTargetFunction() {}

// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundThis() {}

// static
FieldAccess AccessBuilder::ForJSBoundFunctionBoundArguments() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectContext() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectFunction() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectReceiver() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectContinuation() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectInputOrDebugPos() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectParametersAndRegisters() {}

// static
FieldAccess AccessBuilder::ForJSGeneratorObjectResumeMode() {}

// static
FieldAccess AccessBuilder::ForJSAsyncFunctionObjectPromise() {}

// static
FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectQueue() {}

// static
FieldAccess AccessBuilder::ForJSAsyncGeneratorObjectIsAwaiting() {}

// static
FieldAccess AccessBuilder::ForJSArrayLength(ElementsKind elements_kind) {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferBitField() {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferByteLength() {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewBuffer() {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewByteLength() {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewByteOffset() {}

// static
FieldAccess AccessBuilder::ForJSArrayBufferViewBitField() {}

// static
FieldAccess AccessBuilder::ForJSTypedArrayLength() {}

// static
FieldAccess AccessBuilder::ForJSTypedArrayBasePointer() {}

// static
FieldAccess AccessBuilder::ForJSTypedArrayExternalPointer() {}

// static
FieldAccess AccessBuilder::ForJSDataViewDataPointer() {}

// static
FieldAccess AccessBuilder::ForJSDateValue() {}

// static
FieldAccess AccessBuilder::ForJSDateField(JSDate::FieldIndex index) {}

// static
FieldAccess AccessBuilder::ForJSIteratorResultDone() {}

// static
FieldAccess AccessBuilder::ForJSIteratorResultValue() {}

// static
FieldAccess AccessBuilder::ForJSPrimitiveWrapperValue() {}

#ifdef V8_ENABLE_SANDBOX
// static
FieldAccess AccessBuilder::ForJSRegExpData() {}
#else
// static
FieldAccess AccessBuilder::ForJSRegExpData() {
  FieldAccess access = {kTaggedBase,           JSRegExp::kDataOffset,
                        MaybeHandle<Name>(),   OptionalMapRef(),
                        Type::OtherInternal(), MachineType::TaggedPointer(),
                        kPointerWriteBarrier,  "JSRegExpData"};
  return access;
}
#endif  // V8_ENABLE_SANDBOX

// static
FieldAccess AccessBuilder::ForJSRegExpFlags() {}

// static
FieldAccess AccessBuilder::ForJSRegExpLastIndex() {}

// static
FieldAccess AccessBuilder::ForJSRegExpSource() {}

// static
FieldAccess AccessBuilder::ForFixedArrayLength() {}

// static
FieldAccess AccessBuilder::ForWeakFixedArrayLength() {}

// static
FieldAccess AccessBuilder::ForSloppyArgumentsElementsContext() {}

// static
FieldAccess AccessBuilder::ForSloppyArgumentsElementsArguments() {}

// static
FieldAccess AccessBuilder::ForPropertyArrayLengthAndHash() {}

// static
FieldAccess AccessBuilder::ForDescriptorArrayEnumCache() {}

// static
FieldAccess AccessBuilder::ForMapBitField() {}

// static
FieldAccess AccessBuilder::ForMapBitField2() {}

// static
FieldAccess AccessBuilder::ForMapBitField3() {}

// static
FieldAccess AccessBuilder::ForMapDescriptors() {}

// static
FieldAccess AccessBuilder::ForMapInstanceType() {}

// static
FieldAccess AccessBuilder::ForMapPrototype() {}

// static
FieldAccess AccessBuilder::ForMapNativeContext() {}

// static
FieldAccess AccessBuilder::ForModuleRegularExports() {}

// static
FieldAccess AccessBuilder::ForModuleRegularImports() {}

// static
FieldAccess AccessBuilder::ForNameRawHashField() {}

// static
FieldAccess AccessBuilder::ForFreeSpaceSize() {}

// static
FieldAccess AccessBuilder::ForStringLength() {}

// static
FieldAccess AccessBuilder::ForConsStringFirst() {}

// static
FieldAccess AccessBuilder::ForConsStringSecond() {}

// static
FieldAccess AccessBuilder::ForThinStringActual() {}

// static
FieldAccess AccessBuilder::ForSlicedStringOffset() {}

// static
FieldAccess AccessBuilder::ForSlicedStringParent() {}

// static
FieldAccess AccessBuilder::ForExternalStringResourceData() {}

// static
ElementAccess AccessBuilder::ForSeqOneByteStringCharacter() {}

// static
ElementAccess AccessBuilder::ForSeqTwoByteStringCharacter() {}

// static
FieldAccess AccessBuilder::ForJSArrayIteratorIteratedObject() {}

// static
FieldAccess AccessBuilder::ForJSArrayIteratorNextIndex() {}

// static
FieldAccess AccessBuilder::ForJSArrayIteratorKind() {}

// static
FieldAccess AccessBuilder::ForJSStringIteratorString() {}

// static
FieldAccess AccessBuilder::ForJSStringIteratorIndex() {}

// static
FieldAccess AccessBuilder::ForArgumentsLength() {}

// static
FieldAccess AccessBuilder::ForArgumentsCallee() {}

// static
FieldAccess AccessBuilder::ForFixedArraySlot(
    size_t index, WriteBarrierKind write_barrier_kind) {}

// static
FieldAccess AccessBuilder::ForFeedbackVectorSlot(int index) {}

// static
FieldAccess AccessBuilder::ForPropertyArraySlot(int index) {}

// static
FieldAccess AccessBuilder::ForWeakFixedArraySlot(int index) {}
// static
FieldAccess AccessBuilder::ForCellValue() {}

// static
FieldAccess AccessBuilder::ForScopeInfoFlags() {}

// static
FieldAccess AccessBuilder::ForContextSlot(size_t index) {}

// static
FieldAccess AccessBuilder::ForContextSlotKnownPointer(size_t index) {}

// static
ElementAccess AccessBuilder::ForFixedArrayElement() {}

// static
ElementAccess AccessBuilder::ForWeakFixedArrayElement() {}

// static
ElementAccess AccessBuilder::ForSloppyArgumentsElementsMappedEntry() {}

// statics
ElementAccess AccessBuilder::ForFixedArrayElement(ElementsKind kind) {}

// static
ElementAccess AccessBuilder::ForFixedDoubleArrayElement() {}

// static
FieldAccess AccessBuilder::ForEnumCacheKeys() {}

// static
FieldAccess AccessBuilder::ForEnumCacheIndices() {}

// static
ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
                                                  bool is_external) {}

// static
ElementAccess AccessBuilder::ForJSForInCacheArrayElement(ForInMode mode) {}

// static
FieldAccess AccessBuilder::ForHashTableBaseNumberOfElements() {}

// static
FieldAccess AccessBuilder::ForHashTableBaseNumberOfDeletedElement() {}

// static
FieldAccess AccessBuilder::ForHashTableBaseCapacity() {}

// static
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNextTable() {}

// static
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfBuckets() {}

// static
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfDeletedElements() {}

// static
FieldAccess AccessBuilder::ForOrderedHashMapOrSetNumberOfElements() {}

// static
ElementAccess AccessBuilder::ForOrderedHashMapEntryValue() {}

// static
FieldAccess AccessBuilder::ForDictionaryNextEnumerationIndex() {}

// static
FieldAccess AccessBuilder::ForDictionaryObjectHashIndex() {}

// static
FieldAccess AccessBuilder::ForNameDictionaryFlagsIndex() {}

// static
FieldAccess AccessBuilder::ForFeedbackCellInterruptBudget() {}

#ifdef V8_ENABLE_LEAPTIERING
// static
FieldAccess AccessBuilder::ForFeedbackCellDispatchHandleNoWriteBarrier() {
  // Dispatch handles in FeedbackCells are effectively const-after-init and so
  // they are marked as kNoWriteBarrier here (because the fields will not be
  // written to).
  FieldAccess access = {kTaggedBase,
                        FeedbackCell::kDispatchHandleOffset,
                        Handle<Name>(),
                        OptionalMapRef(),
                        TypeCache::Get()->kInt32,
                        MachineType::Int32(),
                        kNoWriteBarrier,
                        "FeedbackCellDispatchHandle"};
  return access;
}
#endif  // V8_ENABLE_LEAPTIERING

// static
FieldAccess AccessBuilder::ForFeedbackVectorInvocationCount() {}

// static
FieldAccess AccessBuilder::ForFeedbackVectorFlags() {}

// static
FieldAccess AccessBuilder::ForFeedbackVectorClosureFeedbackCellArray() {}

#if V8_ENABLE_WEBASSEMBLY
// static
FieldAccess AccessBuilder::ForWasmArrayLength() {}

// static
FieldAccess AccessBuilder::ForWasmDispatchTableLength() {}
#endif  // V8_ENABLE_WEBASSEMBLY

}  // namespace compiler
}  // namespace internal
}  // namespace v8