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

Side by Side Diff: src/isolate.cc

Issue 1149623010: Print and save JS stacktrace on OOM crash. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 6 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/heap/heap.cc ('k') | src/string-stream.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 // 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <fstream> // NOLINT(readability/streams) 7 #include <fstream> // NOLINT(readability/streams)
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "src/v8.h" 10 #include "src/v8.h"
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 StackFrameIterator it(isolate); 698 StackFrameIterator it(isolate);
699 for (int i = 0; !it.done(); it.Advance()) { 699 for (int i = 0; !it.done(); it.Advance()) {
700 it.frame()->Print(accumulator, mode, i++); 700 it.frame()->Print(accumulator, mode, i++);
701 } 701 }
702 } 702 }
703 703
704 704
705 void Isolate::PrintStack(StringStream* accumulator, PrintStackMode mode) { 705 void Isolate::PrintStack(StringStream* accumulator, PrintStackMode mode) {
706 // The MentionedObjectCache is not GC-proof at the moment. 706 // The MentionedObjectCache is not GC-proof at the moment.
707 DisallowHeapAllocation no_gc; 707 DisallowHeapAllocation no_gc;
708 DCHECK(StringStream::IsMentionedObjectCacheClear(this)); 708 DCHECK(accumulator->IsMentionedObjectCacheClear(this));
709 709
710 // Avoid printing anything if there are no frames. 710 // Avoid printing anything if there are no frames.
711 if (c_entry_fp(thread_local_top()) == 0) return; 711 if (c_entry_fp(thread_local_top()) == 0) return;
712 712
713 accumulator->Add( 713 accumulator->Add(
714 "\n==== JS stack trace =========================================\n\n"); 714 "\n==== JS stack trace =========================================\n\n");
715 PrintFrames(this, accumulator, StackFrame::OVERVIEW); 715 PrintFrames(this, accumulator, StackFrame::OVERVIEW);
716 if (mode == kPrintStackVerbose) { 716 if (mode == kPrintStackVerbose) {
717 accumulator->Add( 717 accumulator->Add(
718 "\n==== Details ================================================\n\n"); 718 "\n==== Details ================================================\n\n");
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2793 // Then check whether this scope intercepts. 2793 // Then check whether this scope intercepts.
2794 if ((flag & intercept_mask_)) { 2794 if ((flag & intercept_mask_)) {
2795 intercepted_flags_ |= flag; 2795 intercepted_flags_ |= flag;
2796 return true; 2796 return true;
2797 } 2797 }
2798 return false; 2798 return false;
2799 } 2799 }
2800 2800
2801 } // namespace internal 2801 } // namespace internal
2802 } // namespace v8 2802 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/string-stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698