Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Unified Diff: src/objects.cc

Issue 1803373002: [interpreter] Print bytecode offsets when dumping bytecode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index b6070aaf12784d0a35a53c146c6b6eb32d1d28d5..d441784df7217dca9bc964ec5ef301beeaee177e 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14570,7 +14570,6 @@ int BytecodeArray::SourceStatementPosition(int offset) {
void BytecodeArray::Disassemble(std::ostream& os) {
os << "Parameter count " << parameter_count() << "\n";
os << "Frame size " << frame_size() << "\n";
- Vector<char> buf = Vector<char>::New(50);
const uint8_t* base_address = GetFirstBytecodeAddress();
interpreter::SourcePositionTableIterator source_positions(
@@ -14587,12 +14586,13 @@ void BytecodeArray::Disassemble(std::ostream& os) {
os << " ";
}
const uint8_t* current_address = base_address + iterator.current_offset();
- SNPrintF(buf, "%p", current_address);
- os << buf.start() << " : ";
+ os << reinterpret_cast<const void*>(current_address) << " @ "
+ << std::setw(4) << iterator.current_offset() << " : ";
interpreter::Bytecodes::Decode(os, current_address, parameter_count());
if (interpreter::Bytecodes::IsJump(iterator.current_bytecode())) {
- SNPrintF(buf, " (%p)", base_address + iterator.GetJumpTargetOffset());
- os << buf.start();
+ const void* jump_target = base_address + iterator.GetJumpTargetOffset();
+ os << " (" << jump_target << " @ " << iterator.GetJumpTargetOffset()
+ << ")";
}
os << std::endl;
iterator.Advance();
« no previous file with comments | « no previous file | src/runtime/runtime-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698