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 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 VerifyPointer(READ_FIELD(this, offset)); | 1376 VerifyPointer(READ_FIELD(this, offset)); |
1377 } | 1377 } |
1378 | 1378 |
1379 void HeapObject::VerifySmiField(int offset) { | 1379 void HeapObject::VerifySmiField(int offset) { |
1380 CHECK(READ_FIELD(this, offset)->IsSmi()); | 1380 CHECK(READ_FIELD(this, offset)->IsSmi()); |
1381 } | 1381 } |
1382 #endif | 1382 #endif |
1383 | 1383 |
1384 | 1384 |
1385 Heap* HeapObject::GetHeap() const { | 1385 Heap* HeapObject::GetHeap() const { |
1386 Heap* heap = | 1386 Heap* heap = MemoryChunk::FromAddress( |
1387 MemoryChunk::FromAddress(reinterpret_cast<const byte*>(this))->heap(); | 1387 reinterpret_cast<Address>(const_cast<HeapObject*>(this))) |
| 1388 ->heap(); |
1388 SLOW_DCHECK(heap != NULL); | 1389 SLOW_DCHECK(heap != NULL); |
1389 return heap; | 1390 return heap; |
1390 } | 1391 } |
1391 | 1392 |
1392 | 1393 |
1393 Isolate* HeapObject::GetIsolate() const { | 1394 Isolate* HeapObject::GetIsolate() const { |
1394 return GetHeap()->isolate(); | 1395 return GetHeap()->isolate(); |
1395 } | 1396 } |
1396 | 1397 |
1397 | 1398 |
(...skipping 6438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7836 #undef WRITE_INT64_FIELD | 7837 #undef WRITE_INT64_FIELD |
7837 #undef READ_BYTE_FIELD | 7838 #undef READ_BYTE_FIELD |
7838 #undef WRITE_BYTE_FIELD | 7839 #undef WRITE_BYTE_FIELD |
7839 #undef NOBARRIER_READ_BYTE_FIELD | 7840 #undef NOBARRIER_READ_BYTE_FIELD |
7840 #undef NOBARRIER_WRITE_BYTE_FIELD | 7841 #undef NOBARRIER_WRITE_BYTE_FIELD |
7841 | 7842 |
7842 } // namespace internal | 7843 } // namespace internal |
7843 } // namespace v8 | 7844 } // namespace v8 |
7844 | 7845 |
7845 #endif // V8_OBJECTS_INL_H_ | 7846 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |