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

Side by Side Diff: src/spaces.h

Issue 138903009: Enable concurrent sweeping. Added some extra debugging checks for concurrent sweeping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 intptr_t Concatenate(FreeListCategory* category); 1514 intptr_t Concatenate(FreeListCategory* category);
1515 1515
1516 void Reset(); 1516 void Reset();
1517 1517
1518 void Free(FreeListNode* node, int size_in_bytes); 1518 void Free(FreeListNode* node, int size_in_bytes);
1519 1519
1520 FreeListNode* PickNodeFromList(int *node_size); 1520 FreeListNode* PickNodeFromList(int *node_size);
1521 FreeListNode* PickNodeFromList(int size_in_bytes, int *node_size); 1521 FreeListNode* PickNodeFromList(int size_in_bytes, int *node_size);
1522 1522
1523 intptr_t EvictFreeListItemsInList(Page* p); 1523 intptr_t EvictFreeListItemsInList(Page* p);
1524 bool ContainsPageFreeListItemsInList(Page* p);
1524 1525
1525 void RepairFreeList(Heap* heap); 1526 void RepairFreeList(Heap* heap);
1526 1527
1527 FreeListNode** GetTopAddress() { return &top_; } 1528 FreeListNode** GetTopAddress() { return &top_; }
1528 FreeListNode* top() const { return top_; } 1529 FreeListNode* top() const { return top_; }
1529 void set_top(FreeListNode* top) { top_ = top; } 1530 void set_top(FreeListNode* top) { top_ = top; }
1530 1531
1531 FreeListNode** GetEndAddress() { return &end_; } 1532 FreeListNode** GetEndAddress() { return &end_; }
1532 FreeListNode* end() const { return end_; } 1533 FreeListNode* end() const { return end_; }
1533 void set_end(FreeListNode* end) { end_ = end; } 1534 void set_end(FreeListNode* end) { end_ = end; }
1534 1535
1535 int* GetAvailableAddress() { return &available_; } 1536 int* GetAvailableAddress() { return &available_; }
1536 int available() const { return available_; } 1537 int available() const { return available_; }
1537 void set_available(int available) { available_ = available; } 1538 void set_available(int available) { available_ = available; }
1538 1539
1539 Mutex* mutex() { return &mutex_; } 1540 Mutex* mutex() { return &mutex_; }
1540 1541
1542 bool IsEmpty() {
1543 return top_ == NULL;
1544 }
1545
1541 #ifdef DEBUG 1546 #ifdef DEBUG
1542 intptr_t SumFreeList(); 1547 intptr_t SumFreeList();
1543 int FreeListLength(); 1548 int FreeListLength();
1544 #endif 1549 #endif
1545 1550
1546 private: 1551 private:
1547 FreeListNode* top_; 1552 FreeListNode* top_;
1548 FreeListNode* end_; 1553 FreeListNode* end_;
1549 Mutex mutex_; 1554 Mutex mutex_;
1550 1555
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 // i.e., its contents will be destroyed. The start address should be word 1603 // i.e., its contents will be destroyed. The start address should be word
1599 // aligned, and the size should be a non-zero multiple of the word size. 1604 // aligned, and the size should be a non-zero multiple of the word size.
1600 int Free(Address start, int size_in_bytes); 1605 int Free(Address start, int size_in_bytes);
1601 1606
1602 // Allocate a block of size 'size_in_bytes' from the free list. The block 1607 // Allocate a block of size 'size_in_bytes' from the free list. The block
1603 // is unitialized. A failure is returned if no block is available. The 1608 // is unitialized. A failure is returned if no block is available. The
1604 // number of bytes lost to fragmentation is returned in the output parameter 1609 // number of bytes lost to fragmentation is returned in the output parameter
1605 // 'wasted_bytes'. The size should be a non-zero multiple of the word size. 1610 // 'wasted_bytes'. The size should be a non-zero multiple of the word size.
1606 MUST_USE_RESULT HeapObject* Allocate(int size_in_bytes); 1611 MUST_USE_RESULT HeapObject* Allocate(int size_in_bytes);
1607 1612
1613 bool IsEmpty() {
1614 return small_list_.IsEmpty() && medium_list_.IsEmpty() &&
1615 large_list_.IsEmpty() && huge_list_.IsEmpty();
1616 }
1617
1608 #ifdef DEBUG 1618 #ifdef DEBUG
1609 void Zap(); 1619 void Zap();
1610 intptr_t SumFreeLists(); 1620 intptr_t SumFreeLists();
1611 bool IsVeryLong(); 1621 bool IsVeryLong();
1612 #endif 1622 #endif
1613 1623
1614 // Used after booting the VM. 1624 // Used after booting the VM.
1615 void RepairLists(Heap* heap); 1625 void RepairLists(Heap* heap);
1616 1626
1617 intptr_t EvictFreeListItems(Page* p); 1627 intptr_t EvictFreeListItems(Page* p);
1628 bool ContainsPageFreeListItems(Page* p);
1618 1629
1619 FreeListCategory* small_list() { return &small_list_; } 1630 FreeListCategory* small_list() { return &small_list_; }
1620 FreeListCategory* medium_list() { return &medium_list_; } 1631 FreeListCategory* medium_list() { return &medium_list_; }
1621 FreeListCategory* large_list() { return &large_list_; } 1632 FreeListCategory* large_list() { return &large_list_; }
1622 FreeListCategory* huge_list() { return &huge_list_; } 1633 FreeListCategory* huge_list() { return &huge_list_; }
1623 1634
1624 private: 1635 private:
1625 // The size range of blocks, in bytes. 1636 // The size range of blocks, in bytes.
1626 static const int kMinBlockSize = 3 * kPointerSize; 1637 static const int kMinBlockSize = 3 * kPointerSize;
1627 static const int kMaxBlockSize = Page::kMaxNonCodeHeapObjectSize; 1638 static const int kMaxBlockSize = Page::kMaxNonCodeHeapObjectSize;
(...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2923 } 2934 }
2924 // Must be small, since an iteration is used for lookup. 2935 // Must be small, since an iteration is used for lookup.
2925 static const int kMaxComments = 64; 2936 static const int kMaxComments = 64;
2926 }; 2937 };
2927 #endif 2938 #endif
2928 2939
2929 2940
2930 } } // namespace v8::internal 2941 } } // namespace v8::internal
2931 2942
2932 #endif // V8_SPACES_H_ 2943 #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