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/v8.h" | 5 #include "src/v8.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/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2421 // a little of this again immediately - see below. | 2421 // a little of this again immediately - see below. |
2422 owner_->Allocate(new_node_size); | 2422 owner_->Allocate(new_node_size); |
2423 | 2423 |
2424 if (owner_->heap()->inline_allocation_disabled()) { | 2424 if (owner_->heap()->inline_allocation_disabled()) { |
2425 // Keep the linear allocation area empty if requested to do so, just | 2425 // Keep the linear allocation area empty if requested to do so, just |
2426 // return area back to the free list instead. | 2426 // return area back to the free list instead. |
2427 owner_->Free(new_node->address() + size_in_bytes, bytes_left); | 2427 owner_->Free(new_node->address() + size_in_bytes, bytes_left); |
2428 DCHECK(owner_->top() == NULL && owner_->limit() == NULL); | 2428 DCHECK(owner_->top() == NULL && owner_->limit() == NULL); |
2429 } else if (bytes_left > kThreshold && | 2429 } else if (bytes_left > kThreshold && |
2430 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && | 2430 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && |
2431 FLAG_incremental_marking_steps) { | 2431 FLAG_incremental_marking) { |
2432 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); | 2432 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); |
2433 // We don't want to give too large linear areas to the allocator while | 2433 // We don't want to give too large linear areas to the allocator while |
2434 // incremental marking is going on, because we won't check again whether | 2434 // incremental marking is going on, because we won't check again whether |
2435 // we want to do another increment until the linear area is used up. | 2435 // we want to do another increment until the linear area is used up. |
2436 owner_->Free(new_node->address() + size_in_bytes + linear_size, | 2436 owner_->Free(new_node->address() + size_in_bytes + linear_size, |
2437 new_node_size - size_in_bytes - linear_size); | 2437 new_node_size - size_in_bytes - linear_size); |
2438 owner_->SetTopAndLimit(new_node->address() + size_in_bytes, | 2438 owner_->SetTopAndLimit(new_node->address() + size_in_bytes, |
2439 new_node->address() + size_in_bytes + linear_size); | 2439 new_node->address() + size_in_bytes + linear_size); |
2440 } else if (bytes_left > 0) { | 2440 } else if (bytes_left > 0) { |
2441 // Normally we give the rest of the node to the allocator as its new | 2441 // Normally we give the rest of the node to the allocator as its new |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3152 object->ShortPrint(); | 3152 object->ShortPrint(); |
3153 PrintF("\n"); | 3153 PrintF("\n"); |
3154 } | 3154 } |
3155 printf(" --------------------------------------\n"); | 3155 printf(" --------------------------------------\n"); |
3156 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3156 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3157 } | 3157 } |
3158 | 3158 |
3159 #endif // DEBUG | 3159 #endif // DEBUG |
3160 } // namespace internal | 3160 } // namespace internal |
3161 } // namespace v8 | 3161 } // namespace v8 |
OLD | NEW |