| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } else { | 600 } else { |
| 601 maybe_new_allocation = | 601 maybe_new_allocation = |
| 602 reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size); | 602 reinterpret_cast<PagedSpace*>(space)->AllocateRaw(size); |
| 603 } | 603 } |
| 604 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked(); | 604 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked(); |
| 605 HeapObject* new_object = HeapObject::cast(new_allocation); | 605 HeapObject* new_object = HeapObject::cast(new_allocation); |
| 606 address = new_object->address(); | 606 address = new_object->address(); |
| 607 high_water_[space_index] = address + size; | 607 high_water_[space_index] = address + size; |
| 608 } else { | 608 } else { |
| 609 ASSERT(SpaceIsLarge(space_index)); | 609 ASSERT(SpaceIsLarge(space_index)); |
| 610 ASSERT(size > Page::kPageSize - Page::kObjectStartOffset); | |
| 611 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space); | 610 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space); |
| 612 Object* new_allocation; | 611 Object* new_allocation; |
| 613 if (space_index == kLargeData) { | 612 if (space_index == kLargeData) { |
| 614 new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked(); | 613 new_allocation = lo_space->AllocateRaw(size)->ToObjectUnchecked(); |
| 615 } else if (space_index == kLargeFixedArray) { | 614 } else if (space_index == kLargeFixedArray) { |
| 616 new_allocation = | 615 new_allocation = |
| 617 lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked(); | 616 lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked(); |
| 618 } else { | 617 } else { |
| 619 ASSERT_EQ(kLargeCode, space_index); | 618 ASSERT_EQ(kLargeCode, space_index); |
| 620 new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked(); | 619 new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked(); |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1550 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); | 1549 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); |
| 1551 } | 1550 } |
| 1552 } | 1551 } |
| 1553 int allocation_address = fullness_[space]; | 1552 int allocation_address = fullness_[space]; |
| 1554 fullness_[space] = allocation_address + size; | 1553 fullness_[space] = allocation_address + size; |
| 1555 return allocation_address; | 1554 return allocation_address; |
| 1556 } | 1555 } |
| 1557 | 1556 |
| 1558 | 1557 |
| 1559 } } // namespace v8::internal | 1558 } } // namespace v8::internal |
| OLD | NEW |