OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (new_space_.Contains(address)) return; | 189 if (new_space_.Contains(address)) return; |
190 ASSERT(!new_space_.FromSpaceContains(address)); | 190 ASSERT(!new_space_.FromSpaceContains(address)); |
191 SLOW_ASSERT(Contains(address + offset)); | 191 SLOW_ASSERT(Contains(address + offset)); |
192 Page::FromAddress(address)->MarkRegionDirty(address + offset); | 192 Page::FromAddress(address)->MarkRegionDirty(address + offset); |
193 } | 193 } |
194 | 194 |
195 | 195 |
196 void Heap::RecordWrites(Address address, int start, int len) { | 196 void Heap::RecordWrites(Address address, int start, int len) { |
197 if (new_space_.Contains(address)) return; | 197 if (new_space_.Contains(address)) return; |
198 ASSERT(!new_space_.FromSpaceContains(address)); | 198 ASSERT(!new_space_.FromSpaceContains(address)); |
199 for (int offset = start; | 199 Page* page = Page::FromAddress(address); |
200 offset < start + len * kPointerSize; | 200 page->SetRegionMarks(page->GetRegionMarks() | |
201 offset += kPointerSize) { | 201 page->GetRegionMaskForSpan(address + start, len * kPointerSize)); |
202 SLOW_ASSERT(Contains(address + offset)); | |
203 Page::FromAddress(address)->MarkRegionDirty(address + offset); | |
204 } | |
205 } | 202 } |
206 | 203 |
207 | 204 |
208 OldSpace* Heap::TargetSpace(HeapObject* object) { | 205 OldSpace* Heap::TargetSpace(HeapObject* object) { |
209 InstanceType type = object->map()->instance_type(); | 206 InstanceType type = object->map()->instance_type(); |
210 AllocationSpace space = TargetSpaceId(type); | 207 AllocationSpace space = TargetSpaceId(type); |
211 return (space == OLD_POINTER_SPACE) | 208 return (space == OLD_POINTER_SPACE) |
212 ? old_pointer_space_ | 209 ? old_pointer_space_ |
213 : old_data_space_; | 210 : old_data_space_; |
214 } | 211 } |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 484 |
488 | 485 |
489 void ExternalStringTable::ShrinkNewStrings(int position) { | 486 void ExternalStringTable::ShrinkNewStrings(int position) { |
490 new_space_strings_.Rewind(position); | 487 new_space_strings_.Rewind(position); |
491 Verify(); | 488 Verify(); |
492 } | 489 } |
493 | 490 |
494 } } // namespace v8::internal | 491 } } // namespace v8::internal |
495 | 492 |
496 #endif // V8_HEAP_INL_H_ | 493 #endif // V8_HEAP_INL_H_ |
OLD | NEW |