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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 // Support for the API. | 1027 // Support for the API. |
1028 // | 1028 // |
1029 | 1029 |
1030 void CreateApiObjects(); | 1030 void CreateApiObjects(); |
1031 | 1031 |
1032 // Adjusts the amount of registered external memory. | 1032 // Adjusts the amount of registered external memory. |
1033 // Returns the adjusted value. | 1033 // Returns the adjusted value. |
1034 inline int64_t AdjustAmountOfExternalAllocatedMemory( | 1034 inline int64_t AdjustAmountOfExternalAllocatedMemory( |
1035 int64_t change_in_bytes); | 1035 int64_t change_in_bytes); |
1036 | 1036 |
1037 // Returns the allocation mode (pre-tenuring) based on observed promotion | |
1038 // rates of previous collections. | |
1039 inline PretenureFlag GetPretenureMode() { | |
1040 return FLAG_pretenuring ? TENURED : NOT_TENURED; | |
1041 } | |
1042 | |
1043 inline intptr_t PromotedTotalSize() { | 1037 inline intptr_t PromotedTotalSize() { |
1044 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); | 1038 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); |
1045 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); | 1039 if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt); |
1046 if (total < 0) return 0; | 1040 if (total < 0) return 0; |
1047 return static_cast<intptr_t>(total); | 1041 return static_cast<intptr_t>(total); |
1048 } | 1042 } |
1049 | 1043 |
1050 inline intptr_t OldGenerationSpaceAvailable() { | 1044 inline intptr_t OldGenerationSpaceAvailable() { |
1051 return old_generation_allocation_limit_ - PromotedTotalSize(); | 1045 return old_generation_allocation_limit_ - PromotedTotalSize(); |
1052 } | 1046 } |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2760 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2767 | 2761 |
2768 private: | 2762 private: |
2769 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2763 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2770 }; | 2764 }; |
2771 #endif // DEBUG | 2765 #endif // DEBUG |
2772 | 2766 |
2773 } } // namespace v8::internal | 2767 } } // namespace v8::internal |
2774 | 2768 |
2775 #endif // V8_HEAP_H_ | 2769 #endif // V8_HEAP_H_ |
OLD | NEW |