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

Unified Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 1314473007: [turbofan] Remove usage of Unique<T> from graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased and fixed. Created 5 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 | « test/unittests/compiler/js-type-feedback-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-typed-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
index bd027af4fbafe18663bc2b365348ea6dccc0fd0e..e9a6b97cfb9685505f687137f62f8ae569992154 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -235,14 +235,12 @@ TEST_F(JSTypedLoweringTest, ParameterWithNull) {
{
Reduction r = Reduce(Parameter(Type::Constant(null, zone())));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(null)));
+ EXPECT_THAT(r.replacement(), IsHeapConstant(null));
}
{
Reduction r = Reduce(Parameter(Type::Null()));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(null)));
+ EXPECT_THAT(r.replacement(), IsHeapConstant(null));
}
}
@@ -291,14 +289,12 @@ TEST_F(JSTypedLoweringTest, ParameterWithUndefined) {
{
Reduction r = Reduce(Parameter(Type::Undefined()));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(undefined)));
+ EXPECT_THAT(r.replacement(), IsHeapConstant(undefined));
}
{
Reduction r = Reduce(Parameter(Type::Constant(undefined, zone())));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(undefined)));
+ EXPECT_THAT(r.replacement(), IsHeapConstant(undefined));
}
}
@@ -885,8 +881,8 @@ TEST_F(JSTypedLoweringTest, JSLoadGlobalConstants) {
Handle<String>(isolate()->heap()->nan_string(), isolate()) // --
};
Matcher<Node*> matches[] = {
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(
- Handle<HeapObject>(isolate()->heap()->undefined_value(), isolate()))),
+ IsHeapConstant(
+ Handle<HeapObject>(isolate()->heap()->undefined_value(), isolate())),
IsNumberConstant(std::numeric_limits<double>::infinity()),
IsNumberConstant(IsNaN()) // --
};
@@ -899,9 +895,8 @@ TEST_F(JSTypedLoweringTest, JSLoadGlobalConstants) {
Node* control = graph()->start();
for (size_t i = 0; i < arraysize(names); i++) {
- Unique<Name> name = Unique<Name>::CreateImmovable(names[i]);
Reduction r = Reduce(graph()->NewNode(
- javascript()->LoadGlobal(name, feedback), context, global, vector,
+ javascript()->LoadGlobal(names[i], feedback), context, global, vector,
context, EmptyFrameState(), EmptyFrameState(), effect, control));
ASSERT_TRUE(r.Changed());
@@ -916,7 +911,7 @@ TEST_F(JSTypedLoweringTest, JSLoadGlobalConstants) {
TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
VectorSlotPair feedback;
- Unique<Name> name = Unique<Name>::CreateImmovable(factory()->length_string());
+ Handle<Name> name = factory()->length_string();
Node* const receiver = Parameter(Type::String(), 0);
Node* const vector = Parameter(Type::Internal(), 1);
Node* const context = UndefinedConstant();
@@ -1022,12 +1017,11 @@ TEST_F(JSTypedLoweringTest, JSAddWithString) {
rhs, context, frame_state0,
frame_state1, effect, control));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(
- r.replacement(),
- IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable(
- CodeFactory::StringAdd(isolate(), STRING_ADD_CHECK_NONE,
- NOT_TENURED).code())),
- lhs, rhs, context, frame_state0, effect, control));
+ EXPECT_THAT(r.replacement(),
+ IsCall(_, IsHeapConstant(CodeFactory::StringAdd(
+ isolate(), STRING_ADD_CHECK_NONE,
+ NOT_TENURED).code()),
+ lhs, rhs, context, frame_state0, effect, control));
}
}
@@ -1045,14 +1039,11 @@ TEST_F(JSTypedLoweringTest, JSCreateClosure) {
Reduce(graph()->NewNode(javascript()->CreateClosure(shared, NOT_TENURED),
context, context, effect, control));
ASSERT_TRUE(r.Changed());
- EXPECT_THAT(
- r.replacement(),
- IsCall(_,
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(
- CodeFactory::FastNewClosure(isolate(), shared->language_mode(),
- shared->kind()).code())),
- IsHeapConstant(Unique<HeapObject>::CreateImmovable(shared)),
- effect, control));
+ EXPECT_THAT(r.replacement(),
+ IsCall(_, IsHeapConstant(CodeFactory::FastNewClosure(
+ isolate(), shared->language_mode(),
+ shared->kind()).code()),
+ IsHeapConstant(shared), effect, control));
}
@@ -1074,8 +1065,8 @@ TEST_F(JSTypedLoweringTest, JSCreateLiteralArray) {
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
- IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable(
- CodeFactory::FastCloneShallowArray(isolate()).code())),
+ IsCall(_, IsHeapConstant(
+ CodeFactory::FastCloneShallowArray(isolate()).code()),
input0, input1, input2, context, frame_state, effect, control));
}
@@ -1098,8 +1089,8 @@ TEST_F(JSTypedLoweringTest, JSCreateLiteralObject) {
ASSERT_TRUE(r.Changed());
EXPECT_THAT(
r.replacement(),
- IsCall(_, IsHeapConstant(Unique<HeapObject>::CreateImmovable(
- CodeFactory::FastCloneShallowObject(isolate(), 6).code())),
+ IsCall(_, IsHeapConstant(
+ CodeFactory::FastCloneShallowObject(isolate(), 6).code()),
input0, input1, input2, _, context, frame_state, effect, control));
}
« no previous file with comments | « test/unittests/compiler/js-type-feedback-unittest.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698