summaryrefslogtreecommitdiff
path: root/chromium/v8/src/heap
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-07-01 12:20:27 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-07-01 10:39:40 +0000
commit7366110654eec46f21b6824f302356426f48cd74 (patch)
treef2ff1845183f6117a692bb0c705475c8c13556d5 /chromium/v8/src/heap
parentb92421879c003a0857b2074f7e05b3bbbb326569 (diff)
downloadqtwebengine-chromium-7366110654eec46f21b6824f302356426f48cd74.tar.gz
BASELINE: Update Chromium to 51.0.2704.106
Also add a few extra files we might need for future features. Change-Id: I517c35e43221c610976d347c966d070ad44d4c2b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'chromium/v8/src/heap')
-rw-r--r--chromium/v8/src/heap/mark-compact.cc20
-rw-r--r--chromium/v8/src/heap/mark-compact.h2
-rw-r--r--chromium/v8/src/heap/page-parallel-job.h12
-rw-r--r--chromium/v8/src/heap/spaces.cc4
4 files changed, 25 insertions, 13 deletions
diff --git a/chromium/v8/src/heap/mark-compact.cc b/chromium/v8/src/heap/mark-compact.cc
index e537689c4a5..5ffea25488b 100644
--- a/chromium/v8/src/heap/mark-compact.cc
+++ b/chromium/v8/src/heap/mark-compact.cc
@@ -63,7 +63,8 @@ MarkCompactCollector::MarkCompactCollector(Heap* heap)
compacting_(false),
sweeping_in_progress_(false),
pending_sweeper_tasks_semaphore_(0),
- pending_compaction_tasks_semaphore_(0) {
+ pending_compaction_tasks_semaphore_(0),
+ page_parallel_job_semaphore_(0) {
}
#ifdef VERIFY_HEAP
@@ -3108,7 +3109,8 @@ class EvacuationJobTraits {
void MarkCompactCollector::EvacuatePagesInParallel() {
PageParallelJob<EvacuationJobTraits> job(
- heap_, heap_->isolate()->cancelable_task_manager());
+ heap_, heap_->isolate()->cancelable_task_manager(),
+ &page_parallel_job_semaphore_);
int abandoned_pages = 0;
intptr_t live_bytes = 0;
@@ -3493,9 +3495,9 @@ int NumberOfPointerUpdateTasks(int pages) {
}
template <PointerDirection direction>
-void UpdatePointersInParallel(Heap* heap) {
+void UpdatePointersInParallel(Heap* heap, base::Semaphore* semaphore) {
PageParallelJob<PointerUpdateJobTraits<direction> > job(
- heap, heap->isolate()->cancelable_task_manager());
+ heap, heap->isolate()->cancelable_task_manager(), semaphore);
RememberedSet<direction>::IterateMemoryChunks(
heap, [&job](MemoryChunk* chunk) { job.AddPage(chunk, 0); });
PointersUpdatingVisitor visitor(heap);
@@ -3525,9 +3527,9 @@ class ToSpacePointerUpdateJobTraits {
}
};
-void UpdateToSpacePointersInParallel(Heap* heap) {
+void UpdateToSpacePointersInParallel(Heap* heap, base::Semaphore* semaphore) {
PageParallelJob<ToSpacePointerUpdateJobTraits> job(
- heap, heap->isolate()->cancelable_task_manager());
+ heap, heap->isolate()->cancelable_task_manager(), semaphore);
Address space_start = heap->new_space()->bottom();
Address space_end = heap->new_space()->top();
NewSpacePageIterator it(space_start, space_end);
@@ -3551,17 +3553,17 @@ void MarkCompactCollector::UpdatePointersAfterEvacuation() {
{
TRACE_GC(heap()->tracer(),
GCTracer::Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW);
- UpdateToSpacePointersInParallel(heap_);
+ UpdateToSpacePointersInParallel(heap_, &page_parallel_job_semaphore_);
// Update roots.
heap_->IterateRoots(&updating_visitor, VISIT_ALL_IN_SWEEP_NEWSPACE);
- UpdatePointersInParallel<OLD_TO_NEW>(heap_);
+ UpdatePointersInParallel<OLD_TO_NEW>(heap_, &page_parallel_job_semaphore_);
}
{
Heap* heap = this->heap();
TRACE_GC(heap->tracer(),
GCTracer::Scope::MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED);
- UpdatePointersInParallel<OLD_TO_OLD>(heap_);
+ UpdatePointersInParallel<OLD_TO_OLD>(heap_, &page_parallel_job_semaphore_);
}
{
diff --git a/chromium/v8/src/heap/mark-compact.h b/chromium/v8/src/heap/mark-compact.h
index cd207bcda27..9fee8269d5d 100644
--- a/chromium/v8/src/heap/mark-compact.h
+++ b/chromium/v8/src/heap/mark-compact.h
@@ -841,6 +841,8 @@ class MarkCompactCollector {
// Semaphore used to synchronize compaction tasks.
base::Semaphore pending_compaction_tasks_semaphore_;
+ base::Semaphore page_parallel_job_semaphore_;
+
bool black_allocation_;
friend class Heap;
diff --git a/chromium/v8/src/heap/page-parallel-job.h b/chromium/v8/src/heap/page-parallel-job.h
index 720e288fc8e..02583c78184 100644
--- a/chromium/v8/src/heap/page-parallel-job.h
+++ b/chromium/v8/src/heap/page-parallel-job.h
@@ -33,13 +33,20 @@ class Isolate;
template <typename JobTraits>
class PageParallelJob {
public:
- PageParallelJob(Heap* heap, CancelableTaskManager* cancelable_task_manager)
+ // PageParallelJob cannot dynamically create a semaphore because of a bug in
+ // glibc. See http://crbug.com/609249 and
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=12674.
+ // The caller must provide a semaphore with value 0 and ensure that
+ // the lifetime of the semaphore is the same as the lifetime of the Isolate
+ // It is guaranteed that the semaphore value will be 0 after Run() call.
+ PageParallelJob(Heap* heap, CancelableTaskManager* cancelable_task_manager,
+ base::Semaphore* semaphore)
: heap_(heap),
cancelable_task_manager_(cancelable_task_manager),
items_(nullptr),
num_items_(0),
num_tasks_(0),
- pending_tasks_(new base::Semaphore(0)) {}
+ pending_tasks_(semaphore) {}
~PageParallelJob() {
Item* item = items_;
@@ -48,7 +55,6 @@ class PageParallelJob {
delete item;
item = next;
}
- delete pending_tasks_;
}
void AddPage(MemoryChunk* chunk, typename JobTraits::PerPageData data) {
diff --git a/chromium/v8/src/heap/spaces.cc b/chromium/v8/src/heap/spaces.cc
index 63e7c33c582..a0a37523b24 100644
--- a/chromium/v8/src/heap/spaces.cc
+++ b/chromium/v8/src/heap/spaces.cc
@@ -792,7 +792,9 @@ MemoryChunk* MemoryAllocator::AllocatePagePooled(SpaceType* owner) {
const Address start = reinterpret_cast<Address>(chunk);
const Address area_start = start + MemoryChunk::kObjectStartOffset;
const Address area_end = start + size;
- CommitBlock(reinterpret_cast<Address>(chunk), size, NOT_EXECUTABLE);
+ if (!CommitBlock(reinterpret_cast<Address>(chunk), size, NOT_EXECUTABLE)) {
+ return nullptr;
+ }
base::VirtualMemory reservation(start, size);
MemoryChunk::Initialize(isolate_->heap(), start, size, area_start, area_end,
NOT_EXECUTABLE, owner, &reservation);