OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/js-operator.h" | 5 #include "src/compiler/js-operator.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/base/lazy-instance.h" | 9 #include "src/base/lazy-instance.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 | 75 |
76 | 76 |
77 CallConstructParameters const& CallConstructParametersOf(Operator const* op) { | 77 CallConstructParameters const& CallConstructParametersOf(Operator const* op) { |
78 DCHECK_EQ(IrOpcode::kJSCallConstruct, op->opcode()); | 78 DCHECK_EQ(IrOpcode::kJSCallConstruct, op->opcode()); |
79 return OpParameter<CallConstructParameters>(op); | 79 return OpParameter<CallConstructParameters>(op); |
80 } | 80 } |
81 | 81 |
82 | 82 |
83 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { | 83 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { |
84 os << p.arity() << ", " << p.language_mode() << ", " << p.convert_mode() | 84 os << p.arity() << ", " << p.convert_mode() << ", " << p.tail_call_mode(); |
85 << ", " << p.tail_call_mode(); | |
86 return os; | 85 return os; |
87 } | 86 } |
88 | 87 |
89 | 88 |
90 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) { | 89 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) { |
91 DCHECK_EQ(IrOpcode::kJSCallFunction, op->opcode()); | 90 DCHECK_EQ(IrOpcode::kJSCallFunction, op->opcode()); |
92 return OpParameter<CallFunctionParameters>(op); | 91 return OpParameter<CallFunctionParameters>(op); |
93 } | 92 } |
94 | 93 |
95 | 94 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 536 |
538 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { | 537 const Operator* JSOperatorBuilder::ToBoolean(ToBooleanHints hints) { |
539 // TODO(turbofan): Cache most important versions of this operator. | 538 // TODO(turbofan): Cache most important versions of this operator. |
540 return new (zone()) Operator1<ToBooleanHints>( //-- | 539 return new (zone()) Operator1<ToBooleanHints>( //-- |
541 IrOpcode::kJSToBoolean, Operator::kEliminatable, // opcode | 540 IrOpcode::kJSToBoolean, Operator::kEliminatable, // opcode |
542 "JSToBoolean", // name | 541 "JSToBoolean", // name |
543 1, 1, 0, 1, 1, 0, // inputs/outputs | 542 1, 1, 0, 1, 1, 0, // inputs/outputs |
544 hints); // parameter | 543 hints); // parameter |
545 } | 544 } |
546 | 545 |
547 | |
548 const Operator* JSOperatorBuilder::CallFunction( | 546 const Operator* JSOperatorBuilder::CallFunction( |
549 size_t arity, LanguageMode language_mode, VectorSlotPair const& feedback, | 547 size_t arity, VectorSlotPair const& feedback, |
550 ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) { | 548 ConvertReceiverMode convert_mode, TailCallMode tail_call_mode) { |
551 CallFunctionParameters parameters(arity, language_mode, feedback, | 549 CallFunctionParameters parameters(arity, feedback, tail_call_mode, |
552 tail_call_mode, convert_mode); | 550 convert_mode); |
553 return new (zone()) Operator1<CallFunctionParameters>( // -- | 551 return new (zone()) Operator1<CallFunctionParameters>( // -- |
554 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode | 552 IrOpcode::kJSCallFunction, Operator::kNoProperties, // opcode |
555 "JSCallFunction", // name | 553 "JSCallFunction", // name |
556 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs | 554 parameters.arity(), 1, 1, 1, 1, 2, // inputs/outputs |
557 parameters); // parameter | 555 parameters); // parameter |
558 } | 556 } |
559 | 557 |
560 | 558 |
561 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id) { | 559 const Operator* JSOperatorBuilder::CallRuntime(Runtime::FunctionId id) { |
562 const Runtime::Function* f = Runtime::FunctionForId(id); | 560 const Runtime::Function* f = Runtime::FunctionForId(id); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 806 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
809 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 807 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
810 "JSCreateScriptContext", // name | 808 "JSCreateScriptContext", // name |
811 1, 1, 1, 1, 1, 2, // counts | 809 1, 1, 1, 1, 1, 2, // counts |
812 scpope_info); // parameter | 810 scpope_info); // parameter |
813 } | 811 } |
814 | 812 |
815 } // namespace compiler | 813 } // namespace compiler |
816 } // namespace internal | 814 } // namespace internal |
817 } // namespace v8 | 815 } // namespace v8 |
OLD | NEW |