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/v8.h" | 5 #include "src/v8.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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 DCHECK(start_of_current_page_ != store_buffer_->Top()); | 1450 DCHECK(start_of_current_page_ != store_buffer_->Top()); |
1451 store_buffer_->SetTop(start_of_current_page_); | 1451 store_buffer_->SetTop(start_of_current_page_); |
1452 } | 1452 } |
1453 } else { | 1453 } else { |
1454 UNREACHABLE(); | 1454 UNREACHABLE(); |
1455 } | 1455 } |
1456 } | 1456 } |
1457 | 1457 |
1458 | 1458 |
1459 void PromotionQueue::Initialize() { | 1459 void PromotionQueue::Initialize() { |
1460 // Assumes that a NewSpacePage exactly fits a number of promotion queue | 1460 // The last to-space page may be used for promotion queue. On promotion |
1461 // entries (where each is a pair of intptr_t). This allows us to simplify | 1461 // conflict, we use the emergency stack. |
1462 // the test fpr when to switch pages. | |
1463 DCHECK((Page::kPageSize - MemoryChunk::kBodyOffset) % (2 * kPointerSize) == | 1462 DCHECK((Page::kPageSize - MemoryChunk::kBodyOffset) % (2 * kPointerSize) == |
1464 0); | 1463 0); |
1465 limit_ = reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceStart()); | |
1466 front_ = rear_ = | 1464 front_ = rear_ = |
1467 reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd()); | 1465 reinterpret_cast<intptr_t*>(heap_->new_space()->ToSpaceEnd()); |
| 1466 limit_ = reinterpret_cast<intptr_t*>( |
| 1467 Page::FromAllocationTop(reinterpret_cast<Address>(rear_))->area_start()); |
1468 emergency_stack_ = NULL; | 1468 emergency_stack_ = NULL; |
1469 } | 1469 } |
1470 | 1470 |
1471 | 1471 |
1472 void PromotionQueue::RelocateQueueHead() { | 1472 void PromotionQueue::RelocateQueueHead() { |
1473 DCHECK(emergency_stack_ == NULL); | 1473 DCHECK(emergency_stack_ == NULL); |
1474 | 1474 |
1475 Page* p = Page::FromAllocationTop(reinterpret_cast<Address>(rear_)); | 1475 Page* p = Page::FromAllocationTop(reinterpret_cast<Address>(rear_)); |
1476 intptr_t* head_start = rear_; | 1476 intptr_t* head_start = rear_; |
1477 intptr_t* head_end = Min(front_, reinterpret_cast<intptr_t*>(p->area_end())); | 1477 intptr_t* head_end = Min(front_, reinterpret_cast<intptr_t*>(p->area_end())); |
(...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6532 static_cast<int>(object_sizes_last_time_[index])); | 6532 static_cast<int>(object_sizes_last_time_[index])); |
6533 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6533 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6534 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6534 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6535 | 6535 |
6536 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6536 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6537 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6537 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6538 ClearObjectStats(); | 6538 ClearObjectStats(); |
6539 } | 6539 } |
6540 } | 6540 } |
6541 } // namespace v8::internal | 6541 } // namespace v8::internal |
OLD | NEW |