| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 512 |
| 513 // No large objects required to perform the above steps. | 513 // No large objects required to perform the above steps. |
| 514 CHECK(isolate->heap()->lo_space()->IsEmpty()); | 514 CHECK(isolate->heap()->lo_space()->IsEmpty()); |
| 515 } | 515 } |
| 516 | 516 |
| 517 static HeapObject* AllocateUnaligned(NewSpace* space, int size) { | 517 static HeapObject* AllocateUnaligned(NewSpace* space, int size) { |
| 518 AllocationResult allocation = space->AllocateRawUnaligned(size); | 518 AllocationResult allocation = space->AllocateRawUnaligned(size); |
| 519 CHECK(!allocation.IsRetry()); | 519 CHECK(!allocation.IsRetry()); |
| 520 HeapObject* filler = NULL; | 520 HeapObject* filler = NULL; |
| 521 CHECK(allocation.To(&filler)); | 521 CHECK(allocation.To(&filler)); |
| 522 space->heap()->CreateFillerObjectAt(filler->address(), size); | 522 space->heap()->CreateFillerObjectAt(filler->address(), size, |
| 523 ClearRecordedSlots::kNo); |
| 523 return filler; | 524 return filler; |
| 524 } | 525 } |
| 525 | 526 |
| 526 static HeapObject* AllocateUnaligned(PagedSpace* space, int size) { | 527 static HeapObject* AllocateUnaligned(PagedSpace* space, int size) { |
| 527 AllocationResult allocation = space->AllocateRaw(size, kDoubleUnaligned); | 528 AllocationResult allocation = space->AllocateRaw(size, kDoubleUnaligned); |
| 528 CHECK(!allocation.IsRetry()); | 529 CHECK(!allocation.IsRetry()); |
| 529 HeapObject* filler = NULL; | 530 HeapObject* filler = NULL; |
| 530 CHECK(allocation.To(&filler)); | 531 CHECK(allocation.To(&filler)); |
| 531 space->heap()->CreateFillerObjectAt(filler->address(), size); | 532 space->heap()->CreateFillerObjectAt(filler->address(), size, |
| 533 ClearRecordedSlots::kNo); |
| 532 return filler; | 534 return filler; |
| 533 } | 535 } |
| 534 | 536 |
| 535 static HeapObject* AllocateUnaligned(LargeObjectSpace* space, int size) { | 537 static HeapObject* AllocateUnaligned(LargeObjectSpace* space, int size) { |
| 536 AllocationResult allocation = space->AllocateRaw(size, EXECUTABLE); | 538 AllocationResult allocation = space->AllocateRaw(size, EXECUTABLE); |
| 537 CHECK(!allocation.IsRetry()); | 539 CHECK(!allocation.IsRetry()); |
| 538 HeapObject* filler = NULL; | 540 HeapObject* filler = NULL; |
| 539 CHECK(allocation.To(&filler)); | 541 CHECK(allocation.To(&filler)); |
| 540 return filler; | 542 return filler; |
| 541 } | 543 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 new_space->RemoveAllocationObserver(&observer2); | 673 new_space->RemoveAllocationObserver(&observer2); |
| 672 | 674 |
| 673 CHECK_EQ(observer1.count(), 32); | 675 CHECK_EQ(observer1.count(), 32); |
| 674 CHECK_EQ(observer2.count(), 28); | 676 CHECK_EQ(observer2.count(), 28); |
| 675 } | 677 } |
| 676 isolate->Dispose(); | 678 isolate->Dispose(); |
| 677 } | 679 } |
| 678 | 680 |
| 679 } // namespace internal | 681 } // namespace internal |
| 680 } // namespace v8 | 682 } // namespace v8 |
| OLD | NEW |