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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2084 EmptyMarkingDeque(); | 2084 EmptyMarkingDeque(); |
2085 } | 2085 } |
2086 } | 2086 } |
2087 | 2087 |
2088 | 2088 |
2089 // Mark all objects reachable (transitively) from objects on the marking | 2089 // Mark all objects reachable (transitively) from objects on the marking |
2090 // stack including references only considered in the atomic marking pause. | 2090 // stack including references only considered in the atomic marking pause. |
2091 void MarkCompactCollector::ProcessEphemeralMarking( | 2091 void MarkCompactCollector::ProcessEphemeralMarking( |
2092 ObjectVisitor* visitor, bool only_process_harmony_weak_collections) { | 2092 ObjectVisitor* visitor, bool only_process_harmony_weak_collections) { |
2093 bool work_to_do = true; | 2093 bool work_to_do = true; |
2094 DCHECK(marking_deque_.IsEmpty()); | 2094 DCHECK(marking_deque_.IsEmpty()); |
Erik Corry
2014/12/03 13:09:12
Thinking about it some more, we should just empty
| |
2095 while (work_to_do) { | 2095 while (work_to_do) { |
2096 if (!only_process_harmony_weak_collections) { | 2096 if (!only_process_harmony_weak_collections) { |
2097 isolate()->global_handles()->IterateObjectGroups( | 2097 isolate()->global_handles()->IterateObjectGroups( |
2098 visitor, &IsUnmarkedHeapObjectWithHeap); | 2098 visitor, &IsUnmarkedHeapObjectWithHeap); |
2099 MarkImplicitRefGroups(); | 2099 MarkImplicitRefGroups(); |
2100 } | 2100 } |
2101 ProcessWeakCollections(); | 2101 ProcessWeakCollections(); |
2102 work_to_do = !marking_deque_.IsEmpty(); | 2102 work_to_do = !marking_deque_.IsEmpty() || marking_deque_.overflowed(); |
Erik Corry
2014/12/03 12:46:21
It would be better to improve MarkCompactCollector
Hannes Payer (out of office)
2014/12/03 13:18:24
Let's do that.
| |
2103 ProcessMarkingDeque(); | 2103 ProcessMarkingDeque(); |
2104 } | 2104 } |
2105 } | 2105 } |
2106 | 2106 |
2107 | 2107 |
2108 void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) { | 2108 void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) { |
2109 for (StackFrameIterator it(isolate(), isolate()->thread_local_top()); | 2109 for (StackFrameIterator it(isolate(), isolate()->thread_local_top()); |
2110 !it.done(); it.Advance()) { | 2110 !it.done(); it.Advance()) { |
2111 if (it.frame()->type() == StackFrame::JAVA_SCRIPT) { | 2111 if (it.frame()->type() == StackFrame::JAVA_SCRIPT) { |
2112 return; | 2112 return; |
(...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4439 SlotsBuffer* buffer = *buffer_address; | 4439 SlotsBuffer* buffer = *buffer_address; |
4440 while (buffer != NULL) { | 4440 while (buffer != NULL) { |
4441 SlotsBuffer* next_buffer = buffer->next(); | 4441 SlotsBuffer* next_buffer = buffer->next(); |
4442 DeallocateBuffer(buffer); | 4442 DeallocateBuffer(buffer); |
4443 buffer = next_buffer; | 4443 buffer = next_buffer; |
4444 } | 4444 } |
4445 *buffer_address = NULL; | 4445 *buffer_address = NULL; |
4446 } | 4446 } |
4447 } | 4447 } |
4448 } // namespace v8::internal | 4448 } // namespace v8::internal |
OLD | NEW |