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 mode) { | |
44 return base::hash_value(static_cast<unsigned>(mode)); | |
45 } | |
46 | |
47 | |
48 std::ostream& operator<<(std::ostream& os, ConvertReceiverMode mode) { | |
49 switch (mode) { | |
50 case ConvertReceiverMode::kNullOrUndefined: | |
51 return os << "NULL_OR_UNDEFINED"; | |
52 case ConvertReceiverMode::kNotNullOrUndefined: | |
53 return os << "NOT_NULL_OR_UNDEFINED"; | |
54 case ConvertReceiverMode::kAny: | |
55 return os << "ANY"; | |
56 } | |
57 UNREACHABLE(); | |
58 return os; | |
59 } | |
60 | |
61 | |
62 ConvertReceiverMode ConvertReceiverModeOf(Operator const* op) { | 43 ConvertReceiverMode ConvertReceiverModeOf(Operator const* op) { |
63 DCHECK_EQ(IrOpcode::kJSConvertReceiver, op->opcode()); | 44 DCHECK_EQ(IrOpcode::kJSConvertReceiver, op->opcode()); |
64 return OpParameter<ConvertReceiverMode>(op); | 45 return OpParameter<ConvertReceiverMode>(op); |
65 } | 46 } |
66 | 47 |
67 | 48 |
68 size_t hash_value(TailCallMode mode) { | 49 size_t hash_value(TailCallMode mode) { |
69 return base::hash_value(static_cast<unsigned>(mode)); | 50 return base::hash_value(static_cast<unsigned>(mode)); |
70 } | 51 } |
71 | 52 |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 Handle<ScopeInfo>::hash>( // -- | 701 Handle<ScopeInfo>::hash>( // -- |
721 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode | 702 IrOpcode::kJSCreateScriptContext, Operator::kNoProperties, // opcode |
722 "JSCreateScriptContext", // name | 703 "JSCreateScriptContext", // name |
723 1, 1, 1, 1, 1, 2, // counts | 704 1, 1, 1, 1, 1, 2, // counts |
724 scpope_info); // parameter | 705 scpope_info); // parameter |
725 } | 706 } |
726 | 707 |
727 } // namespace compiler | 708 } // namespace compiler |
728 } // namespace internal | 709 } // namespace internal |
729 } // namespace v8 | 710 } // namespace v8 |
OLD | NEW |