Improve FunctionPtr and use it in the JIT CallRecord.
https://bugs.webkit.org/show_bug.cgi?id=183756
<rdar://problem/38641335>
Reviewed by JF Bastien.
- FunctionPtr hold a C/C++ function pointer by default. Change its default
PtrTag to reflect that.
- Delete the FunctionPtr::value() method. It is effectively a duplicate of
executableAddress().
- Fix the FunctionPtr constructor that takes arbitrary pointers to be able to
take "any" pointer. "any" in this case means that the pointer may not be typed
as a C/C++ function to the C++ compiler (due to upstream casting or usage of
void* as a storage type), but it is still expected to be pointing to a C/C++
function.
- Added a FunctionPtr constructor that takes another FunctionPtr. This is a
convenience constructor that lets us retag the underlying pointer. The other
FunctionPtr is still expected to point to a C/C++ function.
- Added PtrTag assertion placeholder functions to be implemented later.
- Change the JIT CallRecord to embed a FunctionPtr callee instead of a void* to
pointer. This improves type safety, and assists in getting pointer tagging
right later.
- Added versions of JIT callOperations methods that will take a PtrTag.
This is preparation for more more pointer tagging work later.
- assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::linkCall):
- assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::linkCall):
- assembler/MacroAssemblerCodeRef.h:
(JSC::FunctionPtr::FunctionPtr):
(JSC::FunctionPtr::operator bool const):
(JSC::FunctionPtr::operator! const):
(JSC::ReturnAddressPtr::ReturnAddressPtr):
(JSC::MacroAssemblerCodePtr::retagged const):
(JSC::MacroAssemblerCodeRef::retaggedCode const):
(JSC::FunctionPtr::value const): Deleted.
- assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::linkCall):
- assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::linkCall):
- assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType):
(JSC::MacroAssemblerX86_64::linkCall):
(JSC::AccessCase::generateImpl):
(JSC::FTL::SlowPathCallContext::makeCall):
(JSC::FTL::callOperation):
(JSC::FTL::osrExitGenerationThunkGenerator):
(JSC::FTL::lazySlowPathGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):
(JSC::JIT::link):
(JSC::JIT::privateCompileExceptionHandlers):
(JSC::CallRecord::CallRecord):
(JSC::JIT::appendCall):
(JSC::JIT::appendCallWithSlowPathReturnType):
(JSC::JIT::callOperation):
(JSC::JIT::callOperationWithProfile):
(JSC::JIT::callOperationWithResult):
(JSC::JIT::callOperationNoExceptionCheck):
(JSC::JIT::callOperationWithCallFrameRollbackOnException):
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
(JSC::JIT::emitNakedCall):
(JSC::JIT::emitNakedTailCall):
(JSC::JIT::appendCallWithExceptionCheck):
(JSC::JIT::appendCallWithExceptionCheckAndSlowPathReturnType):
(JSC::JIT::appendCallWithCallFrameRollbackOnException):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResult):
(JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile):
- jit/JITPropertyAccess.cpp:
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::privateCompileGetByValWithCachedId):
(JSC::JIT::privateCompilePutByVal):
(JSC::JIT::privateCompilePutByValWithCachedId):
- jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::linkPolymorphicCall):
(JSC::JITSlowPathCall::JITSlowPathCall):
(JSC::JITSlowPathCall::call):
(JSC::nativeForGenerator):
(JSC::nextPtrTagID):
(JSC::assertIsCFunctionPtr):
(JSC::assertIsNullOrCFunctionPtr):
(JSC::assertIsNotTagged):
(JSC::assertIsTagged):
(JSC::assertIsNullOrTagged):
(JSC::assertIsTaggedWith):
(JSC::assertIsNullOrTaggedWith):
(JSC::uniquePtrTagID): Deleted.