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

Unified Diff: src/compiler/js-operator.cc

Issue 769193003: [turbofan] Cache the JSStoreProperty operator(s). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « 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 d3959c771d70424ce204f88097c8204a397d5910..14dfe6f6b9c8e3b4ec9af0af306a39f18e8caada 100644
--- a/src/compiler/js-operator.cc
+++ b/src/compiler/js-operator.cc
@@ -259,6 +259,16 @@ struct JSOperatorGlobalCache FINAL {
Name##Operator k##Name##Operator;
CACHED_OP_LIST(CACHED)
#undef CACHED
+
+ template <StrictMode kStrictMode>
+ struct StorePropertyOperator FINAL : public Operator1<StrictMode> {
+ StorePropertyOperator()
+ : Operator1<StrictMode>(IrOpcode::kJSStoreProperty,
+ Operator::kNoProperties, "JSStoreProperty", 3,
+ 1, 1, 0, 1, 0, kStrictMode) {}
+ };
+ StorePropertyOperator<SLOPPY> kStorePropertySloppyOperator;
+ StorePropertyOperator<STRICT> kStorePropertyStrictOperator;
};
@@ -335,11 +345,14 @@ const Operator* JSOperatorBuilder::LoadProperty(
const Operator* JSOperatorBuilder::StoreProperty(StrictMode strict_mode) {
- return new (zone()) Operator1<StrictMode>( // --
- IrOpcode::kJSStoreProperty, Operator::kNoProperties, // opcode
- "JSStoreProperty", // name
- 3, 1, 1, 0, 1, 0, // counts
- strict_mode); // parameter
+ switch (strict_mode) {
+ case SLOPPY:
+ return &cache_.kStorePropertySloppyOperator;
+ case STRICT:
+ return &cache_.kStorePropertyStrictOperator;
+ }
+ UNREACHABLE();
+ return nullptr;
}
« 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