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
  • Loading branch information
targos authored and ofrobots committed Sep 12, 2016
1 parent 3b6897f commit 499e8b7
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 499e8b7

Please sign in to comment.