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

Side by Side Diff: src/spaces.h

Issue 9241010: Fix corner-case in heap size estimation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. Created 8 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 | « src/mark-compact.cc ('k') | 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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 !p->IsFlagSet(Page::RESCAN_ON_EVACUATION) && 1579 !p->IsFlagSet(Page::RESCAN_ON_EVACUATION) &&
1580 !p->WasSweptPrecisely(); 1580 !p->WasSweptPrecisely();
1581 } 1581 }
1582 1582
1583 void SetPagesToSweep(Page* first) { 1583 void SetPagesToSweep(Page* first) {
1584 ASSERT(unswept_free_bytes_ == 0); 1584 ASSERT(unswept_free_bytes_ == 0);
1585 if (first == &anchor_) first = NULL; 1585 if (first == &anchor_) first = NULL;
1586 first_unswept_page_ = first; 1586 first_unswept_page_ = first;
1587 } 1587 }
1588 1588
1589 void MarkPageForLazySweeping(Page* p) { 1589 void IncreaseUnsweptFreeBytes(Page* p) {
1590 ASSERT(ShouldBeSweptLazily(p));
1590 unswept_free_bytes_ += (Page::kObjectAreaSize - p->LiveBytes()); 1591 unswept_free_bytes_ += (Page::kObjectAreaSize - p->LiveBytes());
1591 } 1592 }
1592 1593
1594 void DecreaseUnsweptFreeBytes(Page* p) {
1595 ASSERT(ShouldBeSweptLazily(p));
1596 unswept_free_bytes_ -= (Page::kObjectAreaSize - p->LiveBytes());
1597 }
1598
1593 bool AdvanceSweeper(intptr_t bytes_to_sweep); 1599 bool AdvanceSweeper(intptr_t bytes_to_sweep);
1594 1600
1595 bool IsSweepingComplete() { 1601 bool IsSweepingComplete() {
1596 return !first_unswept_page_->is_valid(); 1602 return !first_unswept_page_->is_valid();
1597 } 1603 }
1598 1604
1599 inline bool HasAPage() { return anchor_.next_page() != &anchor_; } 1605 inline bool HasAPage() { return anchor_.next_page() != &anchor_; }
1600 Page* FirstPage() { return anchor_.next_page(); } 1606 Page* FirstPage() { return anchor_.next_page(); }
1601 Page* LastPage() { return anchor_.prev_page(); } 1607 Page* LastPage() { return anchor_.prev_page(); }
1602 1608
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
2651 } 2657 }
2652 // Must be small, since an iteration is used for lookup. 2658 // Must be small, since an iteration is used for lookup.
2653 static const int kMaxComments = 64; 2659 static const int kMaxComments = 64;
2654 }; 2660 };
2655 #endif 2661 #endif
2656 2662
2657 2663
2658 } } // namespace v8::internal 2664 } } // namespace v8::internal
2659 2665
2660 #endif // V8_SPACES_H_ 2666 #endif // V8_SPACES_H_
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698