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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 function->PrintName(); 340 function->PrintName();
341 PrintF(" at ast id #%u, address 0x%" V8PRIxPTR ", frame size %d\n", 341 PrintF(" at ast id #%u, address 0x%" V8PRIxPTR ", frame size %d\n",
342 bailout_id, 342 bailout_id,
343 reinterpret_cast<intptr_t>(from), 343 reinterpret_cast<intptr_t>(from),
344 fp_to_sp_delta - (2 * kPointerSize)); 344 fp_to_sp_delta - (2 * kPointerSize));
345 } 345 }
346 // Find the optimized code. 346 // Find the optimized code.
347 if (type == EAGER) { 347 if (type == EAGER) {
348 ASSERT(from == NULL); 348 ASSERT(from == NULL);
349 optimized_code_ = function_->code(); 349 optimized_code_ = function_->code();
350 if (FLAG_trace_deopt && FLAG_code_comments) {
351 // Print instruction associated with this bailout.
352 const char* last_comment = NULL;
353 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT)
354 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
355 for (RelocIterator it(optimized_code_, mask); !it.done(); it.next()) {
356 RelocInfo* info = it.rinfo();
357 if (info->rmode() == RelocInfo::COMMENT) {
358 last_comment = reinterpret_cast<const char*>(info->data());
359 }
360 if (info->rmode() == RelocInfo::RUNTIME_ENTRY) {
361 unsigned id = Deoptimizer::GetDeoptimizationId(
362 info->target_address(), Deoptimizer::EAGER);
363 if (id == bailout_id && last_comment != NULL) {
364 PrintF(" %s\n", last_comment);
365 break;
366 }
367 }
368 }
369 }
350 } else if (type == LAZY) { 370 } else if (type == LAZY) {
351 optimized_code_ = FindDeoptimizingCodeFromAddress(from); 371 optimized_code_ = FindDeoptimizingCodeFromAddress(from);
352 ASSERT(optimized_code_ != NULL); 372 ASSERT(optimized_code_ != NULL);
353 } else if (type == OSR) { 373 } else if (type == OSR) {
354 // The function has already been optimized and we're transitioning 374 // The function has already been optimized and we're transitioning
355 // from the unoptimized shared version to the optimized one in the 375 // from the unoptimized shared version to the optimized one in the
356 // function. The return address (from) points to unoptimized code. 376 // function. The return address (from) points to unoptimized code.
357 optimized_code_ = function_->code(); 377 optimized_code_ = function_->code();
358 ASSERT(optimized_code_->kind() == Code::OPTIMIZED_FUNCTION); 378 ASSERT(optimized_code_->kind() == Code::OPTIMIZED_FUNCTION);
359 ASSERT(!optimized_code_->contains(from)); 379 ASSERT(!optimized_code_->contains(from));
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 1500
1481 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 1501 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
1482 v->VisitPointer(BitCast<Object**>(&function_)); 1502 v->VisitPointer(BitCast<Object**>(&function_));
1483 v->VisitPointers(parameters_, parameters_ + parameters_count_); 1503 v->VisitPointers(parameters_, parameters_ + parameters_count_);
1484 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 1504 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
1485 } 1505 }
1486 1506
1487 #endif // ENABLE_DEBUGGER_SUPPORT 1507 #endif // ENABLE_DEBUGGER_SUPPORT
1488 1508
1489 } } // namespace v8::internal 1509 } } // namespace v8::internal
OLDNEW
« 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