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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 | 61 |
62 void IncrementalMarking::TearDown() { | 62 void IncrementalMarking::TearDown() { |
63 delete marking_deque_memory_; | 63 delete marking_deque_memory_; |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, | 67 void IncrementalMarking::RecordWriteSlow(HeapObject* obj, |
68 Object** slot, | 68 Object** slot, |
69 Object* value) { | 69 Object* value) { |
70 if (BaseRecordWrite(obj, slot, value) && is_compacting_ && slot != NULL) { | 70 if (BaseRecordWrite(obj, slot, value) && slot != NULL) { |
71 MarkBit obj_bit = Marking::MarkBitFrom(obj); | 71 MarkBit obj_bit = Marking::MarkBitFrom(obj); |
72 if (Marking::IsBlack(obj_bit)) { | 72 if (Marking::IsBlack(obj_bit)) { |
73 // Object is not going to be rescanned we need to record the slot. | 73 // Object is not going to be rescanned we need to record the slot. |
74 heap_->mark_compact_collector()->RecordSlot( | 74 heap_->mark_compact_collector()->RecordSlot( |
75 HeapObject::RawField(obj, 0), slot, value); | 75 HeapObject::RawField(obj, 0), slot, value); |
76 } | 76 } |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 | 80 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (IsMarking()) { | 120 if (IsMarking()) { |
121 Code* host = heap_->isolate()->inner_pointer_to_code_cache()-> | 121 Code* host = heap_->isolate()->inner_pointer_to_code_cache()-> |
122 GcSafeFindCodeForInnerPointer(pc); | 122 GcSafeFindCodeForInnerPointer(pc); |
123 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); | 123 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); |
124 RecordWriteIntoCode(host, &rinfo, value); | 124 RecordWriteIntoCode(host, &rinfo, value); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 void IncrementalMarking::RecordWriteOfCodeEntrySlow(JSFunction* host, | 129 void IncrementalMarking::RecordWriteOfCodeEntrySlow(JSFunction* host, |
130 Object** slot, | 130 Object** slot, |
131 Code* value) { | 131 Code* value) { |
132 if (BaseRecordWrite(host, slot, value) && is_compacting_) { | 132 if (BaseRecordWrite(host, slot, value)) { |
133 ASSERT(slot != NULL); | 133 ASSERT(slot != NULL); |
134 heap_->mark_compact_collector()-> | 134 heap_->mark_compact_collector()-> |
135 RecordCodeEntrySlot(reinterpret_cast<Address>(slot), value); | 135 RecordCodeEntrySlot(reinterpret_cast<Address>(slot), value); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 | 139 |
140 void IncrementalMarking::RecordWriteIntoCodeSlow(HeapObject* obj, | 140 void IncrementalMarking::RecordWriteIntoCodeSlow(HeapObject* obj, |
141 RelocInfo* rinfo, | 141 RelocInfo* rinfo, |
142 Object* value) { | 142 Object* value) { |
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 944 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
945 bytes_scanned_ = 0; | 945 bytes_scanned_ = 0; |
946 } | 946 } |
947 | 947 |
948 | 948 |
949 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 949 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
950 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 950 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
951 } | 951 } |
952 | 952 |
953 } } // namespace v8::internal | 953 } } // namespace v8::internal |
OLD | NEW |