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

Unified Diff: runtime/vm/deopt_instructions.cc

Issue 227423005: Add TraceBuffer log to all Functions (plus small tweaks to function-view) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/deopt_instructions.cc
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index ffa87d77454e60d2480910da861c1ebe91377c9d..824244989056cfdd27546c27134fb19c7143e0af 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -10,6 +10,7 @@
#include "vm/locations.h"
#include "vm/parser.h"
#include "vm/stack_frame.h"
+#include "vm/trace_buffer.h"
namespace dart {
@@ -339,12 +340,19 @@ intptr_t DeoptContext::MaterializeDeferredObjects() {
// Since this is the only step where GC can occur during deoptimization,
// use it to report the source line where deoptimization occured.
+ const Code& code = Code::Handle(code_);
+ ASSERT(!code.IsNull());
+ const Function& top_function = Function::Handle(code.function());
+ // TODO(johnmccutchan): Enable appending service objects to a trace message.
+ // Once that is possible, add the Code object which was deoptimized.
+ top_function.log()->TraceF("Deoptimized (reason %" Pd " '%s')",
+ static_cast<intptr_t>(deopt_reason()),
+ DeoptReasonToText(deopt_reason()));
+
if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
DartFrameIterator iterator;
StackFrame* top_frame = iterator.NextFrame();
ASSERT(top_frame != NULL);
- const Code& code = Code::Handle(top_frame->LookupDartCode());
- const Function& top_function = Function::Handle(code.function());
const Script& script = Script::Handle(top_function.script());
const intptr_t token_pos = code.GetTokenIndexOfPC(top_frame->pc());
intptr_t line, column;
@@ -353,6 +361,9 @@ intptr_t DeoptContext::MaterializeDeferredObjects() {
OS::PrintErr(" Function: %s\n", top_function.ToFullyQualifiedCString());
OS::PrintErr(" Line %" Pd ": '%s'\n", line, line_string.ToCString());
OS::PrintErr(" Deopt args: %" Pd "\n", deopt_arg_count);
+ top_function.log()->TraceF("Deoptimized at line %" Pd ": '%s'",
+ line,
+ line_string.ToCString());
}
return deopt_arg_count;
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698