diff --git a/deps/v8/src/heap/mark-compact.cc b/deps/v8/src/heap/mark-compact.cc index ae7b4676aed293..78b4ea8f0ea4ae 100644 --- a/deps/v8/src/heap/mark-compact.cc +++ b/deps/v8/src/heap/mark-compact.cc @@ -3700,10 +3700,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; });