Changeset 229709 in webkit
- Timestamp:
- Mar 19, 2018 1:22:30 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r229648 r229709 1 2018-03-19 Mark Lam <mark.lam@apple.com> 2 3 FunctionPtr should be passed by value. 4 https://bugs.webkit.org/show_bug.cgi?id=183746 5 <rdar://problem/38625311> 6 7 Reviewed by JF Bastien. 8 9 It's meant to be an encapsulation of a C/C++ function pointer. There are cases 10 where we use it to pass JIT compiled code (e.g. the VM thunks/stubs), but they are 11 treated as if they are C/C++ functions. 12 13 Regardless, there's no need to pass it by reference. 14 15 * assembler/MacroAssemblerCodeRef.h: 16 * dfg/DFGJITCompiler.h: 17 (JSC::DFG::JITCompiler::appendCall): 18 * dfg/DFGSpeculativeJIT.h: 19 (JSC::DFG::SpeculativeJIT::appendCall): 20 (JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnException): 21 (JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnExceptionSetResult): 22 (JSC::DFG::SpeculativeJIT::appendCallSetResult): 23 * jit/JIT.h: 24 (JSC::JIT::appendCall): 25 (JSC::JIT::appendCallWithSlowPathReturnType): 26 * jit/JITInlines.h: 27 (JSC::JIT::appendCallWithExceptionCheck): 28 (JSC::JIT::appendCallWithExceptionCheckAndSlowPathReturnType): 29 (JSC::JIT::appendCallWithCallFrameRollbackOnException): 30 (JSC::JIT::appendCallWithExceptionCheckSetJSValueResult): 31 (JSC::JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile): 32 1 33 2018-03-15 Ross Kirsling <ross.kirsling@sony.com> 2 34 -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
r229609 r229709 127 127 }; 128 128 129 static_assert(sizeof(FunctionPtr) == sizeof(void*), ""); 130 static_assert(std::is_trivially_copyable<FunctionPtr>::value, ""); 131 129 132 // ReturnAddressPtr: 130 133 // -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r229609 r229709 157 157 158 158 // Add a call out from JIT code, without an exception check. 159 Call appendCall(const FunctionPtr &function)159 Call appendCall(const FunctionPtr function) 160 160 { 161 161 Call functionCall = call(NoPtrTag); -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
r229514 r229709 1008 1008 1009 1009 // These methods add call instructions, optionally setting results, and optionally rolling back the call frame on an exception. 1010 JITCompiler::Call appendCall(const FunctionPtr &function)1010 JITCompiler::Call appendCall(const FunctionPtr function) 1011 1011 { 1012 1012 prepareForExternalCall(); … … 1014 1014 return m_jit.appendCall(function); 1015 1015 } 1016 JITCompiler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr &function)1016 JITCompiler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr function) 1017 1017 { 1018 1018 JITCompiler::Call call = appendCall(function); … … 1020 1020 return call; 1021 1021 } 1022 JITCompiler::Call appendCallWithCallFrameRollbackOnExceptionSetResult(const FunctionPtr &function, GPRReg result)1022 JITCompiler::Call appendCallWithCallFrameRollbackOnExceptionSetResult(const FunctionPtr function, GPRReg result) 1023 1023 { 1024 1024 JITCompiler::Call call = appendCallWithCallFrameRollbackOnException(function); … … 1027 1027 return call; 1028 1028 } 1029 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, GPRReg result)1029 JITCompiler::Call appendCallSetResult(const FunctionPtr function, GPRReg result) 1030 1030 { 1031 1031 JITCompiler::Call call = appendCall(function); … … 1034 1034 return call; 1035 1035 } 1036 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, GPRReg result1, GPRReg result2)1036 JITCompiler::Call appendCallSetResult(const FunctionPtr function, GPRReg result1, GPRReg result2) 1037 1037 { 1038 1038 JITCompiler::Call call = appendCall(function); … … 1040 1040 return call; 1041 1041 } 1042 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, JSValueRegs resultRegs)1042 JITCompiler::Call appendCallSetResult(const FunctionPtr function, JSValueRegs resultRegs) 1043 1043 { 1044 1044 #if USE(JSVALUE64) … … 1049 1049 } 1050 1050 #if CPU(X86) 1051 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, FPRReg result)1051 JITCompiler::Call appendCallSetResult(const FunctionPtr function, FPRReg result) 1052 1052 { 1053 1053 JITCompiler::Call call = appendCall(function); … … 1059 1059 } 1060 1060 #elif CPU(ARM) && !CPU(ARM_HARDFP) 1061 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, FPRReg result)1061 JITCompiler::Call appendCallSetResult(const FunctionPtr function, FPRReg result) 1062 1062 { 1063 1063 JITCompiler::Call call = appendCall(function); … … 1067 1067 } 1068 1068 #else // CPU(X86_64) || (CPU(ARM) && CPU(ARM_HARDFP)) || CPU(ARM64) || CPU(MIPS) 1069 JITCompiler::Call appendCallSetResult(const FunctionPtr &function, FPRReg result)1069 JITCompiler::Call appendCallSetResult(const FunctionPtr function, FPRReg result) 1070 1070 { 1071 1071 JITCompiler::Call call = appendCall(function); -
trunk/Source/JavaScriptCore/jit/JIT.h
r229609 r229709 268 268 269 269 // Add a call out from JIT code, without an exception check. 270 Call appendCall(const FunctionPtr &function)270 Call appendCall(const FunctionPtr function) 271 271 { 272 272 Call functionCall = call(NoPtrTag); … … 276 276 277 277 #if OS(WINDOWS) && CPU(X86_64) 278 Call appendCallWithSlowPathReturnType(const FunctionPtr &function)278 Call appendCallWithSlowPathReturnType(const FunctionPtr function) 279 279 { 280 280 Call functionCall = callWithSlowPathReturnType(); … … 705 705 } 706 706 707 MacroAssembler::Call appendCallWithExceptionCheck(const FunctionPtr &);707 MacroAssembler::Call appendCallWithExceptionCheck(const FunctionPtr); 708 708 #if OS(WINDOWS) && CPU(X86_64) 709 MacroAssembler::Call appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr &);710 #endif 711 MacroAssembler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr &);712 MacroAssembler::Call appendCallWithExceptionCheckSetJSValueResult(const FunctionPtr &, int);713 MacroAssembler::Call appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr &, int);709 MacroAssembler::Call appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr); 710 #endif 711 MacroAssembler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr); 712 MacroAssembler::Call appendCallWithExceptionCheckSetJSValueResult(const FunctionPtr, int); 713 MacroAssembler::Call appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr, int); 714 714 715 715 template<typename OperationType, typename... Args> -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r229391 r229709 150 150 } 151 151 152 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheck(const FunctionPtr &function)152 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheck(const FunctionPtr function) 153 153 { 154 154 updateTopCallFrame(); … … 159 159 160 160 #if OS(WINDOWS) && CPU(X86_64) 161 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr &function)161 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr function) 162 162 { 163 163 updateTopCallFrame(); … … 168 168 #endif 169 169 170 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithCallFrameRollbackOnException(const FunctionPtr &function)170 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithCallFrameRollbackOnException(const FunctionPtr function) 171 171 { 172 172 updateTopCallFrame(); // The callee is responsible for setting topCallFrame to their caller … … 176 176 } 177 177 178 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResult(const FunctionPtr &function, int dst)178 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResult(const FunctionPtr function, int dst) 179 179 { 180 180 MacroAssembler::Call call = appendCallWithExceptionCheck(function); … … 187 187 } 188 188 189 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr &function, int dst)189 ALWAYS_INLINE MacroAssembler::Call JIT::appendCallWithExceptionCheckSetJSValueResultWithProfile(const FunctionPtr function, int dst) 190 190 { 191 191 MacroAssembler::Call call = appendCallWithExceptionCheck(function);
Note: See TracChangeset
for help on using the changeset viewer.