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

Side by Side Diff: src/spaces.h

Issue 549049: Change return type of MapSpace::NeedsCompaction from int to bool.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 11 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 | « no previous file | 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 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 ASSERT(CountTotalPages() <= kMaxMapPageIndex); 1771 ASSERT(CountTotalPages() <= kMaxMapPageIndex);
1772 return true; 1772 return true;
1773 } 1773 }
1774 int n_of_pages = Capacity() / Page::kObjectAreaSize; 1774 int n_of_pages = Capacity() / Page::kObjectAreaSize;
1775 ASSERT(n_of_pages == CountTotalPages()); 1775 ASSERT(n_of_pages == CountTotalPages());
1776 return n_of_pages <= kMaxMapPageIndex; 1776 return n_of_pages <= kMaxMapPageIndex;
1777 } 1777 }
1778 1778
1779 // Should be called after forced sweep to find out if map space needs 1779 // Should be called after forced sweep to find out if map space needs
1780 // compaction. 1780 // compaction.
1781 int NeedsCompaction(int live_maps) { 1781 bool NeedsCompaction(int live_maps) {
1782 return !MapPointersEncodable() && live_maps <= kCompactionThreshold; 1782 return !MapPointersEncodable() && live_maps <= kCompactionThreshold;
1783 } 1783 }
1784 1784
1785 Address TopAfterCompaction(int live_maps) { 1785 Address TopAfterCompaction(int live_maps) {
1786 ASSERT(NeedsCompaction(live_maps)); 1786 ASSERT(NeedsCompaction(live_maps));
1787 1787
1788 int pages_left = live_maps / kMapsPerPage; 1788 int pages_left = live_maps / kMapsPerPage;
1789 PageIterator it(this, PageIterator::ALL_PAGES); 1789 PageIterator it(this, PageIterator::ALL_PAGES);
1790 while (pages_left-- > 0) { 1790 while (pages_left-- > 0) {
1791 ASSERT(it.has_next()); 1791 ASSERT(it.has_next());
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2045 2045
2046 private: 2046 private:
2047 LargeObjectChunk* current_; 2047 LargeObjectChunk* current_;
2048 HeapObjectCallback size_func_; 2048 HeapObjectCallback size_func_;
2049 }; 2049 };
2050 2050
2051 2051
2052 } } // namespace v8::internal 2052 } } // namespace v8::internal
2053 2053
2054 #endif // V8_SPACES_H_ 2054 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698