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

Side by Side Diff: src/serialize.cc

Issue 2950003: Virtually dispatched scavengers (Closed)
Patch Set: Created 10 years, 5 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
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 Object** write_back) { 666 Object** write_back) {
667 int size = source_->GetInt() << kObjectAlignmentBits; 667 int size = source_->GetInt() << kObjectAlignmentBits;
668 Address address = Allocate(space_number, space, size); 668 Address address = Allocate(space_number, space, size);
669 *write_back = HeapObject::FromAddress(address); 669 *write_back = HeapObject::FromAddress(address);
670 Object** current = reinterpret_cast<Object**>(address); 670 Object** current = reinterpret_cast<Object**>(address);
671 Object** limit = current + (size >> kPointerSizeLog2); 671 Object** limit = current + (size >> kPointerSizeLog2);
672 if (FLAG_log_snapshot_positions) { 672 if (FLAG_log_snapshot_positions) {
673 LOG(SnapshotPositionEvent(address, source_->position())); 673 LOG(SnapshotPositionEvent(address, source_->position()));
674 } 674 }
675 ReadChunk(current, limit, space_number, address); 675 ReadChunk(current, limit, space_number, address);
676
677 if (space == Heap::map_space()) {
678 ASSERT(size == Map::kSize);
679 HeapObject* obj = HeapObject::FromAddress(address);
680 Map* map = reinterpret_cast<Map*>(obj);
681 map->set_scavenger(Heap::GetScavenger(map->instance_type(),
682 map->instance_size()));
683 }
676 } 684 }
677 685
678 686
679 // This macro is always used with a constant argument so it should all fold 687 // This macro is always used with a constant argument so it should all fold
680 // away to almost nothing in the generated code. It might be nicer to do this 688 // away to almost nothing in the generated code. It might be nicer to do this
681 // with the ternary operator but there are type issues with that. 689 // with the ternary operator but there are type issues with that.
682 #define ASSIGN_DEST_SPACE(space_number) \ 690 #define ASSIGN_DEST_SPACE(space_number) \
683 Space* dest_space; \ 691 Space* dest_space; \
684 if (space_number == NEW_SPACE) { \ 692 if (space_number == NEW_SPACE) { \
685 dest_space = Heap::new_space(); \ 693 dest_space = Heap::new_space(); \
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize); 1450 fullness_[space] = RoundUp(fullness_[space], Page::kPageSize);
1443 } 1451 }
1444 } 1452 }
1445 int allocation_address = fullness_[space]; 1453 int allocation_address = fullness_[space];
1446 fullness_[space] = allocation_address + size; 1454 fullness_[space] = allocation_address + size;
1447 return allocation_address; 1455 return allocation_address;
1448 } 1456 }
1449 1457
1450 1458
1451 } } // namespace v8::internal 1459 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698