Skip to content

Commit

Permalink
deps: cherry-pick workaround for clang-3.4 ICE
Browse files Browse the repository at this point in the history
Ref: nodejs#8343
Fixes: nodejs#8323

PR-URL: nodejs#8317
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
  • Loading branch information
targos committed Sep 22, 2016
1 parent 75242a2 commit 91b4094
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deps/v8/src/heap/mark-compact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3700,10 +3700,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; });
Expand Down

0 comments on commit 91b4094

Please sign in to comment.