| 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 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } | 1308 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } |
| 1309 | 1309 |
| 1310 #ifdef DEBUG | 1310 #ifdef DEBUG |
| 1311 bool IsAllocationAllowed() { return allocation_allowed_; } | 1311 bool IsAllocationAllowed() { return allocation_allowed_; } |
| 1312 inline bool allow_allocation(bool enable); | 1312 inline bool allow_allocation(bool enable); |
| 1313 | 1313 |
| 1314 bool disallow_allocation_failure() { | 1314 bool disallow_allocation_failure() { |
| 1315 return disallow_allocation_failure_; | 1315 return disallow_allocation_failure_; |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 bool flush_eagerly() { return flush_eagerly_; } |
| 1319 void set_flush_eagerly(bool to) { flush_eagerly_ = to; } |
| 1320 |
| 1318 void TracePathToObjectFrom(Object* target, Object* root); | 1321 void TracePathToObjectFrom(Object* target, Object* root); |
| 1319 void TracePathToObject(Object* target); | 1322 void TracePathToObject(Object* target); |
| 1320 void TracePathToGlobal(); | 1323 void TracePathToGlobal(); |
| 1321 #endif | 1324 #endif |
| 1322 | 1325 |
| 1323 // Callback function passed to Heap::Iterate etc. Copies an object if | 1326 // Callback function passed to Heap::Iterate etc. Copies an object if |
| 1324 // necessary, the object might be promoted to an old space. The caller must | 1327 // necessary, the object might be promoted to an old space. The caller must |
| 1325 // ensure the precondition that the object is (a) a heap object and (b) in | 1328 // ensure the precondition that the object is (a) a heap object and (b) in |
| 1326 // the heap's from space. | 1329 // the heap's from space. |
| 1327 static inline void ScavengePointer(HeapObject** p); | 1330 static inline void ScavengePointer(HeapObject** p); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 // time? | 1768 // time? |
| 1766 bool disallow_allocation_failure_; | 1769 bool disallow_allocation_failure_; |
| 1767 | 1770 |
| 1768 HeapDebugUtils* debug_utils_; | 1771 HeapDebugUtils* debug_utils_; |
| 1769 #endif // DEBUG | 1772 #endif // DEBUG |
| 1770 | 1773 |
| 1771 // Indicates that the new space should be kept small due to high promotion | 1774 // Indicates that the new space should be kept small due to high promotion |
| 1772 // rates caused by the mutator allocating a lot of long-lived objects. | 1775 // rates caused by the mutator allocating a lot of long-lived objects. |
| 1773 bool new_space_high_promotion_mode_active_; | 1776 bool new_space_high_promotion_mode_active_; |
| 1774 | 1777 |
| 1778 // For emergency memory-freeing GCs. |
| 1779 bool flush_eagerly_; |
| 1780 |
| 1775 // Limit that triggers a global GC on the next (normally caused) GC. This | 1781 // Limit that triggers a global GC on the next (normally caused) GC. This |
| 1776 // is checked when we have already decided to do a GC to help determine | 1782 // is checked when we have already decided to do a GC to help determine |
| 1777 // which collector to invoke. | 1783 // which collector to invoke. |
| 1778 intptr_t old_gen_promotion_limit_; | 1784 intptr_t old_gen_promotion_limit_; |
| 1779 | 1785 |
| 1780 // Limit that triggers a global GC as soon as is reasonable. This is | 1786 // Limit that triggers a global GC as soon as is reasonable. This is |
| 1781 // checked before expanding a paged space in the old generation and on | 1787 // checked before expanding a paged space in the old generation and on |
| 1782 // every allocation in large object space. | 1788 // every allocation in large object space. |
| 1783 intptr_t old_gen_allocation_limit_; | 1789 intptr_t old_gen_allocation_limit_; |
| 1784 | 1790 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2189 inline DisallowAllocationFailure(); | 2195 inline DisallowAllocationFailure(); |
| 2190 inline ~DisallowAllocationFailure(); | 2196 inline ~DisallowAllocationFailure(); |
| 2191 | 2197 |
| 2192 #ifdef DEBUG | 2198 #ifdef DEBUG |
| 2193 private: | 2199 private: |
| 2194 bool old_state_; | 2200 bool old_state_; |
| 2195 #endif | 2201 #endif |
| 2196 }; | 2202 }; |
| 2197 | 2203 |
| 2198 | 2204 |
| 2205 class FlushEagerly { |
| 2206 public: |
| 2207 inline FlushEagerly(); |
| 2208 inline ~FlushEagerly(); |
| 2209 |
| 2210 private: |
| 2211 bool old_state_; |
| 2212 }; |
| 2213 |
| 2214 |
| 2199 class AlwaysAllocateScope { | 2215 class AlwaysAllocateScope { |
| 2200 public: | 2216 public: |
| 2201 inline AlwaysAllocateScope(); | 2217 inline AlwaysAllocateScope(); |
| 2202 inline ~AlwaysAllocateScope(); | 2218 inline ~AlwaysAllocateScope(); |
| 2203 | 2219 |
| 2204 private: | 2220 private: |
| 2205 // Implicitly disable artificial allocation failures. | 2221 // Implicitly disable artificial allocation failures. |
| 2206 DisallowAllocationFailure disallow_allocation_failure_; | 2222 DisallowAllocationFailure disallow_allocation_failure_; |
| 2207 }; | 2223 }; |
| 2208 | 2224 |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2800 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2816 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
| 2801 | 2817 |
| 2802 private: | 2818 private: |
| 2803 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2819 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2804 }; | 2820 }; |
| 2805 #endif // DEBUG || LIVE_OBJECT_LIST | 2821 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2806 | 2822 |
| 2807 } } // namespace v8::internal | 2823 } } // namespace v8::internal |
| 2808 | 2824 |
| 2809 #endif // V8_HEAP_H_ | 2825 #endif // V8_HEAP_H_ |
| OLD | NEW |