| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 | 100 |
| 101 void VisitCell(RelocInfo* rinfo) { | 101 void VisitCell(RelocInfo* rinfo) { |
| 102 Code* code = rinfo->host(); | 102 Code* code = rinfo->host(); |
| 103 ASSERT(rinfo->rmode() == RelocInfo::CELL); | 103 ASSERT(rinfo->rmode() == RelocInfo::CELL); |
| 104 if (!code->IsWeakObject(rinfo->target_cell())) { | 104 if (!code->IsWeakObject(rinfo->target_cell())) { |
| 105 ObjectVisitor::VisitCell(rinfo); | 105 ObjectVisitor::VisitCell(rinfo); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 WeakPointerMode weak_pointer_mode() { |
| 110 return SKIP_WEAK_POINTERS; |
| 111 } |
| 112 |
| 109 private: | 113 private: |
| 110 Heap* heap_; | 114 Heap* heap_; |
| 111 }; | 115 }; |
| 112 | 116 |
| 113 | 117 |
| 114 static void VerifyMarking(Heap* heap, Address bottom, Address top) { | 118 static void VerifyMarking(Heap* heap, Address bottom, Address top) { |
| 115 VerifyMarkingVisitor visitor(heap); | 119 VerifyMarkingVisitor visitor(heap); |
| 116 HeapObject* object; | 120 HeapObject* object; |
| 117 Address next_object_must_be_here_or_later = bottom; | 121 Address next_object_must_be_here_or_later = bottom; |
| 118 | 122 |
| (...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1853 : collector_(heap->mark_compact_collector()) { } | 1857 : collector_(heap->mark_compact_collector()) { } |
| 1854 | 1858 |
| 1855 void VisitPointer(Object** p) { | 1859 void VisitPointer(Object** p) { |
| 1856 MarkObjectByPointer(p); | 1860 MarkObjectByPointer(p); |
| 1857 } | 1861 } |
| 1858 | 1862 |
| 1859 void VisitPointers(Object** start, Object** end) { | 1863 void VisitPointers(Object** start, Object** end) { |
| 1860 for (Object** p = start; p < end; p++) MarkObjectByPointer(p); | 1864 for (Object** p = start; p < end; p++) MarkObjectByPointer(p); |
| 1861 } | 1865 } |
| 1862 | 1866 |
| 1867 WeakPointerMode weak_pointer_mode() { |
| 1868 return SKIP_WEAK_POINTERS; |
| 1869 } |
| 1870 |
| 1863 private: | 1871 private: |
| 1864 void MarkObjectByPointer(Object** p) { | 1872 void MarkObjectByPointer(Object** p) { |
| 1865 if (!(*p)->IsHeapObject()) return; | 1873 if (!(*p)->IsHeapObject()) return; |
| 1866 | 1874 |
| 1867 // Replace flat cons strings in place. | 1875 // Replace flat cons strings in place. |
| 1868 HeapObject* object = ShortCircuitConsString(p); | 1876 HeapObject* object = ShortCircuitConsString(p); |
| 1869 MarkBit mark_bit = Marking::MarkBitFrom(object); | 1877 MarkBit mark_bit = Marking::MarkBitFrom(object); |
| 1870 if (mark_bit.Get()) return; | 1878 if (mark_bit.Get()) return; |
| 1871 | 1879 |
| 1872 Map* map = object->map(); | 1880 Map* map = object->map(); |
| (...skipping 2604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4477 while (buffer != NULL) { | 4485 while (buffer != NULL) { |
| 4478 SlotsBuffer* next_buffer = buffer->next(); | 4486 SlotsBuffer* next_buffer = buffer->next(); |
| 4479 DeallocateBuffer(buffer); | 4487 DeallocateBuffer(buffer); |
| 4480 buffer = next_buffer; | 4488 buffer = next_buffer; |
| 4481 } | 4489 } |
| 4482 *buffer_address = NULL; | 4490 *buffer_address = NULL; |
| 4483 } | 4491 } |
| 4484 | 4492 |
| 4485 | 4493 |
| 4486 } } // namespace v8::internal | 4494 } } // namespace v8::internal |
| OLD | NEW |