OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 584 |
585 // Returns the maximum available bytes of heaps. | 585 // Returns the maximum available bytes of heaps. |
586 static intptr_t Available() { | 586 static intptr_t Available() { |
587 return capacity_ < size_ ? 0 : capacity_ - size_; | 587 return capacity_ < size_ ? 0 : capacity_ - size_; |
588 } | 588 } |
589 | 589 |
590 // Returns allocated spaces in bytes. | 590 // Returns allocated spaces in bytes. |
591 static intptr_t Size() { return size_; } | 591 static intptr_t Size() { return size_; } |
592 | 592 |
593 // Returns the maximum available executable bytes of heaps. | 593 // Returns the maximum available executable bytes of heaps. |
594 static int AvailableExecutable() { | 594 static intptr_t AvailableExecutable() { |
595 if (capacity_executable_ < size_executable_) return 0; | 595 if (capacity_executable_ < size_executable_) return 0; |
596 return capacity_executable_ - size_executable_; | 596 return capacity_executable_ - size_executable_; |
597 } | 597 } |
598 | 598 |
599 // Returns allocated executable spaces in bytes. | 599 // Returns allocated executable spaces in bytes. |
600 static intptr_t SizeExecutable() { return size_executable_; } | 600 static intptr_t SizeExecutable() { return size_executable_; } |
601 | 601 |
602 // Returns maximum available bytes that the old space can have. | 602 // Returns maximum available bytes that the old space can have. |
603 static intptr_t MaxAvailable() { | 603 static intptr_t MaxAvailable() { |
604 return (Available() / Page::kPageSize) * Page::kObjectAreaSize; | 604 return (Available() / Page::kPageSize) * Page::kObjectAreaSize; |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 | 2269 |
2270 private: | 2270 private: |
2271 LargeObjectChunk* current_; | 2271 LargeObjectChunk* current_; |
2272 HeapObjectCallback size_func_; | 2272 HeapObjectCallback size_func_; |
2273 }; | 2273 }; |
2274 | 2274 |
2275 | 2275 |
2276 } } // namespace v8::internal | 2276 } } // namespace v8::internal |
2277 | 2277 |
2278 #endif // V8_SPACES_H_ | 2278 #endif // V8_SPACES_H_ |
OLD | NEW |