| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 bool Heap::OldGenerationAllocationLimitReached() { | 285 bool Heap::OldGenerationAllocationLimitReached() { |
| 286 if (!incremental_marking()->IsStopped()) return false; | 286 if (!incremental_marking()->IsStopped()) return false; |
| 287 return OldGenerationSpaceAvailable() < 0; | 287 return OldGenerationSpaceAvailable() < 0; |
| 288 } | 288 } |
| 289 | 289 |
| 290 | 290 |
| 291 bool Heap::ShouldBePromoted(Address old_address, int object_size) { | 291 bool Heap::ShouldBePromoted(Address old_address, int object_size) { |
| 292 // An object should be promoted if: | 292 // An object should be promoted if: |
| 293 // - the object has survived a scavenge operation or | 293 // - the object has survived a scavenge operation or |
| 294 // - to space is already 25% full. | 294 // - to space is already 25% full. |
| 295 // TODO(gc): Do something about age-mark in paged new-space. | 295 NewSpacePage* page = NewSpacePage::FromAddress(old_address); |
| 296 return old_address < new_space_.age_mark() | 296 Address age_mark = new_space_.age_mark(); |
| 297 || (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); | 297 bool below_mark = page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && |
| 298 (!page->ContainsLimit(age_mark) || old_address < age_mark); |
| 299 return below_mark || |
| 300 (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); |
| 298 } | 301 } |
| 299 | 302 |
| 300 | 303 |
| 301 void Heap::RecordWrite(Address address, int offset) { | 304 void Heap::RecordWrite(Address address, int offset) { |
| 302 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); | 305 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); |
| 303 } | 306 } |
| 304 | 307 |
| 305 | 308 |
| 306 void Heap::RecordWrites(Address address, int start, int len) { | 309 void Heap::RecordWrites(Address address, int start, int len) { |
| 307 if (!InNewSpace(address)) { | 310 if (!InNewSpace(address)) { |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 | 692 |
| 690 | 693 |
| 691 Heap* _inline_get_heap_() { | 694 Heap* _inline_get_heap_() { |
| 692 return HEAP; | 695 return HEAP; |
| 693 } | 696 } |
| 694 | 697 |
| 695 | 698 |
| 696 } } // namespace v8::internal | 699 } } // namespace v8::internal |
| 697 | 700 |
| 698 #endif // V8_HEAP_INL_H_ | 701 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |