| 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 #ifndef V8_HEAP_INL_H_ | 5 #ifndef V8_HEAP_INL_H_ |
| 6 #define V8_HEAP_INL_H_ | 6 #define V8_HEAP_INL_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 381 } |
| 382 | 382 |
| 383 | 383 |
| 384 bool Heap::OldGenerationAllocationLimitReached() { | 384 bool Heap::OldGenerationAllocationLimitReached() { |
| 385 if (!incremental_marking()->IsStopped()) return false; | 385 if (!incremental_marking()->IsStopped()) return false; |
| 386 return OldGenerationSpaceAvailable() < 0; | 386 return OldGenerationSpaceAvailable() < 0; |
| 387 } | 387 } |
| 388 | 388 |
| 389 | 389 |
| 390 bool Heap::ShouldBePromoted(Address old_address, int object_size) { | 390 bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
| 391 // An object should be promoted if the object has survived a | |
| 392 // scavenge operation. | |
| 393 NewSpacePage* page = NewSpacePage::FromAddress(old_address); | 391 NewSpacePage* page = NewSpacePage::FromAddress(old_address); |
| 394 Address age_mark = new_space_.age_mark(); | 392 Address age_mark = new_space_.age_mark(); |
| 395 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && | 393 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && |
| 396 (!page->ContainsLimit(age_mark) || old_address < age_mark); | 394 (!page->ContainsLimit(age_mark) || old_address < age_mark); |
| 397 } | 395 } |
| 398 | 396 |
| 399 | 397 |
| 400 void Heap::RecordWrite(Address address, int offset) { | 398 void Heap::RecordWrite(Address address, int offset) { |
| 401 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); | 399 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); |
| 402 } | 400 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 805 |
| 808 | 806 |
| 809 double GCTracer::SizeOfHeapObjects() { | 807 double GCTracer::SizeOfHeapObjects() { |
| 810 return (static_cast<double>(heap_->SizeOfObjects())) / MB; | 808 return (static_cast<double>(heap_->SizeOfObjects())) / MB; |
| 811 } | 809 } |
| 812 | 810 |
| 813 | 811 |
| 814 } } // namespace v8::internal | 812 } } // namespace v8::internal |
| 815 | 813 |
| 816 #endif // V8_HEAP_INL_H_ | 814 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |