| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 if (Heap::InNewSpace(addr)) { | 68 if (Heap::InNewSpace(addr)) { |
| 69 uint32_t index = Heap::new_space()->AddressToMarkbitIndex(addr); | 69 uint32_t index = Heap::new_space()->AddressToMarkbitIndex(addr); |
| 70 return new_space_bitmap_->MarkBitFromIndex(index); | 70 return new_space_bitmap_->MarkBitFromIndex(index); |
| 71 } else { | 71 } else { |
| 72 Page *p = Page::FromAddress(addr); | 72 Page *p = Page::FromAddress(addr); |
| 73 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr), | 73 return p->markbits()->MarkBitFromIndex(p->AddressToMarkbitIndex(addr), |
| 74 p->ContainsOnlyData()); | 74 p->ContainsOnlyData()); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 // For embedding in generated code. |
| 79 static inline Address new_space_bitmap() { |
| 80 return reinterpret_cast<Address>(new_space_bitmap_); |
| 81 } |
| 82 |
| 78 static void ClearRange(Address addr, int size) { | 83 static void ClearRange(Address addr, int size) { |
| 79 if (Heap::InNewSpace(addr)) { | 84 if (Heap::InNewSpace(addr)) { |
| 80 uint32_t index = Heap::new_space()->AddressToMarkbitIndex(addr); | 85 uint32_t index = Heap::new_space()->AddressToMarkbitIndex(addr); |
| 81 new_space_bitmap_->ClearRange(index, size >> kPointerSizeLog2); | 86 new_space_bitmap_->ClearRange(index, size >> kPointerSizeLog2); |
| 82 } else { | 87 } else { |
| 83 Page *p = Page::FromAddress(addr); | 88 Page *p = Page::FromAddress(addr); |
| 84 p->markbits()->ClearRange(p->FastAddressToMarkbitIndex(addr), | 89 p->markbits()->ClearRange(p->FastAddressToMarkbitIndex(addr), |
| 85 size >> kPointerSizeLog2); | 90 size >> kPointerSizeLog2); |
| 86 } | 91 } |
| 87 } | 92 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 453 |
| 449 friend class UnmarkObjectVisitor; | 454 friend class UnmarkObjectVisitor; |
| 450 static void UnmarkObject(HeapObject* obj); | 455 static void UnmarkObject(HeapObject* obj); |
| 451 #endif | 456 #endif |
| 452 }; | 457 }; |
| 453 | 458 |
| 454 | 459 |
| 455 } } // namespace v8::internal | 460 } } // namespace v8::internal |
| 456 | 461 |
| 457 #endif // V8_MARK_COMPACT_H_ | 462 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |