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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (heap->marking()->TransferMark(elms->address(), |
272 elms->address() + size_delta)) { | 272 elms->address() + size_delta)) { |
273 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); | 273 MemoryChunk::IncrementLiveBytesFromMutator(elms->address(), -size_delta); |
274 } | 274 } |
275 | 275 |
276 FixedArrayBase* new_elms = FixedArrayBase::cast(HeapObject::FromAddress( | |
277 elms->address() + size_delta)); | |
278 HeapProfiler* profiler = heap->isolate()->heap_profiler(); | 276 HeapProfiler* profiler = heap->isolate()->heap_profiler(); |
279 if (profiler->is_profiling()) { | 277 if (profiler->is_profiling()) { |
280 profiler->ObjectMoveEvent(elms->address(), | 278 profiler->ObjectMoveEvent(elms->address(), |
281 new_elms->address(), | 279 elms->address() + size_delta, |
282 new_elms->Size()); | 280 elms->Size()); |
283 } | 281 } |
284 return new_elms; | 282 return FixedArrayBase::cast(HeapObject::FromAddress( |
| 283 elms->address() + to_trim * entry_size)); |
285 } | 284 } |
286 | 285 |
287 | 286 |
288 static bool ArrayPrototypeHasNoElements(Heap* heap, | 287 static bool ArrayPrototypeHasNoElements(Heap* heap, |
289 Context* native_context, | 288 Context* native_context, |
290 JSObject* array_proto) { | 289 JSObject* array_proto) { |
291 // This method depends on non writability of Object and Array prototype | 290 // This method depends on non writability of Object and Array prototype |
292 // fields. | 291 // fields. |
293 if (array_proto->elements() != heap->empty_fixed_array()) return false; | 292 if (array_proto->elements() != heap->empty_fixed_array()) return false; |
294 // Object.prototype | 293 // Object.prototype |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 } | 1815 } |
1817 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1816 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1818 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1817 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1819 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1818 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
1820 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1819 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1821 #undef DEFINE_BUILTIN_ACCESSOR_C | 1820 #undef DEFINE_BUILTIN_ACCESSOR_C |
1822 #undef DEFINE_BUILTIN_ACCESSOR_A | 1821 #undef DEFINE_BUILTIN_ACCESSOR_A |
1823 | 1822 |
1824 | 1823 |
1825 } } // namespace v8::internal | 1824 } } // namespace v8::internal |
OLD | NEW |