OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 162 |
163 | 163 |
164 void* OS::Allocate(const size_t requested, | 164 void* OS::Allocate(const size_t requested, |
165 size_t* allocated, | 165 size_t* allocated, |
166 bool is_executable) { | 166 bool is_executable) { |
167 const size_t msize = RoundUp(requested, getpagesize()); | 167 const size_t msize = RoundUp(requested, getpagesize()); |
168 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); | 168 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); |
169 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0); | 169 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0); |
170 | 170 |
171 if (mbase == MAP_FAILED) { | 171 if (mbase == MAP_FAILED) { |
172 LOG(StringEvent("OS::Allocate", "mmap failed")); | 172 LOG(ISOLATE, StringEvent("OS::Allocate", "mmap failed")); |
173 return NULL; | 173 return NULL; |
174 } | 174 } |
175 *allocated = msize; | 175 *allocated = msize; |
176 UpdateAllocatedSpaceLimits(mbase, msize); | 176 UpdateAllocatedSpaceLimits(mbase, msize); |
177 return mbase; | 177 return mbase; |
178 } | 178 } |
179 | 179 |
180 | 180 |
181 void OS::Free(void* address, const size_t size) { | 181 void OS::Free(void* address, const size_t size) { |
182 // TODO(1240712): munmap has a return value which is ignored here. | 182 // TODO(1240712): munmap has a return value which is ignored here. |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 data_->signal_handler_installed_ = false; | 778 data_->signal_handler_installed_ = false; |
779 } | 779 } |
780 | 780 |
781 // This sampler is no longer the active sampler. | 781 // This sampler is no longer the active sampler. |
782 active_sampler_ = NULL; | 782 active_sampler_ = NULL; |
783 } | 783 } |
784 | 784 |
785 #endif // ENABLE_LOGGING_AND_PROFILING | 785 #endif // ENABLE_LOGGING_AND_PROFILING |
786 | 786 |
787 } } // namespace v8::internal | 787 } } // namespace v8::internal |
OLD | NEW |