Index: src/objects-inl.h |
diff --git a/src/objects-inl.h b/src/objects-inl.h |
index 18bbc7a81f11b1b0cde5463d8102ab39035c299f..71cc4566ee14e72c4011b50533dd200b47e345a9 100644 |
--- a/src/objects-inl.h |
+++ b/src/objects-inl.h |
@@ -1485,21 +1485,22 @@ Isolate* HeapObject::GetIsolate() const { |
return GetHeap()->isolate(); |
} |
- |
Map* HeapObject::map() const { |
return map_word().ToMap(); |
} |
void HeapObject::set_map(Map* value) { |
+ if (value != nullptr) { |
+#ifdef VERIFY_HEAP |
+ value->GetHeap()->VerifyObjectLayoutChange(this, value); |
+#endif |
+ } |
set_map_word(MapWord::FromMap(value)); |
if (value != nullptr) { |
// TODO(1600) We are passing NULL as a slot because maps can never be on |
// evacuation candidate. |
value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
-#ifdef VERIFY_HEAP |
- value->GetHeap()->VerifyObjectLayoutChange(this, value); |
-#endif |
} |
} |
@@ -1510,26 +1511,38 @@ Map* HeapObject::synchronized_map() { |
void HeapObject::synchronized_set_map(Map* value) { |
- synchronized_set_map_word(MapWord::FromMap(value)); |
if (value != nullptr) { |
- // TODO(1600) We are passing NULL as a slot because maps can never be on |
- // evacuation candidate. |
- value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
#ifdef VERIFY_HEAP |
value->GetHeap()->VerifyObjectLayoutChange(this, value); |
#endif |
} |
-} |
- |
- |
-void HeapObject::synchronized_set_map_no_write_barrier(Map* value) { |
synchronized_set_map_word(MapWord::FromMap(value)); |
+ if (value != nullptr) { |
+ // TODO(1600) We are passing NULL as a slot because maps can never be on |
+ // evacuation candidate. |
+ value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
+ } |
} |
// Unsafe accessor omitting write barrier. |
void HeapObject::set_map_no_write_barrier(Map* value) { |
+ if (value != nullptr) { |
+#ifdef VERIFY_HEAP |
+ value->GetHeap()->VerifyObjectLayoutChange(this, value); |
+#endif |
+ } |
+ set_map_word(MapWord::FromMap(value)); |
+} |
+ |
+void HeapObject::set_map_after_allocation(Map* value, WriteBarrierMode mode) { |
set_map_word(MapWord::FromMap(value)); |
+ if (mode != SKIP_WRITE_BARRIER) { |
+ DCHECK(value != nullptr); |
+ // TODO(1600) We are passing NULL as a slot because maps can never be on |
+ // evacuation candidate. |
+ value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
+ } |
} |
HeapObject** HeapObject::map_slot() { |