| 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 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 // At this point, we may be deserializing the heap from a snapshot, and | 3062 // At this point, we may be deserializing the heap from a snapshot, and |
| 3063 // none of the maps have been created yet and are NULL. | 3063 // none of the maps have been created yet and are NULL. |
| 3064 DCHECK((filler->map() == NULL && !deserialization_complete_) || | 3064 DCHECK((filler->map() == NULL && !deserialization_complete_) || |
| 3065 filler->map()->IsMap()); | 3065 filler->map()->IsMap()); |
| 3066 } | 3066 } |
| 3067 | 3067 |
| 3068 | 3068 |
| 3069 bool Heap::CanMoveObjectStart(HeapObject* object) { | 3069 bool Heap::CanMoveObjectStart(HeapObject* object) { |
| 3070 if (!FLAG_move_object_start) return false; | 3070 if (!FLAG_move_object_start) return false; |
| 3071 | 3071 |
| 3072 // Sampling heap profiler may have a reference to the object. |
| 3073 if (isolate()->heap_profiler()->is_sampling_allocations()) return false; |
| 3074 |
| 3072 Address address = object->address(); | 3075 Address address = object->address(); |
| 3073 | 3076 |
| 3074 if (lo_space()->Contains(object)) return false; | 3077 if (lo_space()->Contains(object)) return false; |
| 3075 | 3078 |
| 3076 Page* page = Page::FromAddress(address); | 3079 Page* page = Page::FromAddress(address); |
| 3077 // We can move the object start if: | 3080 // We can move the object start if: |
| 3078 // (1) the object is not in old space, | 3081 // (1) the object is not in old space, |
| 3079 // (2) the page of the object was already swept, | 3082 // (2) the page of the object was already swept, |
| 3080 // (3) the page was already concurrently swept. This case is an optimization | 3083 // (3) the page was already concurrently swept. This case is an optimization |
| 3081 // for concurrent sweeping. The WasSwept predicate for concurrently swept | 3084 // for concurrent sweeping. The WasSwept predicate for concurrently swept |
| (...skipping 3244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6326 } | 6329 } |
| 6327 | 6330 |
| 6328 | 6331 |
| 6329 // static | 6332 // static |
| 6330 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6333 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6331 return StaticVisitorBase::GetVisitorId(map); | 6334 return StaticVisitorBase::GetVisitorId(map); |
| 6332 } | 6335 } |
| 6333 | 6336 |
| 6334 } // namespace internal | 6337 } // namespace internal |
| 6335 } // namespace v8 | 6338 } // namespace v8 |
| OLD | NEW |