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 <fstream> | 5 #include <fstream> |
6 #include <iostream> | 6 #include <iostream> |
7 | 7 |
8 #include "include/libplatform/libplatform.h" | 8 #include "include/libplatform/libplatform.h" |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 stream << 'R'; | 177 stream << 'R'; |
178 if (op_size != OperandSize::kByte) stream << size_tag; | 178 if (op_size != OperandSize::kByte) stream << size_tag; |
179 stream << '(' << register_value.index() << ')'; | 179 stream << '(' << register_value.index() << ')'; |
180 } else { | 180 } else { |
181 stream << 'U' << size_tag << '('; | 181 stream << 'U' << size_tag << '('; |
182 | 182 |
183 if (Bytecodes::IsImmediateOperandType(op_type)) { | 183 if (Bytecodes::IsImmediateOperandType(op_type)) { |
184 // We need a cast, otherwise the result is printed as char. | 184 // We need a cast, otherwise the result is printed as char. |
185 stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index)); | 185 stream << static_cast<int>(bytecode_iter.GetImmediateOperand(op_index)); |
186 } else if (Bytecodes::IsRegisterCountOperandType(op_type)) { | 186 } else if (Bytecodes::IsRegisterCountOperandType(op_type)) { |
187 stream << bytecode_iter.GetCountOperand(op_index); | 187 stream << bytecode_iter.GetRegisterCountOperand(op_index); |
188 } else if (Bytecodes::IsIndexOperandType(op_type)) { | 188 } else if (Bytecodes::IsIndexOperandType(op_type)) { |
189 stream << bytecode_iter.GetIndexOperand(op_index); | 189 stream << bytecode_iter.GetIndexOperand(op_index); |
190 } else { | 190 } else { |
191 UNREACHABLE(); | 191 UNREACHABLE(); |
192 } | 192 } |
193 | 193 |
194 stream << ')'; | 194 stream << ')'; |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 std::string body; | 409 std::string body; |
410 if (!ReadFromFileOrStdin(&body, body_filename)) { | 410 if (!ReadFromFileOrStdin(&body, body_filename)) { |
411 std::cerr << "Could not open '" << body_filename << "'.\n\n"; | 411 std::cerr << "Could not open '" << body_filename << "'.\n\n"; |
412 PrintUsage(argv[0]); | 412 PrintUsage(argv[0]); |
413 return 1; | 413 return 1; |
414 } | 414 } |
415 | 415 |
416 PrintExpectedSnippet(ParseConstantPoolType(const_pool_type_string), argv[0], | 416 PrintExpectedSnippet(ParseConstantPoolType(const_pool_type_string), argv[0], |
417 body); | 417 body); |
418 } | 418 } |
OLD | NEW |