Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: src/heap/mark-compact.cc

Issue 1806283002: Allocate semaphore of page parallel job on heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/page-parallel-job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 38b8167d0d577560bac21ecbe3f70f0297dcb55c..2c998c8817a090478f0e209881aaad04efde6e61 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3585,16 +3585,14 @@ int NumberOfPointerUpdateTasks(int pages) {
template <PointerDirection direction>
void UpdatePointersInParallel(Heap* heap) {
- PageParallelJob<PointerUpdateJobTraits<direction> >* job =
- new PageParallelJob<PointerUpdateJobTraits<direction> >(
- heap, heap->isolate()->cancelable_task_manager());
+ PageParallelJob<PointerUpdateJobTraits<direction> > job(
+ heap, heap->isolate()->cancelable_task_manager());
RememberedSet<direction>::IterateMemoryChunks(
- heap, [job](MemoryChunk* chunk) { job->AddPage(chunk, 0); });
+ heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); });
PointersUpdatingVisitor visitor(heap);
- int num_pages = job->NumberOfPages();
+ int num_pages = job.NumberOfPages();
int num_tasks = NumberOfPointerUpdateTasks(num_pages);
- job->Run(num_tasks, [&visitor](int i) { return &visitor; });
- delete job;
+ job.Run(num_tasks, [&visitor](int i) { return &visitor; });
}
void MarkCompactCollector::UpdatePointersAfterEvacuation() {
« no previous file with comments | « no previous file | src/heap/page-parallel-job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698