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

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
Index: runtime/vm/deopt_instructions.cc
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index ffa87d77454e60d2480910da861c1ebe91377c9d..b1bf125b59447c60db82edf30dfa415c8239253b 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,16 @@ 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.
+ DartFrameIterator iterator;
+ StackFrame* top_frame = iterator.NextFrame();
+ ASSERT(top_frame != NULL);
+ const Code& code = Code::Handle(top_frame->LookupDartCode());
turnidge 2014/04/14 16:41:17 Instead of using a DartFrameIterator to get the co
Cutch 2014/04/15 20:47:58 Done.
+ const Function& top_function = Function::Handle(code.function());
+ top_function.log()->TraceF("Deoptimized (reason %" Pd " '%s')",
+ static_cast<intptr_t>(deopt_reason()),
+ DeoptReasonToText(deopt_reason()));
turnidge 2014/04/14 16:41:17 We should eventually include which code object was
Cutch 2014/04/15 20:47:58 Done.
+
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 +358,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') | runtime/vm/object.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698