| 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 5369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5380 int padding_size = desired_offset - Page::kObjectStartOffset; | 5380 int padding_size = desired_offset - Page::kObjectStartOffset; |
| 5381 int padding_array_length = | 5381 int padding_array_length = |
| 5382 (padding_size - FixedArray::kHeaderSize) / kPointerSize; | 5382 (padding_size - FixedArray::kHeaderSize) / kPointerSize; |
| 5383 | 5383 |
| 5384 Handle<FixedArray> temp2 = | 5384 Handle<FixedArray> temp2 = |
| 5385 factory->NewFixedArray(padding_array_length, TENURED); | 5385 factory->NewFixedArray(padding_array_length, TENURED); |
| 5386 Page* page = Page::FromAddress(temp2->address()); | 5386 Page* page = Page::FromAddress(temp2->address()); |
| 5387 CHECK_EQ(Page::kObjectStartOffset, page->Offset(temp2->address())); | 5387 CHECK_EQ(Page::kObjectStartOffset, page->Offset(temp2->address())); |
| 5388 } | 5388 } |
| 5389 | 5389 |
| 5390 Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED, false); | 5390 Handle<JSObject> o = factory->NewJSObjectFromMap(map1, TENURED); |
| 5391 o->set_properties(*factory->empty_fixed_array()); | 5391 o->set_properties(*factory->empty_fixed_array()); |
| 5392 | 5392 |
| 5393 // Ensure that the object allocated where we need it. | 5393 // Ensure that the object allocated where we need it. |
| 5394 Page* page = Page::FromAddress(o->address()); | 5394 Page* page = Page::FromAddress(o->address()); |
| 5395 CHECK_EQ(desired_offset, page->Offset(o->address())); | 5395 CHECK_EQ(desired_offset, page->Offset(o->address())); |
| 5396 | 5396 |
| 5397 // Now we have an object right at the end of the page. | 5397 // Now we have an object right at the end of the page. |
| 5398 | 5398 |
| 5399 // Enable incremental marking to trigger actions in Heap::AdjustLiveBytes() | 5399 // Enable incremental marking to trigger actions in Heap::AdjustLiveBytes() |
| 5400 // that would cause crash. | 5400 // that would cause crash. |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6048 array->address(), | 6048 array->address(), |
| 6049 array->address() + array->Size()); | 6049 array->address() + array->Size()); |
| 6050 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == | 6050 DCHECK(reinterpret_cast<void*>(buffer->Get(1)) == |
| 6051 HeapObject::RawField(heap->empty_fixed_array(), | 6051 HeapObject::RawField(heap->empty_fixed_array(), |
| 6052 FixedArrayBase::kLengthOffset)); | 6052 FixedArrayBase::kLengthOffset)); |
| 6053 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == | 6053 DCHECK(reinterpret_cast<void*>(buffer->Get(2)) == |
| 6054 HeapObject::RawField(heap->empty_fixed_array(), | 6054 HeapObject::RawField(heap->empty_fixed_array(), |
| 6055 FixedArrayBase::kLengthOffset)); | 6055 FixedArrayBase::kLengthOffset)); |
| 6056 delete buffer; | 6056 delete buffer; |
| 6057 } | 6057 } |
| OLD | NEW |