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"; |