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

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

Issue 1109733002: [turbofan] Sanitize language mode for JSStoreProperty operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/js-operator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-operator-unittest.cc
diff --git a/test/unittests/compiler/js-operator-unittest.cc b/test/unittests/compiler/js-operator-unittest.cc
index 96615214b5d55cecd2bd4b5bfeb30ba540f66353..a8a2d8c38ad0a4d2bf3e67fde0b3fa4bc63c4ee1 100644
--- a/test/unittests/compiler/js-operator-unittest.cc
+++ b/test/unittests/compiler/js-operator-unittest.cc
@@ -14,6 +14,9 @@ namespace compiler {
namespace {
+const LanguageMode kLanguageModes[] = {SLOPPY, STRICT, STRONG};
+
+
#if GTEST_HAS_COMBINE
template <typename T>
@@ -159,9 +162,6 @@ INSTANTIATE_TEST_CASE_P(JSOperatorTest, JSSharedOperatorTest,
namespace {
-const LanguageMode kLanguageModes[] = {SLOPPY, STRICT, STRONG};
-
-
struct SharedOperatorWithLanguageMode {
const Operator* (JSOperatorBuilder::*constructor)(LanguageMode);
IrOpcode::Value opcode;
@@ -201,6 +201,7 @@ const SharedOperatorWithLanguageMode kSharedOperatorsWithLanguageMode[] = {
SHARED(Multiply, Operator::kNoProperties, 2, 2, 1, 1, 1, 1, 2),
SHARED(Divide, Operator::kNoProperties, 2, 2, 1, 1, 1, 1, 2),
SHARED(Modulus, Operator::kNoProperties, 2, 2, 1, 1, 1, 1, 2),
+ SHARED(StoreProperty, Operator::kNoProperties, 3, 2, 1, 1, 0, 1, 2),
#undef SHARED
};
@@ -281,69 +282,6 @@ INSTANTIATE_TEST_CASE_P(
#endif // GTEST_HAS_COMBINE
-
-// -----------------------------------------------------------------------------
-// JSStoreProperty.
-
-
-class JSStorePropertyOperatorTest
- : public TestWithZone,
- public ::testing::WithParamInterface<LanguageMode> {};
-
-
-TEST_P(JSStorePropertyOperatorTest, InstancesAreGloballyShared) {
- const LanguageMode mode = GetParam();
- JSOperatorBuilder javascript1(zone());
- JSOperatorBuilder javascript2(zone());
- EXPECT_EQ(javascript1.StoreProperty(mode), javascript2.StoreProperty(mode));
-}
-
-
-TEST_P(JSStorePropertyOperatorTest, NumberOfInputsAndOutputs) {
- JSOperatorBuilder javascript(zone());
- const LanguageMode mode = GetParam();
- const Operator* op = javascript.StoreProperty(mode);
-
- EXPECT_EQ(3, op->ValueInputCount());
- EXPECT_EQ(1, OperatorProperties::GetContextInputCount(op));
- EXPECT_EQ(2, OperatorProperties::GetFrameStateInputCount(op));
- EXPECT_EQ(1, op->EffectInputCount());
- EXPECT_EQ(1, op->ControlInputCount());
- EXPECT_EQ(8, OperatorProperties::GetTotalInputCount(op));
-
- EXPECT_EQ(0, op->ValueOutputCount());
- EXPECT_EQ(1, op->EffectOutputCount());
- EXPECT_EQ(2, op->ControlOutputCount());
-}
-
-
-TEST_P(JSStorePropertyOperatorTest, OpcodeIsCorrect) {
- JSOperatorBuilder javascript(zone());
- const LanguageMode mode = GetParam();
- const Operator* op = javascript.StoreProperty(mode);
- EXPECT_EQ(IrOpcode::kJSStoreProperty, op->opcode());
-}
-
-
-TEST_P(JSStorePropertyOperatorTest, OpParameter) {
- JSOperatorBuilder javascript(zone());
- const LanguageMode mode = GetParam();
- const Operator* op = javascript.StoreProperty(mode);
- EXPECT_EQ(mode, OpParameter<LanguageMode>(op));
-}
-
-
-TEST_P(JSStorePropertyOperatorTest, Properties) {
- JSOperatorBuilder javascript(zone());
- const LanguageMode mode = GetParam();
- const Operator* op = javascript.StoreProperty(mode);
- EXPECT_EQ(Operator::kNoProperties, op->properties());
-}
-
-
-INSTANTIATE_TEST_CASE_P(JSOperatorTest, JSStorePropertyOperatorTest,
- ::testing::Values(SLOPPY, STRICT));
-
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/js-operator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698