Commit 78082436 authored by ulan's avatar ulan Committed by Commit bot

[heap] Make object field write atomic if concurrent marking is enabled.

This patch also makes concurrent marking visitor loads atomic.

BUG=chromium:694255

Review-Url: https://codereview.chromium.org/2872443003
Cr-Commit-Position: refs/heads/master@{#45179}
parent 4fa473cb
...@@ -37,8 +37,10 @@ class ConcurrentMarkingVisitor final ...@@ -37,8 +37,10 @@ class ConcurrentMarkingVisitor final
void VisitPointers(HeapObject* host, Object** start, Object** end) override { void VisitPointers(HeapObject* host, Object** start, Object** end) override {
for (Object** p = start; p < end; p++) { for (Object** p = start; p < end; p++) {
if (!(*p)->IsHeapObject()) continue; Object* object = reinterpret_cast<Object*>(
MarkObject(HeapObject::cast(*p)); base::NoBarrier_Load(reinterpret_cast<const base::AtomicWord*>(p)));
if (!object->IsHeapObject()) continue;
MarkObject(HeapObject::cast(object));
} }
} }
......
...@@ -1303,8 +1303,15 @@ bool JSObject::PrototypeHasNoElements(Isolate* isolate, JSObject* object) { ...@@ -1303,8 +1303,15 @@ bool JSObject::PrototypeHasNoElements(Isolate* isolate, JSObject* object) {
reinterpret_cast<Object*>(base::NoBarrier_Load( \ reinterpret_cast<Object*>(base::NoBarrier_Load( \
reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset)))) reinterpret_cast<const base::AtomicWord*>(FIELD_ADDR_CONST(p, offset))))
#if V8_CONCURRENT_MARKING
#define WRITE_FIELD(p, offset, value) \
base::NoBarrier_Store( \
reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \
reinterpret_cast<base::AtomicWord>(value));
#else
#define WRITE_FIELD(p, offset, value) \ #define WRITE_FIELD(p, offset, value) \
(*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value) (*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value)
#endif
#define RELEASE_WRITE_FIELD(p, offset, value) \ #define RELEASE_WRITE_FIELD(p, offset, value) \
base::Release_Store( \ base::Release_Store( \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment