Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/base/atomicops.h" | 7 #include "src/base/atomicops.h" |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 VerifyMarkingVisitor visitor(heap); | 95 VerifyMarkingVisitor visitor(heap); |
| 96 HeapObject* object; | 96 HeapObject* object; |
| 97 Address next_object_must_be_here_or_later = bottom; | 97 Address next_object_must_be_here_or_later = bottom; |
| 98 | 98 |
| 99 for (Address current = bottom; current < top; current += kPointerSize) { | 99 for (Address current = bottom; current < top; current += kPointerSize) { |
| 100 object = HeapObject::FromAddress(current); | 100 object = HeapObject::FromAddress(current); |
| 101 if (MarkCompactCollector::IsMarked(object)) { | 101 if (MarkCompactCollector::IsMarked(object)) { |
| 102 CHECK(current >= next_object_must_be_here_or_later); | 102 CHECK(current >= next_object_must_be_here_or_later); |
| 103 object->Iterate(&visitor); | 103 object->Iterate(&visitor); |
| 104 next_object_must_be_here_or_later = current + object->Size(); | 104 next_object_must_be_here_or_later = current + object->Size(); |
| 105 // Take into account that a marked objected is at least two pointers in | |
|
Hannes Payer (out of office)
2015/03/09 13:49:25
object
| |
| 106 // size. If we don't skip one word, the next word gets detected as an | |
| 107 // object as well. | |
| 108 current += kPointerSize; | |
|
Hannes Payer (out of office)
2015/03/09 13:49:25
Now the verifier would allow grey object in the fi
| |
| 105 } | 109 } |
| 106 } | 110 } |
| 107 } | 111 } |
| 108 | 112 |
| 109 | 113 |
| 110 static void VerifyMarking(NewSpace* space) { | 114 static void VerifyMarking(NewSpace* space) { |
| 111 Address end = space->top(); | 115 Address end = space->top(); |
| 112 NewSpacePageIterator it(space->bottom(), end); | 116 NewSpacePageIterator it(space->bottom(), end); |
| 113 // The bottom position is at the start of its page. Allows us to use | 117 // The bottom position is at the start of its page. Allows us to use |
| 114 // page->area_start() as start of range on all pages. | 118 // page->area_start() as start of range on all pages. |
| (...skipping 4381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4496 SlotsBuffer* buffer = *buffer_address; | 4500 SlotsBuffer* buffer = *buffer_address; |
| 4497 while (buffer != NULL) { | 4501 while (buffer != NULL) { |
| 4498 SlotsBuffer* next_buffer = buffer->next(); | 4502 SlotsBuffer* next_buffer = buffer->next(); |
| 4499 DeallocateBuffer(buffer); | 4503 DeallocateBuffer(buffer); |
| 4500 buffer = next_buffer; | 4504 buffer = next_buffer; |
| 4501 } | 4505 } |
| 4502 *buffer_address = NULL; | 4506 *buffer_address = NULL; |
| 4503 } | 4507 } |
| 4504 } | 4508 } |
| 4505 } // namespace v8::internal | 4509 } // namespace v8::internal |
| OLD | NEW |