| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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/spaces.h" | 5 #include "src/heap/spaces.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
| 9 #include "src/full-codegen/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
| 10 #include "src/heap/slots-buffer.h" | 10 #include "src/heap/slots-buffer.h" |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 Address high = to_space_.page_high(); | 1509 Address high = to_space_.page_high(); |
| 1510 Address new_top = allocation_info_.top() + size_in_bytes; | 1510 Address new_top = allocation_info_.top() + size_in_bytes; |
| 1511 allocation_info_.set_limit(Min(new_top, high)); | 1511 allocation_info_.set_limit(Min(new_top, high)); |
| 1512 } else if (top_on_previous_step_ == 0) { | 1512 } else if (top_on_previous_step_ == 0) { |
| 1513 // Normal limit is the end of the current page. | 1513 // Normal limit is the end of the current page. |
| 1514 allocation_info_.set_limit(to_space_.page_high()); | 1514 allocation_info_.set_limit(to_space_.page_high()); |
| 1515 } else { | 1515 } else { |
| 1516 // Lower limit during incremental marking. | 1516 // Lower limit during incremental marking. |
| 1517 Address high = to_space_.page_high(); | 1517 Address high = to_space_.page_high(); |
| 1518 Address new_top = allocation_info_.top() + size_in_bytes; | 1518 Address new_top = allocation_info_.top() + size_in_bytes; |
| 1519 Address new_limit = new_top + GetNextInlineAllocationStepSize(); | 1519 Address new_limit = new_top + GetNextInlineAllocationStepSize() - 1; |
| 1520 allocation_info_.set_limit(Min(new_limit, high)); | 1520 allocation_info_.set_limit(Min(new_limit, high)); |
| 1521 } | 1521 } |
| 1522 DCHECK_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); | 1522 DCHECK_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 | 1525 |
| 1526 bool NewSpace::AddFreshPage() { | 1526 bool NewSpace::AddFreshPage() { |
| 1527 Address top = allocation_info_.top(); | 1527 Address top = allocation_info_.top(); |
| 1528 if (NewSpacePage::IsAtStart(top)) { | 1528 if (NewSpacePage::IsAtStart(top)) { |
| 1529 // The current page is already empty. Don't try to make another. | 1529 // The current page is already empty. Don't try to make another. |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3300 object->ShortPrint(); | 3300 object->ShortPrint(); |
| 3301 PrintF("\n"); | 3301 PrintF("\n"); |
| 3302 } | 3302 } |
| 3303 printf(" --------------------------------------\n"); | 3303 printf(" --------------------------------------\n"); |
| 3304 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3304 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3305 } | 3305 } |
| 3306 | 3306 |
| 3307 #endif // DEBUG | 3307 #endif // DEBUG |
| 3308 } // namespace internal | 3308 } // namespace internal |
| 3309 } // namespace v8 | 3309 } // namespace v8 |
| OLD | NEW |