OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "test/cctest/interpreter/bytecode-expectations-printer.h" | 5 #include "test/cctest/interpreter/bytecode-expectations-printer.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 #include <iostream> | 8 #include <iostream> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 int parameter_index = register_value.ToParameterIndex(parameter_count); | 168 int parameter_index = register_value.ToParameterIndex(parameter_count); |
169 if (parameter_index == 0) { | 169 if (parameter_index == 0) { |
170 stream << "(this)"; | 170 stream << "(this)"; |
171 } else { | 171 } else { |
172 stream << "(arg" << (parameter_index - 1) << ')'; | 172 stream << "(arg" << (parameter_index - 1) << ')'; |
173 } | 173 } |
174 } else { | 174 } else { |
175 stream << '(' << register_value.index() << ')'; | 175 stream << '(' << register_value.index() << ')'; |
176 } | 176 } |
177 } else { | 177 } else { |
178 stream << 'U' << size_tag << '('; | |
179 | |
180 switch (op_type) { | 178 switch (op_type) { |
181 case OperandType::kFlag8: | 179 case OperandType::kFlag8: |
| 180 stream << 'U' << size_tag << '('; |
182 stream << bytecode_iterator.GetFlagOperand(op_index); | 181 stream << bytecode_iterator.GetFlagOperand(op_index); |
183 break; | 182 break; |
184 case OperandType::kIdx: { | 183 case OperandType::kIdx: { |
| 184 stream << 'U' << size_tag << '('; |
185 uint32_t idx = bytecode_iterator.GetIndexOperand(op_index); | 185 uint32_t idx = bytecode_iterator.GetIndexOperand(op_index); |
186 if (bytecode == Bytecode::kCallJSRuntime && op_index == 0) { | 186 if (bytecode == Bytecode::kCallJSRuntime && op_index == 0) { |
187 stream << "%" << NameForNativeContextIntrinsicIndex(idx); | 187 stream << "%" << NameForNativeContextIntrinsicIndex(idx); |
188 } else { | 188 } else { |
189 stream << idx; | 189 stream << idx; |
190 } | 190 } |
191 break; | 191 break; |
192 } | 192 } |
193 case OperandType::kUImm: | 193 case OperandType::kUImm: |
| 194 stream << 'U' << size_tag << '('; |
194 stream << bytecode_iterator.GetUnsignedImmediateOperand(op_index); | 195 stream << bytecode_iterator.GetUnsignedImmediateOperand(op_index); |
195 break; | 196 break; |
196 case OperandType::kImm: | 197 case OperandType::kImm: |
| 198 stream << 'I' << size_tag << '('; |
197 stream << bytecode_iterator.GetImmediateOperand(op_index); | 199 stream << bytecode_iterator.GetImmediateOperand(op_index); |
198 break; | 200 break; |
199 case OperandType::kRegCount: | 201 case OperandType::kRegCount: |
| 202 stream << 'U' << size_tag << '('; |
200 stream << bytecode_iterator.GetRegisterCountOperand(op_index); | 203 stream << bytecode_iterator.GetRegisterCountOperand(op_index); |
201 break; | 204 break; |
202 case OperandType::kRuntimeId: { | 205 case OperandType::kRuntimeId: { |
| 206 stream << 'U' << size_tag << '('; |
203 Runtime::FunctionId id = | 207 Runtime::FunctionId id = |
204 bytecode_iterator.GetRuntimeIdOperand(op_index); | 208 bytecode_iterator.GetRuntimeIdOperand(op_index); |
205 stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name; | 209 stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name; |
206 break; | 210 break; |
207 } | 211 } |
208 case OperandType::kIntrinsicId: { | 212 case OperandType::kIntrinsicId: { |
| 213 stream << 'U' << size_tag << '('; |
209 Runtime::FunctionId id = | 214 Runtime::FunctionId id = |
210 bytecode_iterator.GetIntrinsicIdOperand(op_index); | 215 bytecode_iterator.GetIntrinsicIdOperand(op_index); |
211 stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name; | 216 stream << "Runtime::k" << i::Runtime::FunctionForId(id)->name; |
212 break; | 217 break; |
213 } | 218 } |
214 default: | 219 default: |
215 UNREACHABLE(); | 220 UNREACHABLE(); |
216 } | 221 } |
217 | 222 |
218 stream << ')'; | 223 stream << ')'; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 388 |
384 stream << "---\n"; | 389 stream << "---\n"; |
385 PrintCodeSnippet(stream, snippet); | 390 PrintCodeSnippet(stream, snippet); |
386 PrintBytecodeArray(stream, bytecode_array); | 391 PrintBytecodeArray(stream, bytecode_array); |
387 stream << '\n'; | 392 stream << '\n'; |
388 } | 393 } |
389 | 394 |
390 } // namespace interpreter | 395 } // namespace interpreter |
391 } // namespace internal | 396 } // namespace internal |
392 } // namespace v8 | 397 } // namespace v8 |
OLD | NEW |