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

Side by Side Diff: src/heap/mark-compact.cc

Issue 629903003: Check if there is still time before finalizing an incremental collection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/heap/mark-compact.h ('k') | test/cctest/test-heap.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 // 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 // force lazy re-initialization of it. This must be done after the 958 // force lazy re-initialization of it. This must be done after the
959 // GC, because it relies on the new address of certain old space 959 // GC, because it relies on the new address of certain old space
960 // objects (empty string, illegal builtin). 960 // objects (empty string, illegal builtin).
961 isolate()->stub_cache()->Clear(); 961 isolate()->stub_cache()->Clear();
962 962
963 if (have_code_to_deoptimize_) { 963 if (have_code_to_deoptimize_) {
964 // Some code objects were marked for deoptimization during the GC. 964 // Some code objects were marked for deoptimization during the GC.
965 Deoptimizer::DeoptimizeMarkedCode(isolate()); 965 Deoptimizer::DeoptimizeMarkedCode(isolate());
966 have_code_to_deoptimize_ = false; 966 have_code_to_deoptimize_ = false;
967 } 967 }
968
969 heap_->incremental_marking()->ClearIdleMarkingDelayCounter();
968 } 970 }
969 971
970 972
971 // ------------------------------------------------------------------------- 973 // -------------------------------------------------------------------------
972 // Phase 1: tracing and marking live objects. 974 // Phase 1: tracing and marking live objects.
973 // before: all objects are in normal state. 975 // before: all objects are in normal state.
974 // after: a live object's map pointer is marked as '00'. 976 // after: a live object's map pointer is marked as '00'.
975 977
976 // Marking all live objects in the heap as part of mark-sweep or mark-compact 978 // Marking all live objects in the heap as part of mark-sweep or mark-compact
977 // collection. Before marking, all objects are in their normal state. After 979 // collection. Before marking, all objects are in their normal state. After
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 ProcessMarkingDeque(); 2035 ProcessMarkingDeque();
2034 } 2036 }
2035 2037
2036 2038
2037 void MarkCompactCollector::MarkAllocationSite(AllocationSite* site) { 2039 void MarkCompactCollector::MarkAllocationSite(AllocationSite* site) {
2038 MarkBit mark_bit = Marking::MarkBitFrom(site); 2040 MarkBit mark_bit = Marking::MarkBitFrom(site);
2039 SetMark(site, mark_bit); 2041 SetMark(site, mark_bit);
2040 } 2042 }
2041 2043
2042 2044
2045 bool MarkCompactCollector::IsMarkingDequeEmpty() {
2046 return marking_deque_.IsEmpty();
2047 }
2048
2049
2043 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { 2050 void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) {
2044 // Mark the heap roots including global variables, stack variables, 2051 // Mark the heap roots including global variables, stack variables,
2045 // etc., and all objects reachable from them. 2052 // etc., and all objects reachable from them.
2046 heap()->IterateStrongRoots(visitor, VISIT_ONLY_STRONG); 2053 heap()->IterateStrongRoots(visitor, VISIT_ONLY_STRONG);
2047 2054
2048 // Handle the string table specially. 2055 // Handle the string table specially.
2049 MarkStringTable(visitor); 2056 MarkStringTable(visitor);
2050 2057
2051 MarkWeakObjectToCodeTable(); 2058 MarkWeakObjectToCodeTable();
2052 2059
(...skipping 2452 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 SlotsBuffer* buffer = *buffer_address; 4512 SlotsBuffer* buffer = *buffer_address;
4506 while (buffer != NULL) { 4513 while (buffer != NULL) {
4507 SlotsBuffer* next_buffer = buffer->next(); 4514 SlotsBuffer* next_buffer = buffer->next();
4508 DeallocateBuffer(buffer); 4515 DeallocateBuffer(buffer);
4509 buffer = next_buffer; 4516 buffer = next_buffer;
4510 } 4517 }
4511 *buffer_address = NULL; 4518 *buffer_address = NULL;
4512 } 4519 }
4513 } 4520 }
4514 } // namespace v8::internal 4521 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/mark-compact.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698