Chromium Code Reviews| 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/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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 : isolate_->counters()->gc_compactor()); | 945 : isolate_->counters()->gc_compactor()); |
| 946 next_gc_likely_to_collect_more = | 946 next_gc_likely_to_collect_more = |
| 947 PerformGarbageCollection(collector, gc_callback_flags); | 947 PerformGarbageCollection(collector, gc_callback_flags); |
| 948 } | 948 } |
| 949 | 949 |
| 950 GarbageCollectionEpilogue(); | 950 GarbageCollectionEpilogue(); |
| 951 if (collector == MARK_COMPACTOR && FLAG_track_detached_contexts) { | 951 if (collector == MARK_COMPACTOR && FLAG_track_detached_contexts) { |
| 952 isolate()->CheckDetachedContextsAfterGC(); | 952 isolate()->CheckDetachedContextsAfterGC(); |
| 953 } | 953 } |
| 954 | 954 |
| 955 if (collector == MARK_COMPACTOR) { | 955 if (collector == MARK_COMPACTOR && deserialization_complete_) { |
| 956 intptr_t committed_memory_after = CommittedOldGenerationMemory(); | 956 intptr_t committed_memory_after = CommittedOldGenerationMemory(); |
| 957 intptr_t used_memory_after = PromotedSpaceSizeOfObjects(); | 957 intptr_t used_memory_after = PromotedSpaceSizeOfObjects(); |
| 958 MemoryReducer::Event event; | 958 MemoryReducer::Event event; |
| 959 event.type = MemoryReducer::kMarkCompact; | 959 event.type = MemoryReducer::kMarkCompact; |
| 960 event.time_ms = MonotonicallyIncreasingTimeInMs(); | 960 event.time_ms = MonotonicallyIncreasingTimeInMs(); |
| 961 // Trigger one more GC if | 961 // Trigger one more GC if |
| 962 // - this GC decreased committed memory, | 962 // - this GC decreased committed memory, |
| 963 // - there is high fragmentation, | 963 // - there is high fragmentation, |
| 964 // - there are live detached contexts. | 964 // - there are live detached contexts. |
| 965 event.next_gc_likely_to_collect_more = | 965 event.next_gc_likely_to_collect_more = |
| 966 (committed_memory_before - committed_memory_after) > MB || | 966 (committed_memory_before - committed_memory_after) > MB || |
| 967 HasHighFragmentation(used_memory_after, committed_memory_after) || | 967 HasHighFragmentation(used_memory_after, committed_memory_after) || |
| 968 (detached_contexts()->length() > 0); | 968 (detached_contexts()->length() > 0); |
| 969 memory_reducer_.NotifyMarkCompact(event); | 969 memory_reducer_.NotifyMarkCompact(event); |
|
ulan
2015/07/30 10:34:09
Please guard just this line with "if (deserializat
| |
| 970 } | 970 } |
| 971 | 971 |
| 972 tracer()->Stop(collector); | 972 tracer()->Stop(collector); |
| 973 } | 973 } |
| 974 | 974 |
| 975 if (collector == MARK_COMPACTOR && | 975 if (collector == MARK_COMPACTOR && |
| 976 (gc_callback_flags & kGCCallbackFlagForced) != 0) { | 976 (gc_callback_flags & kGCCallbackFlagForced) != 0) { |
| 977 isolate()->CountUsage(v8::Isolate::kForcedGC); | 977 isolate()->CountUsage(v8::Isolate::kForcedGC); |
| 978 } | 978 } |
| 979 | 979 |
| (...skipping 5943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6923 *object_type = "CODE_TYPE"; \ | 6923 *object_type = "CODE_TYPE"; \ |
| 6924 *object_sub_type = "CODE_AGE/" #name; \ | 6924 *object_sub_type = "CODE_AGE/" #name; \ |
| 6925 return true; | 6925 return true; |
| 6926 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6926 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6927 #undef COMPARE_AND_RETURN_NAME | 6927 #undef COMPARE_AND_RETURN_NAME |
| 6928 } | 6928 } |
| 6929 return false; | 6929 return false; |
| 6930 } | 6930 } |
| 6931 } // namespace internal | 6931 } // namespace internal |
| 6932 } // namespace v8 | 6932 } // namespace v8 |
| OLD | NEW |