OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecodes.h" | 5 #include "src/interpreter/bytecodes.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 #include "src/interpreter/bytecode-traits.h" | 10 #include "src/interpreter/bytecode-traits.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return "Byte"; | 93 return "Byte"; |
94 case OperandSize::kShort: | 94 case OperandSize::kShort: |
95 return "Short"; | 95 return "Short"; |
96 case OperandSize::kQuad: | 96 case OperandSize::kQuad: |
97 return "Quad"; | 97 return "Quad"; |
98 } | 98 } |
99 UNREACHABLE(); | 99 UNREACHABLE(); |
100 return ""; | 100 return ""; |
101 } | 101 } |
102 | 102 |
103 | |
104 // static | |
105 uint8_t Bytecodes::ToByte(Bytecode bytecode) { | |
106 DCHECK(bytecode <= Bytecode::kLast); | |
107 return static_cast<uint8_t>(bytecode); | |
108 } | |
109 | |
110 | |
111 // static | 103 // static |
112 Bytecode Bytecodes::FromByte(uint8_t value) { | 104 Bytecode Bytecodes::FromByte(uint8_t value) { |
113 Bytecode bytecode = static_cast<Bytecode>(value); | 105 Bytecode bytecode = static_cast<Bytecode>(value); |
114 DCHECK(bytecode <= Bytecode::kLast); | 106 DCHECK(bytecode <= Bytecode::kLast); |
115 return bytecode; | 107 return bytecode; |
116 } | 108 } |
117 | 109 |
118 | 110 |
119 // static | 111 // static |
120 Bytecode Bytecodes::GetDebugBreak(Bytecode bytecode) { | 112 Bytecode Bytecodes::GetDebugBreak(Bytecode bytecode) { |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 } else { | 920 } else { |
929 std::ostringstream s; | 921 std::ostringstream s; |
930 s << "r" << index(); | 922 s << "r" << index(); |
931 return s.str(); | 923 return s.str(); |
932 } | 924 } |
933 } | 925 } |
934 | 926 |
935 } // namespace interpreter | 927 } // namespace interpreter |
936 } // namespace internal | 928 } // namespace internal |
937 } // namespace v8 | 929 } // namespace v8 |
OLD | NEW |