| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 | 149 |
| 150 void* OS::Allocate(const size_t requested, | 150 void* OS::Allocate(const size_t requested, |
| 151 size_t* allocated, | 151 size_t* allocated, |
| 152 bool executable) { | 152 bool executable) { |
| 153 const size_t msize = RoundUp(requested, getpagesize()); | 153 const size_t msize = RoundUp(requested, getpagesize()); |
| 154 int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0); | 154 int prot = PROT_READ | PROT_WRITE | (executable ? PROT_EXEC : 0); |
| 155 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0); | 155 void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0); |
| 156 | 156 |
| 157 if (mbase == MAP_FAILED) { | 157 if (mbase == MAP_FAILED) { |
| 158 LOG(StringEvent("OS::Allocate", "mmap failed")); | 158 LOG(ISOLATE,StringEvent("OS::Allocate", "mmap failed")); |
| 159 return NULL; | 159 return NULL; |
| 160 } | 160 } |
| 161 *allocated = msize; | 161 *allocated = msize; |
| 162 UpdateAllocatedSpaceLimits(mbase, msize); | 162 UpdateAllocatedSpaceLimits(mbase, msize); |
| 163 return mbase; | 163 return mbase; |
| 164 } | 164 } |
| 165 | 165 |
| 166 | 166 |
| 167 void OS::Free(void* buf, const size_t length) { | 167 void OS::Free(void* buf, const size_t length) { |
| 168 // TODO(1240712): munmap has a return value which is ignored here. | 168 // TODO(1240712): munmap has a return value which is ignored here. |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 698 } |
| 699 | 699 |
| 700 // This sampler is no longer the active sampler. | 700 // This sampler is no longer the active sampler. |
| 701 active_sampler_ = NULL; | 701 active_sampler_ = NULL; |
| 702 active_ = false; | 702 active_ = false; |
| 703 } | 703 } |
| 704 | 704 |
| 705 #endif // ENABLE_LOGGING_AND_PROFILING | 705 #endif // ENABLE_LOGGING_AND_PROFILING |
| 706 | 706 |
| 707 } } // namespace v8::internal | 707 } } // namespace v8::internal |
| OLD | NEW |