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

Unified Diff: src/compiler/js-operator.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 | « no previous file | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-operator.cc
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
index 48324034480187c11c0a249691afab78a71d0466..91aa271e17c3897bee7986779e4cb559a5b65951 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -263,22 +263,23 @@ const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) {
V(CreateScriptContext, Operator::kNoProperties, 2, 1)
-#define CACHED_OP_LIST_WITH_LANGUAGE_MODE(V) \
- V(LessThan, Operator::kNoProperties, 2, 1) \
- V(GreaterThan, Operator::kNoProperties, 2, 1) \
- V(LessThanOrEqual, Operator::kNoProperties, 2, 1) \
- V(GreaterThanOrEqual, Operator::kNoProperties, 2, 1) \
- V(BitwiseOr, Operator::kNoProperties, 2, 1) \
- V(BitwiseXor, Operator::kNoProperties, 2, 1) \
- V(BitwiseAnd, Operator::kNoProperties, 2, 1) \
- V(ShiftLeft, Operator::kNoProperties, 2, 1) \
- V(ShiftRight, Operator::kNoProperties, 2, 1) \
- V(ShiftRightLogical, Operator::kNoProperties, 2, 1) \
- V(Add, Operator::kNoProperties, 2, 1) \
- V(Subtract, Operator::kNoProperties, 2, 1) \
- V(Multiply, Operator::kNoProperties, 2, 1) \
- V(Divide, Operator::kNoProperties, 2, 1) \
- V(Modulus, Operator::kNoProperties, 2, 1)
+#define CACHED_OP_LIST_WITH_LANGUAGE_MODE(V) \
+ V(LessThan, Operator::kNoProperties, 2, 1) \
+ V(GreaterThan, Operator::kNoProperties, 2, 1) \
+ V(LessThanOrEqual, Operator::kNoProperties, 2, 1) \
+ V(GreaterThanOrEqual, Operator::kNoProperties, 2, 1) \
+ V(BitwiseOr, Operator::kNoProperties, 2, 1) \
+ V(BitwiseXor, Operator::kNoProperties, 2, 1) \
+ V(BitwiseAnd, Operator::kNoProperties, 2, 1) \
+ V(ShiftLeft, Operator::kNoProperties, 2, 1) \
+ V(ShiftRight, Operator::kNoProperties, 2, 1) \
+ V(ShiftRightLogical, Operator::kNoProperties, 2, 1) \
+ V(Add, Operator::kNoProperties, 2, 1) \
+ V(Subtract, Operator::kNoProperties, 2, 1) \
+ V(Multiply, Operator::kNoProperties, 2, 1) \
+ V(Divide, Operator::kNoProperties, 2, 1) \
+ V(Modulus, Operator::kNoProperties, 2, 1) \
+ V(StoreProperty, Operator::kNoProperties, 3, 0)
struct JSOperatorGlobalCache final {
@@ -313,17 +314,6 @@ struct JSOperatorGlobalCache final {
Name##Operator<STRONG> k##Name##StrongOperator;
CACHED_OP_LIST_WITH_LANGUAGE_MODE(CACHED_WITH_LANGUAGE_MODE)
#undef CACHED_WITH_LANGUAGE_MODE
-
-
- template <LanguageMode kLanguageMode>
- struct StorePropertyOperator final : public Operator1<LanguageMode> {
- StorePropertyOperator()
- : Operator1<LanguageMode>(IrOpcode::kJSStoreProperty,
- Operator::kNoProperties, "JSStoreProperty", 3,
- 1, 1, 0, 1, 2, kLanguageMode) {}
- };
- StorePropertyOperator<SLOPPY> kStorePropertySloppyOperator;
- StorePropertyOperator<STRICT> kStorePropertyStrictOperator;
};
@@ -420,17 +410,6 @@ const Operator* JSOperatorBuilder::LoadProperty(
}
-const Operator* JSOperatorBuilder::StoreProperty(LanguageMode language_mode) {
- if (is_strict(language_mode)) {
- return &cache_.kStorePropertyStrictOperator;
- } else {
- return &cache_.kStorePropertySloppyOperator;
- }
- UNREACHABLE();
- return nullptr;
-}
-
-
const Operator* JSOperatorBuilder::StoreNamed(LanguageMode language_mode,
const Unique<Name>& name,
PropertyICMode store_ic) {
« no previous file with comments | « no previous file | test/unittests/compiler/js-operator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698