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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return OpParameter<ConvertReceiverMode>(op); | 45 return OpParameter<ConvertReceiverMode>(op); |
46 } | 46 } |
47 | 47 |
48 | 48 |
49 ToBooleanHints ToBooleanHintsOf(Operator const* op) { | 49 ToBooleanHints ToBooleanHintsOf(Operator const* op) { |
50 DCHECK_EQ(IrOpcode::kJSToBoolean, op->opcode()); | 50 DCHECK_EQ(IrOpcode::kJSToBoolean, op->opcode()); |
51 return OpParameter<ToBooleanHints>(op); | 51 return OpParameter<ToBooleanHints>(op); |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 size_t hash_value(TailCallMode mode) { | |
56 return base::hash_value(static_cast<unsigned>(mode)); | |
57 } | |
58 | |
59 | |
60 std::ostream& operator<<(std::ostream& os, TailCallMode mode) { | |
61 switch (mode) { | |
62 case TailCallMode::kAllow: | |
63 return os << "ALLOW_TAIL_CALLS"; | |
64 case TailCallMode::kDisallow: | |
65 return os << "DISALLOW_TAIL_CALLS"; | |
66 } | |
67 UNREACHABLE(); | |
68 return os; | |
69 } | |
70 | |
71 | |
72 bool operator==(BinaryOperationParameters const& lhs, | 55 bool operator==(BinaryOperationParameters const& lhs, |
73 BinaryOperationParameters const& rhs) { | 56 BinaryOperationParameters const& rhs) { |
74 return lhs.language_mode() == rhs.language_mode() && | 57 return lhs.language_mode() == rhs.language_mode() && |
75 lhs.hints() == rhs.hints(); | 58 lhs.hints() == rhs.hints(); |
76 } | 59 } |
77 | 60 |
78 | 61 |
79 bool operator!=(BinaryOperationParameters const& lhs, | 62 bool operator!=(BinaryOperationParameters const& lhs, |
80 BinaryOperationParameters const& rhs) { | 63 BinaryOperationParameters const& rhs) { |
81 return !(lhs == rhs); | 64 return !(lhs == rhs); |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- | 996 return new (zone()) Operator1<Handle<ScopeInfo>>( // -- |
1014 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 997 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
1015 "JSCreateScriptContext", // name | 998 "JSCreateScriptContext", // name |
1016 1, 1, 1, 1, 1, 2, // counts | 999 1, 1, 1, 1, 1, 2, // counts |
1017 scpope_info); // parameter | 1000 scpope_info); // parameter |
1018 } | 1001 } |
1019 | 1002 |
1020 } // namespace compiler | 1003 } // namespace compiler |
1021 } // namespace internal | 1004 } // namespace internal |
1022 } // namespace v8 | 1005 } // namespace v8 |
OLD | NEW |