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

Side by Side Diff: src/deoptimizer.cc

Issue 816013002: Use ShortPrint() in --trace_deopt output. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use ShortPrint() in --trace_deopt output. Created 6 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
« 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/disasm.h" 10 #include "src/disasm.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 DCHECK(optimized_code->contains(from_)); 630 DCHECK(optimized_code->contains(from_));
631 return optimized_code; 631 return optimized_code;
632 } 632 }
633 FATAL("Could not find code for optimized function"); 633 FATAL("Could not find code for optimized function");
634 return NULL; 634 return NULL;
635 } 635 }
636 636
637 637
638 void Deoptimizer::PrintFunctionName() { 638 void Deoptimizer::PrintFunctionName() {
639 if (function_->IsJSFunction()) { 639 if (function_->IsJSFunction()) {
640 function_->PrintName(trace_scope_->file()); 640 function_->ShortPrint(trace_scope_->file());
641 } else { 641 } else {
642 PrintF(trace_scope_->file(), 642 PrintF(trace_scope_->file(),
643 "%s", Code::Kind2String(compiled_code_->kind())); 643 "%s", Code::Kind2String(compiled_code_->kind()));
644 } 644 }
645 } 645 }
646 646
647 647
648 Deoptimizer::~Deoptimizer() { 648 Deoptimizer::~Deoptimizer() {
649 DCHECK(input_ == NULL && output_ == NULL); 649 DCHECK(input_ == NULL && output_ == NULL);
650 DCHECK(disallow_heap_allocation_ == NULL); 650 DCHECK(disallow_heap_allocation_ == NULL);
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 base::ElapsedTimer timer; 755 base::ElapsedTimer timer;
756 756
757 // Determine basic deoptimization information. The optimized frame is 757 // Determine basic deoptimization information. The optimized frame is
758 // described by the input data. 758 // described by the input data.
759 DeoptimizationInputData* input_data = 759 DeoptimizationInputData* input_data =
760 DeoptimizationInputData::cast(compiled_code_->deoptimization_data()); 760 DeoptimizationInputData::cast(compiled_code_->deoptimization_data());
761 761
762 if (trace_scope_ != NULL) { 762 if (trace_scope_ != NULL) {
763 timer.Start(); 763 timer.Start();
764 PrintF(trace_scope_->file(), 764 PrintF(trace_scope_->file(),
765 "[deoptimizing (DEOPT %s): begin 0x%08" V8PRIxPTR " ", 765 "[deoptimizing (DEOPT %s): begin ",
766 MessageFor(bailout_type_), 766 MessageFor(bailout_type_));
767 reinterpret_cast<intptr_t>(function_));
768 PrintFunctionName(); 767 PrintFunctionName();
769 PrintF(trace_scope_->file(), 768 PrintF(trace_scope_->file(),
770 " (opt #%d) @%d, FP to SP delta: %d]\n", 769 " (opt #%d) @%d, FP to SP delta: %d]\n",
771 input_data->OptimizationId()->value(), 770 input_data->OptimizationId()->value(),
772 bailout_id_, 771 bailout_id_,
773 fp_to_sp_delta_); 772 fp_to_sp_delta_);
774 if (bailout_type_ == EAGER || bailout_type_ == SOFT || 773 if (bailout_type_ == EAGER || bailout_type_ == SOFT ||
775 (compiled_code_->is_hydrogen_stub())) { 774 (compiled_code_->is_hydrogen_stub())) {
776 compiled_code_->PrintDeoptLocation(trace_scope_->file(), bailout_id_); 775 compiled_code_->PrintDeoptLocation(trace_scope_->file(), bailout_id_);
777 } 776 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 default: 842 default:
844 FATAL("Unsupported translation"); 843 FATAL("Unsupported translation");
845 break; 844 break;
846 } 845 }
847 } 846 }
848 847
849 // Print some helpful diagnostic information. 848 // Print some helpful diagnostic information.
850 if (trace_scope_ != NULL) { 849 if (trace_scope_ != NULL) {
851 double ms = timer.Elapsed().InMillisecondsF(); 850 double ms = timer.Elapsed().InMillisecondsF();
852 int index = output_count_ - 1; // Index of the topmost frame. 851 int index = output_count_ - 1; // Index of the topmost frame.
853 JSFunction* function = output_[index]->GetFunction();
854 PrintF(trace_scope_->file(), 852 PrintF(trace_scope_->file(),
855 "[deoptimizing (%s): end 0x%08" V8PRIxPTR " ", 853 "[deoptimizing (%s): end ",
856 MessageFor(bailout_type_), 854 MessageFor(bailout_type_));
857 reinterpret_cast<intptr_t>(function));
858 PrintFunctionName(); 855 PrintFunctionName();
859 PrintF(trace_scope_->file(), 856 PrintF(trace_scope_->file(),
860 " @%d => node=%d, pc=0x%08" V8PRIxPTR ", state=%s, alignment=%s," 857 " @%d => node=%d, pc=0x%08" V8PRIxPTR ", state=%s, alignment=%s,"
861 " took %0.3f ms]\n", 858 " took %0.3f ms]\n",
862 bailout_id_, 859 bailout_id_,
863 node_id.ToInt(), 860 node_id.ToInt(),
864 output_[index]->GetPc(), 861 output_[index]->GetPc(),
865 FullCodeGenerator::State2String( 862 FullCodeGenerator::State2String(
866 static_cast<FullCodeGenerator::State>( 863 static_cast<FullCodeGenerator::State>(
867 output_[index]->GetState()->value())), 864 output_[index]->GetState()->value())),
(...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 3624
3628 3625
3629 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) { 3626 void DeoptimizedFrameInfo::Iterate(ObjectVisitor* v) {
3630 v->VisitPointer(bit_cast<Object**>(&function_)); 3627 v->VisitPointer(bit_cast<Object**>(&function_));
3631 v->VisitPointer(&context_); 3628 v->VisitPointer(&context_);
3632 v->VisitPointers(parameters_, parameters_ + parameters_count_); 3629 v->VisitPointers(parameters_, parameters_ + parameters_count_);
3633 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_); 3630 v->VisitPointers(expression_stack_, expression_stack_ + expression_count_);
3634 } 3631 }
3635 3632
3636 } } // namespace v8::internal 3633 } } // 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