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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (Marking::IsBlack(obj_bit)) { | 71 if (Marking::IsBlack(obj_bit)) { |
72 // Object is not going to be rescanned we need to record the slot. | 72 // Object is not going to be rescanned we need to record the slot. |
73 heap_->mark_compact_collector()->RecordSlot( | 73 heap_->mark_compact_collector()->RecordSlot( |
74 HeapObject::RawField(obj, 0), slot, value); | 74 HeapObject::RawField(obj, 0), slot, value); |
75 } | 75 } |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 | 79 |
80 void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, | 80 void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, |
81 Object* value, | 81 Object** slot, |
82 Isolate* isolate) { | 82 Isolate* isolate) { |
83 ASSERT(obj->IsHeapObject()); | 83 ASSERT(obj->IsHeapObject()); |
84 IncrementalMarking* marking = isolate->heap()->incremental_marking(); | 84 IncrementalMarking* marking = isolate->heap()->incremental_marking(); |
85 ASSERT(!marking->is_compacting_); | 85 ASSERT(!marking->is_compacting_); |
86 | 86 |
87 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); | 87 MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address()); |
88 int counter = chunk->write_barrier_counter(); | 88 int counter = chunk->write_barrier_counter(); |
89 if (counter < (MemoryChunk::kWriteBarrierCounterGranularity / 2)) { | 89 if (counter < (MemoryChunk::kWriteBarrierCounterGranularity / 2)) { |
90 marking->write_barriers_invoked_since_last_step_ += | 90 marking->write_barriers_invoked_since_last_step_ += |
91 MemoryChunk::kWriteBarrierCounterGranularity - | 91 MemoryChunk::kWriteBarrierCounterGranularity - |
92 chunk->write_barrier_counter(); | 92 chunk->write_barrier_counter(); |
93 chunk->set_write_barrier_counter( | 93 chunk->set_write_barrier_counter( |
94 MemoryChunk::kWriteBarrierCounterGranularity); | 94 MemoryChunk::kWriteBarrierCounterGranularity); |
95 } | 95 } |
96 | 96 |
97 marking->RecordWrite(obj, NULL, value); | 97 marking->RecordWrite(obj, slot, *slot); |
98 } | 98 } |
99 | 99 |
100 | 100 |
101 void IncrementalMarking::RecordWriteForEvacuationFromCode(HeapObject* obj, | 101 void IncrementalMarking::RecordWriteForEvacuationFromCode(HeapObject* obj, |
102 Object** slot, | 102 Object** slot, |
103 Isolate* isolate) { | 103 Isolate* isolate) { |
104 ASSERT(obj->IsHeapObject()); | 104 ASSERT(obj->IsHeapObject()); |
105 IncrementalMarking* marking = isolate->heap()->incremental_marking(); | 105 IncrementalMarking* marking = isolate->heap()->incremental_marking(); |
106 ASSERT(marking->is_compacting_); | 106 ASSERT(marking->is_compacting_); |
107 | 107 |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 bytes_scanned_ = 0; | 996 bytes_scanned_ = 0; |
997 write_barriers_invoked_since_last_step_ = 0; | 997 write_barriers_invoked_since_last_step_ = 0; |
998 } | 998 } |
999 | 999 |
1000 | 1000 |
1001 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 1001 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
1002 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 1002 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
1003 } | 1003 } |
1004 | 1004 |
1005 } } // namespace v8::internal | 1005 } } // namespace v8::internal |
OLD | NEW |