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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 int freed_global_handles); | 1061 int freed_global_handles); |
1062 | 1062 |
1063 // Indicates whether inline bump-pointer allocation has been disabled. | 1063 // Indicates whether inline bump-pointer allocation has been disabled. |
1064 bool inline_allocation_disabled() { return inline_allocation_disabled_; } | 1064 bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
1065 | 1065 |
1066 // Switch whether inline bump-pointer allocation should be used. | 1066 // Switch whether inline bump-pointer allocation should be used. |
1067 void EnableInlineAllocation(); | 1067 void EnableInlineAllocation(); |
1068 void DisableInlineAllocation(); | 1068 void DisableInlineAllocation(); |
1069 | 1069 |
1070 // Implements the corresponding V8 API function. | 1070 // Implements the corresponding V8 API function. |
1071 bool IdleNotification(int hint); | 1071 bool IdleNotification(int idle_time_in_ms); |
1072 | 1072 |
1073 // Declare all the root indices. This defines the root list order. | 1073 // Declare all the root indices. This defines the root list order. |
1074 enum RootListIndex { | 1074 enum RootListIndex { |
1075 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 1075 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
1076 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) | 1076 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) |
1077 #undef ROOT_INDEX_DECLARATION | 1077 #undef ROOT_INDEX_DECLARATION |
1078 | 1078 |
1079 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, | 1079 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, |
1080 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) | 1080 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) |
1081 #undef STRING_DECLARATION | 1081 #undef STRING_DECLARATION |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 // - a number less than 10 for small heaps, which are less than 8Mb. | 1962 // - a number less than 10 for small heaps, which are less than 8Mb. |
1963 // - a number greater than 10 for large heaps, which are greater than 32Mb. | 1963 // - a number greater than 10 for large heaps, which are greater than 32Mb. |
1964 int TimeMarkSweepWouldTakeInMs() { | 1964 int TimeMarkSweepWouldTakeInMs() { |
1965 // Rough estimate of how many megabytes of heap can be processed in 1 ms. | 1965 // Rough estimate of how many megabytes of heap can be processed in 1 ms. |
1966 static const int kMbPerMs = 2; | 1966 static const int kMbPerMs = 2; |
1967 | 1967 |
1968 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); | 1968 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); |
1969 return heap_size_mb / kMbPerMs; | 1969 return heap_size_mb / kMbPerMs; |
1970 } | 1970 } |
1971 | 1971 |
1972 void AdvanceIdleIncrementalMarking(intptr_t step_size); | 1972 intptr_t EstimateMarkingStepSize(int idle_time_in_ms); |
| 1973 void AdvanceIdleIncrementalMarking(int idle_time_in_ms); |
1973 | 1974 |
1974 void ClearObjectStats(bool clear_last_time_stats = false); | 1975 void ClearObjectStats(bool clear_last_time_stats = false); |
1975 | 1976 |
1976 void set_weak_object_to_code_table(Object* value) { | 1977 void set_weak_object_to_code_table(Object* value) { |
1977 DCHECK(!InNewSpace(value)); | 1978 DCHECK(!InNewSpace(value)); |
1978 weak_object_to_code_table_ = value; | 1979 weak_object_to_code_table_ = value; |
1979 } | 1980 } |
1980 | 1981 |
1981 Object** weak_object_to_code_table_address() { | 1982 Object** weak_object_to_code_table_address() { |
1982 return &weak_object_to_code_table_; | 1983 return &weak_object_to_code_table_; |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2538 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2539 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2539 | 2540 |
2540 private: | 2541 private: |
2541 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2542 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2542 }; | 2543 }; |
2543 #endif // DEBUG | 2544 #endif // DEBUG |
2544 } | 2545 } |
2545 } // namespace v8::internal | 2546 } // namespace v8::internal |
2546 | 2547 |
2547 #endif // V8_HEAP_HEAP_H_ | 2548 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |