| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 398 |
| 399 const CreateArrayParameters& CreateArrayParametersOf(const Operator* op) { | 399 const CreateArrayParameters& CreateArrayParametersOf(const Operator* op) { |
| 400 DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode()); | 400 DCHECK_EQ(IrOpcode::kJSCreateArray, op->opcode()); |
| 401 return OpParameter<CreateArrayParameters>(op); | 401 return OpParameter<CreateArrayParameters>(op); |
| 402 } | 402 } |
| 403 | 403 |
| 404 | 404 |
| 405 bool operator==(CreateClosureParameters const& lhs, | 405 bool operator==(CreateClosureParameters const& lhs, |
| 406 CreateClosureParameters const& rhs) { | 406 CreateClosureParameters const& rhs) { |
| 407 return lhs.pretenure() == rhs.pretenure() && | 407 return lhs.pretenure() == rhs.pretenure() && |
| 408 lhs.feedback() == rhs.feedback() && |
| 408 lhs.shared_info().location() == rhs.shared_info().location(); | 409 lhs.shared_info().location() == rhs.shared_info().location(); |
| 409 } | 410 } |
| 410 | 411 |
| 411 | 412 |
| 412 bool operator!=(CreateClosureParameters const& lhs, | 413 bool operator!=(CreateClosureParameters const& lhs, |
| 413 CreateClosureParameters const& rhs) { | 414 CreateClosureParameters const& rhs) { |
| 414 return !(lhs == rhs); | 415 return !(lhs == rhs); |
| 415 } | 416 } |
| 416 | 417 |
| 417 | 418 |
| 418 size_t hash_value(CreateClosureParameters const& p) { | 419 size_t hash_value(CreateClosureParameters const& p) { |
| 419 return base::hash_combine(p.pretenure(), p.shared_info().location()); | 420 return base::hash_combine(p.pretenure(), p.shared_info().location(), |
| 421 p.feedback()); |
| 420 } | 422 } |
| 421 | 423 |
| 422 | 424 |
| 423 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { | 425 std::ostream& operator<<(std::ostream& os, CreateClosureParameters const& p) { |
| 424 return os << p.pretenure() << ", " << Brief(*p.shared_info()); | 426 return os << p.pretenure() << ", " << Brief(*p.shared_info()); |
| 425 } | 427 } |
| 426 | 428 |
| 427 | 429 |
| 428 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { | 430 const CreateClosureParameters& CreateClosureParametersOf(const Operator* op) { |
| 429 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode()); | 431 DCHECK_EQ(IrOpcode::kJSCreateClosure, op->opcode()); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 // constructor, new_target, arg1, ..., argN | 869 // constructor, new_target, arg1, ..., argN |
| 868 int const value_input_count = static_cast<int>(arity) + 2; | 870 int const value_input_count = static_cast<int>(arity) + 2; |
| 869 CreateArrayParameters parameters(arity, site); | 871 CreateArrayParameters parameters(arity, site); |
| 870 return new (zone()) Operator1<CreateArrayParameters>( // -- | 872 return new (zone()) Operator1<CreateArrayParameters>( // -- |
| 871 IrOpcode::kJSCreateArray, Operator::kNoProperties, // opcode | 873 IrOpcode::kJSCreateArray, Operator::kNoProperties, // opcode |
| 872 "JSCreateArray", // name | 874 "JSCreateArray", // name |
| 873 value_input_count, 1, 1, 1, 1, 2, // counts | 875 value_input_count, 1, 1, 1, 1, 2, // counts |
| 874 parameters); // parameter | 876 parameters); // parameter |
| 875 } | 877 } |
| 876 | 878 |
| 877 | |
| 878 const Operator* JSOperatorBuilder::CreateClosure( | 879 const Operator* JSOperatorBuilder::CreateClosure( |
| 879 Handle<SharedFunctionInfo> shared_info, PretenureFlag pretenure) { | 880 Handle<SharedFunctionInfo> shared_info, VectorSlotPair const& feedback, |
| 880 CreateClosureParameters parameters(shared_info, pretenure); | 881 PretenureFlag pretenure) { |
| 882 CreateClosureParameters parameters(shared_info, feedback, pretenure); |
| 881 return new (zone()) Operator1<CreateClosureParameters>( // -- | 883 return new (zone()) Operator1<CreateClosureParameters>( // -- |
| 882 IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode | 884 IrOpcode::kJSCreateClosure, Operator::kNoThrow, // opcode |
| 883 "JSCreateClosure", // name | 885 "JSCreateClosure", // name |
| 884 0, 1, 1, 1, 1, 0, // counts | 886 0, 1, 1, 1, 1, 0, // counts |
| 885 parameters); // parameter | 887 parameters); // parameter |
| 886 } | 888 } |
| 887 | 889 |
| 888 const Operator* JSOperatorBuilder::CreateLiteralArray( | 890 const Operator* JSOperatorBuilder::CreateLiteralArray( |
| 889 Handle<ConstantElementsPair> constant_elements, int literal_flags, | 891 Handle<ConstantElementsPair> constant_elements, int literal_flags, |
| 890 int literal_index, int number_of_elements) { | 892 int literal_index, int number_of_elements) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 964 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 966 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
| 965 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 967 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
| 966 "JSCreateScriptContext", // name | 968 "JSCreateScriptContext", // name |
| 967 1, 1, 1, 1, 1, 2, // counts | 969 1, 1, 1, 1, 1, 2, // counts |
| 968 scope_info); // parameter | 970 scope_info); // parameter |
| 969 } | 971 } |
| 970 | 972 |
| 971 } // namespace compiler | 973 } // namespace compiler |
| 972 } // namespace internal | 974 } // namespace internal |
| 973 } // namespace v8 | 975 } // namespace v8 |
| OLD | NEW |