OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 map_word().ToRawValue() & ~static_cast<uintptr_t>(PathTracer::kMarkTag); | 1461 map_word().ToRawValue() & ~static_cast<uintptr_t>(PathTracer::kMarkTag); |
1462 return MapWord::FromRawValue(raw_value).ToMap(); | 1462 return MapWord::FromRawValue(raw_value).ToMap(); |
1463 #else | 1463 #else |
1464 return map_word().ToMap(); | 1464 return map_word().ToMap(); |
1465 #endif | 1465 #endif |
1466 } | 1466 } |
1467 | 1467 |
1468 | 1468 |
1469 void HeapObject::set_map(Map* value) { | 1469 void HeapObject::set_map(Map* value) { |
1470 set_map_word(MapWord::FromMap(value)); | 1470 set_map_word(MapWord::FromMap(value)); |
1471 if (value != NULL) { | 1471 if (value != nullptr) { |
1472 // TODO(1600) We are passing NULL as a slot because maps can never be on | 1472 // TODO(1600) We are passing NULL as a slot because maps can never be on |
1473 // evacuation candidate. | 1473 // evacuation candidate. |
1474 value->GetHeap()->incremental_marking()->RecordWrite(this, NULL, value); | 1474 value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
| 1475 #ifdef VERIFY_HEAP |
| 1476 value->GetHeap()->VerifyObjectLayoutChange(this, value); |
| 1477 #endif |
1475 } | 1478 } |
1476 } | 1479 } |
1477 | 1480 |
1478 | 1481 |
1479 Map* HeapObject::synchronized_map() { | 1482 Map* HeapObject::synchronized_map() { |
1480 return synchronized_map_word().ToMap(); | 1483 return synchronized_map_word().ToMap(); |
1481 } | 1484 } |
1482 | 1485 |
1483 | 1486 |
1484 void HeapObject::synchronized_set_map(Map* value) { | 1487 void HeapObject::synchronized_set_map(Map* value) { |
1485 synchronized_set_map_word(MapWord::FromMap(value)); | 1488 synchronized_set_map_word(MapWord::FromMap(value)); |
1486 if (value != NULL) { | 1489 if (value != nullptr) { |
1487 // TODO(1600) We are passing NULL as a slot because maps can never be on | 1490 // TODO(1600) We are passing NULL as a slot because maps can never be on |
1488 // evacuation candidate. | 1491 // evacuation candidate. |
1489 value->GetHeap()->incremental_marking()->RecordWrite(this, NULL, value); | 1492 value->GetHeap()->incremental_marking()->RecordWrite(this, nullptr, value); |
| 1493 #ifdef VERIFY_HEAP |
| 1494 value->GetHeap()->VerifyObjectLayoutChange(this, value); |
| 1495 #endif |
1490 } | 1496 } |
1491 } | 1497 } |
1492 | 1498 |
1493 | 1499 |
1494 void HeapObject::synchronized_set_map_no_write_barrier(Map* value) { | 1500 void HeapObject::synchronized_set_map_no_write_barrier(Map* value) { |
1495 synchronized_set_map_word(MapWord::FromMap(value)); | 1501 synchronized_set_map_word(MapWord::FromMap(value)); |
1496 } | 1502 } |
1497 | 1503 |
1498 | 1504 |
1499 // Unsafe accessor omitting write barrier. | 1505 // Unsafe accessor omitting write barrier. |
(...skipping 6749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8249 #undef WRITE_INT64_FIELD | 8255 #undef WRITE_INT64_FIELD |
8250 #undef READ_BYTE_FIELD | 8256 #undef READ_BYTE_FIELD |
8251 #undef WRITE_BYTE_FIELD | 8257 #undef WRITE_BYTE_FIELD |
8252 #undef NOBARRIER_READ_BYTE_FIELD | 8258 #undef NOBARRIER_READ_BYTE_FIELD |
8253 #undef NOBARRIER_WRITE_BYTE_FIELD | 8259 #undef NOBARRIER_WRITE_BYTE_FIELD |
8254 | 8260 |
8255 } // namespace internal | 8261 } // namespace internal |
8256 } // namespace v8 | 8262 } // namespace v8 |
8257 | 8263 |
8258 #endif // V8_OBJECTS_INL_H_ | 8264 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |