| OLD | NEW |
| 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 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 static void ReportCodeStatistics(); | 1427 static void ReportCodeStatistics(); |
| 1428 static void ResetCodeStatistics(); | 1428 static void ResetCodeStatistics(); |
| 1429 #endif | 1429 #endif |
| 1430 | 1430 |
| 1431 bool was_swept_conservatively() { return was_swept_conservatively_; } | 1431 bool was_swept_conservatively() { return was_swept_conservatively_; } |
| 1432 void set_was_swept_conservatively(bool b) { was_swept_conservatively_ = b; } | 1432 void set_was_swept_conservatively(bool b) { was_swept_conservatively_ = b; } |
| 1433 | 1433 |
| 1434 void SetPagesToSweep(Page* first, Page* last) { | 1434 void SetPagesToSweep(Page* first, Page* last) { |
| 1435 first_unswept_page_ = first; | 1435 first_unswept_page_ = first; |
| 1436 last_unswept_page_ = last; | 1436 last_unswept_page_ = last; |
| 1437 int unswept_pages = 0; |
| 1437 | 1438 |
| 1438 Page* p = first; | 1439 Page* p = first; |
| 1439 do { | 1440 do { |
| 1440 // The WAS_SWEPT_CONSERVATIVELY flag means that we can't iterate over the | 1441 // The WAS_SWEPT_CONSERVATIVELY flag means that we can't iterate over the |
| 1441 // page. We have to set this flag on the pages to indicate this. | 1442 // page. We have to set this flag on the pages to indicate this. |
| 1442 p->SetFlag(MemoryChunk::WAS_SWEPT_CONSERVATIVELY); | 1443 p->SetFlag(MemoryChunk::WAS_SWEPT_CONSERVATIVELY); |
| 1443 p = p->next_page(); | 1444 p = p->next_page(); |
| 1445 unswept_pages++; |
| 1444 } while (p != last); | 1446 } while (p != last); |
| 1447 |
| 1448 if (FLAG_trace_gc_verbose) { |
| 1449 PrintF("Postponing sweep for %d pages\n", unswept_pages); |
| 1450 } |
| 1445 } | 1451 } |
| 1446 | 1452 |
| 1447 bool AdvanceSweeper(intptr_t bytes_to_sweep); | 1453 bool AdvanceSweeper(intptr_t bytes_to_sweep); |
| 1448 | 1454 |
| 1449 bool IsSweepingComplete() { | 1455 bool IsSweepingComplete() { |
| 1450 return !first_unswept_page_->is_valid(); | 1456 return !first_unswept_page_->is_valid(); |
| 1451 } | 1457 } |
| 1452 | 1458 |
| 1453 Page* FirstPage() { return anchor_.next_page(); } | 1459 Page* FirstPage() { return anchor_.next_page(); } |
| 1454 Page* LastPage() { return anchor_.prev_page(); } | 1460 Page* LastPage() { return anchor_.prev_page(); } |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 } | 2526 } |
| 2521 // Must be small, since an iteration is used for lookup. | 2527 // Must be small, since an iteration is used for lookup. |
| 2522 static const int kMaxComments = 64; | 2528 static const int kMaxComments = 64; |
| 2523 }; | 2529 }; |
| 2524 #endif | 2530 #endif |
| 2525 | 2531 |
| 2526 | 2532 |
| 2527 } } // namespace v8::internal | 2533 } } // namespace v8::internal |
| 2528 | 2534 |
| 2529 #endif // V8_SPACES_H_ | 2535 #endif // V8_SPACES_H_ |
| OLD | NEW |