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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ | 1268 reinterpret_cast<base::AtomicWord*>(FIELD_ADDR(p, offset)), \ |
1269 reinterpret_cast<base::AtomicWord>(value)); | 1269 reinterpret_cast<base::AtomicWord>(value)); |
1270 | 1270 |
1271 #define WRITE_BARRIER(heap, object, offset, value) \ | 1271 #define WRITE_BARRIER(heap, object, offset, value) \ |
1272 heap->incremental_marking()->RecordWrite( \ | 1272 heap->incremental_marking()->RecordWrite( \ |
1273 object, HeapObject::RawField(object, offset), value); \ | 1273 object, HeapObject::RawField(object, offset), value); \ |
1274 if (heap->InNewSpace(value)) { \ | 1274 if (heap->InNewSpace(value)) { \ |
1275 heap->RecordWrite(object->address(), offset); \ | 1275 heap->RecordWrite(object->address(), offset); \ |
1276 } | 1276 } |
1277 | 1277 |
1278 #define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \ | 1278 #define CONDITIONAL_WRITE_BARRIER(heap, object, offset, value, mode) \ |
1279 if (mode == UPDATE_WRITE_BARRIER) { \ | 1279 if (mode != SKIP_WRITE_BARRIER) { \ |
1280 heap->incremental_marking()->RecordWrite( \ | 1280 if (mode == UPDATE_WRITE_BARRIER) { \ |
1281 object, HeapObject::RawField(object, offset), value); \ | 1281 heap->incremental_marking()->RecordWrite( \ |
1282 if (heap->InNewSpace(value)) { \ | 1282 object, HeapObject::RawField(object, offset), value); \ |
1283 heap->RecordWrite(object->address(), offset); \ | 1283 } \ |
1284 } \ | 1284 if (heap->InNewSpace(value)) { \ |
| 1285 heap->RecordWrite(object->address(), offset); \ |
| 1286 } \ |
1285 } | 1287 } |
1286 | 1288 |
1287 #ifndef V8_TARGET_ARCH_MIPS | 1289 #ifndef V8_TARGET_ARCH_MIPS |
1288 #define READ_DOUBLE_FIELD(p, offset) \ | 1290 #define READ_DOUBLE_FIELD(p, offset) \ |
1289 (*reinterpret_cast<const double*>(FIELD_ADDR_CONST(p, offset))) | 1291 (*reinterpret_cast<const double*>(FIELD_ADDR_CONST(p, offset))) |
1290 #else // V8_TARGET_ARCH_MIPS | 1292 #else // V8_TARGET_ARCH_MIPS |
1291 // Prevent gcc from using load-double (mips ldc1) on (possibly) | 1293 // Prevent gcc from using load-double (mips ldc1) on (possibly) |
1292 // non-64-bit aligned HeapNumber::value. | 1294 // non-64-bit aligned HeapNumber::value. |
1293 static inline double read_double_field(const void* p, int offset) { | 1295 static inline double read_double_field(const void* p, int offset) { |
1294 union conversion { | 1296 union conversion { |
(...skipping 6346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7641 #undef READ_SHORT_FIELD | 7643 #undef READ_SHORT_FIELD |
7642 #undef WRITE_SHORT_FIELD | 7644 #undef WRITE_SHORT_FIELD |
7643 #undef READ_BYTE_FIELD | 7645 #undef READ_BYTE_FIELD |
7644 #undef WRITE_BYTE_FIELD | 7646 #undef WRITE_BYTE_FIELD |
7645 #undef NOBARRIER_READ_BYTE_FIELD | 7647 #undef NOBARRIER_READ_BYTE_FIELD |
7646 #undef NOBARRIER_WRITE_BYTE_FIELD | 7648 #undef NOBARRIER_WRITE_BYTE_FIELD |
7647 | 7649 |
7648 } } // namespace v8::internal | 7650 } } // namespace v8::internal |
7649 | 7651 |
7650 #endif // V8_OBJECTS_INL_H_ | 7652 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |