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

Side by Side Diff: src/mark-compact.h

Issue 148153010: Synchronize with r15701. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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
« no previous file with comments | « src/log-utils.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 // After: Live objects are unmarked, non-live regions have been added to 912 // After: Live objects are unmarked, non-live regions have been added to
913 // their space's free list. Active eden semispace is compacted by 913 // their space's free list. Active eden semispace is compacted by
914 // evacuation. 914 // evacuation.
915 // 915 //
916 916
917 // If we are not compacting the heap, we simply sweep the spaces except 917 // If we are not compacting the heap, we simply sweep the spaces except
918 // for the large object space, clearing mark bits and adding unmarked 918 // for the large object space, clearing mark bits and adding unmarked
919 // regions to each space's free list. 919 // regions to each space's free list.
920 void SweepSpaces(); 920 void SweepSpaces();
921 921
922 int DiscoverAndPromoteBlackObjectsOnPage(NewSpace* new_space,
923 NewSpacePage* p);
924
922 void EvacuateNewSpace(); 925 void EvacuateNewSpace();
923 926
924 void EvacuateLiveObjectsFromPage(Page* p); 927 void EvacuateLiveObjectsFromPage(Page* p);
925 928
926 void EvacuatePages(); 929 void EvacuatePages();
927 930
928 void EvacuateNewSpaceAndCandidates(); 931 void EvacuateNewSpaceAndCandidates();
929 932
930 void SweepSpace(PagedSpace* space, SweeperType sweeper); 933 void SweepSpace(PagedSpace* space, SweeperType sweeper);
931 934
(...skipping 10 matching lines...) Expand all
942 CodeFlusher* code_flusher_; 945 CodeFlusher* code_flusher_;
943 Object* encountered_weak_maps_; 946 Object* encountered_weak_maps_;
944 947
945 List<Page*> evacuation_candidates_; 948 List<Page*> evacuation_candidates_;
946 List<Code*> invalidated_code_; 949 List<Code*> invalidated_code_;
947 950
948 friend class Heap; 951 friend class Heap;
949 }; 952 };
950 953
951 954
955 class MarkBitCellIterator BASE_EMBEDDED {
956 public:
957 explicit MarkBitCellIterator(MemoryChunk* chunk)
958 : chunk_(chunk) {
959 last_cell_index_ = Bitmap::IndexToCell(
960 Bitmap::CellAlignIndex(
961 chunk->AddressToMarkbitIndex(chunk->area_end())));
962 cell_base_ = chunk->area_start();
963 cell_index_ = Bitmap::IndexToCell(
964 Bitmap::CellAlignIndex(
965 chunk->AddressToMarkbitIndex(cell_base_)));
966 cells_ = chunk->markbits()->cells();
967 }
968
969 inline bool Done() { return cell_index_ == last_cell_index_; }
970
971 inline bool HasNext() { return cell_index_ < last_cell_index_ - 1; }
972
973 inline MarkBit::CellType* CurrentCell() {
974 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex(
975 chunk_->AddressToMarkbitIndex(cell_base_))));
976 return &cells_[cell_index_];
977 }
978
979 inline Address CurrentCellBase() {
980 ASSERT(cell_index_ == Bitmap::IndexToCell(Bitmap::CellAlignIndex(
981 chunk_->AddressToMarkbitIndex(cell_base_))));
982 return cell_base_;
983 }
984
985 inline void Advance() {
986 cell_index_++;
987 cell_base_ += 32 * kPointerSize;
988 }
989
990 private:
991 MemoryChunk* chunk_;
992 MarkBit::CellType* cells_;
993 unsigned int last_cell_index_;
994 unsigned int cell_index_;
995 Address cell_base_;
996 };
997
998
952 class SequentialSweepingScope BASE_EMBEDDED { 999 class SequentialSweepingScope BASE_EMBEDDED {
953 public: 1000 public:
954 explicit SequentialSweepingScope(MarkCompactCollector *collector) : 1001 explicit SequentialSweepingScope(MarkCompactCollector *collector) :
955 collector_(collector) { 1002 collector_(collector) {
956 collector_->set_sequential_sweeping(true); 1003 collector_->set_sequential_sweeping(true);
957 } 1004 }
958 1005
959 ~SequentialSweepingScope() { 1006 ~SequentialSweepingScope() {
960 collector_->set_sequential_sweeping(false); 1007 collector_->set_sequential_sweeping(false);
961 } 1008 }
962 1009
963 private: 1010 private:
964 MarkCompactCollector* collector_; 1011 MarkCompactCollector* collector_;
965 }; 1012 };
966 1013
967 1014
968 const char* AllocationSpaceName(AllocationSpace space); 1015 const char* AllocationSpaceName(AllocationSpace space);
969 1016
970 } } // namespace v8::internal 1017 } } // namespace v8::internal
971 1018
972 #endif // V8_MARK_COMPACT_H_ 1019 #endif // V8_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/log-utils.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698