| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 // Forward declarations. | 412 // Forward declarations. |
| 413 class HeapStats; | 413 class HeapStats; |
| 414 class Isolate; | 414 class Isolate; |
| 415 class MemoryReducer; | 415 class MemoryReducer; |
| 416 class WeakObjectRetainer; | 416 class WeakObjectRetainer; |
| 417 | 417 |
| 418 | 418 |
| 419 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap, | 419 typedef String* (*ExternalStringTableUpdaterCallback)(Heap* heap, |
| 420 Object** pointer); | 420 Object** pointer); |
| 421 | 421 |
| 422 class StoreBufferRebuilder { | |
| 423 public: | |
| 424 explicit StoreBufferRebuilder(StoreBuffer* store_buffer) | |
| 425 : store_buffer_(store_buffer) {} | |
| 426 | |
| 427 void Callback(MemoryChunk* page, StoreBufferEvent event); | |
| 428 | |
| 429 private: | |
| 430 StoreBuffer* store_buffer_; | |
| 431 | |
| 432 // We record in this variable how full the store buffer was when we started | |
| 433 // iterating over the current page, finding pointers to new space. If the | |
| 434 // store buffer overflows again we can exempt the page from the store buffer | |
| 435 // by rewinding to this point instead of having to search the store buffer. | |
| 436 Object*** start_of_current_page_; | |
| 437 // The current page we are scanning in the store buffer iterator. | |
| 438 MemoryChunk* current_page_; | |
| 439 }; | |
| 440 | |
| 441 | 422 |
| 442 // A queue of objects promoted during scavenge. Each object is accompanied | 423 // A queue of objects promoted during scavenge. Each object is accompanied |
| 443 // by it's size to avoid dereferencing a map pointer for scanning. | 424 // by it's size to avoid dereferencing a map pointer for scanning. |
| 444 // The last page in to-space is used for the promotion queue. On conflict | 425 // The last page in to-space is used for the promotion queue. On conflict |
| 445 // during scavenge, the promotion queue is allocated externally and all | 426 // during scavenge, the promotion queue is allocated externally and all |
| 446 // entries are copied to the external queue. | 427 // entries are copied to the external queue. |
| 447 class PromotionQueue { | 428 class PromotionQueue { |
| 448 public: | 429 public: |
| 449 explicit PromotionQueue(Heap* heap) | 430 explicit PromotionQueue(Heap* heap) |
| 450 : front_(NULL), | 431 : front_(NULL), |
| (...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2690 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2710 | 2691 |
| 2711 private: | 2692 private: |
| 2712 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2693 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2713 }; | 2694 }; |
| 2714 #endif // DEBUG | 2695 #endif // DEBUG |
| 2715 } | 2696 } |
| 2716 } // namespace v8::internal | 2697 } // namespace v8::internal |
| 2717 | 2698 |
| 2718 #endif // V8_HEAP_HEAP_H_ | 2699 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |