Browse Source

deps: cherry-pick workaround for clang-3.4 ICE

Fixes: https://github.com/nodejs/node/issues/8323
Refs: https://github.com/nodejs/node/pull/8343
Refs: https://github.com/nodejs/node/pull/8317

PR-URL: https://github.com/nodejs/node/pull/11029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
v7.x
Michaël Zasso 9 years ago
committed by Italo A. Casas
parent
commit
7fea966a1d
No known key found for this signature in database GPG Key ID: 23EFEFE93C4CFFFE
  1. 14
      deps/v8/src/heap/mark-compact.cc

14
deps/v8/src/heap/mark-compact.cc

@ -3673,10 +3673,20 @@ int NumberOfPointerUpdateTasks(int pages) {
template <PointerDirection direction>
void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore) {
// Work-around bug in clang-3.4
// https://github.com/nodejs/node/issues/8323
struct MemoryChunkVisitor {
PageParallelJob<PointerUpdateJobTraits<direction> >& job_;
MemoryChunkVisitor(PageParallelJob<PointerUpdateJobTraits<direction> >& job)
: job_(job) {}
void operator()(MemoryChunk* chunk) {
job_.AddPage(chunk, 0);
}
};
PageParallelJob<PointerUpdateJobTraits<direction> > job(
heap, heap->isolate()->cancelable_task_manager(), semaphore);
RememberedSet<direction>::IterateMemoryChunks(
heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); });
RememberedSet<direction>::IterateMemoryChunks(heap, MemoryChunkVisitor(job));
int num_pages = job.NumberOfPages();
int num_tasks = NumberOfPointerUpdateTasks(num_pages);
job.Run(num_tasks, [](int i) { return 0; });

Loading…
Cancel
Save