| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 void* OS::Allocate(const size_t requested, | 144 void* OS::Allocate(const size_t requested, |
| 145 size_t* allocated, | 145 size_t* allocated, |
| 146 bool is_executable) { | 146 bool is_executable) { |
| 147 const size_t msize = RoundUp(requested, getpagesize()); | 147 const size_t msize = RoundUp(requested, getpagesize()); |
| 148 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); | 148 int prot = PROT_READ | PROT_WRITE | (is_executable ? PROT_EXEC : 0); |
| 149 void* mbase = mmap(NULL, msize, prot, | 149 void* mbase = mmap(NULL, msize, prot, |
| 150 MAP_PRIVATE | MAP_ANON, | 150 MAP_PRIVATE | MAP_ANON, |
| 151 kMmapFd, kMmapFdOffset); | 151 kMmapFd, kMmapFdOffset); |
| 152 if (mbase == MAP_FAILED) { | 152 if (mbase == MAP_FAILED) { |
| 153 LOG(ISOLATE, StringEvent("OS::Allocate", "mmap failed")); | 153 LOG(Isolate::Current(), StringEvent("OS::Allocate", "mmap failed")); |
| 154 return NULL; | 154 return NULL; |
| 155 } | 155 } |
| 156 *allocated = msize; | 156 *allocated = msize; |
| 157 UpdateAllocatedSpaceLimits(mbase, msize); | 157 UpdateAllocatedSpaceLimits(mbase, msize); |
| 158 return mbase; | 158 return mbase; |
| 159 } | 159 } |
| 160 | 160 |
| 161 | 161 |
| 162 void OS::Free(void* address, const size_t size) { | 162 void OS::Free(void* address, const size_t size) { |
| 163 // TODO(1240712): munmap has a return value which is ignored here. | 163 // TODO(1240712): munmap has a return value which is ignored here. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 SEG_TEXT, | 258 SEG_TEXT, |
| 259 SECT_TEXT, | 259 SECT_TEXT, |
| 260 &size); | 260 &size); |
| 261 #else | 261 #else |
| 262 unsigned int size; | 262 unsigned int size; |
| 263 char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size); | 263 char* code_ptr = getsectdatafromheader(header, SEG_TEXT, SECT_TEXT, &size); |
| 264 #endif | 264 #endif |
| 265 if (code_ptr == NULL) continue; | 265 if (code_ptr == NULL) continue; |
| 266 const uintptr_t slide = _dyld_get_image_vmaddr_slide(i); | 266 const uintptr_t slide = _dyld_get_image_vmaddr_slide(i); |
| 267 const uintptr_t start = reinterpret_cast<uintptr_t>(code_ptr) + slide; | 267 const uintptr_t start = reinterpret_cast<uintptr_t>(code_ptr) + slide; |
| 268 LOG(SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); | 268 LOG(Isolate::Current(), |
| 269 SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); |
| 269 } | 270 } |
| 270 #endif // ENABLE_LOGGING_AND_PROFILING | 271 #endif // ENABLE_LOGGING_AND_PROFILING |
| 271 } | 272 } |
| 272 | 273 |
| 273 | 274 |
| 274 void OS::SignalCodeMovingGC() { | 275 void OS::SignalCodeMovingGC() { |
| 275 } | 276 } |
| 276 | 277 |
| 277 | 278 |
| 278 uint64_t OS::CpuFeaturesImpliedByPlatform() { | 279 uint64_t OS::CpuFeaturesImpliedByPlatform() { |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 776 |
| 776 void Sampler::Stop() { | 777 void Sampler::Stop() { |
| 777 ASSERT(IsActive()); | 778 ASSERT(IsActive()); |
| 778 SamplerThread::RemoveActiveSampler(this); | 779 SamplerThread::RemoveActiveSampler(this); |
| 779 SetActive(false); | 780 SetActive(false); |
| 780 } | 781 } |
| 781 | 782 |
| 782 #endif // ENABLE_LOGGING_AND_PROFILING | 783 #endif // ENABLE_LOGGING_AND_PROFILING |
| 783 | 784 |
| 784 } } // namespace v8::internal | 785 } } // namespace v8::internal |
| OLD | NEW |