| Index: src/heap.h
|
| diff --git a/src/heap.h b/src/heap.h
|
| index 64fd17d61bf81332ee41a6e47dadbf3cb47db1f4..5a5470ff52aa4422507e9924a166d3c139780670 100644
|
| --- a/src/heap.h
|
| +++ b/src/heap.h
|
| @@ -1620,6 +1620,25 @@ class Heap {
|
|
|
| void CheckpointObjectStats();
|
|
|
| + // We don't use a ScopedLock here since we want to lock the heap
|
| + // only when FLAG_parallel_recompilation is true.
|
| + class RelocationLock {
|
| + public:
|
| + explicit RelocationLock(Heap* heap) : heap_(heap) {
|
| + if (FLAG_parallel_recompilation) {
|
| + heap_->relocation_mutex_->Lock();
|
| + }
|
| + }
|
| + ~RelocationLock() {
|
| + if (FLAG_parallel_recompilation) {
|
| + heap_->relocation_mutex_->Unlock();
|
| + }
|
| + }
|
| +
|
| + private:
|
| + Heap* heap_;
|
| + };
|
| +
|
| private:
|
| Heap();
|
|
|
| @@ -2072,6 +2091,8 @@ class Heap {
|
|
|
| MemoryChunk* chunks_queued_for_free_;
|
|
|
| + Mutex* relocation_mutex_;
|
| +
|
| friend class Factory;
|
| friend class GCTracer;
|
| friend class DisallowAllocationFailure;
|
|
|