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

Unified Diff: runtime/vm/object.cc

Issue 10823131: Add deopt info to code object and print it (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/locations.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 10302)
+++ runtime/vm/object.cc (working copy)
@@ -10,6 +10,7 @@
#include "vm/bigint_operations.h"
#include "vm/bootstrap.h"
#include "vm/datastream.h"
+#include "vm/deopt_instructions.h"
#include "vm/code_generator.h"
#include "vm/code_patcher.h"
#include "vm/compiler.h"
@@ -6932,11 +6933,15 @@
if (Length() == 0) {
return "No DeoptInfo";
}
- // First compute the buffer size required.
+ // Convert to DeoptInstr.
+ GrowableArray<DeoptInstr*> deopt_instrs(Length());
+ for (intptr_t i = 0; i < Length(); i++) {
+ deopt_instrs.Add(DeoptInstr::Create(Instruction(i), FromIndex(i)));
+ }
+ // Compute the buffer size required.
intptr_t len = 0;
for (intptr_t i = 0; i < Length(); i++) {
- len += OS::SNPrint(NULL, 0, "[%d(%d):%d]",
- Instruction(i), FromIndex(i), i);
+ len += OS::SNPrint(NULL, 0, "[%s]", deopt_instrs[i]->ToCString());
}
// Allocate the buffer.
char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
@@ -6944,11 +6949,9 @@
intptr_t index = 0;
for (intptr_t i = 0; i < Length(); i++) {
index += OS::SNPrint((buffer + index),
- (len - index),
- "[%d(%d):%d]",
- Instruction(i),
- FromIndex(i),
- i);
+ (len - index) + 1,
+ "[%s]",
+ deopt_instrs[i]->ToCString());
}
return buffer;
}
« no previous file with comments | « runtime/vm/locations.h ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698