Skip to content

Commit a88bb3a

Browse files
targosjasnell
authored andcommitted
deps: cherry-pick workaround for clang-3.4 ICE
Ref: #8343 Fixes: #8323 PR-URL: #8317 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent b032f1c commit a88bb3a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -3700,10 +3700,20 @@ int NumberOfPointerUpdateTasks(int pages) {
37003700

37013701
template <PointerDirection direction>
37023702
void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore) {
3703+
// Work-around bug in clang-3.4
3704+
// https://github.com/nodejs/node/issues/8323
3705+
struct MemoryChunkVisitor {
3706+
PageParallelJob<PointerUpdateJobTraits<direction> >& job_;
3707+
MemoryChunkVisitor(PageParallelJob<PointerUpdateJobTraits<direction> >& job)
3708+
: job_(job) {}
3709+
void operator()(MemoryChunk* chunk) {
3710+
job_.AddPage(chunk, 0);
3711+
}
3712+
};
3713+
37033714
PageParallelJob<PointerUpdateJobTraits<direction> > job(
37043715
heap, heap->isolate()->cancelable_task_manager(), semaphore);
3705-
RememberedSet<direction>::IterateMemoryChunks(
3706-
heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); });
3716+
RememberedSet<direction>::IterateMemoryChunks(heap, MemoryChunkVisitor(job));
37073717
int num_pages = job.NumberOfPages();
37083718
int num_tasks = NumberOfPointerUpdateTasks(num_pages);
37093719
job.Run(num_tasks, [](int i) { return 0; });

0 commit comments

Comments
 (0)