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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 int freed_global_handles); | 1042 int freed_global_handles); |
1043 | 1043 |
1044 // Indicates whether inline bump-pointer allocation has been disabled. | 1044 // Indicates whether inline bump-pointer allocation has been disabled. |
1045 bool inline_allocation_disabled() { return inline_allocation_disabled_; } | 1045 bool inline_allocation_disabled() { return inline_allocation_disabled_; } |
1046 | 1046 |
1047 // Switch whether inline bump-pointer allocation should be used. | 1047 // Switch whether inline bump-pointer allocation should be used. |
1048 void EnableInlineAllocation(); | 1048 void EnableInlineAllocation(); |
1049 void DisableInlineAllocation(); | 1049 void DisableInlineAllocation(); |
1050 | 1050 |
1051 // Implements the corresponding V8 API function. | 1051 // Implements the corresponding V8 API function. |
1052 bool IdleNotification(int hint); | 1052 bool IdleNotification(int idle_time_in_ms); |
1053 | 1053 |
1054 // Declare all the root indices. This defines the root list order. | 1054 // Declare all the root indices. This defines the root list order. |
1055 enum RootListIndex { | 1055 enum RootListIndex { |
1056 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 1056 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
1057 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) | 1057 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) |
1058 #undef ROOT_INDEX_DECLARATION | 1058 #undef ROOT_INDEX_DECLARATION |
1059 | 1059 |
1060 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, | 1060 #define STRING_INDEX_DECLARATION(name, str) k##name##RootIndex, |
1061 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) | 1061 INTERNALIZED_STRING_LIST(STRING_INDEX_DECLARATION) |
1062 #undef STRING_DECLARATION | 1062 #undef STRING_DECLARATION |
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1943 // - a number less than 10 for small heaps, which are less than 8Mb. | 1943 // - a number less than 10 for small heaps, which are less than 8Mb. |
1944 // - a number greater than 10 for large heaps, which are greater than 32Mb. | 1944 // - a number greater than 10 for large heaps, which are greater than 32Mb. |
1945 int TimeMarkSweepWouldTakeInMs() { | 1945 int TimeMarkSweepWouldTakeInMs() { |
1946 // Rough estimate of how many megabytes of heap can be processed in 1 ms. | 1946 // Rough estimate of how many megabytes of heap can be processed in 1 ms. |
1947 static const int kMbPerMs = 2; | 1947 static const int kMbPerMs = 2; |
1948 | 1948 |
1949 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); | 1949 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); |
1950 return heap_size_mb / kMbPerMs; | 1950 return heap_size_mb / kMbPerMs; |
1951 } | 1951 } |
1952 | 1952 |
1953 void AdvanceIdleIncrementalMarking(intptr_t step_size); | 1953 void AdvanceIdleIncrementalMarking(int idle_time_in_ms); |
1954 | 1954 |
1955 void ClearObjectStats(bool clear_last_time_stats = false); | 1955 void ClearObjectStats(bool clear_last_time_stats = false); |
1956 | 1956 |
1957 void set_weak_object_to_code_table(Object* value) { | 1957 void set_weak_object_to_code_table(Object* value) { |
1958 DCHECK(!InNewSpace(value)); | 1958 DCHECK(!InNewSpace(value)); |
1959 weak_object_to_code_table_ = value; | 1959 weak_object_to_code_table_ = value; |
1960 } | 1960 } |
1961 | 1961 |
1962 Object** weak_object_to_code_table_address() { | 1962 Object** weak_object_to_code_table_address() { |
1963 return &weak_object_to_code_table_; | 1963 return &weak_object_to_code_table_; |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2519 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2519 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2520 | 2520 |
2521 private: | 2521 private: |
2522 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2522 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2523 }; | 2523 }; |
2524 #endif // DEBUG | 2524 #endif // DEBUG |
2525 } | 2525 } |
2526 } // namespace v8::internal | 2526 } // namespace v8::internal |
2527 | 2527 |
2528 #endif // V8_HEAP_HEAP_H_ | 2528 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |