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

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

Issue 620803003: [turbofan] Add control input to Load and LoadElements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: test/unittests/compiler/change-lowering-unittest.cc
diff --git a/test/unittests/compiler/change-lowering-unittest.cc b/test/unittests/compiler/change-lowering-unittest.cc
index c135def2e49414c94d8391dba0e8c072c22d513f..d217f77b2ad302f0e0c81f4d06befb5950f5b966 100644
--- a/test/unittests/compiler/change-lowering-unittest.cc
+++ b/test/unittests/compiler/change-lowering-unittest.cc
@@ -87,6 +87,12 @@ class ChangeLoweringTest : public GraphTest {
IsInt32Constant(0), IsNumberConstant(0.0), effect_matcher,
control_matcher);
}
+ Matcher<Node*> IsLoadHeapNumber(const Matcher<Node*>& value_matcher,
+ const Matcher<Node*>& control_matcher) {
+ return IsLoad(kMachFloat64, value_matcher,
+ IsInt32Constant(HeapNumberValueOffset()), graph()->start(),
+ control_matcher);
+ }
Matcher<Node*> IsWordEqual(const Matcher<Node*>& lhs_matcher,
const Matcher<Node*>& rhs_matcher) {
return Is32() ? IsWord32Equal(lhs_matcher, rhs_matcher)
@@ -226,9 +232,7 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToFloat64) {
EXPECT_THAT(
phi,
IsPhi(
- kMachFloat64,
- IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true))),
+ kMachFloat64, IsLoadHeapNumber(val, CaptureEq(&if_true)),
IsChangeInt32ToFloat64(
IsWord32Sar(val, IsInt32Constant(SmiShiftAmount()))),
IsMerge(
@@ -255,9 +259,7 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToInt32) {
EXPECT_THAT(
phi,
IsPhi(kMachInt32,
- IsChangeFloat64ToInt32(IsLoad(
- kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true)))),
+ IsChangeFloat64ToInt32(IsLoadHeapNumber(val, CaptureEq(&if_true))),
IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
@@ -281,9 +283,7 @@ TARGET_TEST_F(ChangeLowering32Test, ChangeTaggedToUint32) {
EXPECT_THAT(
phi,
IsPhi(kMachUint32,
- IsChangeFloat64ToUint32(IsLoad(
- kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true)))),
+ IsChangeFloat64ToUint32(IsLoadHeapNumber(val, CaptureEq(&if_true))),
IsWord32Sar(val, IsInt32Constant(SmiShiftAmount())),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
IsIfFalse(AllOf(
@@ -363,9 +363,7 @@ TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToFloat64) {
EXPECT_THAT(
phi,
IsPhi(
- kMachFloat64,
- IsLoad(kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true))),
+ kMachFloat64, IsLoadHeapNumber(val, CaptureEq(&if_true)),
IsChangeInt32ToFloat64(IsTruncateInt64ToInt32(
IsWord64Sar(val, IsInt32Constant(SmiShiftAmount())))),
IsMerge(
@@ -392,9 +390,7 @@ TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToInt32) {
EXPECT_THAT(
phi,
IsPhi(kMachInt32,
- IsChangeFloat64ToInt32(IsLoad(
- kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true)))),
+ IsChangeFloat64ToInt32(IsLoadHeapNumber(val, CaptureEq(&if_true))),
IsTruncateInt64ToInt32(
IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
@@ -419,9 +415,7 @@ TARGET_TEST_F(ChangeLowering64Test, ChangeTaggedToUint32) {
EXPECT_THAT(
phi,
IsPhi(kMachUint32,
- IsChangeFloat64ToUint32(IsLoad(
- kMachFloat64, val, IsInt32Constant(HeapNumberValueOffset()),
- IsControlEffect(CaptureEq(&if_true)))),
+ IsChangeFloat64ToUint32(IsLoadHeapNumber(val, CaptureEq(&if_true))),
IsTruncateInt64ToInt32(
IsWord64Sar(val, IsInt32Constant(SmiShiftAmount()))),
IsMerge(AllOf(CaptureEq(&if_true), IsIfTrue(CaptureEq(&branch))),
« no previous file with comments | « test/cctest/compiler/test-simplified-lowering.cc ('k') | test/unittests/compiler/common-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698