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

Unified Diff: src/objects.cc

Issue 598703003: convert disassembler to use OStream (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « src/ia32/assembler-ia32.cc ('k') | test/cctest/test-assembler-ia32.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 eed4554091a8be0cbc6fbd15548b6beda0b7f40a..bea27922c73d72b37b57e46e0f242c623e903f63 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -10871,10 +10871,19 @@ void Code::Disassemble(const char* name, OStream& os) { // NOLINT
}
os << "Instructions (size = " << instruction_size() << ")\n";
- // TODO(svenpanne) The Disassembler should use streams, too!
{
- CodeTracer::Scope trace_scope(GetIsolate()->GetCodeTracer());
- Disassembler::Decode(trace_scope.file(), this);
+ Isolate* isolate = GetIsolate();
+ int decode_size = is_crankshafted()
+ ? static_cast<int>(safepoint_table_offset())
+ : instruction_size();
+ // If there might be a back edge table, stop before reaching it.
+ if (kind() == Code::FUNCTION) {
+ decode_size =
+ Min(decode_size, static_cast<int>(back_edge_table_offset()));
+ }
+ byte* begin = instruction_start();
+ byte* end = begin + decode_size;
+ Disassembler::Decode(isolate, &os, begin, end, this);
}
os << "\n";
« no previous file with comments | « src/ia32/assembler-ia32.cc ('k') | test/cctest/test-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698