| 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 3136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3147 MemoryChunk::IncrementLiveBytesFromGC(object, by); | 3147 MemoryChunk::IncrementLiveBytesFromGC(object, by); |
| 3148 } else { | 3148 } else { |
| 3149 MemoryChunk::IncrementLiveBytesFromMutator(object, by); | 3149 MemoryChunk::IncrementLiveBytesFromMutator(object, by); |
| 3150 } | 3150 } |
| 3151 } | 3151 } |
| 3152 } | 3152 } |
| 3153 | 3153 |
| 3154 | 3154 |
| 3155 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, | 3155 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, |
| 3156 int elements_to_trim) { | 3156 int elements_to_trim) { |
| 3157 CHECK_NOT_NULL(object); |
| 3157 DCHECK(!object->IsFixedTypedArrayBase()); | 3158 DCHECK(!object->IsFixedTypedArrayBase()); |
| 3158 DCHECK(!object->IsByteArray()); | 3159 DCHECK(!object->IsByteArray()); |
| 3159 const int element_size = object->IsFixedArray() ? kPointerSize : kDoubleSize; | 3160 const int element_size = object->IsFixedArray() ? kPointerSize : kDoubleSize; |
| 3160 const int bytes_to_trim = elements_to_trim * element_size; | 3161 const int bytes_to_trim = elements_to_trim * element_size; |
| 3161 Map* map = object->map(); | 3162 Map* map = object->map(); |
| 3162 | 3163 |
| 3163 // For now this trick is only applied to objects in new and paged space. | 3164 // For now this trick is only applied to objects in new and paged space. |
| 3164 // In large object space the object's start must coincide with chunk | 3165 // In large object space the object's start must coincide with chunk |
| 3165 // and thus the trick is just not applicable. | 3166 // and thus the trick is just not applicable. |
| 3166 DCHECK(!lo_space()->Contains(object)); | 3167 DCHECK(!lo_space()->Contains(object)); |
| (...skipping 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6379 } | 6380 } |
| 6380 | 6381 |
| 6381 | 6382 |
| 6382 // static | 6383 // static |
| 6383 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6384 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6384 return StaticVisitorBase::GetVisitorId(map); | 6385 return StaticVisitorBase::GetVisitorId(map); |
| 6385 } | 6386 } |
| 6386 | 6387 |
| 6387 } // namespace internal | 6388 } // namespace internal |
| 6388 } // namespace v8 | 6389 } // namespace v8 |
| OLD | NEW |