OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1953 return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold); | 1953 return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold); |
1954 } | 1954 } |
1955 | 1955 |
1956 bool WorthStartingGCWhenIdle() { | 1956 bool WorthStartingGCWhenIdle() { |
1957 if (contexts_disposed_ > 0) { | 1957 if (contexts_disposed_ > 0) { |
1958 return true; | 1958 return true; |
1959 } | 1959 } |
1960 return incremental_marking()->WorthActivating(); | 1960 return incremental_marking()->WorthActivating(); |
1961 } | 1961 } |
1962 | 1962 |
1963 // Estimates how many milliseconds a Mark-Sweep would take to complete. | |
1964 // In idle notification handler we assume that this function will return: | |
1965 // - a number less than 1000 for any heap size. | |
Erik Corry
2012/03/20 08:16:00
We should either make sure that this is true, or m
| |
1966 // - a number less than 10 for small heaps, which are less than 8Mb. | |
1967 // - a number greater than 10 for large heaps, which are greater than 32Mb. | |
1968 int TimeMarkSweepWouldTakeInMs() { | |
1969 // Rough estimate of how many megabytes of heap can be processed in 1 ms. | |
1970 static const int kMbPerMs = 2; | |
1971 | |
1972 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); | |
1973 return heap_size_mb / kMbPerMs; | |
1974 } | |
1975 | |
1963 // Returns true if no more GC work is left. | 1976 // Returns true if no more GC work is left. |
1964 bool IdleGlobalGC(); | 1977 bool IdleGlobalGC(); |
1965 | 1978 |
1979 void AdvanceIdleIncrementalMarking(intptr_t step_size); | |
1980 | |
1981 | |
1966 static const int kInitialSymbolTableSize = 2048; | 1982 static const int kInitialSymbolTableSize = 2048; |
1967 static const int kInitialEvalCacheSize = 64; | 1983 static const int kInitialEvalCacheSize = 64; |
1968 static const int kInitialNumberStringCacheSize = 256; | 1984 static const int kInitialNumberStringCacheSize = 256; |
1969 | 1985 |
1970 // Maximum GC pause. | 1986 // Maximum GC pause. |
1971 int max_gc_pause_; | 1987 int max_gc_pause_; |
1972 | 1988 |
1973 // Maximum size of objects alive after GC. | 1989 // Maximum size of objects alive after GC. |
1974 intptr_t max_alive_after_gc_; | 1990 intptr_t max_alive_after_gc_; |
1975 | 1991 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2671 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2687 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2672 | 2688 |
2673 private: | 2689 private: |
2674 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2690 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2675 }; | 2691 }; |
2676 #endif // DEBUG || LIVE_OBJECT_LIST | 2692 #endif // DEBUG || LIVE_OBJECT_LIST |
2677 | 2693 |
2678 } } // namespace v8::internal | 2694 } } // namespace v8::internal |
2679 | 2695 |
2680 #endif // V8_HEAP_H_ | 2696 #endif // V8_HEAP_H_ |
OLD | NEW |