diff options
Diffstat (limited to 'V8Binding/v8/src/platform-freebsd.cc')
-rw-r--r-- | V8Binding/v8/src/platform-freebsd.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/V8Binding/v8/src/platform-freebsd.cc b/V8Binding/v8/src/platform-freebsd.cc index 92d72f8..73d6eeb 100644 --- a/V8Binding/v8/src/platform-freebsd.cc +++ b/V8Binding/v8/src/platform-freebsd.cc @@ -141,7 +141,9 @@ void* OS::Allocate(const size_t requested, void OS::Free(void* buf, const size_t length) { // TODO(1240712): munmap has a return value which is ignored here. - munmap(buf, length); + int result = munmap(buf, length); + USE(result); + ASSERT(result == 0); } @@ -334,7 +336,7 @@ bool VirtualMemory::Commit(void* address, size_t size, bool executable) { bool VirtualMemory::Uncommit(void* address, size_t size) { return mmap(address, size, PROT_NONE, - MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, + MAP_PRIVATE | MAP_ANON | MAP_NORESERVE | MAP_FIXED, kMmapFd, kMmapFdOffset) != MAP_FAILED; } @@ -552,14 +554,18 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) { // Extracting the sample from the context is extremely machine dependent. ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); mcontext_t& mcontext = ucontext->uc_mcontext; -#if defined (__arm__) || defined(__thumb__) - sample.pc = mcontext.mc_r15; - sample.sp = mcontext.mc_r13; - sample.fp = mcontext.mc_r11; -#else +#if V8_HOST_ARCH_IA32 sample.pc = mcontext.mc_eip; sample.sp = mcontext.mc_esp; sample.fp = mcontext.mc_ebp; +#elif V8_HOST_ARCH_X64 + sample.pc = mcontext.mc_rip; + sample.sp = mcontext.mc_rsp; + sample.fp = mcontext.mc_rbp; +#elif V8_HOST_ARCH_ARM + sample.pc = mcontext.mc_r15; + sample.sp = mcontext.mc_r13; + sample.fp = mcontext.mc_r11; #endif active_sampler_->SampleStack(&sample); } |