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
Fixes: #8323
Refs: #8343
Refs: #8317

PR-URL: #11029
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
targos authored and italoacasas committed Feb 14, 2017
1 parent 61870b4 commit 7fea966
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 @@ -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; });
Expand Down

0 comments on commit 7fea966

Please sign in to comment.