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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 static Object* AllocateUninitializedFixedArray(int length); | 477 static Object* AllocateUninitializedFixedArray(int length); |
478 | 478 |
479 // Make a copy of src and return it. Returns | 479 // Make a copy of src and return it. Returns |
480 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. | 480 // Failure::RetryAfterGC(requested_bytes, space) if the allocation failed. |
481 static Object* CopyFixedArray(FixedArray* src); | 481 static Object* CopyFixedArray(FixedArray* src); |
482 | 482 |
483 // Allocates a fixed array initialized with the hole values. | 483 // Allocates a fixed array initialized with the hole values. |
484 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 484 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
485 // failed. | 485 // failed. |
486 // Please note this does not perform a garbage collection. | 486 // Please note this does not perform a garbage collection. |
487 static Object* AllocateFixedArrayWithHoles(int length); | 487 static Object* AllocateFixedArrayWithHoles( |
| 488 int length, |
| 489 PretenureFlag pretenure = NOT_TENURED); |
488 | 490 |
489 // AllocateHashTable is identical to AllocateFixedArray except | 491 // AllocateHashTable is identical to AllocateFixedArray except |
490 // that the resulting object has hash_table_map as map. | 492 // that the resulting object has hash_table_map as map. |
491 static Object* AllocateHashTable(int length, | 493 static Object* AllocateHashTable(int length, |
492 PretenureFlag pretenure = NOT_TENURED); | 494 PretenureFlag pretenure = NOT_TENURED); |
493 | 495 |
494 // Allocate a global (but otherwise uninitialized) context. | 496 // Allocate a global (but otherwise uninitialized) context. |
495 static Object* AllocateGlobalContext(); | 497 static Object* AllocateGlobalContext(); |
496 | 498 |
497 // Allocate a function context. | 499 // Allocate a function context. |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 // the string representation of the number. Otherwise return undefined. | 891 // the string representation of the number. Otherwise return undefined. |
890 static Object* GetNumberStringCache(Object* number); | 892 static Object* GetNumberStringCache(Object* number); |
891 | 893 |
892 // Update the cache with a new number-string pair. | 894 // Update the cache with a new number-string pair. |
893 static void SetNumberStringCache(Object* number, String* str); | 895 static void SetNumberStringCache(Object* number, String* str); |
894 | 896 |
895 // Adjusts the amount of registered external memory. | 897 // Adjusts the amount of registered external memory. |
896 // Returns the adjusted value. | 898 // Returns the adjusted value. |
897 static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); | 899 static inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); |
898 | 900 |
899 // Allocate unitialized fixed array (pretenure == NON_TENURE). | 901 // Allocate uninitialized fixed array. |
900 static Object* AllocateRawFixedArray(int length); | 902 static Object* AllocateRawFixedArray(int length); |
| 903 static Object* AllocateRawFixedArray(int length, |
| 904 PretenureFlag pretenure); |
901 | 905 |
902 // True if we have reached the allocation limit in the old generation that | 906 // True if we have reached the allocation limit in the old generation that |
903 // should force the next GC (caused normally) to be a full one. | 907 // should force the next GC (caused normally) to be a full one. |
904 static bool OldGenerationPromotionLimitReached() { | 908 static bool OldGenerationPromotionLimitReached() { |
905 return (PromotedSpaceSize() + PromotedExternalMemorySize()) | 909 return (PromotedSpaceSize() + PromotedExternalMemorySize()) |
906 > old_gen_promotion_limit_; | 910 > old_gen_promotion_limit_; |
907 } | 911 } |
908 | 912 |
909 static intptr_t OldGenerationSpaceAvailable() { | 913 static intptr_t OldGenerationSpaceAvailable() { |
910 return old_gen_allocation_limit_ - | 914 return old_gen_allocation_limit_ - |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1828 | 1832 |
1829 // To speed up scavenge collections new space string are kept | 1833 // To speed up scavenge collections new space string are kept |
1830 // separate from old space strings. | 1834 // separate from old space strings. |
1831 static List<Object*> new_space_strings_; | 1835 static List<Object*> new_space_strings_; |
1832 static List<Object*> old_space_strings_; | 1836 static List<Object*> old_space_strings_; |
1833 }; | 1837 }; |
1834 | 1838 |
1835 } } // namespace v8::internal | 1839 } } // namespace v8::internal |
1836 | 1840 |
1837 #endif // V8_HEAP_H_ | 1841 #endif // V8_HEAP_H_ |
OLD | NEW |