| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // Technically in new space this write might be omitted (except for | 356 // Technically in new space this write might be omitted (except for |
| 357 // debug mode which iterates through the heap), but to play safer | 357 // debug mode which iterates through the heap), but to play safer |
| 358 // we still do it. | 358 // we still do it. |
| 359 heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize); | 359 heap->CreateFillerObjectAt(elms->address(), to_trim * kPointerSize); |
| 360 | 360 |
| 361 former_start[to_trim] = heap->fixed_array_map(); | 361 former_start[to_trim] = heap->fixed_array_map(); |
| 362 former_start[to_trim + 1] = Smi::FromInt(len - to_trim); | 362 former_start[to_trim + 1] = Smi::FromInt(len - to_trim); |
| 363 | 363 |
| 364 // Maintain marking consistency for HeapObjectIterator and | 364 // Maintain marking consistency for HeapObjectIterator and |
| 365 // IncrementalMarking. | 365 // IncrementalMarking. |
| 366 heap->marking()->TransferMark(elms->address(), | 366 int size_delta = to_trim * kPointerSize; |
| 367 elms->address() + to_trim * kPointerSize); | 367 if (heap->marking()->TransferMark(elms->address(), |
| 368 elms->address() + size_delta)) { |
| 369 MemoryChunk::IncrementLiveBytes(elms->address(), -size_delta); |
| 370 } |
| 368 | 371 |
| 369 return FixedArray::cast(HeapObject::FromAddress( | 372 return FixedArray::cast(HeapObject::FromAddress( |
| 370 elms->address() + to_trim * kPointerSize)); | 373 elms->address() + to_trim * kPointerSize)); |
| 371 } | 374 } |
| 372 | 375 |
| 373 | 376 |
| 374 static bool ArrayPrototypeHasNoElements(Heap* heap, | 377 static bool ArrayPrototypeHasNoElements(Heap* heap, |
| 375 Context* global_context, | 378 Context* global_context, |
| 376 JSObject* array_proto) { | 379 JSObject* array_proto) { |
| 377 // This method depends on non writability of Object and Array prototype | 380 // This method depends on non writability of Object and Array prototype |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 return Handle<Code>(code_address); \ | 1709 return Handle<Code>(code_address); \ |
| 1707 } | 1710 } |
| 1708 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1711 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1709 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1712 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1710 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1713 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1711 #undef DEFINE_BUILTIN_ACCESSOR_C | 1714 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1712 #undef DEFINE_BUILTIN_ACCESSOR_A | 1715 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1713 | 1716 |
| 1714 | 1717 |
| 1715 } } // namespace v8::internal | 1718 } } // namespace v8::internal |
| OLD | NEW |