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

Unified Diff: test/unittests/compiler/simplified-operator-reducer-unittest.cc

Issue 763963002: [turbofan] Add checked load/store operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reapply fix. Created 6 years 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/node-test-utils.cc ('k') | test/unittests/compiler/simplified-operator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/simplified-operator-reducer-unittest.cc
diff --git a/test/unittests/compiler/simplified-operator-reducer-unittest.cc b/test/unittests/compiler/simplified-operator-reducer-unittest.cc
index 7f8e43d4284e6d9bae2948510b0ba7e4617004ca..8a42f7d3ebc620f626f54abd639b8808a60f8a5b 100644
--- a/test/unittests/compiler/simplified-operator-reducer-unittest.cc
+++ b/test/unittests/compiler/simplified-operator-reducer-unittest.cc
@@ -478,126 +478,6 @@ TEST_F(SimplifiedOperatorReducerTest, ChangeUint32ToTagged) {
}
}
-
-// -----------------------------------------------------------------------------
-// LoadElement
-
-
-TEST_F(SimplifiedOperatorReducerTest, LoadElementWithConstantKeyAndLength) {
- ElementAccess const access = {kTypedArrayBoundsCheck, kUntaggedBase, 0,
- Type::Any(), kMachAnyTagged};
- ElementAccess access_nocheck = access;
- access_nocheck.bounds_check = kNoBoundsCheck;
- Node* const base = Parameter(0);
- Node* const effect = graph()->start();
- {
- Node* const key = NumberConstant(-42.0);
- Node* const length = NumberConstant(100.0);
- Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect));
- ASSERT_FALSE(r.Changed());
- }
- {
- Node* const key = NumberConstant(-0.0);
- Node* const length = NumberConstant(1.0);
- Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsLoadElement(access_nocheck, base, key, length, effect));
- }
- {
- Node* const key = NumberConstant(0);
- Node* const length = NumberConstant(1);
- Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsLoadElement(access_nocheck, base, key, length, effect));
- }
- {
- Node* const key = NumberConstant(42.2);
- Node* const length = NumberConstant(128);
- Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsLoadElement(access_nocheck, base, key, length, effect));
- }
- {
- Node* const key = NumberConstant(39.2);
- Node* const length = NumberConstant(32.0);
- Reduction r = Reduce(graph()->NewNode(simplified()->LoadElement(access),
- base, key, length, effect));
- ASSERT_FALSE(r.Changed());
- }
-}
-
-
-// -----------------------------------------------------------------------------
-// StoreElement
-
-
-TEST_F(SimplifiedOperatorReducerTest, StoreElementWithConstantKeyAndLength) {
- ElementAccess const access = {kTypedArrayBoundsCheck, kUntaggedBase, 0,
- Type::Any(), kMachAnyTagged};
- ElementAccess access_nocheck = access;
- access_nocheck.bounds_check = kNoBoundsCheck;
- Node* const base = Parameter(0);
- Node* const value = Parameter(1);
- Node* const effect = graph()->start();
- Node* const control = graph()->start();
- {
- Node* const key = NumberConstant(-72.1);
- Node* const length = NumberConstant(0.0);
- Reduction r =
- Reduce(graph()->NewNode(simplified()->StoreElement(access), base, key,
- length, value, effect, control));
- ASSERT_FALSE(r.Changed());
- }
- {
- Node* const key = NumberConstant(-0.0);
- Node* const length = NumberConstant(999);
- Reduction r =
- Reduce(graph()->NewNode(simplified()->StoreElement(access), base, key,
- length, value, effect, control));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsStoreElement(access_nocheck, base, key, length, value, effect,
- control));
- }
- {
- Node* const key = NumberConstant(0);
- Node* const length = NumberConstant(1);
- Reduction r =
- Reduce(graph()->NewNode(simplified()->StoreElement(access), base, key,
- length, value, effect, control));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsStoreElement(access_nocheck, base, key, length, value, effect,
- control));
- }
- {
- Node* const key = NumberConstant(42.2);
- Node* const length = NumberConstant(128);
- Reduction r =
- Reduce(graph()->NewNode(simplified()->StoreElement(access), base, key,
- length, value, effect, control));
- ASSERT_TRUE(r.Changed());
- EXPECT_THAT(r.replacement(),
- IsStoreElement(access_nocheck, base, key, length, value, effect,
- control));
- }
- {
- Node* const key = NumberConstant(39.2);
- Node* const length = NumberConstant(32.0);
- Reduction r =
- Reduce(graph()->NewNode(simplified()->StoreElement(access), base, key,
- length, value, effect, control));
- ASSERT_FALSE(r.Changed());
- }
-}
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « test/unittests/compiler/node-test-utils.cc ('k') | test/unittests/compiler/simplified-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698