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