OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 6023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6034 void* fake_object[1]; | 6034 void* fake_object[1]; |
6035 | 6035 |
6036 Handle<FixedArray> array = factory->NewFixedArray(2, TENURED); | 6036 Handle<FixedArray> array = factory->NewFixedArray(2, TENURED); |
6037 CHECK(heap->old_space()->Contains(*array)); | 6037 CHECK(heap->old_space()->Contains(*array)); |
6038 array->set(0, reinterpret_cast<Object*>(fake_object), SKIP_WRITE_BARRIER); | 6038 array->set(0, reinterpret_cast<Object*>(fake_object), SKIP_WRITE_BARRIER); |
6039 | 6039 |
6040 // Firstly, let's test the regular slots buffer entry. | 6040 // Firstly, let's test the regular slots buffer entry. |
6041 buffer->Add(HeapObject::RawField(*array, FixedArray::kHeaderSize)); | 6041 buffer->Add(HeapObject::RawField(*array, FixedArray::kHeaderSize)); |
6042 DCHECK(reinterpret_cast<void*>(buffer->Get(0)) == | 6042 DCHECK(reinterpret_cast<void*>(buffer->Get(0)) == |
6043 HeapObject::RawField(*array, FixedArray::kHeaderSize)); | 6043 HeapObject::RawField(*array, FixedArray::kHeaderSize)); |
6044 SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer, *array); | 6044 SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer, |
| 6045 array->address(), |
| 6046 array->address() + array->Size()); |
6045 DCHECK(reinterpret_cast<void*>(buffer->Get(0)) == | 6047 DCHECK(reinterpret_cast<void*>(buffer->Get(0)) == |
6046 HeapObject::RawField(heap->empty_fixed_array(), | 6048 HeapObject::RawField(heap->empty_fixed_array(), |
6047 FixedArrayBase::kLengthOffset)); | 6049 FixedArrayBase::kLengthOffset)); |
6048 | 6050 |
6049 // Secondly, let's test the typed slots buffer entry. | 6051 // Secondly, let's test the typed slots buffer entry. |
6050 SlotsBuffer::AddTo(NULL, &buffer, SlotsBuffer::EMBEDDED_OBJECT_SLOT, | 6052 SlotsBuffer::AddTo(NULL, &buffer, SlotsBuffer::EMBEDDED_OBJECT_SLOT, |
6051 array->address() + FixedArray::kHeaderSize, | 6053 array->address() + FixedArray::kHeaderSize, |
6052 SlotsBuffer::FAIL_ON_OVERFLOW); | 6054 SlotsBuffer::FAIL_ON_OVERFLOW); |
6053 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == | 6055 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == |
6054 reinterpret_cast<Object**>(SlotsBuffer::EMBEDDED_OBJECT_SLOT)); | 6056 reinterpret_cast<Object**>(SlotsBuffer::EMBEDDED_OBJECT_SLOT)); |
6055 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == | 6057 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == |
6056 HeapObject::RawField(*array, FixedArray::kHeaderSize)); | 6058 HeapObject::RawField(*array, FixedArray::kHeaderSize)); |
6057 SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer, *array); | 6059 SlotsBuffer::RemoveObjectSlots(CcTest::i_isolate()->heap(), buffer, |
| 6060 array->address(), |
| 6061 array->address() + array->Size()); |
6058 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == | 6062 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == |
6059 HeapObject::RawField(heap->empty_fixed_array(), | 6063 HeapObject::RawField(heap->empty_fixed_array(), |
6060 FixedArrayBase::kLengthOffset)); | 6064 FixedArrayBase::kLengthOffset)); |
6061 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == | 6065 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == |
6062 HeapObject::RawField(heap->empty_fixed_array(), | 6066 HeapObject::RawField(heap->empty_fixed_array(), |
6063 FixedArrayBase::kLengthOffset)); | 6067 FixedArrayBase::kLengthOffset)); |
6064 delete buffer; | 6068 delete buffer; |
6065 } | 6069 } |
OLD | NEW |