Reviewers: Sven,
Description:
Make --trace-deopt --code-comments print the Lithium instruction that caused
deoptimization.
This saves us from manually searching the disassembled code for the bailout
id
when looking for the reason for deoptimization.
Please review this at http://codereview.chromium.org/8008013/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/deoptimizer.cc
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);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev