Browse Source

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 <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
v7.x
Michaël Zasso 8 years ago
committed by James M Snell
parent
commit
a88bb3a758
  1. 14
      deps/v8/src/heap/mark-compact.cc

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

@ -3700,10 +3700,20 @@ int NumberOfPointerUpdateTasks(int pages) {
template <PointerDirection direction> template <PointerDirection direction>
void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore) { 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( PageParallelJob<PointerUpdateJobTraits<direction> > job(
heap, heap->isolate()->cancelable_task_manager(), semaphore); heap, heap->isolate()->cancelable_task_manager(), semaphore);
RememberedSet<direction>::IterateMemoryChunks( RememberedSet<direction>::IterateMemoryChunks(heap, MemoryChunkVisitor(job));
heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); });
int num_pages = job.NumberOfPages(); int num_pages = job.NumberOfPages();
int num_tasks = NumberOfPointerUpdateTasks(num_pages); int num_tasks = NumberOfPointerUpdateTasks(num_pages);
job.Run(num_tasks, [](int i) { return 0; }); job.Run(num_tasks, [](int i) { return 0; });

Loading…
Cancel
Save