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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 // we still do it. | 261 // we still do it. |
262 heap->CreateFillerObjectAt(elms->address(), to_trim * entry_size); | 262 heap->CreateFillerObjectAt(elms->address(), to_trim * entry_size); |
263 | 263 |
264 int new_start_index = to_trim * (entry_size / kPointerSize); | 264 int new_start_index = to_trim * (entry_size / kPointerSize); |
265 former_start[new_start_index] = map; | 265 former_start[new_start_index] = map; |
266 former_start[new_start_index + 1] = Smi::FromInt(len - to_trim); | 266 former_start[new_start_index + 1] = Smi::FromInt(len - to_trim); |
267 | 267 |
268 // Maintain marking consistency for HeapObjectIterator and | 268 // Maintain marking consistency for HeapObjectIterator and |
269 // IncrementalMarking. | 269 // IncrementalMarking. |
270 int size_delta = to_trim * entry_size; | 270 int size_delta = to_trim * entry_size; |
271 if (heap->marking()->TransferMark(elms->address(), | 271 heap->marking()->TransferMark(elms->address(), elms->address() + size_delta); |
272 elms->address() + size_delta)) { | 272 heap->AdjustLiveBytes(elms->address(), -size_delta, Heap::FROM_MUTATOR); |
Michael Starzinger
2014/03/19 11:25:26
Unfortunately this is not correct. The adjustment
| |
273 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); | |
274 } | |
275 | 273 |
276 FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress( | 274 FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress( |
277 elms->address() + size_delta)); | 275 elms->address() + size_delta)); |
278 HeapProfiler* profiler = heap->isolate()->heap_profiler(); | 276 HeapProfiler* profiler = heap->isolate()->heap_profiler(); |
279 if (profiler->is_tracking_object_moves()) { | 277 if (profiler->is_tracking_object_moves()) { |
280 profiler->ObjectMoveEvent(elms->address(), | 278 profiler->ObjectMoveEvent(elms->address(), |
281 new_elms->address(), | 279 new_elms->address(), |
282 new_elms->Size()); | 280 new_elms->Size()); |
283 } | 281 } |
284 return new_elms; | 282 return new_elms; |
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1758 } | 1756 } |
1759 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1757 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1760 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1758 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1761 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1759 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1762 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1760 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1763 #undef DEFINE_BUILTIN_ACCESSOR_C | 1761 #undef DEFINE_BUILTIN_ACCESSOR_C |
1764 #undef DEFINE_BUILTIN_ACCESSOR_A | 1762 #undef DEFINE_BUILTIN_ACCESSOR_A |
1765 | 1763 |
1766 | 1764 |
1767 } } // namespace v8::internal | 1765 } } // namespace v8::internal |
OLD | NEW |