| 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 30 matching lines...) Expand all Loading... |
| 41 if (Marking::IsWhite(value_bit)) { | 41 if (Marking::IsWhite(value_bit)) { |
| 42 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 42 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
| 43 if (Marking::IsBlack(obj_bit)) { | 43 if (Marking::IsBlack(obj_bit)) { |
| 44 BlackToGreyAndUnshift(obj, obj_bit); | 44 BlackToGreyAndUnshift(obj, obj_bit); |
| 45 RestartIfNotMarking(); | 45 RestartIfNotMarking(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 // Object is either grey or white. It will be scanned if survives. | 48 // Object is either grey or white. It will be scanned if survives. |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 return true; | 51 if (!is_compacting_) return false; |
| 52 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
| 53 return Marking::IsBlack(obj_bit); |
| 52 } | 54 } |
| 53 | 55 |
| 54 | 56 |
| 55 void IncrementalMarking::RecordWrite(HeapObject* obj, | 57 void IncrementalMarking::RecordWrite(HeapObject* obj, |
| 56 Object** slot, | 58 Object** slot, |
| 57 Object* value) { | 59 Object* value) { |
| 58 if (IsMarking() && value->NonFailureIsHeapObject()) { | 60 if (IsMarking() && value->NonFailureIsHeapObject()) { |
| 59 RecordWriteSlow(obj, slot, value); | 61 RecordWriteSlow(obj, slot, value); |
| 60 } | 62 } |
| 61 } | 63 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); | 142 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); |
| 141 return true; | 143 return true; |
| 142 } | 144 } |
| 143 return false; | 145 return false; |
| 144 } | 146 } |
| 145 | 147 |
| 146 | 148 |
| 147 } } // namespace v8::internal | 149 } } // namespace v8::internal |
| 148 | 150 |
| 149 #endif // V8_INCREMENTAL_MARKING_INL_H_ | 151 #endif // V8_INCREMENTAL_MARKING_INL_H_ |
| OLD | NEW |