| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 NormalPage1HeapIndex = 0, |
| 141 NormalPage2HeapIndex, | 141 NormalPage2HeapIndex, |
| 142 NormalPage3HeapIndex, | 142 NormalPage3HeapIndex, |
| 143 NormalPage4HeapIndex, | 143 NormalPage4HeapIndex, |
| 144 EagerSweepHeapIndex, |
| 144 Vector1HeapIndex, | 145 Vector1HeapIndex, |
| 145 Vector2HeapIndex, | 146 Vector2HeapIndex, |
| 146 Vector3HeapIndex, | 147 Vector3HeapIndex, |
| 147 Vector4HeapIndex, | 148 Vector4HeapIndex, |
| 148 InlineVectorHeapIndex, | 149 InlineVectorHeapIndex, |
| 149 HashTableHeapIndex, | 150 HashTableHeapIndex, |
| 150 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) | 151 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) |
| 151 LargeObjectHeapIndex, | 152 LargeObjectHeapIndex, |
| 152 // Values used for iteration of heap segments. | 153 // Values used for iteration of heap segments. |
| 153 NumberOfHeaps, | 154 NumberOfHeaps, |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 // If shouldForceConservativeGC returns true, we force the garbage | 627 // If shouldForceConservativeGC returns true, we force the garbage |
| 627 // collection immediately. Otherwise, if shouldGC returns true, we | 628 // collection immediately. Otherwise, if shouldGC returns true, we |
| 628 // record that we should garbage collect the next time we return | 629 // record that we should garbage collect the next time we return |
| 629 // to the event loop. If both return false, we don't need to | 630 // to the event loop. If both return false, we don't need to |
| 630 // collect garbage at this point. | 631 // collect garbage at this point. |
| 631 bool shouldScheduleIdleGC(); | 632 bool shouldScheduleIdleGC(); |
| 632 bool shouldSchedulePreciseGC(); | 633 bool shouldSchedulePreciseGC(); |
| 633 bool shouldForceConservativeGC(); | 634 bool shouldForceConservativeGC(); |
| 634 void runScheduledGC(StackState); | 635 void runScheduledGC(StackState); |
| 635 | 636 |
| 637 void eagerSweep(); |
| 638 |
| 636 // When ThreadState is detaching from non-main thread its | 639 // When ThreadState is detaching from non-main thread its |
| 637 // heap is expected to be empty (because it is going away). | 640 // heap is expected to be empty (because it is going away). |
| 638 // Perform registered cleanup tasks and garbage collection | 641 // Perform registered cleanup tasks and garbage collection |
| 639 // to sweep away any objects that are left on this heap. | 642 // to sweep away any objects that are left on this heap. |
| 640 // We assert that nothing must remain after this cleanup. | 643 // We assert that nothing must remain after this cleanup. |
| 641 // If assertion does not hold we crash as we are potentially | 644 // If assertion does not hold we crash as we are potentially |
| 642 // in the dangling pointer situation. | 645 // in the dangling pointer situation. |
| 643 void cleanup(); | 646 void cleanup(); |
| 644 void cleanupPages(); | 647 void cleanupPages(); |
| 645 | 648 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 }; | 734 }; |
| 732 | 735 |
| 733 template<> class ThreadStateFor<AnyThread> { | 736 template<> class ThreadStateFor<AnyThread> { |
| 734 public: | 737 public: |
| 735 static ThreadState* state() { return ThreadState::current(); } | 738 static ThreadState* state() { return ThreadState::current(); } |
| 736 }; | 739 }; |
| 737 | 740 |
| 738 } // namespace blink | 741 } // namespace blink |
| 739 | 742 |
| 740 #endif // ThreadState_h | 743 #endif // ThreadState_h |
| OLD | NEW |