OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 } else { | 594 } else { |
595 maybe_new_allocation = | 595 maybe_new_allocation = |
596 reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size); | 596 reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size); |
597 } | 597 } |
598 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked(); | 598 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked(); |
599 HeapObject* new_object = HeapObject::cast(new_allocation); | 599 HeapObject* new_object = HeapObject::cast(new_allocation); |
600 address = new_object->address(); | 600 address = new_object->address(); |
601 high_water_[space_index] = address + size; | 601 high_water_[space_index] = address + size; |
602 } else { | 602 } else { |
603 ASSERT(SpaceIsLarge(space_index)); | 603 ASSERT(SpaceIsLarge(space_index)); |
604 ASSERT(size > Page::kPageSize - Page::kObjectStartOffset); | |
605 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space); | 604 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space); |
606 Object* new_allocation; | 605 Object* new_allocation; |
607 if (space_index == kLargeData) { | 606 if (space_index == kLargeData) { |
608 new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked(); | 607 new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked(); |
609 } else if (space_index == kLargeFixedArray) { | 608 } else if (space_index == kLargeFixedArray) { |
610 new_allocation = | 609 new_allocation = |
611 lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked(); | 610 lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked(); |
612 } else { | 611 } else { |
613 ASSERT_EQ(kLargeCode, space_index); | 612 ASSERT_EQ(kLargeCode, space_index); |
614 new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked(); | 613 new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked(); |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1526 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1525 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
1527 } | 1526 } |
1528 } | 1527 } |
1529 int allocation_address = fullness_[space]; | 1528 int allocation_address = fullness_[space]; |
1530 fullness_[space] = allocation_address + size; | 1529 fullness_[space] = allocation_address + size; |
1531 return allocation_address; | 1530 return allocation_address; |
1532 } | 1531 } |
1533 | 1532 |
1534 | 1533 |
1535 } } // namespace v8::internal | 1534 } } // namespace v8::internal |
OLD | NEW |