| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 // Returns whether required_space bytes are available after the collection. | 558 // Returns whether required_space bytes are available after the collection. |
| 559 static bool CollectGarbage(int required_space, AllocationSpace space); | 559 static bool CollectGarbage(int required_space, AllocationSpace space); |
| 560 | 560 |
| 561 // Performs a full garbage collection. | 561 // Performs a full garbage collection. |
| 562 static void CollectAllGarbage(); | 562 static void CollectAllGarbage(); |
| 563 | 563 |
| 564 // Utility to invoke the scavenger. This is needed in test code to | 564 // Utility to invoke the scavenger. This is needed in test code to |
| 565 // ensure correct callback for weak global handles. | 565 // ensure correct callback for weak global handles. |
| 566 static void PerformScavenge(); | 566 static void PerformScavenge(); |
| 567 | 567 |
| 568 // Utility used with flag gc-greedy. |
| 569 static bool GarbageCollectionGreedyCheck(); |
| 570 |
| 568 static void SetGlobalGCPrologueCallback(GCCallback callback) { | 571 static void SetGlobalGCPrologueCallback(GCCallback callback) { |
| 569 global_gc_prologue_callback_ = callback; | 572 global_gc_prologue_callback_ = callback; |
| 570 } | 573 } |
| 571 static void SetGlobalGCEpilogueCallback(GCCallback callback) { | 574 static void SetGlobalGCEpilogueCallback(GCCallback callback) { |
| 572 global_gc_epilogue_callback_ = callback; | 575 global_gc_epilogue_callback_ = callback; |
| 573 } | 576 } |
| 574 | 577 |
| 575 // Heap roots | 578 // Heap roots |
| 576 #define ROOT_ACCESSOR(type, name) static type* name() { return name##_; } | 579 #define ROOT_ACCESSOR(type, name) static type* name() { return name##_; } |
| 577 ROOT_LIST(ROOT_ACCESSOR) | 580 ROOT_LIST(ROOT_ACCESSOR) |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 int marked_count_; | 1178 int marked_count_; |
| 1176 | 1179 |
| 1177 // The count from the end of the previous full GC. Will be zero if there | 1180 // The count from the end of the previous full GC. Will be zero if there |
| 1178 // was no previous full GC. | 1181 // was no previous full GC. |
| 1179 int previous_marked_count_; | 1182 int previous_marked_count_; |
| 1180 }; | 1183 }; |
| 1181 | 1184 |
| 1182 } } // namespace v8::internal | 1185 } } // namespace v8::internal |
| 1183 | 1186 |
| 1184 #endif // V8_HEAP_H_ | 1187 #endif // V8_HEAP_H_ |
| OLD | NEW |