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

Side by Side Diff: src/spaces.h

Issue 7983001: Fix new space shrinking to compute correct capacity. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. Created 9 years, 3 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 | src/spaces.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 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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1786 // Sets up the semispace using the given chunk. 1786 // Sets up the semispace using the given chunk.
1787 bool Setup(Address start, int initial_capacity, int maximum_capacity); 1787 bool Setup(Address start, int initial_capacity, int maximum_capacity);
1788 1788
1789 // Tear down the space. Heap memory was not allocated by the space, so it 1789 // Tear down the space. Heap memory was not allocated by the space, so it
1790 // is not deallocated here. 1790 // is not deallocated here.
1791 void TearDown(); 1791 void TearDown();
1792 1792
1793 // True if the space has been set up but not torn down. 1793 // True if the space has been set up but not torn down.
1794 bool HasBeenSetup() { return start_ != NULL; } 1794 bool HasBeenSetup() { return start_ != NULL; }
1795 1795
1796 // Grow the size of the semispace by committing extra virtual memory.
1797 // Assumes that the caller has checked that the semispace has not reached
1798 // its maximum capacity (and thus there is space available in the reserved
1799 // address range to grow).
1800 bool Grow();
1801
1802 // Grow the semispace to the new capacity. The new capacity 1796 // Grow the semispace to the new capacity. The new capacity
1803 // requested must be larger than the current capacity. 1797 // requested must be larger than the current capacity and less than
1798 // the maximum capacity.
1804 bool GrowTo(int new_capacity); 1799 bool GrowTo(int new_capacity);
1805 1800
1806 // Shrinks the semispace to the new capacity. The new capacity 1801 // Shrinks the semispace to the new capacity. The new capacity
1807 // requested must be more than the amount of used memory in the 1802 // requested must be more than the amount of used memory in the
1808 // semispace and less than the current capacity. 1803 // semispace and less than the current capacity.
1809 bool ShrinkTo(int new_capacity); 1804 bool ShrinkTo(int new_capacity);
1810 1805
1811 // Returns the start address of the first page of the space. 1806 // Returns the start address of the first page of the space.
1812 Address space_start() { 1807 Address space_start() {
1813 ASSERT(anchor_.next_page() != &anchor_); 1808 ASSERT(anchor_.next_page() != &anchor_);
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 } 2612 }
2618 // Must be small, since an iteration is used for lookup. 2613 // Must be small, since an iteration is used for lookup.
2619 static const int kMaxComments = 64; 2614 static const int kMaxComments = 64;
2620 }; 2615 };
2621 #endif 2616 #endif
2622 2617
2623 2618
2624 } } // namespace v8::internal 2619 } } // namespace v8::internal
2625 2620
2626 #endif // V8_SPACES_H_ 2621 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698