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

Side by Side Diff: src/heap/heap.cc

Issue 1156463002: Pass GC flags to incremental marker and start incremental marking with (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | src/heap/incremental-marking.h » ('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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 if (collector == MARK_COMPACTOR && 946 if (collector == MARK_COMPACTOR &&
947 (gc_callback_flags & kGCCallbackFlagForced) != 0) { 947 (gc_callback_flags & kGCCallbackFlagForced) != 0) {
948 isolate()->CountUsage(v8::Isolate::kForcedGC); 948 isolate()->CountUsage(v8::Isolate::kForcedGC);
949 } 949 }
950 950
951 // Start incremental marking for the next cycle. The heap snapshot 951 // Start incremental marking for the next cycle. The heap snapshot
952 // generator needs incremental marking to stay off after it aborted. 952 // generator needs incremental marking to stay off after it aborted.
953 if (!mark_compact_collector()->abort_incremental_marking() && 953 if (!mark_compact_collector()->abort_incremental_marking() &&
954 incremental_marking()->IsStopped() && 954 incremental_marking()->IsStopped() &&
955 incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) { 955 incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) {
956 incremental_marking()->Start(); 956 incremental_marking()->Start(kNoGCFlags);
957 } 957 }
958 958
959 return next_gc_likely_to_collect_more; 959 return next_gc_likely_to_collect_more;
960 } 960 }
961 961
962 962
963 int Heap::NotifyContextDisposed(bool dependant_context) { 963 int Heap::NotifyContextDisposed(bool dependant_context) {
964 if (!dependant_context) { 964 if (!dependant_context) {
965 tracer()->ResetSurvivalEvents(); 965 tracer()->ResetSurvivalEvents();
966 old_generation_size_configured_ = false; 966 old_generation_size_configured_ = false;
(...skipping 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 GCIdleTimeHandler::HeapState heap_state, 4643 GCIdleTimeHandler::HeapState heap_state,
4644 double deadline_in_ms, 4644 double deadline_in_ms,
4645 bool is_long_idle_notification) { 4645 bool is_long_idle_notification) {
4646 bool result = false; 4646 bool result = false;
4647 switch (action.type) { 4647 switch (action.type) {
4648 case DONE: 4648 case DONE:
4649 result = true; 4649 result = true;
4650 break; 4650 break;
4651 case DO_INCREMENTAL_MARKING: { 4651 case DO_INCREMENTAL_MARKING: {
4652 if (incremental_marking()->IsStopped()) { 4652 if (incremental_marking()->IsStopped()) {
4653 // TODO(ulan): take reduce_memory into account. 4653 incremental_marking()->Start(
4654 incremental_marking()->Start(); 4654 action.reduce_memory ? kReduceMemoryFootprintMask : kNoGCFlags);
4655 } 4655 }
4656 double remaining_idle_time_in_ms = 0.0; 4656 double remaining_idle_time_in_ms = 0.0;
4657 do { 4657 do {
4658 incremental_marking()->Step( 4658 incremental_marking()->Step(
4659 action.parameter, IncrementalMarking::NO_GC_VIA_STACK_GUARD, 4659 action.parameter, IncrementalMarking::NO_GC_VIA_STACK_GUARD,
4660 IncrementalMarking::FORCE_MARKING, 4660 IncrementalMarking::FORCE_MARKING,
4661 IncrementalMarking::DO_NOT_FORCE_COMPLETION); 4661 IncrementalMarking::DO_NOT_FORCE_COMPLETION);
4662 remaining_idle_time_in_ms = 4662 remaining_idle_time_in_ms =
4663 deadline_in_ms - MonotonicallyIncreasingTimeInMs(); 4663 deadline_in_ms - MonotonicallyIncreasingTimeInMs();
4664 } while (remaining_idle_time_in_ms >= 4664 } while (remaining_idle_time_in_ms >=
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after
6587 *object_type = "CODE_TYPE"; \ 6587 *object_type = "CODE_TYPE"; \
6588 *object_sub_type = "CODE_AGE/" #name; \ 6588 *object_sub_type = "CODE_AGE/" #name; \
6589 return true; 6589 return true;
6590 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6590 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6591 #undef COMPARE_AND_RETURN_NAME 6591 #undef COMPARE_AND_RETURN_NAME
6592 } 6592 }
6593 return false; 6593 return false;
6594 } 6594 }
6595 } 6595 }
6596 } // namespace v8::internal 6596 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698