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 22 matching lines...) Expand all Loading... |
33 bool operator!=(VectorSlotPair const& lhs, VectorSlotPair const& rhs) { | 33 bool operator!=(VectorSlotPair const& lhs, VectorSlotPair const& rhs) { |
34 return !(lhs == rhs); | 34 return !(lhs == rhs); |
35 } | 35 } |
36 | 36 |
37 | 37 |
38 size_t hash_value(VectorSlotPair const& p) { | 38 size_t hash_value(VectorSlotPair const& p) { |
39 return base::hash_combine(p.slot(), p.vector().location()); | 39 return base::hash_combine(p.slot(), p.vector().location()); |
40 } | 40 } |
41 | 41 |
42 | 42 |
43 size_t hash_value(ConvertReceiverMode const& mode) { | 43 size_t hash_value(ConvertReceiverMode mode) { |
44 return base::hash_value(static_cast<int>(mode)); | 44 return base::hash_value(static_cast<int>(mode)); |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 std::ostream& operator<<(std::ostream& os, ConvertReceiverMode const& mode) { | 48 std::ostream& operator<<(std::ostream& os, ConvertReceiverMode mode) { |
49 switch (mode) { | 49 switch (mode) { |
50 case ConvertReceiverMode::kNullOrUndefined: | 50 case ConvertReceiverMode::kNullOrUndefined: |
51 return os << "NULL_OR_UNDEFINED"; | 51 return os << "NULL_OR_UNDEFINED"; |
52 case ConvertReceiverMode::kNotNullOrUndefined: | 52 case ConvertReceiverMode::kNotNullOrUndefined: |
53 return os << "NOT_NULL_OR_UNDEFINED"; | 53 return os << "NOT_NULL_OR_UNDEFINED"; |
54 case ConvertReceiverMode::kAny: | 54 case ConvertReceiverMode::kAny: |
55 return os << "ANY"; | 55 return os << "ANY"; |
56 } | 56 } |
57 UNREACHABLE(); | 57 UNREACHABLE(); |
58 return os; | 58 return os; |
59 } | 59 } |
60 | 60 |
61 | 61 |
| 62 ConvertReceiverMode ConvertReceiverModeOf(Operator const* op) { |
| 63 DCHECK_EQ(IrOpcode::kJSConvertReceiver, op->opcode()); |
| 64 return OpParameter<ConvertReceiverMode>(op); |
| 65 } |
| 66 |
| 67 |
62 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { | 68 std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) { |
63 os << p.arity() << ", " << p.flags() << ", " << p.language_mode(); | 69 os << p.arity() << ", " << p.flags() << ", " << p.language_mode(); |
64 if (p.AllowTailCalls()) { | 70 if (p.AllowTailCalls()) { |
65 os << ", ALLOW_TAIL_CALLS"; | 71 os << ", ALLOW_TAIL_CALLS"; |
66 } | 72 } |
67 return os; | 73 return os; |
68 } | 74 } |
69 | 75 |
70 | 76 |
71 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) { | 77 const CallFunctionParameters& CallFunctionParametersOf(const Operator* op) { |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 Handle<ScopeInfo>::hash>( // -- | 772 Handle<ScopeInfo>::hash>( // -- |
767 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 773 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
768 "JSCreateScriptContext", // name | 774 "JSCreateScriptContext", // name |
769 1, 1, 1, 1, 1, 2, // counts | 775 1, 1, 1, 1, 1, 2, // counts |
770 scpope_info); // parameter | 776 scpope_info); // parameter |
771 } | 777 } |
772 | 778 |
773 } // namespace compiler | 779 } // namespace compiler |
774 } // namespace internal | 780 } // namespace internal |
775 } // namespace v8 | 781 } // namespace v8 |
OLD | NEW |