1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef V8_COMPILER_ACCESS_BUILDER_H_
6 #define V8_COMPILER_ACCESS_BUILDER_H_
8 #include "src/compiler/simplified-operator.h"
14 // This access builder provides a set of static methods constructing commonly
15 // used FieldAccess and ElementAccess descriptors. These descriptors server as
16 // parameters to simplified load/store operators.
17 class AccessBuilder FINAL : public AllStatic {
19 // Provides access to HeapObject::map() field.
20 static FieldAccess ForMap();
22 // Provides access to JSObject::properties() field.
23 static FieldAccess ForJSObjectProperties();
25 // Provides access to JSObject::elements() field.
26 static FieldAccess ForJSObjectElements();
28 // Provides access to JSFunction::context() field.
29 static FieldAccess ForJSFunctionContext();
31 // Provides access to JSArrayBuffer::backing_store() field.
32 static FieldAccess ForJSArrayBufferBackingStore();
34 // Provides access to ExternalArray::external_pointer() field.
35 static FieldAccess ForExternalArrayPointer();
37 // Provides access to FixedArray elements.
38 static ElementAccess ForFixedArrayElement();
40 // TODO(mstarzinger): Raw access only for testing, drop me.
41 static ElementAccess ForBackingStoreElement(MachineType rep);
43 // Provides access to Fixed{type}TypedArray and External{type}Array elements.
44 static ElementAccess ForTypedArrayElement(ExternalArrayType type,
48 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessBuilder);
51 } // namespace compiler
52 } // namespace internal
55 #endif // V8_COMPILER_ACCESS_BUILDER_H_