| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 // Maintain marking consistency for HeapObjectIterator and | 233 // Maintain marking consistency for HeapObjectIterator and |
| 234 // IncrementalMarking. | 234 // IncrementalMarking. |
| 235 int size_delta = to_trim * entry_size; | 235 int size_delta = to_trim * entry_size; |
| 236 Address new_start = elms->address() + size_delta; | 236 Address new_start = elms->address() + size_delta; |
| 237 heap->marking()->TransferMark(elms->address(), new_start); | 237 heap->marking()->TransferMark(elms->address(), new_start); |
| 238 heap->AdjustLiveBytes(new_start, -size_delta, Heap::FROM_MUTATOR); | 238 heap->AdjustLiveBytes(new_start, -size_delta, Heap::FROM_MUTATOR); |
| 239 | 239 |
| 240 FixedArrayBase* new_elms = | 240 FixedArrayBase* new_elms = |
| 241 FixedArrayBase::cast(HeapObject::FromAddress(new_start)); | 241 FixedArrayBase::cast(HeapObject::FromAddress(new_start)); |
| 242 HeapProfiler* profiler = heap->isolate()->heap_profiler(); | 242 |
| 243 if (profiler->is_tracking_object_moves()) { | 243 heap->OnMoveEvent(new_elms, elms, new_elms->Size()); |
| 244 profiler->ObjectMoveEvent(elms->address(), | |
| 245 new_elms->address(), | |
| 246 new_elms->Size()); | |
| 247 } | |
| 248 return new_elms; | 244 return new_elms; |
| 249 } | 245 } |
| 250 | 246 |
| 251 | 247 |
| 252 static bool ArrayPrototypeHasNoElements(Heap* heap, | 248 static bool ArrayPrototypeHasNoElements(Heap* heap, |
| 253 Context* native_context, | 249 Context* native_context, |
| 254 JSObject* array_proto) { | 250 JSObject* array_proto) { |
| 255 DisallowHeapAllocation no_gc; | 251 DisallowHeapAllocation no_gc; |
| 256 // This method depends on non writability of Object and Array prototype | 252 // This method depends on non writability of Object and Array prototype |
| 257 // fields. | 253 // fields. |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 } | 1713 } |
| 1718 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1714 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
| 1719 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1715 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1720 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 1716 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
| 1721 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1717 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
| 1722 #undef DEFINE_BUILTIN_ACCESSOR_C | 1718 #undef DEFINE_BUILTIN_ACCESSOR_C |
| 1723 #undef DEFINE_BUILTIN_ACCESSOR_A | 1719 #undef DEFINE_BUILTIN_ACCESSOR_A |
| 1724 | 1720 |
| 1725 | 1721 |
| 1726 } } // namespace v8::internal | 1722 } } // namespace v8::internal |
| OLD | NEW |