Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: src/compiler/access-builder.h

Issue 516943002: Move constructors for [Element/Field]Access into AccessBuilder. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-builder.h
diff --git a/src/compiler/access-builder.h b/src/compiler/access-builder.h
index a22df9d59f4dc9e77e9ea8be28a7c83104341da6..b3003303ae859f7fd3eec0c2df90bbef8bca8ebb 100644
--- a/src/compiler/access-builder.h
+++ b/src/compiler/access-builder.h
@@ -16,18 +16,47 @@ namespace compiler {
// parameters to simplified load/store operators.
class AccessBuilder : public AllStatic {
public:
+ // Provides access to HeapObject::map() field.
+ static FieldAccess ForMap() {
+ return {kTaggedBase, HeapObject::kMapOffset, Handle<Name>(), Type::Any(),
+ kMachAnyTagged};
+ }
+
+ // Provides access to JSObject::properties() field.
+ static FieldAccess ForJSObjectProperties() {
+ return {kTaggedBase, JSObject::kPropertiesOffset, Handle<Name>(),
+ Type::Any(), kMachAnyTagged};
+ }
+
// Provides access to JSObject::elements() field.
static FieldAccess ForJSObjectElements() {
return {kTaggedBase, JSObject::kElementsOffset, Handle<Name>(),
Type::Internal(), kMachAnyTagged};
}
+ // Provides access to JSArrayBuffer::backing_store() field.
+ static FieldAccess ForJSArrayBufferBackingStore() {
+ return {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, Handle<Name>(),
+ Type::UntaggedPtr(), kMachPtr};
+ }
+
// Provides access to ExternalArray::external_pointer() field.
static FieldAccess ForExternalArrayPointer() {
return {kTaggedBase, ExternalArray::kExternalPointerOffset, Handle<Name>(),
Type::UntaggedPtr(), kMachPtr};
}
+ // Provides access to FixedArray elements.
+ static ElementAccess ForFixedArrayElement() {
+ return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged};
+ }
+
+ // TODO(mstarzinger): Raw access only for testing, drop me.
+ static ElementAccess ForBackingStoreElement(MachineType rep) {
+ return {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag,
+ Type::Any(), rep};
+ }
+
// Provides access to Fixed{type}TypedArray and External{type}Array elements.
static ElementAccess ForTypedArrayElement(ExternalArrayType type,
bool is_external) {
« no previous file with comments | « no previous file | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698