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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 stream << "frame size: " << frame_size / kPointerSize | 301 stream << "frame size: " << frame_size / kPointerSize |
302 << "\nparameter count: " << bytecode_array->parameter_count() << '\n'; | 302 << "\nparameter count: " << bytecode_array->parameter_count() << '\n'; |
303 } | 303 } |
304 | 304 |
305 void BytecodeExpectationsPrinter::PrintBytecodeSequence( | 305 void BytecodeExpectationsPrinter::PrintBytecodeSequence( |
306 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const { | 306 std::ostream& stream, i::Handle<i::BytecodeArray> bytecode_array) const { |
307 stream << "bytecode array length: " << bytecode_array->length() | 307 stream << "bytecode array length: " << bytecode_array->length() |
308 << "\nbytecodes: [\n"; | 308 << "\nbytecodes: [\n"; |
309 | 309 |
310 SourcePositionTableIterator source_iterator( | 310 SourcePositionTableIterator source_iterator( |
311 bytecode_array->source_position_table()); | 311 bytecode_array->SourcePositionTable()); |
312 BytecodeArrayIterator bytecode_iterator(bytecode_array); | 312 BytecodeArrayIterator bytecode_iterator(bytecode_array); |
313 for (; !bytecode_iterator.done(); bytecode_iterator.Advance()) { | 313 for (; !bytecode_iterator.done(); bytecode_iterator.Advance()) { |
314 stream << kIndent; | 314 stream << kIndent; |
315 PrintSourcePosition(stream, source_iterator, | 315 PrintSourcePosition(stream, source_iterator, |
316 bytecode_iterator.current_offset()); | 316 bytecode_iterator.current_offset()); |
317 PrintBytecode(stream, bytecode_iterator, bytecode_array->parameter_count()); | 317 PrintBytecode(stream, bytecode_iterator, bytecode_array->parameter_count()); |
318 stream << ",\n"; | 318 stream << ",\n"; |
319 } | 319 } |
320 stream << "]\n"; | 320 stream << "]\n"; |
321 } | 321 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 stream << "---\n"; | 391 stream << "---\n"; |
392 PrintCodeSnippet(stream, snippet); | 392 PrintCodeSnippet(stream, snippet); |
393 PrintBytecodeArray(stream, bytecode_array); | 393 PrintBytecodeArray(stream, bytecode_array); |
394 stream << '\n'; | 394 stream << '\n'; |
395 } | 395 } |
396 | 396 |
397 } // namespace interpreter | 397 } // namespace interpreter |
398 } // namespace internal | 398 } // namespace internal |
399 } // namespace v8 | 399 } // namespace v8 |
OLD | NEW |