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

Side by Side Diff: src/deoptimizer.cc

Issue 11640041: Refactoring only: Extracted method to print deopt location. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 if (function->IsSmi()) { 522 if (function->IsSmi()) {
523 function = NULL; 523 function = NULL;
524 } 524 }
525 if (function != NULL && function->IsOptimized()) { 525 if (function != NULL && function->IsOptimized()) {
526 function->shared()->increment_deopt_count(); 526 function->shared()->increment_deopt_count();
527 } 527 }
528 // Find the optimized code. 528 // Find the optimized code.
529 if (type == EAGER) { 529 if (type == EAGER) {
530 ASSERT(from == NULL); 530 ASSERT(from == NULL);
531 compiled_code_ = function_->code(); 531 compiled_code_ = function_->code();
532 if (FLAG_trace_deopt && FLAG_code_comments) { 532 if (FLAG_trace_deopt) compiled_code_->PrintDeoptLocation(bailout_id);
533 // Print instruction associated with this bailout.
534 const char* last_comment = NULL;
535 int mask = RelocInfo::ModeMask(RelocInfo::COMMENT)
536 | RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
537 for (RelocIterator it(compiled_code_, mask); !it.done(); it.next()) {
538 RelocInfo* info = it.rinfo();
539 if (info->rmode() == RelocInfo::COMMENT) {
540 last_comment = reinterpret_cast<const char*>(info->data());
541 }
542 if (info->rmode() == RelocInfo::RUNTIME_ENTRY) {
543 unsigned id = Deoptimizer::GetDeoptimizationId(
544 info->target_address(), Deoptimizer::EAGER);
545 if (id == bailout_id && last_comment != NULL) {
546 PrintF(" %s\n", last_comment);
547 break;
548 }
549 }
550 }
551 }
552 } else if (type == LAZY) { 533 } else if (type == LAZY) {
553 compiled_code_ = isolate->deoptimizer_data()->FindDeoptimizingCode(from); 534 compiled_code_ = isolate->deoptimizer_data()->FindDeoptimizingCode(from);
554 if (compiled_code_ == NULL) { 535 if (compiled_code_ == NULL) {
555 compiled_code_ = 536 compiled_code_ =
556 static_cast<Code*>(isolate->heap()->FindCodeObject(from)); 537 static_cast<Code*>(isolate->heap()->FindCodeObject(from));
557 } 538 }
558 ASSERT(compiled_code_ != NULL); 539 ASSERT(compiled_code_ != NULL);
559 } else if (type == OSR) { 540 } else if (type == OSR) {
560 // The function has already been optimized and we're transitioning 541 // The function has already been optimized and we're transitioning
561 // from the unoptimized shared version to the optimized one in the 542 // from the unoptimized shared version to the optimized one in the
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 2071
2091 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 2072 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
2092 v->VisitPointer(BitCast<Object**>(&function_)); 2073 v->VisitPointer(BitCast<Object**>(&function_));
2093 v->VisitPointers(parameters_, parameters_ + parameters_count_); 2074 v->VisitPointers(parameters_, parameters_ + parameters_count_);
2094 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 2075 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
2095 } 2076 }
2096 2077
2097 #endif // ENABLE_DEBUGGER_SUPPORT 2078 #endif // ENABLE_DEBUGGER_SUPPORT
2098 2079
2099 } } // namespace v8::internal 2080 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698