9 #include "src/codegen.h" 10 #include "src/macro-assembler.h" 11 #include "src/ppc/simulator-ppc.h" 18 UnaryMathFunction CreateSqrtFunction() {
19 #if defined(USE_SIMULATOR) 24 byte* buffer = AllocatePage(page_allocator,
26 if (buffer ==
nullptr)
return nullptr;
28 MacroAssembler masm(AssemblerOptions{}, buffer,
static_cast<int>(allocated));
31 __ function_descriptor();
33 __ MovFromFloatParameter(d1);
35 __ MovToFloatResult(d1);
39 masm.GetCode(
nullptr, &desc);
40 DCHECK(ABI_USES_FUNCTION_DESCRIPTORS ||
41 !RelocInfo::RequiresRelocationAfterCodegen(desc));
43 Assembler::FlushICache(buffer, allocated);
44 CHECK(SetPermissions(page_allocator, buffer, allocated,
45 PageAllocator::kReadExecute));
46 return FUNCTION_CAST<UnaryMathFunction>(buffer);
55 #endif // V8_TARGET_ARCH_PPC
virtual void * GetRandomMmapAddr()=0