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 3097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3108 } else { | 3108 } else { |
3109 MemoryChunk::IncrementLiveBytesFromMutator(object, by); | 3109 MemoryChunk::IncrementLiveBytesFromMutator(object, by); |
3110 } | 3110 } |
3111 } | 3111 } |
3112 } | 3112 } |
3113 | 3113 |
3114 | 3114 |
3115 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, | 3115 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, |
3116 int elements_to_trim) { | 3116 int elements_to_trim) { |
3117 DCHECK(!object->IsFixedTypedArrayBase()); | 3117 DCHECK(!object->IsFixedTypedArrayBase()); |
3118 printf("%d\n", elements_to_trim); | |
Camillo Bruni
2015/12/21 16:40:32
ok this has to go...
| |
3118 const int element_size = object->IsFixedArray() ? kPointerSize : kDoubleSize; | 3119 const int element_size = object->IsFixedArray() ? kPointerSize : kDoubleSize; |
3119 const int bytes_to_trim = elements_to_trim * element_size; | 3120 const int bytes_to_trim = elements_to_trim * element_size; |
3120 Map* map = object->map(); | 3121 Map* map = object->map(); |
3121 | 3122 |
3122 // For now this trick is only applied to objects in new and paged space. | 3123 // For now this trick is only applied to objects in new and paged space. |
3123 // In large object space the object's start must coincide with chunk | 3124 // In large object space the object's start must coincide with chunk |
3124 // and thus the trick is just not applicable. | 3125 // and thus the trick is just not applicable. |
3125 DCHECK(!lo_space()->Contains(object)); | 3126 DCHECK(!lo_space()->Contains(object)); |
3126 DCHECK(object->map() != fixed_cow_array_map()); | 3127 DCHECK(object->map() != fixed_cow_array_map()); |
3127 | 3128 |
(...skipping 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6221 } | 6222 } |
6222 | 6223 |
6223 | 6224 |
6224 // static | 6225 // static |
6225 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6226 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6226 return StaticVisitorBase::GetVisitorId(map); | 6227 return StaticVisitorBase::GetVisitorId(map); |
6227 } | 6228 } |
6228 | 6229 |
6229 } // namespace internal | 6230 } // namespace internal |
6230 } // namespace v8 | 6231 } // namespace v8 |
OLD | NEW |