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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 void BytecodeExpectationsPrinter::PrintSourcePosition( | 215 void BytecodeExpectationsPrinter::PrintSourcePosition( |
216 std::ostream& stream, SourcePositionTableIterator& source_iterator, | 216 std::ostream& stream, SourcePositionTableIterator& source_iterator, |
217 int bytecode_offset) const { | 217 int bytecode_offset) const { |
218 static const size_t kPositionWidth = 4; | 218 static const size_t kPositionWidth = 4; |
219 if (!source_iterator.done() && | 219 if (!source_iterator.done() && |
220 source_iterator.code_offset() == bytecode_offset) { | 220 source_iterator.code_offset() == bytecode_offset) { |
221 stream << "/* " << std::setw(kPositionWidth) | 221 stream << "/* " << std::setw(kPositionWidth) |
222 << source_iterator.source_position(); | 222 << source_iterator.source_position().ScriptOffset(); |
223 if (source_iterator.is_statement()) { | 223 if (source_iterator.is_statement()) { |
224 stream << " S> */ "; | 224 stream << " S> */ "; |
225 } else { | 225 } else { |
226 stream << " E> */ "; | 226 stream << " E> */ "; |
227 } | 227 } |
228 source_iterator.Advance(); | 228 source_iterator.Advance(); |
229 } else { | 229 } else { |
230 stream << " " << std::setw(kPositionWidth) << ' ' << " "; | 230 stream << " " << std::setw(kPositionWidth) << ' ' << " "; |
231 } | 231 } |
232 } | 232 } |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 stream << "---\n"; | 359 stream << "---\n"; |
360 PrintCodeSnippet(stream, snippet); | 360 PrintCodeSnippet(stream, snippet); |
361 PrintBytecodeArray(stream, bytecode_array); | 361 PrintBytecodeArray(stream, bytecode_array); |
362 stream << '\n'; | 362 stream << '\n'; |
363 } | 363 } |
364 | 364 |
365 } // namespace interpreter | 365 } // namespace interpreter |
366 } // namespace internal | 366 } // namespace internal |
367 } // namespace v8 | 367 } // namespace v8 |
OLD | NEW |