| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // | 130 // |
| 131 // To create a new typed heap add a H(<ClassName>) to the | 131 // To create a new typed heap add a H(<ClassName>) to the |
| 132 // FOR_EACH_TYPED_HEAP macro below. | 132 // FOR_EACH_TYPED_HEAP macro below. |
| 133 #define FOR_EACH_TYPED_HEAP(H) \ | 133 #define FOR_EACH_TYPED_HEAP(H) \ |
| 134 H(Node) \ | 134 H(Node) \ |
| 135 H(CSSValue) | 135 H(CSSValue) |
| 136 | 136 |
| 137 #define TypedHeapEnumName(Type) Type##HeapIndex, | 137 #define TypedHeapEnumName(Type) Type##HeapIndex, |
| 138 | 138 |
| 139 enum HeapIndices { | 139 enum HeapIndices { |
| 140 NormalPage1HeapIndex = 0, | 140 EagerSweepHeapIndex = 0, |
| 141 NormalPage1HeapIndex, |
| 141 NormalPage2HeapIndex, | 142 NormalPage2HeapIndex, |
| 142 NormalPage3HeapIndex, | 143 NormalPage3HeapIndex, |
| 143 NormalPage4HeapIndex, | 144 NormalPage4HeapIndex, |
| 144 EagerSweepHeapIndex, | |
| 145 Vector1HeapIndex, | 145 Vector1HeapIndex, |
| 146 Vector2HeapIndex, | 146 Vector2HeapIndex, |
| 147 Vector3HeapIndex, | 147 Vector3HeapIndex, |
| 148 Vector4HeapIndex, | 148 Vector4HeapIndex, |
| 149 InlineVectorHeapIndex, | 149 InlineVectorHeapIndex, |
| 150 HashTableHeapIndex, | 150 HashTableHeapIndex, |
| 151 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) | 151 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) |
| 152 LargeObjectHeapIndex, | 152 LargeObjectHeapIndex, |
| 153 // Values used for iteration of heap segments. | 153 // Values used for iteration of heap segments. |
| 154 NumberOfHeaps, | 154 NumberOfHeaps, |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // record that we should garbage collect the next time we return | 630 // record that we should garbage collect the next time we return |
| 631 // to the event loop. If both return false, we don't need to | 631 // to the event loop. If both return false, we don't need to |
| 632 // collect garbage at this point. | 632 // collect garbage at this point. |
| 633 bool shouldScheduleIdleGC(); | 633 bool shouldScheduleIdleGC(); |
| 634 bool shouldSchedulePreciseGC(); | 634 bool shouldSchedulePreciseGC(); |
| 635 bool shouldForceConservativeGC(); | 635 bool shouldForceConservativeGC(); |
| 636 void runScheduledGC(StackState); | 636 void runScheduledGC(StackState); |
| 637 | 637 |
| 638 void eagerSweep(); | 638 void eagerSweep(); |
| 639 | 639 |
| 640 #if defined(ADDRESS_SANITIZER) |
| 641 void poisonEagerHeaps(bool poisonOrNot); |
| 642 void poisonHeapsForCompleteSweep(); |
| 643 #endif |
| 644 |
| 640 // When ThreadState is detaching from non-main thread its | 645 // When ThreadState is detaching from non-main thread its |
| 641 // heap is expected to be empty (because it is going away). | 646 // heap is expected to be empty (because it is going away). |
| 642 // Perform registered cleanup tasks and garbage collection | 647 // Perform registered cleanup tasks and garbage collection |
| 643 // to sweep away any objects that are left on this heap. | 648 // to sweep away any objects that are left on this heap. |
| 644 // We assert that nothing must remain after this cleanup. | 649 // We assert that nothing must remain after this cleanup. |
| 645 // If assertion does not hold we crash as we are potentially | 650 // If assertion does not hold we crash as we are potentially |
| 646 // in the dangling pointer situation. | 651 // in the dangling pointer situation. |
| 647 void cleanup(); | 652 void cleanup(); |
| 648 void cleanupPages(); | 653 void cleanupPages(); |
| 649 | 654 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 }; | 740 }; |
| 736 | 741 |
| 737 template<> class ThreadStateFor<AnyThread> { | 742 template<> class ThreadStateFor<AnyThread> { |
| 738 public: | 743 public: |
| 739 static ThreadState* state() { return ThreadState::current(); } | 744 static ThreadState* state() { return ThreadState::current(); } |
| 740 }; | 745 }; |
| 741 | 746 |
| 742 } // namespace blink | 747 } // namespace blink |
| 743 | 748 |
| 744 #endif // ThreadState_h | 749 #endif // ThreadState_h |
| OLD | NEW |