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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (deserialization_complete_) { |
| 970 memory_reducer_.NotifyMarkCompact(event); |
| 971 } |
970 } | 972 } |
971 | 973 |
972 tracer()->Stop(collector); | 974 tracer()->Stop(collector); |
973 } | 975 } |
974 | 976 |
975 if (collector == MARK_COMPACTOR && | 977 if (collector == MARK_COMPACTOR && |
976 (gc_callback_flags & kGCCallbackFlagForced) != 0) { | 978 (gc_callback_flags & kGCCallbackFlagForced) != 0) { |
977 isolate()->CountUsage(v8::Isolate::kForcedGC); | 979 isolate()->CountUsage(v8::Isolate::kForcedGC); |
978 } | 980 } |
979 | 981 |
(...skipping 5914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6894 *object_type = "CODE_TYPE"; \ | 6896 *object_type = "CODE_TYPE"; \ |
6895 *object_sub_type = "CODE_AGE/" #name; \ | 6897 *object_sub_type = "CODE_AGE/" #name; \ |
6896 return true; | 6898 return true; |
6897 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6899 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6898 #undef COMPARE_AND_RETURN_NAME | 6900 #undef COMPARE_AND_RETURN_NAME |
6899 } | 6901 } |
6900 return false; | 6902 return false; |
6901 } | 6903 } |
6902 } // namespace internal | 6904 } // namespace internal |
6903 } // namespace v8 | 6905 } // namespace v8 |
OLD | NEW |