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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 RelocationLock relocation_lock(this); | 1604 RelocationLock relocation_lock(this); |
1605 // There are soft limits in the allocation code, designed to trigger a mark | 1605 // There are soft limits in the allocation code, designed to trigger a mark |
1606 // sweep collection by failing allocations. There is no sense in trying to | 1606 // sweep collection by failing allocations. There is no sense in trying to |
1607 // trigger one during scavenge: scavenges allocation should always succeed. | 1607 // trigger one during scavenge: scavenges allocation should always succeed. |
1608 AlwaysAllocateScope scope(isolate()); | 1608 AlwaysAllocateScope scope(isolate()); |
1609 | 1609 |
1610 // Bump-pointer allocations done during scavenge are not real allocations. | 1610 // Bump-pointer allocations done during scavenge are not real allocations. |
1611 // Pause the inline allocation steps. | 1611 // Pause the inline allocation steps. |
1612 PauseAllocationObserversScope pause_observers(this); | 1612 PauseAllocationObserversScope pause_observers(this); |
1613 | 1613 |
| 1614 mark_compact_collector()->sweeper().EnsureNewSpaceCompleted(); |
| 1615 |
1614 #ifdef VERIFY_HEAP | 1616 #ifdef VERIFY_HEAP |
1615 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); | 1617 if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this); |
1616 #endif | 1618 #endif |
1617 | 1619 |
1618 gc_state_ = SCAVENGE; | 1620 gc_state_ = SCAVENGE; |
1619 | 1621 |
1620 // Implements Cheney's copying algorithm | 1622 // Implements Cheney's copying algorithm |
1621 LOG(isolate_, ResourceEvent("scavenge", "begin")); | 1623 LOG(isolate_, ResourceEvent("scavenge", "begin")); |
1622 | 1624 |
1623 // Used for updating survived_since_last_expansion_ at function end. | 1625 // Used for updating survived_since_last_expansion_ at function end. |
(...skipping 4828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6452 } | 6454 } |
6453 | 6455 |
6454 | 6456 |
6455 // static | 6457 // static |
6456 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6458 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6457 return StaticVisitorBase::GetVisitorId(map); | 6459 return StaticVisitorBase::GetVisitorId(map); |
6458 } | 6460 } |
6459 | 6461 |
6460 } // namespace internal | 6462 } // namespace internal |
6461 } // namespace v8 | 6463 } // namespace v8 |
OLD | NEW |