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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 const char* gc_reason, | 1034 const char* gc_reason, |
1035 const char* collector_reason); | 1035 const char* collector_reason); |
1036 | 1036 |
1037 // Performs garbage collection operation. | 1037 // Performs garbage collection operation. |
1038 // Returns whether there is a chance that another major GC could | 1038 // Returns whether there is a chance that another major GC could |
1039 // collect more garbage. | 1039 // collect more garbage. |
1040 inline bool CollectGarbage(AllocationSpace space, | 1040 inline bool CollectGarbage(AllocationSpace space, |
1041 const char* gc_reason = NULL); | 1041 const char* gc_reason = NULL); |
1042 | 1042 |
1043 static const int kNoGCFlags = 0; | 1043 static const int kNoGCFlags = 0; |
1044 static const int kMakeHeapIterableMask = 1; | 1044 static const int kSweepPreciselyMask = 1; |
1045 static const int kReduceMemoryFootprintMask = 2; | 1045 static const int kReduceMemoryFootprintMask = 2; |
| 1046 static const int kAbortIncrementalMarkingMask = 4; |
| 1047 |
| 1048 // Making the heap iterable requires us to sweep precisely and abort any |
| 1049 // incremental marking as well. |
| 1050 static const int kMakeHeapIterableMask = |
| 1051 kSweepPreciselyMask | kAbortIncrementalMarkingMask; |
1046 | 1052 |
1047 // Performs a full garbage collection. If (flags & kMakeHeapIterableMask) is | 1053 // Performs a full garbage collection. If (flags & kMakeHeapIterableMask) is |
1048 // non-zero, then the slower precise sweeper is used, which leaves the heap | 1054 // non-zero, then the slower precise sweeper is used, which leaves the heap |
1049 // in a state where we can iterate over the heap visiting all objects. | 1055 // in a state where we can iterate over the heap visiting all objects. |
1050 void CollectAllGarbage(int flags, const char* gc_reason = NULL); | 1056 void CollectAllGarbage(int flags, const char* gc_reason = NULL); |
1051 | 1057 |
1052 // Last hope GC, should try to squeeze as much as possible. | 1058 // Last hope GC, should try to squeeze as much as possible. |
1053 void CollectAllAvailableGarbage(const char* gc_reason = NULL); | 1059 void CollectAllAvailableGarbage(const char* gc_reason = NULL); |
1054 | 1060 |
1055 // Check whether the heap is currently iterable. | 1061 // Check whether the heap is currently iterable. |
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2665 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2671 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2666 | 2672 |
2667 private: | 2673 private: |
2668 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2674 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2669 }; | 2675 }; |
2670 #endif // DEBUG || LIVE_OBJECT_LIST | 2676 #endif // DEBUG || LIVE_OBJECT_LIST |
2671 | 2677 |
2672 } } // namespace v8::internal | 2678 } } // namespace v8::internal |
2673 | 2679 |
2674 #endif // V8_HEAP_H_ | 2680 #endif // V8_HEAP_H_ |
OLD | NEW |