| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 static GCCallback global_gc_prologue_callback_; | 1249 static GCCallback global_gc_prologue_callback_; |
| 1250 static GCCallback global_gc_epilogue_callback_; | 1250 static GCCallback global_gc_epilogue_callback_; |
| 1251 | 1251 |
| 1252 // Support for computing object sizes during GC. | 1252 // Support for computing object sizes during GC. |
| 1253 static HeapObjectCallback gc_safe_size_of_old_object_; | 1253 static HeapObjectCallback gc_safe_size_of_old_object_; |
| 1254 static int GcSafeSizeOfOldObject(HeapObject* object); | 1254 static int GcSafeSizeOfOldObject(HeapObject* object); |
| 1255 static int GcSafeSizeOfOldObjectWithEncodedMap(HeapObject* object); | 1255 static int GcSafeSizeOfOldObjectWithEncodedMap(HeapObject* object); |
| 1256 | 1256 |
| 1257 // Update the GC state. Called from the mark-compact collector. | 1257 // Update the GC state. Called from the mark-compact collector. |
| 1258 static void MarkMapPointersAsEncoded(bool encoded) { | 1258 static void MarkMapPointersAsEncoded(bool encoded) { |
| 1259 ASSERT(!encoded || !FLAG_new_gc); // Encoding not used in new GC. |
| 1260 |
| 1259 gc_safe_size_of_old_object_ = encoded | 1261 gc_safe_size_of_old_object_ = encoded |
| 1260 ? &GcSafeSizeOfOldObjectWithEncodedMap | 1262 ? &GcSafeSizeOfOldObjectWithEncodedMap |
| 1261 : &GcSafeSizeOfOldObject; | 1263 : &GcSafeSizeOfOldObject; |
| 1262 } | 1264 } |
| 1263 | 1265 |
| 1264 // Checks whether a global GC is necessary | 1266 // Checks whether a global GC is necessary |
| 1265 static GarbageCollector SelectGarbageCollector(AllocationSpace space); | 1267 static GarbageCollector SelectGarbageCollector(AllocationSpace space); |
| 1266 | 1268 |
| 1267 // Performs garbage collection | 1269 // Performs garbage collection |
| 1268 // Returns whether there is a chance another major GC could | 1270 // Returns whether there is a chance another major GC could |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 // Return whether this object should be retained. If NULL is returned the | 2107 // Return whether this object should be retained. If NULL is returned the |
| 2106 // object has no references. Otherwise the address of the retained object | 2108 // object has no references. Otherwise the address of the retained object |
| 2107 // should be returned as in some GC situations the object has been moved. | 2109 // should be returned as in some GC situations the object has been moved. |
| 2108 virtual Object* RetainAs(Object* object) = 0; | 2110 virtual Object* RetainAs(Object* object) = 0; |
| 2109 }; | 2111 }; |
| 2110 | 2112 |
| 2111 | 2113 |
| 2112 } } // namespace v8::internal | 2114 } } // namespace v8::internal |
| 2113 | 2115 |
| 2114 #endif // V8_HEAP_H_ | 2116 #endif // V8_HEAP_H_ |
| OLD | NEW |