| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 V(proto_string, "__proto__") \ | 202 V(proto_string, "__proto__") \ |
| 203 V(arguments_string, "arguments") \ | 203 V(arguments_string, "arguments") \ |
| 204 V(Arguments_string, "Arguments") \ | 204 V(Arguments_string, "Arguments") \ |
| 205 V(call_string, "call") \ | 205 V(call_string, "call") \ |
| 206 V(apply_string, "apply") \ | 206 V(apply_string, "apply") \ |
| 207 V(caller_string, "caller") \ | 207 V(caller_string, "caller") \ |
| 208 V(boolean_string, "boolean") \ | 208 V(boolean_string, "boolean") \ |
| 209 V(Boolean_string, "Boolean") \ | 209 V(Boolean_string, "Boolean") \ |
| 210 V(callee_string, "callee") \ | 210 V(callee_string, "callee") \ |
| 211 V(constructor_string, "constructor") \ | 211 V(constructor_string, "constructor") \ |
| 212 V(result_string, ".result") \ | 212 V(dot_result_string, ".result") \ |
| 213 V(dot_for_string, ".for.") \ | 213 V(dot_for_string, ".for.") \ |
| 214 V(dot_iterator_string, ".iterator") \ |
| 215 V(dot_generator_object_string, ".generator_object") \ |
| 214 V(eval_string, "eval") \ | 216 V(eval_string, "eval") \ |
| 215 V(empty_string, "") \ | 217 V(empty_string, "") \ |
| 216 V(function_string, "function") \ | 218 V(function_string, "function") \ |
| 217 V(length_string, "length") \ | 219 V(length_string, "length") \ |
| 218 V(module_string, "module") \ | 220 V(module_string, "module") \ |
| 219 V(name_string, "name") \ | 221 V(name_string, "name") \ |
| 220 V(native_string, "native") \ | 222 V(native_string, "native") \ |
| 221 V(null_string, "null") \ | 223 V(null_string, "null") \ |
| 222 V(number_string, "number") \ | 224 V(number_string, "number") \ |
| 223 V(Number_string, "Number") \ | 225 V(Number_string, "Number") \ |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 528 |
| 527 // Returns the amount of memory currently committed for the heap. | 529 // Returns the amount of memory currently committed for the heap. |
| 528 intptr_t CommittedMemory(); | 530 intptr_t CommittedMemory(); |
| 529 | 531 |
| 530 // Returns the amount of executable memory currently committed for the heap. | 532 // Returns the amount of executable memory currently committed for the heap. |
| 531 intptr_t CommittedMemoryExecutable(); | 533 intptr_t CommittedMemoryExecutable(); |
| 532 | 534 |
| 533 // Returns the amount of phyical memory currently committed for the heap. | 535 // Returns the amount of phyical memory currently committed for the heap. |
| 534 size_t CommittedPhysicalMemory(); | 536 size_t CommittedPhysicalMemory(); |
| 535 | 537 |
| 538 // Returns the maximum amount of memory ever committed for the heap. |
| 539 intptr_t MaximumCommittedMemory() { return maximum_committed_; } |
| 540 |
| 541 // Updates the maximum committed memory for the heap. Should be called |
| 542 // whenever a space grows. |
| 543 void UpdateMaximumCommitted(); |
| 544 |
| 536 // Returns the available bytes in space w/o growing. | 545 // Returns the available bytes in space w/o growing. |
| 537 // Heap doesn't guarantee that it can allocate an object that requires | 546 // Heap doesn't guarantee that it can allocate an object that requires |
| 538 // all available bytes. Check MaxHeapObjectSize() instead. | 547 // all available bytes. Check MaxHeapObjectSize() instead. |
| 539 intptr_t Available(); | 548 intptr_t Available(); |
| 540 | 549 |
| 541 // Returns of size of all objects residing in the heap. | 550 // Returns of size of all objects residing in the heap. |
| 542 intptr_t SizeOfObjects(); | 551 intptr_t SizeOfObjects(); |
| 543 | 552 |
| 544 // Return the starting address and a mask for the new space. And-masking an | 553 // Return the starting address and a mask for the new space. And-masking an |
| 545 // address with the mask will result in the start address of the new space | 554 // address with the mask will result in the start address of the new space |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 // failed. | 626 // failed. |
| 618 // Please note this does not perform a garbage collection. | 627 // Please note this does not perform a garbage collection. |
| 619 MUST_USE_RESULT MaybeObject* AllocateJSObject( | 628 MUST_USE_RESULT MaybeObject* AllocateJSObject( |
| 620 JSFunction* constructor, | 629 JSFunction* constructor, |
| 621 PretenureFlag pretenure = NOT_TENURED); | 630 PretenureFlag pretenure = NOT_TENURED); |
| 622 | 631 |
| 623 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( | 632 MUST_USE_RESULT MaybeObject* AllocateJSObjectWithAllocationSite( |
| 624 JSFunction* constructor, | 633 JSFunction* constructor, |
| 625 Handle<AllocationSite> allocation_site); | 634 Handle<AllocationSite> allocation_site); |
| 626 | 635 |
| 627 MUST_USE_RESULT MaybeObject* AllocateJSGeneratorObject( | |
| 628 JSFunction* function); | |
| 629 | |
| 630 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, | 636 MUST_USE_RESULT MaybeObject* AllocateJSModule(Context* context, |
| 631 ScopeInfo* scope_info); | 637 ScopeInfo* scope_info); |
| 632 | 638 |
| 633 // Allocate a JSArray with no elements | 639 // Allocate a JSArray with no elements |
| 634 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( | 640 MUST_USE_RESULT MaybeObject* AllocateEmptyJSArray( |
| 635 ElementsKind elements_kind, | 641 ElementsKind elements_kind, |
| 636 PretenureFlag pretenure = NOT_TENURED) { | 642 PretenureFlag pretenure = NOT_TENURED) { |
| 637 return AllocateJSArrayAndStorage(elements_kind, 0, 0, | 643 return AllocateJSArrayAndStorage(elements_kind, 0, 0, |
| 638 DONT_INITIALIZE_ARRAY_ELEMENTS, | 644 DONT_INITIALIZE_ARRAY_ELEMENTS, |
| 639 pretenure); | 645 pretenure); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 661 int length, | 667 int length, |
| 662 PretenureFlag pretenure = NOT_TENURED); | 668 PretenureFlag pretenure = NOT_TENURED); |
| 663 | 669 |
| 664 // Returns a deep copy of the JavaScript object. | 670 // Returns a deep copy of the JavaScript object. |
| 665 // Properties and elements are copied too. | 671 // Properties and elements are copied too. |
| 666 // Returns failure if allocation failed. | 672 // Returns failure if allocation failed. |
| 667 // Optionally takes an AllocationSite to be appended in an AllocationMemento. | 673 // Optionally takes an AllocationSite to be appended in an AllocationMemento. |
| 668 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source, | 674 MUST_USE_RESULT MaybeObject* CopyJSObject(JSObject* source, |
| 669 AllocationSite* site = NULL); | 675 AllocationSite* site = NULL); |
| 670 | 676 |
| 671 // Allocates the function prototype. | |
| 672 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | |
| 673 // failed. | |
| 674 // Please note this does not perform a garbage collection. | |
| 675 MUST_USE_RESULT MaybeObject* AllocateFunctionPrototype(JSFunction* function); | |
| 676 | |
| 677 // Allocates a JS ArrayBuffer object. | 677 // Allocates a JS ArrayBuffer object. |
| 678 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 678 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 679 // failed. | 679 // failed. |
| 680 // Please note this does not perform a garbage collection. | 680 // Please note this does not perform a garbage collection. |
| 681 MUST_USE_RESULT MaybeObject* AllocateJSArrayBuffer(); | 681 MUST_USE_RESULT MaybeObject* AllocateJSArrayBuffer(); |
| 682 | 682 |
| 683 // Allocates a Harmony proxy or function proxy. | 683 // Allocates a Harmony proxy or function proxy. |
| 684 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 684 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 685 // failed. | 685 // failed. |
| 686 // Please note this does not perform a garbage collection. | 686 // Please note this does not perform a garbage collection. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 // Please note this function does not perform a garbage collection. | 733 // Please note this function does not perform a garbage collection. |
| 734 MUST_USE_RESULT MaybeObject* AllocateMap( | 734 MUST_USE_RESULT MaybeObject* AllocateMap( |
| 735 InstanceType instance_type, | 735 InstanceType instance_type, |
| 736 int instance_size, | 736 int instance_size, |
| 737 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); | 737 ElementsKind elements_kind = TERMINAL_FAST_ELEMENTS_KIND); |
| 738 | 738 |
| 739 // Allocates a partial map for bootstrapping. | 739 // Allocates a partial map for bootstrapping. |
| 740 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type, | 740 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type, |
| 741 int instance_size); | 741 int instance_size); |
| 742 | 742 |
| 743 // Allocate a map for the specified function | |
| 744 MUST_USE_RESULT MaybeObject* AllocateInitialMap(JSFunction* fun); | |
| 745 | |
| 746 // Allocates an empty code cache. | 743 // Allocates an empty code cache. |
| 747 MUST_USE_RESULT MaybeObject* AllocateCodeCache(); | 744 MUST_USE_RESULT MaybeObject* AllocateCodeCache(); |
| 748 | 745 |
| 749 // Allocates a serialized scope info. | 746 // Allocates a serialized scope info. |
| 750 MUST_USE_RESULT MaybeObject* AllocateScopeInfo(int length); | 747 MUST_USE_RESULT MaybeObject* AllocateScopeInfo(int length); |
| 751 | 748 |
| 752 // Allocates an External object for v8's external API. | 749 // Allocates an External object for v8's external API. |
| 753 MUST_USE_RESULT MaybeObject* AllocateExternal(void* value); | 750 MUST_USE_RESULT MaybeObject* AllocateExternal(void* value); |
| 754 | 751 |
| 755 // Allocates an empty PolymorphicCodeCache. | 752 // Allocates an empty PolymorphicCodeCache. |
| 756 MUST_USE_RESULT MaybeObject* AllocatePolymorphicCodeCache(); | 753 MUST_USE_RESULT MaybeObject* AllocatePolymorphicCodeCache(); |
| 757 | 754 |
| 758 // Allocates a pre-tenured empty AccessorPair. | 755 // Allocates a pre-tenured empty AccessorPair. |
| 759 MUST_USE_RESULT MaybeObject* AllocateAccessorPair(); | 756 MUST_USE_RESULT MaybeObject* AllocateAccessorPair(); |
| 760 | 757 |
| 761 // Allocates an empty TypeFeedbackInfo. | 758 // Allocates an empty TypeFeedbackInfo. |
| 762 MUST_USE_RESULT MaybeObject* AllocateTypeFeedbackInfo(); | 759 MUST_USE_RESULT MaybeObject* AllocateTypeFeedbackInfo(); |
| 763 | 760 |
| 764 // Allocates an AliasedArgumentsEntry. | 761 // Allocates an AliasedArgumentsEntry. |
| 765 MUST_USE_RESULT MaybeObject* AllocateAliasedArgumentsEntry(int slot); | 762 MUST_USE_RESULT MaybeObject* AllocateAliasedArgumentsEntry(int slot); |
| 766 | 763 |
| 767 // Clear the Instanceof cache (used when a prototype changes). | 764 // Clear the Instanceof cache (used when a prototype changes). |
| 768 inline void ClearInstanceofCache(); | 765 inline void ClearInstanceofCache(); |
| 769 | 766 |
| 767 // Iterates the whole code space to clear all ICs of the given kind. |
| 768 void ClearAllICsByKind(Code::Kind kind); |
| 769 |
| 770 // For use during bootup. | 770 // For use during bootup. |
| 771 void RepairFreeListsAfterBoot(); | 771 void RepairFreeListsAfterBoot(); |
| 772 | 772 |
| 773 // Allocates and fully initializes a String. There are two String | 773 // Allocates and fully initializes a String. There are two String |
| 774 // encodings: ASCII and two byte. One should choose between the three string | 774 // encodings: ASCII and two byte. One should choose between the three string |
| 775 // allocation functions based on the encoding of the string buffer used to | 775 // allocation functions based on the encoding of the string buffer used to |
| 776 // initialized the string. | 776 // initialized the string. |
| 777 // - ...FromAscii initializes the string from a buffer that is ASCII | 777 // - ...FromAscii initializes the string from a buffer that is ASCII |
| 778 // encoded (it does not check that the buffer is ASCII encoded) and the | 778 // encoded (it does not check that the buffer is ASCII encoded) and the |
| 779 // result will be ASCII encoded. | 779 // result will be ASCII encoded. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 int length, | 874 int length, |
| 875 ExternalArrayType array_type, | 875 ExternalArrayType array_type, |
| 876 void* external_pointer, | 876 void* external_pointer, |
| 877 PretenureFlag pretenure); | 877 PretenureFlag pretenure); |
| 878 | 878 |
| 879 // Allocate a symbol in old space. | 879 // Allocate a symbol in old space. |
| 880 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 880 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 881 // failed. | 881 // failed. |
| 882 // Please note this does not perform a garbage collection. | 882 // Please note this does not perform a garbage collection. |
| 883 MUST_USE_RESULT MaybeObject* AllocateSymbol(); | 883 MUST_USE_RESULT MaybeObject* AllocateSymbol(); |
| 884 MUST_USE_RESULT MaybeObject* AllocatePrivateSymbol(); |
| 884 | 885 |
| 885 // Allocate a tenured AllocationSite. It's payload is null | 886 // Allocate a tenured AllocationSite. It's payload is null |
| 886 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); | 887 MUST_USE_RESULT MaybeObject* AllocateAllocationSite(); |
| 887 | 888 |
| 888 // Allocates a fixed array initialized with undefined values | 889 // Allocates a fixed array initialized with undefined values |
| 889 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation | 890 // Returns Failure::RetryAfterGC(requested_bytes, space) if the allocation |
| 890 // failed. | 891 // failed. |
| 891 // Please note this does not perform a garbage collection. | 892 // Please note this does not perform a garbage collection. |
| 892 MUST_USE_RESULT MaybeObject* AllocateFixedArray( | 893 MUST_USE_RESULT MaybeObject* AllocateFixedArray( |
| 893 int length, | 894 int length, |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 | 1806 |
| 1806 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1807 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
| 1807 // stored in a contiguous linear buffer. Stats groups are stored one after | 1808 // stored in a contiguous linear buffer. Stats groups are stored one after |
| 1808 // another. | 1809 // another. |
| 1809 enum { | 1810 enum { |
| 1810 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1811 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
| 1811 FIRST_FIXED_ARRAY_SUB_TYPE = | 1812 FIRST_FIXED_ARRAY_SUB_TYPE = |
| 1812 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, | 1813 FIRST_CODE_KIND_SUB_TYPE + Code::NUMBER_OF_KINDS, |
| 1813 FIRST_CODE_AGE_SUB_TYPE = | 1814 FIRST_CODE_AGE_SUB_TYPE = |
| 1814 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1, | 1815 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1, |
| 1815 OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kLastCodeAge + 1 | 1816 OBJECT_STATS_COUNT = FIRST_CODE_AGE_SUB_TYPE + Code::kCodeAgeCount + 1 |
| 1816 }; | 1817 }; |
| 1817 | 1818 |
| 1818 void RecordObjectStats(InstanceType type, size_t size) { | 1819 void RecordObjectStats(InstanceType type, size_t size) { |
| 1819 ASSERT(type <= LAST_TYPE); | 1820 ASSERT(type <= LAST_TYPE); |
| 1820 object_counts_[type]++; | 1821 object_counts_[type]++; |
| 1821 object_sizes_[type] += size; | 1822 object_sizes_[type] += size; |
| 1822 } | 1823 } |
| 1823 | 1824 |
| 1824 void RecordCodeSubTypeStats(int code_sub_type, int code_age, size_t size) { | 1825 void RecordCodeSubTypeStats(int code_sub_type, int code_age, size_t size) { |
| 1825 ASSERT(code_sub_type < Code::NUMBER_OF_KINDS); | 1826 int code_sub_type_index = FIRST_CODE_KIND_SUB_TYPE + code_sub_type; |
| 1826 ASSERT(code_age < Code::kLastCodeAge); | 1827 int code_age_index = |
| 1827 object_counts_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type]++; | 1828 FIRST_CODE_AGE_SUB_TYPE + code_age - Code::kFirstCodeAge; |
| 1828 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + code_sub_type] += size; | 1829 ASSERT(code_sub_type_index >= FIRST_CODE_KIND_SUB_TYPE && |
| 1829 object_counts_[FIRST_CODE_AGE_SUB_TYPE + code_age]++; | 1830 code_sub_type_index < FIRST_CODE_AGE_SUB_TYPE); |
| 1830 object_sizes_[FIRST_CODE_AGE_SUB_TYPE + code_age] += size; | 1831 ASSERT(code_age_index >= FIRST_CODE_AGE_SUB_TYPE && |
| 1832 code_age_index < OBJECT_STATS_COUNT); |
| 1833 object_counts_[code_sub_type_index]++; |
| 1834 object_sizes_[code_sub_type_index] += size; |
| 1835 object_counts_[code_age_index]++; |
| 1836 object_sizes_[code_age_index] += size; |
| 1831 } | 1837 } |
| 1832 | 1838 |
| 1833 void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) { | 1839 void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) { |
| 1834 ASSERT(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); | 1840 ASSERT(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); |
| 1835 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++; | 1841 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++; |
| 1836 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size; | 1842 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size; |
| 1837 } | 1843 } |
| 1838 | 1844 |
| 1839 void CheckpointObjectStats(); | 1845 void CheckpointObjectStats(); |
| 1840 | 1846 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1881 Isolate* isolate_; | 1887 Isolate* isolate_; |
| 1882 | 1888 |
| 1883 Object* roots_[kRootListLength]; | 1889 Object* roots_[kRootListLength]; |
| 1884 | 1890 |
| 1885 intptr_t code_range_size_; | 1891 intptr_t code_range_size_; |
| 1886 int reserved_semispace_size_; | 1892 int reserved_semispace_size_; |
| 1887 int max_semispace_size_; | 1893 int max_semispace_size_; |
| 1888 int initial_semispace_size_; | 1894 int initial_semispace_size_; |
| 1889 intptr_t max_old_generation_size_; | 1895 intptr_t max_old_generation_size_; |
| 1890 intptr_t max_executable_size_; | 1896 intptr_t max_executable_size_; |
| 1897 intptr_t maximum_committed_; |
| 1891 | 1898 |
| 1892 // For keeping track of how much data has survived | 1899 // For keeping track of how much data has survived |
| 1893 // scavenge since last new space expansion. | 1900 // scavenge since last new space expansion. |
| 1894 int survived_since_last_expansion_; | 1901 int survived_since_last_expansion_; |
| 1895 | 1902 |
| 1896 // For keeping track on when to flush RegExp code. | 1903 // For keeping track on when to flush RegExp code. |
| 1897 int sweep_generation_; | 1904 int sweep_generation_; |
| 1898 | 1905 |
| 1899 int always_allocate_scope_depth_; | 1906 int always_allocate_scope_depth_; |
| 1900 int linear_allocation_scope_depth_; | 1907 int linear_allocation_scope_depth_; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 // size, pretenuring decision, and preferred old-space. | 2091 // size, pretenuring decision, and preferred old-space. |
| 2085 static AllocationSpace SelectSpace(int object_size, | 2092 static AllocationSpace SelectSpace(int object_size, |
| 2086 AllocationSpace preferred_old_space, | 2093 AllocationSpace preferred_old_space, |
| 2087 PretenureFlag pretenure) { | 2094 PretenureFlag pretenure) { |
| 2088 ASSERT(preferred_old_space == OLD_POINTER_SPACE || | 2095 ASSERT(preferred_old_space == OLD_POINTER_SPACE || |
| 2089 preferred_old_space == OLD_DATA_SPACE); | 2096 preferred_old_space == OLD_DATA_SPACE); |
| 2090 if (object_size > Page::kMaxNonCodeHeapObjectSize) return LO_SPACE; | 2097 if (object_size > Page::kMaxNonCodeHeapObjectSize) return LO_SPACE; |
| 2091 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; | 2098 return (pretenure == TENURED) ? preferred_old_space : NEW_SPACE; |
| 2092 } | 2099 } |
| 2093 | 2100 |
| 2094 // Allocate an uninitialized object in map space. The behavior is identical | |
| 2095 // to Heap::AllocateRaw(size_in_bytes, MAP_SPACE), except that (a) it doesn't | |
| 2096 // have to test the allocation space argument and (b) can reduce code size | |
| 2097 // (since both AllocateRaw and AllocateRawMap are inlined). | |
| 2098 MUST_USE_RESULT inline MaybeObject* AllocateRawMap(); | |
| 2099 | |
| 2100 // Allocate an uninitialized object in the simple cell space. | |
| 2101 MUST_USE_RESULT inline MaybeObject* AllocateRawCell(); | |
| 2102 | |
| 2103 // Allocate an uninitialized object in the global property cell space. | |
| 2104 MUST_USE_RESULT inline MaybeObject* AllocateRawPropertyCell(); | |
| 2105 | |
| 2106 // Allocate an uninitialized fixed array. | 2101 // Allocate an uninitialized fixed array. |
| 2107 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray( | 2102 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray( |
| 2108 int length, PretenureFlag pretenure); | 2103 int length, PretenureFlag pretenure); |
| 2109 | 2104 |
| 2110 // Allocate an uninitialized fixed double array. | 2105 // Allocate an uninitialized fixed double array. |
| 2111 MUST_USE_RESULT MaybeObject* AllocateRawFixedDoubleArray( | 2106 MUST_USE_RESULT MaybeObject* AllocateRawFixedDoubleArray( |
| 2112 int length, PretenureFlag pretenure); | 2107 int length, PretenureFlag pretenure); |
| 2113 | 2108 |
| 2114 // Allocate an initialized fixed array with the given filler value. | 2109 // Allocate an initialized fixed array with the given filler value. |
| 2115 MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithFiller( | 2110 MUST_USE_RESULT MaybeObject* AllocateFixedArrayWithFiller( |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 class AlwaysAllocateScope { | 2469 class AlwaysAllocateScope { |
| 2475 public: | 2470 public: |
| 2476 inline AlwaysAllocateScope(); | 2471 inline AlwaysAllocateScope(); |
| 2477 inline ~AlwaysAllocateScope(); | 2472 inline ~AlwaysAllocateScope(); |
| 2478 | 2473 |
| 2479 private: | 2474 private: |
| 2480 // Implicitly disable artificial allocation failures. | 2475 // Implicitly disable artificial allocation failures. |
| 2481 DisallowAllocationFailure disallow_allocation_failure_; | 2476 DisallowAllocationFailure disallow_allocation_failure_; |
| 2482 }; | 2477 }; |
| 2483 | 2478 |
| 2479 |
| 2484 #ifdef VERIFY_HEAP | 2480 #ifdef VERIFY_HEAP |
| 2485 class NoWeakObjectVerificationScope { | 2481 class NoWeakObjectVerificationScope { |
| 2486 public: | 2482 public: |
| 2487 inline NoWeakObjectVerificationScope(); | 2483 inline NoWeakObjectVerificationScope(); |
| 2488 inline ~NoWeakObjectVerificationScope(); | 2484 inline ~NoWeakObjectVerificationScope(); |
| 2489 }; | 2485 }; |
| 2490 #endif | 2486 #endif |
| 2491 | 2487 |
| 2492 | 2488 |
| 2493 // Visitor class to verify interior pointers in spaces that do not contain | 2489 // Visitor class to verify interior pointers in spaces that do not contain |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3082 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 3078 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 3083 | 3079 |
| 3084 private: | 3080 private: |
| 3085 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 3081 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 3086 }; | 3082 }; |
| 3087 #endif // DEBUG | 3083 #endif // DEBUG |
| 3088 | 3084 |
| 3089 } } // namespace v8::internal | 3085 } } // namespace v8::internal |
| 3090 | 3086 |
| 3091 #endif // V8_HEAP_H_ | 3087 #endif // V8_HEAP_H_ |
| OLD | NEW |