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

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: Created 4 years, 9 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 | no next file » | 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 aa098d6005eadf3fc4ffef7e5c3b5cab93f54fc2..193dcc4c90d98fc31e064d69a4ec5ccfe09234f7 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14977,7 +14977,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(
@@ -14993,12 +14992,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() << " : ";
rmcilroy 2016/03/17 11:29:37 It's difficult to tell what this looks like when r
Michael Starzinger 2016/03/17 11:51:14 I went with this formatting because it is the same
rmcilroy 2016/03/17 13:17:08 @ symbols sound good to me, let's go with that.
Michael Starzinger 2016/04/08 13:49:29 Done.
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 | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698