| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 343 |
| 344 const CreateArrayParameters& CreateArrayParametersOf(const Operator* op) { | 344 const CreateArrayParameters& CreateArrayParametersOf(const Operator* op) { |
| 345 DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode()); | 345 DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode()); |
| 346 return OpParameter<CreateArrayParameters>(op); | 346 return OpParameter<CreateArrayParameters>(op); |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| 350 bool operator==(CreateClosureParameters const& lhs, | 350 bool operator==(CreateClosureParameters const& lhs, |
| 351 CreateClosureParameters const& rhs) { | 351 CreateClosureParameters const& rhs) { |
| 352 return lhs.pretenure() == rhs.pretenure() && | 352 return lhs.pretenure() == rhs.pretenure() && |
| 353 lhs.feedback() == rhs.feedback() && |
| 353 lhs.shared_info().location() == rhs.shared_info().location(); | 354 lhs.shared_info().location() == rhs.shared_info().location(); |
| 354 } | 355 } |
| 355 | 356 |
| 356 | 357 |
| 357 bool operator!=(CreateClosureParameters const& lhs, | 358 bool operator!=(CreateClosureParameters const& lhs, |
| 358 CreateClosureParameters const& rhs) { | 359 CreateClosureParameters const& rhs) { |
| 359 return !(lhs == rhs); | 360 return !(lhs == rhs); |
| 360 } | 361 } |
| 361 | 362 |
| 362 | 363 |
| 363 size_t hash_value(CreateClosureParameters const& p) { | 364 size_t hash_value(CreateClosureParameters const& p) { |
| 364 return base::hash_combine(p.pretenure(), p.shared_info().location()); | 365 return base::hash_combine(p.pretenure(), p.shared_info().location(), |
| 366 p.feedback()); |
| 365 } | 367 } |
| 366 | 368 |
| 367 | 369 |
| 368 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { | 370 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { |
| 369 return os << p.pretenure() << ", " << Brief(*p.shared_info()); | 371 return os << p.pretenure() << ", " << Brief(*p.shared_info()); |
| 370 } | 372 } |
| 371 | 373 |
| 372 | 374 |
| 373 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { | 375 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { |
| 374 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode()); | 376 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode()); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 // constructor, new_target, arg1, ..., argN | 805 // constructor, new_target, arg1, ..., argN |
| 804 int const value_input_count = static_cast<int>(arity) + 2; | 806 int const value_input_count = static_cast<int>(arity) + 2; |
| 805 CreateArrayParameters parameters(arity, site); | 807 CreateArrayParameters parameters(arity, site); |
| 806 return new (zone()) Operator1<CreateArrayParameters>( // -- | 808 return new (zone()) Operator1<CreateArrayParameters>( // -- |
| 807 IrOpcode::kJSCreateArray, Operator::kNoProperties, // opcode | 809 IrOpcode::kJSCreateArray, Operator::kNoProperties, // opcode |
| 808 "JSCreateArray", // name | 810 "JSCreateArray", // name |
| 809 value_input_count, 1, 1, 1, 1, 2, // counts | 811 value_input_count, 1, 1, 1, 1, 2, // counts |
| 810 parameters); // parameter | 812 parameters); // parameter |
| 811 } | 813 } |
| 812 | 814 |
| 813 | |
| 814 const Operator* JSOperatorBuilder::CreateClosure( | 815 const Operator* JSOperatorBuilder::CreateClosure( |
| 815 Handle<SharedFunctionInfo> shared_info, PretenureFlag pretenure) { | 816 Handle<SharedFunctionInfo> shared_info, VectorSlotPair const& feedback, |
| 816 CreateClosureParameters parameters(shared_info, pretenure); | 817 PretenureFlag pretenure) { |
| 818 CreateClosureParameters parameters(shared_info, feedback, pretenure); |
| 817 return new (zone()) Operator1<CreateClosureParameters>( // -- | 819 return new (zone()) Operator1<CreateClosureParameters>( // -- |
| 818 IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode | 820 IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode |
| 819 "JSCreateClosure", // name | 821 "JSCreateClosure", // name |
| 820 0, 1, 1, 1, 1, 0, // counts | 822 0, 1, 1, 1, 1, 0, // counts |
| 821 parameters); // parameter | 823 parameters); // parameter |
| 822 } | 824 } |
| 823 | 825 |
| 824 const Operator* JSOperatorBuilder::CreateLiteralArray( | 826 const Operator* JSOperatorBuilder::CreateLiteralArray( |
| 825 Handle<FixedArray> constant_elements, int literal_flags, int literal_index, | 827 Handle<FixedArray> constant_elements, int literal_flags, int literal_index, |
| 826 int number_of_elements) { | 828 int number_of_elements) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 902 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
| 901 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 903 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
| 902 "JSCreateScriptContext", // name | 904 "JSCreateScriptContext", // name |
| 903 1, 1, 1, 1, 1, 2, // counts | 905 1, 1, 1, 1, 1, 2, // counts |
| 904 scpope_info); // parameter | 906 scpope_info); // parameter |
| 905 } | 907 } |
| 906 | 908 |
| 907 } // namespace compiler | 909 } // namespace compiler |
| 908 } // namespace internal | 910 } // namespace internal |
| 909 } // namespace v8 | 911 } // namespace v8 |
| OLD | NEW |