OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_H_ | 5 #ifndef V8_HEAP_H_ |
6 #define V8_HEAP_H_ | 6 #define V8_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "allocation.h" | 10 #include "allocation.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 // Allocates a partial map for bootstrapping. | 732 // Allocates a partial map for bootstrapping. |
733 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type, | 733 MUST_USE_RESULT MaybeObject* AllocatePartialMap(InstanceType instance_type, |
734 int instance_size); | 734 int instance_size); |
735 | 735 |
736 // Allocate a block of memory in the given space (filled with a filler). | 736 // Allocate a block of memory in the given space (filled with a filler). |
737 // Used as a fall-back for generated code when the space is full. | 737 // Used as a fall-back for generated code when the space is full. |
738 MUST_USE_RESULT MaybeObject* AllocateFillerObject(int size, | 738 MUST_USE_RESULT MaybeObject* AllocateFillerObject(int size, |
739 bool double_align, | 739 bool double_align, |
740 AllocationSpace space); | 740 AllocationSpace space); |
741 | 741 |
742 // Allocates an empty PolymorphicCodeCache. | |
743 MUST_USE_RESULT MaybeObject* AllocatePolymorphicCodeCache(); | |
744 | |
745 // Clear the Instanceof cache (used when a prototype changes). | 742 // Clear the Instanceof cache (used when a prototype changes). |
746 inline void ClearInstanceofCache(); | 743 inline void ClearInstanceofCache(); |
747 | 744 |
748 // Iterates the whole code space to clear all ICs of the given kind. | 745 // Iterates the whole code space to clear all ICs of the given kind. |
749 void ClearAllICsByKind(Code::Kind kind); | 746 void ClearAllICsByKind(Code::Kind kind); |
750 | 747 |
751 // For use during bootup. | 748 // For use during bootup. |
752 void RepairFreeListsAfterBoot(); | 749 void RepairFreeListsAfterBoot(); |
753 | 750 |
754 // Allocates and fully initializes a String. There are two String | 751 // Allocates and fully initializes a String. There are two String |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 HeapObject* object, ScratchpadSlotMode mode); | 1271 HeapObject* object, ScratchpadSlotMode mode); |
1275 | 1272 |
1276 // Support for partial snapshots. After calling this we have a linear | 1273 // Support for partial snapshots. After calling this we have a linear |
1277 // space to write objects in each space. | 1274 // space to write objects in each space. |
1278 void ReserveSpace(int *sizes, Address* addresses); | 1275 void ReserveSpace(int *sizes, Address* addresses); |
1279 | 1276 |
1280 // | 1277 // |
1281 // Support for the API. | 1278 // Support for the API. |
1282 // | 1279 // |
1283 | 1280 |
1284 bool CreateApiObjects(); | 1281 void CreateApiObjects(); |
1285 | 1282 |
1286 // Adjusts the amount of registered external memory. | 1283 // Adjusts the amount of registered external memory. |
1287 // Returns the adjusted value. | 1284 // Returns the adjusted value. |
1288 inline int64_t AdjustAmountOfExternalAllocatedMemory( | 1285 inline int64_t AdjustAmountOfExternalAllocatedMemory( |
1289 int64_t change_in_bytes); | 1286 int64_t change_in_bytes); |
1290 | 1287 |
1291 // This is only needed for testing high promotion mode. | 1288 // This is only needed for testing high promotion mode. |
1292 void SetNewSpaceHighPromotionModeActive(bool mode) { | 1289 void SetNewSpaceHighPromotionModeActive(bool mode) { |
1293 new_space_high_promotion_mode_active_ = mode; | 1290 new_space_high_promotion_mode_active_ = mode; |
1294 } | 1291 } |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 int length, PretenureFlag pretenure); | 1951 int length, PretenureFlag pretenure); |
1955 | 1952 |
1956 // Initializes a JSObject based on its map. | 1953 // Initializes a JSObject based on its map. |
1957 void InitializeJSObjectFromMap(JSObject* obj, | 1954 void InitializeJSObjectFromMap(JSObject* obj, |
1958 FixedArray* properties, | 1955 FixedArray* properties, |
1959 Map* map); | 1956 Map* map); |
1960 void InitializeAllocationMemento(AllocationMemento* memento, | 1957 void InitializeAllocationMemento(AllocationMemento* memento, |
1961 AllocationSite* allocation_site); | 1958 AllocationSite* allocation_site); |
1962 | 1959 |
1963 bool CreateInitialMaps(); | 1960 bool CreateInitialMaps(); |
1964 bool CreateInitialObjects(); | 1961 void CreateInitialObjects(); |
1965 | 1962 |
1966 // These five Create*EntryStub functions are here and forced to not be inlined | 1963 // These five Create*EntryStub functions are here and forced to not be inlined |
1967 // because of a gcc-4.4 bug that assigns wrong vtable entries. | 1964 // because of a gcc-4.4 bug that assigns wrong vtable entries. |
1968 NO_INLINE(void CreateJSEntryStub()); | 1965 NO_INLINE(void CreateJSEntryStub()); |
1969 NO_INLINE(void CreateJSConstructEntryStub()); | 1966 NO_INLINE(void CreateJSConstructEntryStub()); |
1970 | 1967 |
1971 void CreateFixedStubs(); | 1968 void CreateFixedStubs(); |
1972 | 1969 |
1973 // Allocate empty fixed array. | 1970 // Allocate empty fixed array. |
1974 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); | 1971 MUST_USE_RESULT MaybeObject* AllocateEmptyFixedArray(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 void ReportStatisticsAfterGC(); | 2035 void ReportStatisticsAfterGC(); |
2039 | 2036 |
2040 // Slow part of scavenge object. | 2037 // Slow part of scavenge object. |
2041 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); | 2038 static void ScavengeObjectSlow(HeapObject** p, HeapObject* object); |
2042 | 2039 |
2043 // Total RegExp code ever generated | 2040 // Total RegExp code ever generated |
2044 double total_regexp_code_generated_; | 2041 double total_regexp_code_generated_; |
2045 | 2042 |
2046 GCTracer* tracer_; | 2043 GCTracer* tracer_; |
2047 | 2044 |
2048 // Allocates a small number to string cache. | |
2049 MUST_USE_RESULT MaybeObject* AllocateInitialNumberStringCache(); | |
2050 // Creates and installs the full-sized number string cache. | 2045 // Creates and installs the full-sized number string cache. |
2051 int FullSizeNumberStringCacheLength(); | 2046 int FullSizeNumberStringCacheLength(); |
2052 // Flush the number to string cache. | 2047 // Flush the number to string cache. |
2053 void FlushNumberStringCache(); | 2048 void FlushNumberStringCache(); |
2054 | 2049 |
2055 // Allocates a fixed-size allocation sites scratchpad. | |
2056 MUST_USE_RESULT MaybeObject* AllocateAllocationSitesScratchpad(); | |
2057 | |
2058 // Sets used allocation sites entries to undefined. | 2050 // Sets used allocation sites entries to undefined. |
2059 void FlushAllocationSitesScratchpad(); | 2051 void FlushAllocationSitesScratchpad(); |
2060 | 2052 |
2061 // Initializes the allocation sites scratchpad with undefined values. | 2053 // Initializes the allocation sites scratchpad with undefined values. |
2062 void InitializeAllocationSitesScratchpad(); | 2054 void InitializeAllocationSitesScratchpad(); |
2063 | 2055 |
2064 // Adds an allocation site to the scratchpad if there is space left. | 2056 // Adds an allocation site to the scratchpad if there is space left. |
2065 void AddAllocationSiteToScratchpad(AllocationSite* site, | 2057 void AddAllocationSiteToScratchpad(AllocationSite* site, |
2066 ScratchpadSlotMode mode); | 2058 ScratchpadSlotMode mode); |
2067 | 2059 |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2858 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2867 | 2859 |
2868 private: | 2860 private: |
2869 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2861 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2870 }; | 2862 }; |
2871 #endif // DEBUG | 2863 #endif // DEBUG |
2872 | 2864 |
2873 } } // namespace v8::internal | 2865 } } // namespace v8::internal |
2874 | 2866 |
2875 #endif // V8_HEAP_H_ | 2867 #endif // V8_HEAP_H_ |
OLD | NEW |