| 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 committed = true); |
| 893 bool CommitRawMemory(Address start, size_t size); |
| 894 Address ReserveChunk(size_t body_size, size_t *reserved); |
| 895 |
| 892 void FreeRawMemory(Address buf, size_t length); | 896 void FreeRawMemory(Address buf, size_t length); |
| 893 | 897 |
| 894 private: | 898 private: |
| 895 Isolate* isolate_; | 899 Isolate* isolate_; |
| 896 | 900 |
| 897 // The reserved range of virtual memory that all code objects are put in. | 901 // The reserved range of virtual memory that all code objects are put in. |
| 898 VirtualMemory* code_range_; | 902 VirtualMemory* code_range_; |
| 899 // Plain old data class, just a struct plus a constructor. | 903 // Plain old data class, just a struct plus a constructor. |
| 900 class FreeBlock { | 904 class FreeBlock { |
| 901 public: | 905 public: |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 } | 1036 } |
| 1033 | 1037 |
| 1034 #ifdef DEBUG | 1038 #ifdef DEBUG |
| 1035 // Reports statistic info of the space. | 1039 // Reports statistic info of the space. |
| 1036 void ReportStatistics(); | 1040 void ReportStatistics(); |
| 1037 #endif | 1041 #endif |
| 1038 | 1042 |
| 1039 MemoryChunk* AllocateChunk(intptr_t body_size, | 1043 MemoryChunk* AllocateChunk(intptr_t body_size, |
| 1040 Executability executable, | 1044 Executability executable, |
| 1041 Space* space); | 1045 Space* space); |
| 1046 MemoryChunk* CommitChunkInCodeRange(Address start, |
| 1047 size_t body_size, |
| 1048 size_t reserved_size); |
| 1042 | 1049 |
| 1043 Address ReserveAlignedMemory(size_t requested, | 1050 Address ReserveAlignedMemory(size_t requested, |
| 1044 size_t alignment, | 1051 size_t alignment, |
| 1045 VirtualMemory* controller); | 1052 VirtualMemory* controller); |
| 1046 Address AllocateAlignedMemory(size_t requested, | 1053 Address AllocateAlignedMemory(size_t requested, |
| 1047 size_t alignment, | 1054 size_t alignment, |
| 1048 Executability executable, | 1055 Executability executable, |
| 1049 VirtualMemory* controller); | 1056 VirtualMemory* controller); |
| 1050 | 1057 |
| 1051 void FreeMemory(VirtualMemory* reservation, Executability executable); | 1058 void FreeMemory(VirtualMemory* reservation, Executability executable); |
| (...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2763 } | 2770 } |
| 2764 // Must be small, since an iteration is used for lookup. | 2771 // Must be small, since an iteration is used for lookup. |
| 2765 static const int kMaxComments = 64; | 2772 static const int kMaxComments = 64; |
| 2766 }; | 2773 }; |
| 2767 #endif | 2774 #endif |
| 2768 | 2775 |
| 2769 | 2776 |
| 2770 } } // namespace v8::internal | 2777 } } // namespace v8::internal |
| 2771 | 2778 |
| 2772 #endif // V8_SPACES_H_ | 2779 #endif // V8_SPACES_H_ |
| OLD | NEW |