| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 marking_deque_.UnshiftGrey(obj); | 118 marking_deque_.UnshiftGrey(obj); |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { | 122 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { |
| 123 Marking::WhiteToGrey(mark_bit); | 123 Marking::WhiteToGrey(mark_bit); |
| 124 marking_deque_.PushGrey(obj); | 124 marking_deque_.PushGrey(obj); |
| 125 } | 125 } |
| 126 | 126 |
| 127 | 127 |
| 128 bool IncrementalMarking::MarkObjectAndPush(HeapObject* obj) { | |
| 129 MarkBit mark_bit = Marking::MarkBitFrom(obj); | |
| 130 if (!mark_bit.Get()) { | |
| 131 WhiteToGreyAndPush(obj, mark_bit); | |
| 132 return true; | |
| 133 } | |
| 134 return false; | |
| 135 } | |
| 136 | |
| 137 | |
| 138 bool IncrementalMarking::MarkObjectWithoutPush(HeapObject* obj) { | |
| 139 MarkBit mark_bit = Marking::MarkBitFrom(obj); | |
| 140 if (!mark_bit.Get()) { | |
| 141 mark_bit.Set(); | |
| 142 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); | |
| 143 return true; | |
| 144 } | |
| 145 return false; | |
| 146 } | |
| 147 | |
| 148 | |
| 149 } } // namespace v8::internal | 128 } } // namespace v8::internal |
| 150 | 129 |
| 151 #endif // V8_INCREMENTAL_MARKING_INL_H_ | 130 #endif // V8_INCREMENTAL_MARKING_INL_H_ |
| OLD | NEW |