OLD | NEW |
---|---|
1 // Copyright 2011 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 WhiteToGrey(obj, mark_bit); | 121 WhiteToGrey(obj, mark_bit); |
122 marking_deque_.PushGrey(obj); | 122 marking_deque_.PushGrey(obj); |
123 } | 123 } |
124 | 124 |
125 | 125 |
126 void IncrementalMarking::WhiteToGrey(HeapObject* obj, MarkBit mark_bit) { | 126 void IncrementalMarking::WhiteToGrey(HeapObject* obj, MarkBit mark_bit) { |
127 Marking::WhiteToGrey(mark_bit); | 127 Marking::WhiteToGrey(mark_bit); |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 bool IncrementalMarking::MarkObject(HeapObject* obj) { | |
Vyacheslav Egorov (Chromium)
2012/05/11 12:58:35
I suggest naming it MarkObjectAndPush
Michael Starzinger
2012/05/11 14:51:53
Done.
| |
132 MarkBit mark_bit = Marking::MarkBitFrom(obj); | |
133 if (!mark_bit.Get()) { | |
134 WhiteToGreyAndPush(obj, mark_bit); | |
135 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); | |
136 return true; | |
137 } | |
138 return false; | |
139 } | |
140 | |
141 | |
142 bool IncrementalMarking::MarkObjectWithoutPush(HeapObject* obj) { | |
143 MarkBit mark_bit = Marking::MarkBitFrom(obj); | |
144 if (!mark_bit.Get()) { | |
145 MarkBlackOrKeepGrey(mark_bit); | |
Vyacheslav Egorov (Chromium)
2012/05/11 12:58:35
Can it be grey at this point? I don't think so.
Michael Starzinger
2012/05/11 14:51:53
Done, inlined mark bit setting.
| |
146 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); | |
147 return true; | |
148 } | |
149 return false; | |
150 } | |
151 | |
152 | |
131 } } // namespace v8::internal | 153 } } // namespace v8::internal |
132 | 154 |
133 #endif // V8_INCREMENTAL_MARKING_INL_H_ | 155 #endif // V8_INCREMENTAL_MARKING_INL_H_ |
OLD | NEW |