| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 static int CellsForLength(int length) { | 181 static int CellsForLength(int length) { |
| 182 return (length + kBitsPerCell - 1) >> kBitsPerCellLog2; | 182 return (length + kBitsPerCell - 1) >> kBitsPerCellLog2; |
| 183 } | 183 } |
| 184 | 184 |
| 185 int CellsCount() { | 185 int CellsCount() { |
| 186 return CellsForLength(kLength); | 186 return CellsForLength(kLength); |
| 187 } | 187 } |
| 188 | 188 |
| 189 static int SizeFor(int cells_count) { | 189 static int SizeFor(int cells_count) { |
| 190 return sizeof(MarkBit::CellType)*cells_count; | 190 return sizeof(MarkBit::CellType) * cells_count; |
| 191 } | 191 } |
| 192 | 192 |
| 193 INLINE(static uint32_t IndexToCell(uint32_t index)) { | 193 INLINE(static uint32_t IndexToCell(uint32_t index)) { |
| 194 return index >> kBitsPerCellLog2; | 194 return index >> kBitsPerCellLog2; |
| 195 } | 195 } |
| 196 | 196 |
| 197 INLINE(static uint32_t CellToIndex(uint32_t index)) { | 197 INLINE(static uint32_t CellToIndex(uint32_t index)) { |
| 198 return index << kBitsPerCellLog2; | 198 return index << kBitsPerCellLog2; |
| 199 } | 199 } |
| 200 | 200 |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 static_cast<double>(sizes[0] * 100) / Page::kObjectAreaSize, | 1578 static_cast<double>(sizes[0] * 100) / Page::kObjectAreaSize, |
| 1579 static_cast<int>(sizes[1]), | 1579 static_cast<int>(sizes[1]), |
| 1580 static_cast<double>(sizes[1] * 100) / Page::kObjectAreaSize, | 1580 static_cast<double>(sizes[1] * 100) / Page::kObjectAreaSize, |
| 1581 static_cast<int>(sizes[2]), | 1581 static_cast<int>(sizes[2]), |
| 1582 static_cast<double>(sizes[2] * 100) / Page::kObjectAreaSize, | 1582 static_cast<double>(sizes[2] * 100) / Page::kObjectAreaSize, |
| 1583 static_cast<int>(sizes[3]), | 1583 static_cast<int>(sizes[3]), |
| 1584 static_cast<double>(sizes[3] * 100) / Page::kObjectAreaSize, | 1584 static_cast<double>(sizes[3] * 100) / Page::kObjectAreaSize, |
| 1585 (ratio > ratio_threshold) ? "[fragmented]" : ""); | 1585 (ratio > ratio_threshold) ? "[fragmented]" : ""); |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 return (ratio > ratio_threshold) || FLAG_always_compact; | 1588 return (ratio > ratio_threshold) || |
| 1589 (FLAG_always_compact && sizes[3] != Page::kObjectAreaSize); |
| 1589 } | 1590 } |
| 1590 | 1591 |
| 1591 void EvictEvacuationCandidatesFromFreeLists(); | 1592 void EvictEvacuationCandidatesFromFreeLists(); |
| 1592 | 1593 |
| 1593 bool CanExpand(); | 1594 bool CanExpand(); |
| 1594 | 1595 |
| 1595 protected: | 1596 protected: |
| 1596 // Maximum capacity of this space. | 1597 // Maximum capacity of this space. |
| 1597 intptr_t max_capacity_; | 1598 intptr_t max_capacity_; |
| 1598 | 1599 |
| (...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2612 } | 2613 } |
| 2613 // Must be small, since an iteration is used for lookup. | 2614 // Must be small, since an iteration is used for lookup. |
| 2614 static const int kMaxComments = 64; | 2615 static const int kMaxComments = 64; |
| 2615 }; | 2616 }; |
| 2616 #endif | 2617 #endif |
| 2617 | 2618 |
| 2618 | 2619 |
| 2619 } } // namespace v8::internal | 2620 } } // namespace v8::internal |
| 2620 | 2621 |
| 2621 #endif // V8_SPACES_H_ | 2622 #endif // V8_SPACES_H_ |
| OLD | NEW |