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/heap/heap.h" | 5 #include "src/heap/heap.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/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 DisallowHeapAllocation no_recursive_gc; | 888 DisallowHeapAllocation no_recursive_gc; |
889 isolate()->optimizing_compile_dispatcher()->Flush(); | 889 isolate()->optimizing_compile_dispatcher()->Flush(); |
890 } | 890 } |
891 isolate()->ClearSerializerData(); | 891 isolate()->ClearSerializerData(); |
892 set_current_gc_flags(kMakeHeapIterableMask | kReduceMemoryFootprintMask); | 892 set_current_gc_flags(kMakeHeapIterableMask | kReduceMemoryFootprintMask); |
893 isolate_->compilation_cache()->Clear(); | 893 isolate_->compilation_cache()->Clear(); |
894 const int kMaxNumberOfAttempts = 7; | 894 const int kMaxNumberOfAttempts = 7; |
895 const int kMinNumberOfAttempts = 2; | 895 const int kMinNumberOfAttempts = 2; |
896 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { | 896 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { |
897 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL, | 897 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL, |
898 v8::kGCCallbackFlagForced) && | 898 v8::kGCCallbackFlagCollectAllAvailableGarbage) && |
899 attempt + 1 >= kMinNumberOfAttempts) { | 899 attempt + 1 >= kMinNumberOfAttempts) { |
900 break; | 900 break; |
901 } | 901 } |
902 } | 902 } |
903 set_current_gc_flags(kNoGCFlags); | 903 set_current_gc_flags(kNoGCFlags); |
904 new_space_.Shrink(); | 904 new_space_.Shrink(); |
905 UncommitFromSpace(); | 905 UncommitFromSpace(); |
906 } | 906 } |
907 | 907 |
908 | 908 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 (detached_contexts()->length() > 0); | 1037 (detached_contexts()->length() > 0); |
1038 if (deserialization_complete_) { | 1038 if (deserialization_complete_) { |
1039 memory_reducer_->NotifyMarkCompact(event); | 1039 memory_reducer_->NotifyMarkCompact(event); |
1040 } | 1040 } |
1041 } | 1041 } |
1042 | 1042 |
1043 tracer()->Stop(collector); | 1043 tracer()->Stop(collector); |
1044 } | 1044 } |
1045 | 1045 |
1046 if (collector == MARK_COMPACTOR && | 1046 if (collector == MARK_COMPACTOR && |
1047 (gc_callback_flags & kGCCallbackFlagForced) != 0) { | 1047 (gc_callback_flags & (kGCCallbackFlagForced | |
| 1048 kGCCallbackFlagCollectAllAvailableGarbage)) != 0) { |
1048 isolate()->CountUsage(v8::Isolate::kForcedGC); | 1049 isolate()->CountUsage(v8::Isolate::kForcedGC); |
1049 } | 1050 } |
1050 | 1051 |
1051 // Start incremental marking for the next cycle. The heap snapshot | 1052 // Start incremental marking for the next cycle. The heap snapshot |
1052 // generator needs incremental marking to stay off after it aborted. | 1053 // generator needs incremental marking to stay off after it aborted. |
1053 if (!ShouldAbortIncrementalMarking() && incremental_marking()->IsStopped() && | 1054 if (!ShouldAbortIncrementalMarking() && incremental_marking()->IsStopped() && |
1054 incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) { | 1055 incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) { |
1055 StartIncrementalMarking(kNoGCFlags, kNoGCCallbackFlags, "GC epilogue"); | 1056 StartIncrementalMarking(kNoGCFlags, kNoGCCallbackFlags, "GC epilogue"); |
1056 } | 1057 } |
1057 | 1058 |
(...skipping 5286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6344 } | 6345 } |
6345 | 6346 |
6346 | 6347 |
6347 // static | 6348 // static |
6348 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6349 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6349 return StaticVisitorBase::GetVisitorId(map); | 6350 return StaticVisitorBase::GetVisitorId(map); |
6350 } | 6351 } |
6351 | 6352 |
6352 } // namespace internal | 6353 } // namespace internal |
6353 } // namespace v8 | 6354 } // namespace v8 |
OLD | NEW |