Skip to content

Commit 499e8b7

Browse files
targosofrobots
authored andcommitted
deps: cherry-pick workaround for clang-3.4 ICE
Ref: nodejs#8343 Fixes: nodejs#8323
1 parent 3b6897f commit 499e8b7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
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)