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

Unified Diff: test/cctest/compiler/test-simplified-lowering.cc

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 | « src/compiler/access-builder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-simplified-lowering.cc
diff --git a/test/cctest/compiler/test-simplified-lowering.cc b/test/cctest/compiler/test-simplified-lowering.cc
index 4c86e40c0235870f894673f5686d4ba57520fbef..cce2a82ac92c716b66334b3e8f0a513222abb3be 100644
--- a/test/cctest/compiler/test-simplified-lowering.cc
+++ b/test/cctest/compiler/test-simplified-lowering.cc
@@ -4,6 +4,7 @@
#include <limits>
+#include "src/compiler/access-builder.h"
#include "src/compiler/control-builders.h"
#include "src/compiler/generic-node-inl.h"
#include "src/compiler/graph-visualizer.h"
@@ -53,48 +54,6 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
};
-// TODO(dcarney): find a home for these functions.
-namespace {
-
-FieldAccess ForJSObjectMap() {
- FieldAccess access = {kTaggedBase, JSObject::kMapOffset, Handle<Name>(),
- Type::Any(), kMachAnyTagged};
- return access;
-}
-
-
-FieldAccess ForJSObjectProperties() {
- FieldAccess access = {kTaggedBase, JSObject::kPropertiesOffset,
- Handle<Name>(), Type::Any(), kMachAnyTagged};
- return access;
-}
-
-
-FieldAccess ForArrayBufferBackingStore() {
- FieldAccess access = {
- kTaggedBase, JSArrayBuffer::kBackingStoreOffset, Handle<Name>(),
- Type::UntaggedPtr(), kMachPtr,
- };
- return access;
-}
-
-
-ElementAccess ForFixedArrayElement() {
- ElementAccess access = {kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
- kMachAnyTagged};
- return access;
-}
-
-
-ElementAccess ForBackingStoreElement(MachineType rep) {
- ElementAccess access = {kUntaggedBase,
- kNonHeapObjectHeaderSize - kHeapObjectTag,
- Type::Any(), rep};
- return access;
-}
-}
-
-
#ifndef V8_TARGET_ARCH_ARM64
// TODO(titzer): these result in a stub call that doesn't work on ARM64.
// TODO(titzer): factor these tests out to test-run-simplifiedops.cc.
@@ -166,7 +125,7 @@ static Handle<JSObject> TestObject() {
TEST(RunLoadMap) {
SimplifiedLoweringTester<Object*> t(kMachAnyTagged);
- FieldAccess access = ForJSObjectMap();
+ FieldAccess access = AccessBuilder::ForMap();
Node* load = t.LoadField(access, t.Parameter(0));
t.Return(load);
@@ -184,7 +143,7 @@ TEST(RunLoadMap) {
TEST(RunStoreMap) {
SimplifiedLoweringTester<int32_t> t(kMachAnyTagged, kMachAnyTagged);
- FieldAccess access = ForJSObjectMap();
+ FieldAccess access = AccessBuilder::ForMap();
t.StoreField(access, t.Parameter(1), t.Parameter(0));
t.Return(t.jsgraph.TrueConstant());
@@ -204,7 +163,7 @@ TEST(RunStoreMap) {
TEST(RunLoadProperties) {
SimplifiedLoweringTester<Object*> t(kMachAnyTagged);
- FieldAccess access = ForJSObjectProperties();
+ FieldAccess access = AccessBuilder::ForJSObjectProperties();
Node* load = t.LoadField(access, t.Parameter(0));
t.Return(load);
@@ -222,7 +181,7 @@ TEST(RunLoadProperties) {
TEST(RunLoadStoreMap) {
SimplifiedLoweringTester<Object*> t(kMachAnyTagged, kMachAnyTagged);
- FieldAccess access = ForJSObjectMap();
+ FieldAccess access = AccessBuilder::ForMap();
Node* load = t.LoadField(access, t.Parameter(0));
t.StoreField(access, t.Parameter(1), load);
t.Return(load);
@@ -245,7 +204,7 @@ TEST(RunLoadStoreMap) {
TEST(RunLoadStoreFixedArrayIndex) {
SimplifiedLoweringTester<Object*> t(kMachAnyTagged);
- ElementAccess access = ForFixedArrayElement();
+ ElementAccess access = AccessBuilder::ForFixedArrayElement();
Node* load = t.LoadElement(access, t.Parameter(0), t.Int32Constant(0));
t.StoreElement(access, t.Parameter(0), t.Int32Constant(1), load);
t.Return(load);
@@ -270,9 +229,10 @@ TEST(RunLoadStoreFixedArrayIndex) {
TEST(RunLoadStoreArrayBuffer) {
SimplifiedLoweringTester<Object*> t(kMachAnyTagged);
const int index = 12;
- ElementAccess buffer_access = ForBackingStoreElement(kMachInt8);
- Node* backing_store =
- t.LoadField(ForArrayBufferBackingStore(), t.Parameter(0));
+ ElementAccess buffer_access =
+ AccessBuilder::ForBackingStoreElement(kMachInt8);
+ Node* backing_store = t.LoadField(
+ AccessBuilder::ForJSArrayBufferBackingStore(), t.Parameter(0));
Node* load =
t.LoadElement(buffer_access, backing_store, t.Int32Constant(index));
t.StoreElement(buffer_access, backing_store, t.Int32Constant(index + 1),
« no previous file with comments | « src/compiler/access-builder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698