7 #include "src/codegen.h" 8 #include "src/macro-assembler.h" 9 #include "src/x64/assembler-x64-inl.h" 16 UnaryMathFunction CreateSqrtFunction() {
19 byte* buffer = AllocatePage(page_allocator,
21 if (buffer ==
nullptr)
return nullptr;
23 MacroAssembler masm(AssemblerOptions{}, buffer,
static_cast<int>(allocated));
27 __ Sqrtsd(xmm0, xmm0);
31 masm.GetCode(
nullptr, &desc);
32 DCHECK(!RelocInfo::RequiresRelocationAfterCodegen(desc));
34 Assembler::FlushICache(buffer, allocated);
35 CHECK(SetPermissions(page_allocator, buffer, allocated,
36 PageAllocator::kReadExecute));
37 return FUNCTION_CAST<UnaryMathFunction>(buffer);
45 #endif // V8_TARGET_ARCH_X64
virtual void * GetRandomMmapAddr()=0