OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
881 bool contains(Address address) { | 881 bool contains(Address address) { |
882 if (this == NULL || code_range_ == NULL) return false; | 882 if (this == NULL || code_range_ == NULL) return false; |
883 Address start = static_cast<Address>(code_range_->address()); | 883 Address start = static_cast<Address>(code_range_->address()); |
884 return start <= address && address < start + code_range_->size(); | 884 return start <= address && address < start + code_range_->size(); |
885 } | 885 } |
886 | 886 |
887 // Allocates a chunk of memory from the large-object portion of | 887 // Allocates a chunk of memory from the large-object portion of |
888 // the code range. On platforms with no separate code range, should | 888 // the code range. On platforms with no separate code range, should |
889 // not be called. | 889 // not be called. |
890 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested, | 890 MUST_USE_RESULT Address AllocateRawMemory(const size_t requested, |
891 size_t* allocated); | 891 size_t* allocated, |
892 bool commit = true); | |
danno
2013/01/15 09:41:18
Please add an enum for this new flag so that it's
| |
893 bool CommitRawMemory(Address start, size_t size); | |
892 void FreeRawMemory(Address buf, size_t length); | 894 void FreeRawMemory(Address buf, size_t length); |
893 | 895 |
894 private: | 896 private: |
895 Isolate* isolate_; | 897 Isolate* isolate_; |
896 | 898 |
897 // The reserved range of virtual memory that all code objects are put in. | 899 // The reserved range of virtual memory that all code objects are put in. |
898 VirtualMemory* code_range_; | 900 VirtualMemory* code_range_; |
899 // Plain old data class, just a struct plus a constructor. | 901 // Plain old data class, just a struct plus a constructor. |
900 class FreeBlock { | 902 class FreeBlock { |
901 public: | 903 public: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1032 } | 1034 } |
1033 | 1035 |
1034 #ifdef DEBUG | 1036 #ifdef DEBUG |
1035 // Reports statistic info of the space. | 1037 // Reports statistic info of the space. |
1036 void ReportStatistics(); | 1038 void ReportStatistics(); |
1037 #endif | 1039 #endif |
1038 | 1040 |
1039 MemoryChunk* AllocateChunk(intptr_t body_size, | 1041 MemoryChunk* AllocateChunk(intptr_t body_size, |
1040 Executability executable, | 1042 Executability executable, |
1041 Space* space); | 1043 Space* space); |
1044 Address ReserveChunk(size_t requested, | |
danno
2013/01/15 09:41:18
I have a fundamental concern with the increase in
| |
1045 Executability executable, | |
1046 VirtualMemory* controller); | |
1047 Address ReserveChunk(size_t requested, size_t* reserved); | |
1048 MemoryChunk* CommitChunkShared(Heap* heap, | |
1049 Address base, | |
1050 size_t chunk_size, | |
1051 Address area_start, | |
1052 Address area_end, | |
1053 Executability executable, | |
1054 Space* owner, | |
1055 VirtualMemory* reservation); | |
1056 MemoryChunk* CommitChunk(size_t body_size, | |
1057 Executability executable, | |
1058 VirtualMemory* reservation, | |
1059 Space* owner); | |
1060 MemoryChunk* CommitChunk(size_t body_size, | |
1061 Address base, | |
1062 size_t chunk_size, | |
1063 Space* owner); | |
1042 | 1064 |
1043 Address ReserveAlignedMemory(size_t requested, | 1065 Address ReserveAlignedMemory(size_t requested, |
1044 size_t alignment, | 1066 size_t alignment, |
1067 Executability executable, | |
1045 VirtualMemory* controller); | 1068 VirtualMemory* controller); |
1069 Address CommitAlignedMemory(VirtualMemory* controller, | |
1070 Executability executable); | |
1046 Address AllocateAlignedMemory(size_t requested, | 1071 Address AllocateAlignedMemory(size_t requested, |
1047 size_t alignment, | 1072 size_t alignment, |
1048 Executability executable, | 1073 Executability executable, |
1049 VirtualMemory* controller); | 1074 VirtualMemory* controller); |
1050 | 1075 |
1051 void FreeMemory(VirtualMemory* reservation, Executability executable); | 1076 void FreeMemory(VirtualMemory* reservation, Executability executable); |
1052 void FreeMemory(Address addr, size_t size, Executability executable); | 1077 void FreeMemory(Address addr, size_t size, Executability executable); |
1053 | 1078 |
1054 // Commit a contiguous block of memory from the initial chunk. Assumes that | 1079 // Commit a contiguous block of memory from the initial chunk. Assumes that |
1055 // the address is not NULL, the size is greater than zero, and that the | 1080 // the address is not NULL, the size is greater than zero, and that the |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2763 } | 2788 } |
2764 // Must be small, since an iteration is used for lookup. | 2789 // Must be small, since an iteration is used for lookup. |
2765 static const int kMaxComments = 64; | 2790 static const int kMaxComments = 64; |
2766 }; | 2791 }; |
2767 #endif | 2792 #endif |
2768 | 2793 |
2769 | 2794 |
2770 } } // namespace v8::internal | 2795 } } // namespace v8::internal |
2771 | 2796 |
2772 #endif // V8_SPACES_H_ | 2797 #endif // V8_SPACES_H_ |
OLD | NEW |