| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 static void RecordWriteFromCode(HeapObject* obj, | 102 static void RecordWriteFromCode(HeapObject* obj, |
| 103 Object* value, | 103 Object* value, |
| 104 Isolate* isolate); | 104 Isolate* isolate); |
| 105 | 105 |
| 106 inline void RecordWrite(HeapObject* obj, Object* value); | 106 inline void RecordWrite(HeapObject* obj, Object* value); |
| 107 inline void RecordWriteOf(HeapObject* value); | 107 inline void RecordWriteOf(HeapObject* value); |
| 108 inline void RecordWrites(HeapObject* obj); | 108 inline void RecordWrites(HeapObject* obj); |
| 109 | 109 |
| 110 // Impossible markbits: 01 | 110 // Impossible markbits: 01 |
| 111 static const char* kImpossibleBitPattern; |
| 111 static inline bool IsImpossible(MarkBit mark_bit) { | 112 static inline bool IsImpossible(MarkBit mark_bit) { |
| 113 ASSERT(strcmp(kImpossibleBitPattern, "01") == 0); |
| 112 return !mark_bit.Get() && mark_bit.Next().Get(); | 114 return !mark_bit.Get() && mark_bit.Next().Get(); |
| 113 } | 115 } |
| 114 | 116 |
| 115 // Black markbits: 10 - this is required by the sweeper. | 117 // Black markbits: 10 - this is required by the sweeper. |
| 118 static const char* kBlackBitPattern; |
| 116 static inline bool IsBlack(MarkBit mark_bit) { | 119 static inline bool IsBlack(MarkBit mark_bit) { |
| 120 ASSERT(strcmp(kBlackBitPattern, "10") == 0); |
| 117 ASSERT(!IsImpossible(mark_bit)); | 121 ASSERT(!IsImpossible(mark_bit)); |
| 118 return mark_bit.Get() && !mark_bit.Next().Get(); | 122 return mark_bit.Get() && !mark_bit.Next().Get(); |
| 119 } | 123 } |
| 120 | 124 |
| 121 // White markbits: 00 - this is required by the mark bit clearer. | 125 // White markbits: 00 - this is required by the mark bit clearer. |
| 126 static const char* kWhiteBitPattern; |
| 122 static inline bool IsWhite(MarkBit mark_bit) { | 127 static inline bool IsWhite(MarkBit mark_bit) { |
| 128 ASSERT(strcmp(kWhiteBitPattern, "00") == 0); |
| 123 ASSERT(!IsImpossible(mark_bit)); | 129 ASSERT(!IsImpossible(mark_bit)); |
| 124 return !mark_bit.Get(); | 130 return !mark_bit.Get(); |
| 125 } | 131 } |
| 126 | 132 |
| 127 // Grey markbits: 11 | 133 // Grey markbits: 11 |
| 134 static const char* kGreyBitPattern; |
| 128 static inline bool IsGrey(MarkBit mark_bit) { | 135 static inline bool IsGrey(MarkBit mark_bit) { |
| 136 ASSERT(strcmp(kGreyBitPattern, "11") == 0); |
| 129 ASSERT(!IsImpossible(mark_bit)); | 137 ASSERT(!IsImpossible(mark_bit)); |
| 130 return mark_bit.Get() && mark_bit.Next().Get(); | 138 return mark_bit.Get() && mark_bit.Next().Get(); |
| 131 } | 139 } |
| 132 | 140 |
| 133 inline void BlackToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 141 inline void BlackToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
| 134 | 142 |
| 135 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); | 143 inline void WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit); |
| 136 | 144 |
| 137 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); | 145 inline void WhiteToGrey(HeapObject* obj, MarkBit mark_bit); |
| 138 | 146 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 int steps_count_; | 204 int steps_count_; |
| 197 double steps_took_; | 205 double steps_took_; |
| 198 bool should_hurry_; | 206 bool should_hurry_; |
| 199 intptr_t allocation_marking_factor_; | 207 intptr_t allocation_marking_factor_; |
| 200 intptr_t allocated_; | 208 intptr_t allocated_; |
| 201 }; | 209 }; |
| 202 | 210 |
| 203 } } // namespace v8::internal | 211 } } // namespace v8::internal |
| 204 | 212 |
| 205 #endif // V8_INCREMENTAL_MARKING_H_ | 213 #endif // V8_INCREMENTAL_MARKING_H_ |
| OLD | NEW |