Index: src/compiler/js-operator.cc |
diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc |
index afc9fb3dcffc851096f43e7fed417a46035112e1..229188ffeb07bb04230e21f787be62fcea77ef5c 100644 |
--- a/src/compiler/js-operator.cc |
+++ b/src/compiler/js-operator.cc |
@@ -249,6 +249,12 @@ const LoadNamedParameters& LoadNamedParametersOf(const Operator* op) { |
} |
+const LoadNamedParameters& LoadGlobalParametersOf(const Operator* op) { |
+ DCHECK_EQ(IrOpcode::kJSLoadGlobal, op->opcode()); |
+ return OpParameter<LoadNamedParameters>(op); |
+} |
+ |
+ |
bool operator==(StoreNamedParameters const& lhs, |
StoreNamedParameters const& rhs) { |
return lhs.language_mode() == rhs.language_mode() && |
@@ -278,6 +284,12 @@ const StoreNamedParameters& StoreNamedParametersOf(const Operator* op) { |
} |
+const StoreNamedParameters& StoreGlobalParametersOf(const Operator* op) { |
+ DCHECK_EQ(IrOpcode::kJSStoreGlobal, op->opcode()); |
+ return OpParameter<StoreNamedParameters>(op); |
+} |
+ |
+ |
bool operator==(StorePropertyParameters const& lhs, |
StorePropertyParameters const& rhs) { |
return lhs.language_mode() == rhs.language_mode() && |
@@ -490,9 +502,8 @@ const Operator* JSOperatorBuilder::CallConstruct(int arguments) { |
const Operator* JSOperatorBuilder::LoadNamed(const Unique<Name>& name, |
- const VectorSlotPair& feedback, |
- ContextualMode contextual_mode) { |
- LoadNamedParameters parameters(name, feedback, contextual_mode); |
+ const VectorSlotPair& feedback) { |
+ LoadNamedParameters parameters(name, feedback, NOT_CONTEXTUAL); |
return new (zone()) Operator1<LoadNamedParameters>( // -- |
IrOpcode::kJSLoadNamed, Operator::kNoProperties, // opcode |
"JSLoadNamed", // name |
@@ -544,6 +555,30 @@ const Operator* JSOperatorBuilder::DeleteProperty(LanguageMode language_mode) { |
} |
+const Operator* JSOperatorBuilder::LoadGlobal(const Unique<Name>& name, |
+ const VectorSlotPair& feedback, |
+ ContextualMode contextual_mode) { |
+ LoadNamedParameters parameters(name, feedback, contextual_mode); |
+ return new (zone()) Operator1<LoadNamedParameters>( // -- |
+ IrOpcode::kJSLoadGlobal, Operator::kNoProperties, // opcode |
+ "JSLoadGlobal", // name |
+ 2, 1, 1, 1, 1, 2, // counts |
+ parameters); // parameter |
+} |
+ |
+ |
+const Operator* JSOperatorBuilder::StoreGlobal(LanguageMode language_mode, |
+ const Unique<Name>& name, |
+ const VectorSlotPair& feedback) { |
+ StoreNamedParameters parameters(language_mode, feedback, name); |
+ return new (zone()) Operator1<StoreNamedParameters>( // -- |
+ IrOpcode::kJSStoreGlobal, Operator::kNoProperties, // opcode |
+ "JSStoreGlobal", // name |
+ 3, 1, 1, 0, 1, 2, // counts |
+ parameters); // parameter |
+} |
+ |
+ |
const Operator* JSOperatorBuilder::LoadContext(size_t depth, size_t index, |
bool immutable) { |
ContextAccess access(depth, index, immutable); |