| 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_H_ | 5 #ifndef V8_HEAP_H_ |
| 6 #define V8_HEAP_H_ | 6 #define V8_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 // - a number less than 10 for small heaps, which are less than 8Mb. | 2071 // - a number less than 10 for small heaps, which are less than 8Mb. |
| 2072 // - a number greater than 10 for large heaps, which are greater than 32Mb. | 2072 // - a number greater than 10 for large heaps, which are greater than 32Mb. |
| 2073 int TimeMarkSweepWouldTakeInMs() { | 2073 int TimeMarkSweepWouldTakeInMs() { |
| 2074 // Rough estimate of how many megabytes of heap can be processed in 1 ms. | 2074 // Rough estimate of how many megabytes of heap can be processed in 1 ms. |
| 2075 static const int kMbPerMs = 2; | 2075 static const int kMbPerMs = 2; |
| 2076 | 2076 |
| 2077 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); | 2077 int heap_size_mb = static_cast<int>(SizeOfObjects() / MB); |
| 2078 return heap_size_mb / kMbPerMs; | 2078 return heap_size_mb / kMbPerMs; |
| 2079 } | 2079 } |
| 2080 | 2080 |
| 2081 // Returns true if no more GC work is left. | |
| 2082 bool IdleGlobalGC(); | |
| 2083 | |
| 2084 void AdvanceIdleIncrementalMarking(intptr_t step_size); | 2081 void AdvanceIdleIncrementalMarking(intptr_t step_size); |
| 2085 | 2082 |
| 2086 void ClearObjectStats(bool clear_last_time_stats = false); | 2083 void ClearObjectStats(bool clear_last_time_stats = false); |
| 2087 | 2084 |
| 2088 void set_weak_object_to_code_table(Object* value) { | 2085 void set_weak_object_to_code_table(Object* value) { |
| 2089 ASSERT(!InNewSpace(value)); | 2086 ASSERT(!InNewSpace(value)); |
| 2090 weak_object_to_code_table_ = value; | 2087 weak_object_to_code_table_ = value; |
| 2091 } | 2088 } |
| 2092 | 2089 |
| 2093 Object** weak_object_to_code_table_address() { | 2090 Object** weak_object_to_code_table_address() { |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2657 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2654 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2658 | 2655 |
| 2659 private: | 2656 private: |
| 2660 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2657 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2661 }; | 2658 }; |
| 2662 #endif // DEBUG | 2659 #endif // DEBUG |
| 2663 | 2660 |
| 2664 } } // namespace v8::internal | 2661 } } // namespace v8::internal |
| 2665 | 2662 |
| 2666 #endif // V8_HEAP_H_ | 2663 #endif // V8_HEAP_H_ |
| OLD | NEW |