Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 294 bool Heap::OldGenerationAllocationLimitReached() { | 294 bool Heap::OldGenerationAllocationLimitReached() { |
| 295 if (!incremental_marking()->IsStopped()) return false; | 295 if (!incremental_marking()->IsStopped()) return false; |
| 296 return OldGenerationSpaceAvailable() < 0; | 296 return OldGenerationSpaceAvailable() < 0; |
| 297 } | 297 } |
| 298 | 298 |
| 299 | 299 |
| 300 bool Heap::ShouldBePromoted(Address old_address, int object_size) { | 300 bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
| 301 // An object should be promoted if: | 301 // An object should be promoted if: |
| 302 // - the object has survived a scavenge operation or | 302 // - the object has survived a scavenge operation or |
| 303 // - to space is already 25% full. | 303 // - to space is already 25% full. |
| 304 // TODO(gc): Do something about age-mark in paged new-space. | 304 // TODO(gc): Do something about age-mark in paged new-space. |
|
Vyacheslav Egorov (Chromium)
2011/06/14 12:12:46
You can remove this todo.
| |
| 305 return old_address < new_space_.age_mark() | 305 NewSpacePage* page = NewSpacePage::FromAddress(old_address); |
| 306 Address age_mark = new_space_.age_mark(); | |
| 307 bool below_mark = page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) | |
| 308 && (!page->ContainsLimit(age_mark) || old_address < age_mark); | |
| 309 return below_mark | |
| 306 || (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); | 310 || (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); |
|
Vyacheslav Egorov (Chromium)
2011/06/14 12:12:46
move || to the end of the previous line
| |
| 307 } | 311 } |
| 308 | 312 |
| 309 | 313 |
| 310 void Heap::RecordWrite(Address address, int offset) { | 314 void Heap::RecordWrite(Address address, int offset) { |
| 311 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); | 315 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); |
| 312 } | 316 } |
| 313 | 317 |
| 314 | 318 |
| 315 void Heap::RecordWrites(Address address, int start, int len) { | 319 void Heap::RecordWrites(Address address, int start, int len) { |
| 316 if (!InNewSpace(address)) { | 320 if (!InNewSpace(address)) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 | 702 |
| 699 | 703 |
| 700 Heap* _inline_get_heap_() { | 704 Heap* _inline_get_heap_() { |
| 701 return HEAP; | 705 return HEAP; |
| 702 } | 706 } |
| 703 | 707 |
| 704 | 708 |
| 705 } } // namespace v8::internal | 709 } } // namespace v8::internal |
| 706 | 710 |
| 707 #endif // V8_HEAP_INL_H_ | 711 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |