From a88bb3a758649400a3b715d6c747200b7b5c9197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 12 Sep 2016 11:50:56 +0200 Subject: [PATCH] deps: cherry-pick workaround for clang-3.4 ICE Ref: https://github.com/nodejs/node/pull/8343 Fixes: https://github.com/nodejs/node/issues/8323 PR-URL: https://github.com/nodejs/node/pull/8317 Reviewed-By: Ben Noordhuis Reviewed-By: Ali Ijaz Sheikh --- deps/v8/src/heap/mark-compact.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/deps/v8/src/heap/mark-compact.cc b/deps/v8/src/heap/mark-compact.cc index ae7b4676ae..78b4ea8f0e 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; });