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

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

Issue 1314133004: Synchronize on concurrent slot buffer entries during migration. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index ffb54bb462cbd13dbb595d27b902a4c51eb38067..f6df6f4a2e5394b30b22fdef668789ed50f73d19 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -374,6 +374,14 @@ class SlotsBuffer {
return buffer != NULL && buffer->chain_length_ >= kChainLengthThreshold;
}
+ INLINE(static bool AddToSynchronized(SlotsBufferAllocator* allocator,
+ SlotsBuffer** buffer_address,
+ base::Mutex* buffer_mutex,
+ ObjectSlot slot, AdditionMode mode)) {
+ base::LockGuard<base::Mutex> lock_guard(buffer_mutex);
+ return AddTo(allocator, buffer_address, slot, mode);
+ }
+
INLINE(static bool AddTo(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address, ObjectSlot slot,
AdditionMode mode)) {
@@ -392,6 +400,11 @@ class SlotsBuffer {
static bool IsTypedSlot(ObjectSlot slot);
+ static bool AddToSynchronized(SlotsBufferAllocator* allocator,
+ SlotsBuffer** buffer_address,
+ base::Mutex* buffer_mutex, SlotType type,
+ Address addr, AdditionMode mode);
+
static bool AddTo(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address, SlotType type, Address addr,
AdditionMode mode);
@@ -722,6 +735,8 @@ class MarkCompactCollector {
SlotsBuffer* migration_slots_buffer_;
+ base::Mutex migration_slots_buffer_mutex_;
+
// Finishes GC, performs heap verification if enabled.
void Finish();
@@ -897,6 +912,12 @@ class MarkCompactCollector {
// Updates store buffer and slot buffer for a pointer in a migrating object.
void RecordMigratedSlot(Object* value, Address slot);
+ // Adds the code entry slot to the slots buffer.
+ void RecordMigratedCodeEntrySlot(Address code_entry, Address code_entry_slot);
+
+ // Adds the slot of a moved code object.
+ void RecordMigratedCodeObjectSlot(Address code_object);
+
#ifdef DEBUG
friend class MarkObjectVisitor;
static void VisitObject(HeapObject* obj);
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698