| 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 return old_address < new_space_.age_mark() | 296 return old_address < new_space_.age_mark() |
| 296 || (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); | 297 || (new_space_.Size() + object_size) >= (new_space_.Capacity() >> 2); |
| 297 } | 298 } |
| 298 | 299 |
| 299 | 300 |
| 300 void Heap::RecordWrite(Address address, int offset) { | 301 void Heap::RecordWrite(Address address, int offset) { |
| 301 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); | 302 if (!InNewSpace(address)) store_buffer_.Mark(address + offset); |
| 302 } | 303 } |
| 303 | 304 |
| 304 | 305 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 | 689 |
| 689 | 690 |
| 690 Heap* _inline_get_heap_() { | 691 Heap* _inline_get_heap_() { |
| 691 return HEAP; | 692 return HEAP; |
| 692 } | 693 } |
| 693 | 694 |
| 694 | 695 |
| 695 } } // namespace v8::internal | 696 } } // namespace v8::internal |
| 696 | 697 |
| 697 #endif // V8_HEAP_INL_H_ | 698 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |