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

Unified Diff: src/deoptimizer.cc

Issue 8008013: Make --trace-deopt --code-comments print the Lithium instruction that caused deoptimization. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
===================================================================
--- src/deoptimizer.cc (revision 9412)
+++ src/deoptimizer.cc (working copy)
@@ -347,6 +347,26 @@
if (type == EAGER) {
ASSERT(from == NULL);
optimized_code_ = function_->code();
+ if (FLAG_trace_deopt && FLAG_code_comments) {
+ // Print instruction associated with this bailout.
+ const char* last_comment = NULL;
+ int mask = RelocInfo::ModeMask(RelocInfo::COMMENT)
+ | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
+ for (RelocIterator it(optimized_code_, mask); !it.done(); it.next()) {
+ RelocInfo* info = it.rinfo();
+ if (info->rmode() == RelocInfo::COMMENT) {
+ last_comment = reinterpret_cast<const char*>(info->data());
+ }
+ if (info->rmode() == RelocInfo::RUNTIME_ENTRY) {
+ unsigned id = Deoptimizer::GetDeoptimizationId(
+ info->target_address(), Deoptimizer::EAGER);
+ if (id == bailout_id && last_comment != NULL) {
+ PrintF(" %s\n", last_comment);
+ break;
+ }
+ }
+ }
+ }
} else if (type == LAZY) {
optimized_code_ = FindDeoptimizingCodeFromAddress(from);
ASSERT(optimized_code_ != NULL);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698