| OLD | NEW |
| 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 "src/isolate.h" | 5 #include "src/isolate.h" |
| 6 | 6 |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 StackFrameIterator it(isolate); | 816 StackFrameIterator it(isolate); |
| 817 for (int i = 0; !it.done(); it.Advance()) { | 817 for (int i = 0; !it.done(); it.Advance()) { |
| 818 it.frame()->Print(accumulator, mode, i++); | 818 it.frame()->Print(accumulator, mode, i++); |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 | 821 |
| 822 | 822 |
| 823 void Isolate::PrintStack(StringStream* accumulator, PrintStackMode mode) { | 823 void Isolate::PrintStack(StringStream* accumulator, PrintStackMode mode) { |
| 824 // The MentionedObjectCache is not GC-proof at the moment. | 824 // The MentionedObjectCache is not GC-proof at the moment. |
| 825 DisallowHeapAllocation no_gc; | 825 DisallowHeapAllocation no_gc; |
| 826 HandleScope scope(this); |
| 826 DCHECK(accumulator->IsMentionedObjectCacheClear(this)); | 827 DCHECK(accumulator->IsMentionedObjectCacheClear(this)); |
| 827 | 828 |
| 828 // Avoid printing anything if there are no frames. | 829 // Avoid printing anything if there are no frames. |
| 829 if (c_entry_fp(thread_local_top()) == 0) return; | 830 if (c_entry_fp(thread_local_top()) == 0) return; |
| 830 | 831 |
| 831 accumulator->Add( | 832 accumulator->Add( |
| 832 "\n==== JS stack trace =========================================\n\n"); | 833 "\n==== JS stack trace =========================================\n\n"); |
| 833 PrintFrames(this, accumulator, StackFrame::OVERVIEW); | 834 PrintFrames(this, accumulator, StackFrame::OVERVIEW); |
| 834 if (mode == kPrintStackVerbose) { | 835 if (mode == kPrintStackVerbose) { |
| 835 accumulator->Add( | 836 accumulator->Add( |
| (...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 // Then check whether this scope intercepts. | 3087 // Then check whether this scope intercepts. |
| 3087 if ((flag & intercept_mask_)) { | 3088 if ((flag & intercept_mask_)) { |
| 3088 intercepted_flags_ |= flag; | 3089 intercepted_flags_ |= flag; |
| 3089 return true; | 3090 return true; |
| 3090 } | 3091 } |
| 3091 return false; | 3092 return false; |
| 3092 } | 3093 } |
| 3093 | 3094 |
| 3094 } // namespace internal | 3095 } // namespace internal |
| 3095 } // namespace v8 | 3096 } // namespace v8 |
| OLD | NEW |