Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 478 if (collector == MARK_COMPACTOR && global_gc_epilogue_callback_) { | 478 if (collector == MARK_COMPACTOR && global_gc_epilogue_callback_) { |
| 479 ASSERT(!allocation_allowed_); | 479 ASSERT(!allocation_allowed_); |
| 480 global_gc_epilogue_callback_(); | 480 global_gc_epilogue_callback_(); |
| 481 } | 481 } |
| 482 VerifySymbolTable(); | 482 VerifySymbolTable(); |
| 483 } | 483 } |
| 484 | 484 |
| 485 | 485 |
| 486 void Heap::PostGarbageCollectionProcessing() { | 486 void Heap::PostGarbageCollectionProcessing() { |
| 487 // Process weak handles post gc. | 487 // Process weak handles post gc. |
| 488 bool old_value = allow_allocation(true); | |
| 488 GlobalHandles::PostGarbageCollectionProcessing(); | 489 GlobalHandles::PostGarbageCollectionProcessing(); |
| 490 if (!old_value) allow_allocation(false); | |
|
Mads Ager (chromium)
2009/08/21 05:58:16
Just call allow_allocation with old_value?
| |
| 489 // Update flat string readers. | 491 // Update flat string readers. |
| 490 FlatStringReader::PostGarbageCollectionProcessing(); | 492 FlatStringReader::PostGarbageCollectionProcessing(); |
| 491 } | 493 } |
| 492 | 494 |
| 493 | 495 |
| 494 void Heap::MarkCompact(GCTracer* tracer) { | 496 void Heap::MarkCompact(GCTracer* tracer) { |
| 495 gc_state_ = MARK_COMPACT; | 497 gc_state_ = MARK_COMPACT; |
| 496 mc_count_++; | 498 mc_count_++; |
| 497 tracer->set_full_gc_count(mc_count_); | 499 tracer->set_full_gc_count(mc_count_); |
| 498 LOG(ResourceEvent("markcompact", "begin")); | 500 LOG(ResourceEvent("markcompact", "begin")); |
| (...skipping 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3915 #ifdef DEBUG | 3917 #ifdef DEBUG |
| 3916 bool Heap::GarbageCollectionGreedyCheck() { | 3918 bool Heap::GarbageCollectionGreedyCheck() { |
| 3917 ASSERT(FLAG_gc_greedy); | 3919 ASSERT(FLAG_gc_greedy); |
| 3918 if (Bootstrapper::IsActive()) return true; | 3920 if (Bootstrapper::IsActive()) return true; |
| 3919 if (disallow_allocation_failure()) return true; | 3921 if (disallow_allocation_failure()) return true; |
| 3920 return CollectGarbage(0, NEW_SPACE); | 3922 return CollectGarbage(0, NEW_SPACE); |
| 3921 } | 3923 } |
| 3922 #endif | 3924 #endif |
| 3923 | 3925 |
| 3924 } } // namespace v8::internal | 3926 } } // namespace v8::internal |
| OLD | NEW |