| Index: src/compiler/js-operator.cc
|
| diff --git a/src/compiler/js-operator.cc b/src/compiler/js-operator.cc
|
| index f577a455a8ee06c3a78fac6bd97eb9c4722be1f1..002481ee701ea7c94459715aeefa383470dc7aed 100644
|
| --- a/src/compiler/js-operator.cc
|
| +++ b/src/compiler/js-operator.cc
|
| @@ -215,6 +215,37 @@ CreateCatchContextParameters const& CreateCatchContextParametersOf(
|
| return OpParameter<CreateCatchContextParameters>(op);
|
| }
|
|
|
| +CreateFunctionContextParameters::CreateFunctionContextParameters(
|
| + int slot_count, ScopeType scope_type)
|
| + : slot_count_(slot_count), scope_type_(scope_type) {}
|
| +
|
| +bool operator==(CreateFunctionContextParameters const& lhs,
|
| + CreateFunctionContextParameters const& rhs) {
|
| + return lhs.slot_count() == rhs.slot_count() &&
|
| + lhs.scope_type() == rhs.scope_type();
|
| +}
|
| +
|
| +bool operator!=(CreateFunctionContextParameters const& lhs,
|
| + CreateFunctionContextParameters const& rhs) {
|
| + return !(lhs == rhs);
|
| +}
|
| +
|
| +size_t hash_value(CreateFunctionContextParameters const& parameters) {
|
| + return base::hash_combine(parameters.slot_count(),
|
| + static_cast<int>(parameters.scope_type()));
|
| +}
|
| +
|
| +std::ostream& operator<<(std::ostream& os,
|
| + CreateFunctionContextParameters const& parameters) {
|
| + return os << parameters.slot_count() << ", " << parameters.scope_type();
|
| +}
|
| +
|
| +CreateFunctionContextParameters const& CreateFunctionContextParametersOf(
|
| + Operator const* op) {
|
| + DCHECK_EQ(IrOpcode::kJSCreateFunctionContext, op->opcode());
|
| + return OpParameter<CreateFunctionContextParameters>(op);
|
| +}
|
| +
|
| bool operator==(NamedAccess const& lhs, NamedAccess const& rhs) {
|
| return lhs.name().location() == rhs.name().location() &&
|
| lhs.language_mode() == rhs.language_mode() &&
|
| @@ -889,13 +920,14 @@ const Operator* JSOperatorBuilder::CreateLiteralRegExp(
|
| parameters); // parameter
|
| }
|
|
|
| -
|
| -const Operator* JSOperatorBuilder::CreateFunctionContext(int slot_count) {
|
| - return new (zone()) Operator1<int>( // --
|
| +const Operator* JSOperatorBuilder::CreateFunctionContext(int slot_count,
|
| + ScopeType scope_type) {
|
| + CreateFunctionContextParameters parameters(slot_count, scope_type);
|
| + return new (zone()) Operator1<CreateFunctionContextParameters>( // --
|
| IrOpcode::kJSCreateFunctionContext, Operator::kNoProperties, // opcode
|
| "JSCreateFunctionContext", // name
|
| 1, 1, 1, 1, 1, 2, // counts
|
| - slot_count); // parameter
|
| + parameters); // parameter
|
| }
|
|
|
| const Operator* JSOperatorBuilder::CreateCatchContext(
|
| @@ -918,22 +950,21 @@ const Operator* JSOperatorBuilder::CreateWithContext(
|
| }
|
|
|
| const Operator* JSOperatorBuilder::CreateBlockContext(
|
| - const Handle<ScopeInfo>& scpope_info) {
|
| + const Handle<ScopeInfo>& scope_info) {
|
| return new (zone()) Operator1<Handle<ScopeInfo>>( // --
|
| IrOpcode::kJSCreateBlockContext, Operator::kNoProperties, // opcode
|
| "JSCreateBlockContext", // name
|
| 1, 1, 1, 1, 1, 2, // counts
|
| - scpope_info); // parameter
|
| + scope_info); // parameter
|
| }
|
|
|
| -
|
| const Operator* JSOperatorBuilder::CreateScriptContext(
|
| - const Handle<ScopeInfo>& scpope_info) {
|
| + const Handle<ScopeInfo>& scope_info) {
|
| return new (zone()) Operator1<Handle<ScopeInfo>>( // --
|
| IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode
|
| "JSCreateScriptContext", // name
|
| 1, 1, 1, 1, 1, 2, // counts
|
| - scpope_info); // parameter
|
| + scope_info); // parameter
|
| }
|
|
|
| } // namespace compiler
|
|
|