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

Side by Side Diff: src/isolate.cc

Issue 15298005: Make Runtime_Abort print to stderr instead of stdout. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 | « src/isolate.h ('k') | src/runtime.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 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 frames_seen++; 828 frames_seen++;
829 } 829 }
830 it.Advance(); 830 it.Advance();
831 } 831 }
832 832
833 stack_trace->set_length(Smi::FromInt(frames_seen)); 833 stack_trace->set_length(Smi::FromInt(frames_seen));
834 return stack_trace; 834 return stack_trace;
835 } 835 }
836 836
837 837
838 void Isolate::PrintStack() { 838 void Isolate::PrintStack(FILE* out) {
839 if (stack_trace_nesting_level_ == 0) { 839 if (stack_trace_nesting_level_ == 0) {
840 stack_trace_nesting_level_++; 840 stack_trace_nesting_level_++;
841 841
842 StringAllocator* allocator; 842 StringAllocator* allocator;
843 if (preallocated_message_space_ == NULL) { 843 if (preallocated_message_space_ == NULL) {
844 allocator = new HeapStringAllocator(); 844 allocator = new HeapStringAllocator();
845 } else { 845 } else {
846 allocator = preallocated_message_space_; 846 allocator = preallocated_message_space_;
847 } 847 }
848 848
849 StringStream::ClearMentionedObjectCache(); 849 StringStream::ClearMentionedObjectCache();
850 StringStream accumulator(allocator); 850 StringStream accumulator(allocator);
851 incomplete_message_ = &accumulator; 851 incomplete_message_ = &accumulator;
852 PrintStack(&accumulator); 852 PrintStack(&accumulator);
853 accumulator.OutputToStdOut(); 853 accumulator.OutputToFile(out);
854 InitializeLoggingAndCounters(); 854 InitializeLoggingAndCounters();
855 accumulator.Log(); 855 accumulator.Log();
856 incomplete_message_ = NULL; 856 incomplete_message_ = NULL;
857 stack_trace_nesting_level_ = 0; 857 stack_trace_nesting_level_ = 0;
858 if (preallocated_message_space_ == NULL) { 858 if (preallocated_message_space_ == NULL) {
859 // Remove the HeapStringAllocator created above. 859 // Remove the HeapStringAllocator created above.
860 delete allocator; 860 delete allocator;
861 } 861 }
862 } else if (stack_trace_nesting_level_ == 1) { 862 } else if (stack_trace_nesting_level_ == 1) {
863 stack_trace_nesting_level_++; 863 stack_trace_nesting_level_++;
864 OS::PrintError( 864 OS::PrintError(
865 "\n\nAttempt to print stack while printing stack (double fault)\n"); 865 "\n\nAttempt to print stack while printing stack (double fault)\n");
866 OS::PrintError( 866 OS::PrintError(
867 "If you are lucky you may find a partial stack dump on stdout.\n\n"); 867 "If you are lucky you may find a partial stack dump on stdout.\n\n");
868 incomplete_message_->OutputToStdOut(); 868 incomplete_message_->OutputToFile(out);
869 } 869 }
870 } 870 }
871 871
872 872
873 static void PrintFrames(Isolate* isolate, 873 static void PrintFrames(Isolate* isolate,
874 StringStream* accumulator, 874 StringStream* accumulator,
875 StackFrame::PrintMode mode) { 875 StackFrame::PrintMode mode) {
876 StackFrameIterator it(isolate); 876 StackFrameIterator it(isolate);
877 for (int i = 0; !it.done(); it.Advance()) { 877 for (int i = 0; !it.done(); it.Advance()) {
878 it.frame()->Print(accumulator, mode, i++); 878 it.frame()->Print(accumulator, mode, i++);
(...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after
2489 2489
2490 #ifdef DEBUG 2490 #ifdef DEBUG
2491 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2491 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2492 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2492 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2493 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2493 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2494 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2494 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2495 #undef ISOLATE_FIELD_OFFSET 2495 #undef ISOLATE_FIELD_OFFSET
2496 #endif 2496 #endif
2497 2497
2498 } } // namespace v8::internal 2498 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698