| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 int64_t old_bytes_rescanned = bytes_rescanned_; | 100 int64_t old_bytes_rescanned = bytes_rescanned_; |
| 101 bytes_rescanned_ = old_bytes_rescanned + obj_size; | 101 bytes_rescanned_ = old_bytes_rescanned + obj_size; |
| 102 if ((bytes_rescanned_ >> 20) != (old_bytes_rescanned >> 20)) { | 102 if ((bytes_rescanned_ >> 20) != (old_bytes_rescanned >> 20)) { |
| 103 if (bytes_rescanned_ > 2 * heap_->PromotedSpaceSizeOfObjects()) { | 103 if (bytes_rescanned_ > 2 * heap_->PromotedSpaceSizeOfObjects()) { |
| 104 // If we have queued twice the heap size for rescanning then we are | 104 // If we have queued twice the heap size for rescanning then we are |
| 105 // going around in circles, scanning the same objects again and again | 105 // going around in circles, scanning the same objects again and again |
| 106 // as the program mutates the heap faster than we can incrementally | 106 // as the program mutates the heap faster than we can incrementally |
| 107 // trace it. In this case we switch to non-incremental marking in | 107 // trace it. In this case we switch to non-incremental marking in |
| 108 // order to finish off this marking phase. | 108 // order to finish off this marking phase. |
| 109 if (FLAG_trace_gc) { | 109 if (FLAG_trace_gc) { |
| 110 PrintF("Hurrying incremental marking because of lack of progress\n"); | 110 PrintPID("Hurrying incremental marking because of lack of progress\n"); |
| 111 } | 111 } |
| 112 allocation_marking_factor_ = kMaxAllocationMarkingFactor; | 112 allocation_marking_factor_ = kMaxAllocationMarkingFactor; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 marking_deque_.UnshiftGrey(obj); | 116 marking_deque_.UnshiftGrey(obj); |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { | 120 void IncrementalMarking::WhiteToGreyAndPush(HeapObject* obj, MarkBit mark_bit) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 140 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); | 140 MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size()); |
| 141 return true; | 141 return true; |
| 142 } | 142 } |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 | 145 |
| 146 | 146 |
| 147 } } // namespace v8::internal | 147 } } // namespace v8::internal |
| 148 | 148 |
| 149 #endif // V8_INCREMENTAL_MARKING_INL_H_ | 149 #endif // V8_INCREMENTAL_MARKING_INL_H_ |
| OLD | NEW |