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 // 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 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #include "incremental-marking.h" | 31 #include "incremental-marking.h" |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 | 36 |
| 37 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, | 37 bool IncrementalMarking::BaseRecordWrite(HeapObject* obj, |
| 38 Object** slot, | 38 Object** slot, |
| 39 Object* value) { | 39 Object* value) { |
| 40 MarkBit value_bit = Marking::MarkBitFrom(HeapObject::cast(value)); | 40 HeapObject* value_heap_obj = HeapObject::cast(value); |
| 41 MarkBit value_bit = Marking::MarkBitFrom(value_heap_obj); | |
| 41 if (Marking::IsWhite(value_bit)) { | 42 if (Marking::IsWhite(value_bit)) { |
| 42 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 43 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
| 43 if (Marking::IsBlack(obj_bit)) { | 44 bool is_black = Marking::IsBlack(obj_bit); |
| 44 BlackToGreyAndUnshift(obj, obj_bit); | 45 if (is_black) { |
|
Michael Starzinger
2012/11/18 22:07:02
Move the "Marking::IsBlack(obj_bit)" into the if c
Hannes Payer (out of office)
2012/11/19 10:56:20
Done.
| |
| 45 RestartIfNotMarking(); | 46 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); |
| 47 if (chunk->IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { | |
| 48 WhiteToGreyAndPush(value_heap_obj, value_bit); | |
| 49 RestartIfNotMarking(); | |
| 50 } else { | |
| 51 BlackToGreyAndUnshift(obj, obj_bit); | |
| 52 RestartIfNotMarking(); | |
| 53 return false; | |
| 54 } | |
| 55 } else { | |
| 56 return false; | |
| 46 } | 57 } |
| 47 | |
| 48 // Object is either grey or white. It will be scanned if survives. | |
| 49 return false; | |
| 50 } | 58 } |
| 51 if (!is_compacting_) return false; | 59 if (!is_compacting_) return false; |
| 52 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 60 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
| 53 return Marking::IsBlack(obj_bit); | 61 return Marking::IsBlack(obj_bit); |
| 54 } | 62 } |
| 55 | 63 |
| 56 | 64 |
| 57 void IncrementalMarking::RecordWrite(HeapObject* obj, | 65 void IncrementalMarking::RecordWrite(HeapObject* obj, |
| 58 Object** slot, | 66 Object** slot, |
| 59 Object* value) { | 67 Object* value) { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 | 129 |
| 122 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { | 130 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { |
| 123 Marking::WhiteToGrey(mark_bit); | 131 Marking::WhiteToGrey(mark_bit); |
| 124 marking_deque_.PushGrey(obj); | 132 marking_deque_.PushGrey(obj); |
| 125 } | 133 } |
| 126 | 134 |
| 127 | 135 |
| 128 } } // namespace v8::internal | 136 } } // namespace v8::internal |
| 129 | 137 |
| 130 #endif // V8_INCREMENTAL_MARKING_INL_H_ | 138 #endif // V8_INCREMENTAL_MARKING_INL_H_ |
| OLD | NEW |