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

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

Issue 526313002: [turbofan] First step of Operator refactoring. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 3 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 | « src/compiler/access-builder.h ('k') | src/compiler/arm/linkage-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-builder.cc
diff --git a/src/compiler/access-builder.cc b/src/compiler/access-builder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..26beac6d9e8fc26b8cc140963d9a686f0b143bde
--- /dev/null
+++ b/src/compiler/access-builder.cc
@@ -0,0 +1,90 @@
+// 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/types-inl.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// static
+FieldAccess AccessBuilder::ForMap() {
+ return {kTaggedBase, HeapObject::kMapOffset, Handle<Name>(), Type::Any(),
+ kMachAnyTagged};
+}
+
+
+// static
+FieldAccess AccessBuilder::ForJSObjectProperties() {
+ return {kTaggedBase, JSObject::kPropertiesOffset, Handle<Name>(), Type::Any(),
+ kMachAnyTagged};
+}
+
+
+// static
+FieldAccess AccessBuilder::ForJSObjectElements() {
+ return {kTaggedBase, JSObject::kElementsOffset, Handle<Name>(),
+ Type::Internal(), kMachAnyTagged};
+}
+
+
+// static
+FieldAccess AccessBuilder::ForJSArrayBufferBackingStore() {
+ return {kTaggedBase, JSArrayBuffer::kBackingStoreOffset, Handle<Name>(),
+ Type::UntaggedPtr(), kMachPtr};
+}
+
+
+// static
+FieldAccess AccessBuilder::ForExternalArrayPointer() {
+ return {kTaggedBase, ExternalArray::kExternalPointerOffset, Handle<Name>(),
+ Type::UntaggedPtr(), kMachPtr};
+}
+
+
+// static
+ElementAccess AccessBuilder::ForFixedArrayElement() {
+ return {kTaggedBase, FixedArray::kHeaderSize, Type::Any(), kMachAnyTagged};
+}
+
+
+// static
+ElementAccess AccessBuilder::ForBackingStoreElement(MachineType rep) {
+ return {kUntaggedBase, kNonHeapObjectHeaderSize - kHeapObjectTag, Type::Any(),
+ rep};
+}
+
+
+// static
+ElementAccess AccessBuilder::ForTypedArrayElement(ExternalArrayType type,
+ bool is_external) {
+ BaseTaggedness taggedness = is_external ? kUntaggedBase : kTaggedBase;
+ int header_size = is_external ? 0 : FixedTypedArrayBase::kDataOffset;
+ switch (type) {
+ case kExternalInt8Array:
+ return {taggedness, header_size, Type::Signed32(), kMachInt8};
+ case kExternalUint8Array:
+ case kExternalUint8ClampedArray:
+ return {taggedness, header_size, Type::Unsigned32(), kMachUint8};
+ case kExternalInt16Array:
+ return {taggedness, header_size, Type::Signed32(), kMachInt16};
+ case kExternalUint16Array:
+ return {taggedness, header_size, Type::Unsigned32(), kMachUint16};
+ case kExternalInt32Array:
+ return {taggedness, header_size, Type::Signed32(), kMachInt32};
+ case kExternalUint32Array:
+ return {taggedness, header_size, Type::Unsigned32(), kMachUint32};
+ case kExternalFloat32Array:
+ return {taggedness, header_size, Type::Number(), kRepFloat32};
+ case kExternalFloat64Array:
+ return {taggedness, header_size, Type::Number(), kRepFloat64};
+ }
+ UNREACHABLE();
+ return {kUntaggedBase, 0, Type::None(), kMachNone};
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/compiler/access-builder.h ('k') | src/compiler/arm/linkage-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698