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

Side by Side Diff: src/top.cc

Issue 39009: Dump more stack frames to perf log when executing a C++ function. (Closed)
Patch Set: Changes according to Soren's comments Created 11 years, 9 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
« no previous file with comments | « src/platform.h ('k') | test/cctest/test-log-ia32.cc » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 661
662 662
663 Object* Top::PromoteScheduledException() { 663 Object* Top::PromoteScheduledException() {
664 Object* thrown = scheduled_exception(); 664 Object* thrown = scheduled_exception();
665 clear_scheduled_exception(); 665 clear_scheduled_exception();
666 // Re-throw the exception to avoid getting repeated error reporting. 666 // Re-throw the exception to avoid getting repeated error reporting.
667 return ReThrow(thrown); 667 return ReThrow(thrown);
668 } 668 }
669 669
670 670
671 // NOTE: The stack trace frame iterator is an iterator that only
672 // traverse proper JavaScript frames; that is JavaScript frames that
673 // have proper JavaScript functions. This excludes the problematic
674 // functions in runtime.js.
675 class StackTraceFrameIterator: public JavaScriptFrameIterator {
676 public:
677 StackTraceFrameIterator() {
678 if (!done() && !frame()->function()->IsJSFunction()) Advance();
679 }
680
681 void Advance() {
682 while (true) {
683 JavaScriptFrameIterator::Advance();
684 if (done()) return;
685 if (frame()->function()->IsJSFunction()) return;
686 }
687 }
688 };
689
690
691 void Top::PrintCurrentStackTrace(FILE* out) { 671 void Top::PrintCurrentStackTrace(FILE* out) {
692 StackTraceFrameIterator it; 672 StackTraceFrameIterator it;
693 while (!it.done()) { 673 while (!it.done()) {
694 HandleScope scope; 674 HandleScope scope;
695 // Find code position if recorded in relocation info. 675 // Find code position if recorded in relocation info.
696 JavaScriptFrame* frame = it.frame(); 676 JavaScriptFrame* frame = it.frame();
697 int pos = frame->code()->SourcePosition(frame->pc()); 677 int pos = frame->code()->SourcePosition(frame->pc());
698 Handle<Object> pos_obj(Smi::FromInt(pos)); 678 Handle<Object> pos_obj(Smi::FromInt(pos));
699 // Fetch function and receiver. 679 // Fetch function and receiver.
700 Handle<JSFunction> fun(JSFunction::cast(frame->function())); 680 Handle<JSFunction> fun(JSFunction::cast(frame->function()));
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 Top::break_access_->Lock(); 937 Top::break_access_->Lock();
958 } 938 }
959 939
960 940
961 ExecutionAccess::~ExecutionAccess() { 941 ExecutionAccess::~ExecutionAccess() {
962 Top::break_access_->Unlock(); 942 Top::break_access_->Unlock();
963 } 943 }
964 944
965 945
966 } } // namespace v8::internal 946 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform.h ('k') | test/cctest/test-log-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698