OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize); | 364 heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize); |
365 | 365 |
366 former_start[to_trim] = heap->fixed_array_map(); | 366 former_start[to_trim] = heap->fixed_array_map(); |
367 former_start[to_trim + 1] = Smi::FromInt(len - to_trim); | 367 former_start[to_trim + 1] = Smi::FromInt(len - to_trim); |
368 | 368 |
369 // Maintain marking consistency for HeapObjectIterator and | 369 // Maintain marking consistency for HeapObjectIterator and |
370 // IncrementalMarking. | 370 // IncrementalMarking. |
371 int size_delta = to_trim * kPointerSize; | 371 int size_delta = to_trim * kPointerSize; |
372 if (heap->marking()->TransferMark(elms->address(), | 372 if (heap->marking()->TransferMark(elms->address(), |
373 elms->address() + size_delta)) { | 373 elms->address() + size_delta)) { |
374 MemoryChunk::IncrementLiveBytes(elms->address(), -size_delta); | 374 if (MarkCompactCollector::IsLiveBytesUpdateRequired(elms)) { |
| 375 MemoryChunk::IncrementLiveBytes(elms->address(), -size_delta); |
| 376 } |
375 } | 377 } |
376 | 378 |
377 return FixedArray::cast(HeapObject::FromAddress( | 379 return FixedArray::cast(HeapObject::FromAddress( |
378 elms->address() + to_trim * kPointerSize)); | 380 elms->address() + to_trim * kPointerSize)); |
379 } | 381 } |
380 | 382 |
381 | 383 |
382 static bool ArrayPrototypeHasNoElements(Heap* heap, | 384 static bool ArrayPrototypeHasNoElements(Heap* heap, |
383 Context* global_context, | 385 Context* global_context, |
384 JSObject* array_proto) { | 386 JSObject* array_proto) { |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1764 return Handle<Code>(code_address); \ | 1766 return Handle<Code>(code_address); \ |
1765 } | 1767 } |
1766 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1768 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1767 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1769 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1768 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1770 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1769 #undef DEFINE_BUILTIN_ACCESSOR_C | 1771 #undef DEFINE_BUILTIN_ACCESSOR_C |
1770 #undef DEFINE_BUILTIN_ACCESSOR_A | 1772 #undef DEFINE_BUILTIN_ACCESSOR_A |
1771 | 1773 |
1772 | 1774 |
1773 } } // namespace v8::internal | 1775 } } // namespace v8::internal |
OLD | NEW |