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