diff --git a/deps/v8/src/heap/mark-compact.cc b/deps/v8/src/heap/mark-compact.cc index 7e5ef96fc9889c..838f137e9f44d9 100644 --- a/deps/v8/src/heap/mark-compact.cc +++ b/deps/v8/src/heap/mark-compact.cc @@ -3673,10 +3673,20 @@ int NumberOfPointerUpdateTasks(int pages) { template void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore) { + // Work-around bug in clang-3.4 + // https://github.com/nodejs/node/issues/8323 + struct MemoryChunkVisitor { + PageParallelJob >& job_; + MemoryChunkVisitor(PageParallelJob >& job) + : job_(job) {} + void operator()(MemoryChunk* chunk) { + job_.AddPage(chunk, 0); + } + }; + PageParallelJob > job( heap, heap->isolate()->cancelable_task_manager(), semaphore); - RememberedSet::IterateMemoryChunks( - heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); }); + RememberedSet::IterateMemoryChunks(heap, MemoryChunkVisitor(job)); int num_pages = job.NumberOfPages(); int num_tasks = NumberOfPointerUpdateTasks(num_pages); job.Run(num_tasks, [](int i) { return 0; });