Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Side by Side Diff: src/serialize.cc

Issue 7639020: Perform TODO(gc) cleanup for TODO-lockdown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 632 }
633 ASSERT(!maybe_new_allocation->IsFailure()); 633 ASSERT(!maybe_new_allocation->IsFailure());
634 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked(); 634 Object* new_allocation = maybe_new_allocation->ToObjectUnchecked();
635 HeapObject* new_object = HeapObject::cast(new_allocation); 635 HeapObject* new_object = HeapObject::cast(new_allocation);
636 address = new_object->address(); 636 address = new_object->address();
637 high_water_[space_index] = address + size; 637 high_water_[space_index] = address + size;
638 } else { 638 } else {
639 ASSERT(SpaceIsLarge(space_index)); 639 ASSERT(SpaceIsLarge(space_index));
640 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space); 640 LargeObjectSpace* lo_space = reinterpret_cast<LargeObjectSpace*>(space);
641 Object* new_allocation; 641 Object* new_allocation;
642 if (space_index == kLargeData) { 642 if (space_index == kLargeData || space_index == kLargeFixedArray) {
643 new_allocation = lo_space->AllocateRawData(size)->ToObjectUnchecked();
644 } else if (space_index == kLargeFixedArray) {
645 new_allocation = 643 new_allocation =
646 lo_space->AllocateRawFixedArray(size)->ToObjectUnchecked(); 644 lo_space->AllocateRaw(size, NOT_EXECUTABLE)->ToObjectUnchecked();
647 } else { 645 } else {
648 ASSERT_EQ(kLargeCode, space_index); 646 ASSERT_EQ(kLargeCode, space_index);
649 new_allocation = lo_space->AllocateRawCode(size)->ToObjectUnchecked(); 647 new_allocation =
648 lo_space->AllocateRaw(size, EXECUTABLE)->ToObjectUnchecked();
650 } 649 }
651 HeapObject* new_object = HeapObject::cast(new_allocation); 650 HeapObject* new_object = HeapObject::cast(new_allocation);
652 // Record all large objects in the same space. 651 // Record all large objects in the same space.
653 address = new_object->address(); 652 address = new_object->address();
654 pages_[LO_SPACE].Add(address); 653 pages_[LO_SPACE].Add(address);
655 } 654 }
656 last_object_address_ = address; 655 last_object_address_ = address;
657 return address; 656 return address;
658 } 657 }
659 658
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1601 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1603 } 1602 }
1604 } 1603 }
1605 int allocation_address = fullness_[space]; 1604 int allocation_address = fullness_[space];
1606 fullness_[space] = allocation_address + size; 1605 fullness_[space] = allocation_address + size;
1607 return allocation_address; 1606 return allocation_address;
1608 } 1607 }
1609 1608
1610 1609
1611 } } // namespace v8::internal 1610 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698