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 2907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2918 counters()->detached_context_age_in_gc()->AddSample(mark_sweeps + 1); | 2918 counters()->detached_context_age_in_gc()->AddSample(mark_sweeps + 1); |
2919 } | 2919 } |
2920 if (FLAG_trace_detached_contexts) { | 2920 if (FLAG_trace_detached_contexts) { |
2921 PrintF("%d detached contexts are collected out of %d\n", | 2921 PrintF("%d detached contexts are collected out of %d\n", |
2922 length - new_length, length); | 2922 length - new_length, length); |
2923 for (int i = 0; i < new_length; i += 2) { | 2923 for (int i = 0; i < new_length; i += 2) { |
2924 int mark_sweeps = Smi::cast(detached_contexts->get(i))->value(); | 2924 int mark_sweeps = Smi::cast(detached_contexts->get(i))->value(); |
2925 DCHECK(detached_contexts->get(i + 1)->IsWeakCell()); | 2925 DCHECK(detached_contexts->get(i + 1)->IsWeakCell()); |
2926 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); | 2926 WeakCell* cell = WeakCell::cast(detached_contexts->get(i + 1)); |
2927 if (mark_sweeps > 3) { | 2927 if (mark_sweeps > 3) { |
2928 PrintF("detached context %p\n survived %d GCs (leak?)\n", | 2928 PrintF("detached context 0x%p\n survived %d GCs (leak?)\n", |
2929 static_cast<void*>(cell->value()), mark_sweeps); | 2929 static_cast<void*>(cell->value()), mark_sweeps); |
2930 } | 2930 } |
2931 } | 2931 } |
2932 } | 2932 } |
2933 if (new_length == 0) { | 2933 if (new_length == 0) { |
2934 heap()->set_detached_contexts(heap()->empty_fixed_array()); | 2934 heap()->set_detached_contexts(heap()->empty_fixed_array()); |
2935 } else if (new_length < length) { | 2935 } else if (new_length < length) { |
2936 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( | 2936 heap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>( |
2937 *detached_contexts, length - new_length); | 2937 *detached_contexts, length - new_length); |
2938 } | 2938 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2980 // Then check whether this scope intercepts. | 2980 // Then check whether this scope intercepts. |
2981 if ((flag & intercept_mask_)) { | 2981 if ((flag & intercept_mask_)) { |
2982 intercepted_flags_ |= flag; | 2982 intercepted_flags_ |= flag; |
2983 return true; | 2983 return true; |
2984 } | 2984 } |
2985 return false; | 2985 return false; |
2986 } | 2986 } |
2987 | 2987 |
2988 } // namespace internal | 2988 } // namespace internal |
2989 } // namespace v8 | 2989 } // namespace v8 |
OLD | NEW |