Changeset 229989 in webkit
- Timestamp:
- Mar 26, 2018 2:41:13 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r229988 r229989 1 2018-03-26 Ross Kirsling <ross.kirsling@sony.com> 2 3 JIT callOperation() needs to support operations that return SlowPathReturnType differently on Windows. 4 https://bugs.webkit.org/show_bug.cgi?id=183655 5 6 Reviewed by Keith Miller. 7 8 * jit/CCallHelpers.h: 9 (JSC::CCallHelpers::ArgCollection::argCount): 10 (JSC::CCallHelpers::marshallArgumentRegister): 11 (JSC::CCallHelpers::setupArgumentsImpl): 12 On Win64, ensure that argCount always includes GPRs and FPRs and that counting starts from 1 for SlowPathReturnType. 13 14 * jit/JIT.h: 15 (JSC::JIT::callOperation): 16 (JSC::JIT::is64BitType): 17 (JSC::JIT::is64BitType<void>): 18 On Win64, ensure special call is used for SlowPathReturnType. 19 20 * jit/JITOperations.h: 21 Update changed type. 22 1 23 2018-03-26 Yusuke Suzuki <utatane.tea@gmail.com> 2 24 -
trunk/Source/JavaScriptCore/jit/CCallHelpers.h
r229648 r229989 239 239 } 240 240 241 241 #if OS(WINDOWS) && CPU(X86_64) 242 unsigned argCount(GPRReg) { return numGPRArgs + numFPRArgs; } 243 unsigned argCount(FPRReg) { return numGPRArgs + numFPRArgs; } 244 #else 242 245 unsigned argCount(GPRReg) { return numGPRArgs; } 243 246 unsigned argCount(FPRReg) { return numFPRArgs; } 247 #endif 244 248 245 249 std::array<GPRReg, GPRInfo::numberOfRegisters> gprSources; … … 288 292 289 293 #define CURRENT_ARGUMENT_TYPE typename FunctionTraits<OperationType>::template ArgumentType<numGPRArgs + numFPRArgs> 294 #define RESULT_TYPE typename FunctionTraits<OperationType>::ResultType 290 295 291 296 #if USE(JSVALUE64) … … 296 301 using InfoType = InfoTypeForReg<RegType>; 297 302 unsigned numArgRegisters = InfoType::numberOfArgumentRegisters; 303 #if OS(WINDOWS) && CPU(X86_64) 304 unsigned currentArgCount = argSourceRegs.argCount(arg) + (std::is_same<RESULT_TYPE, SlowPathReturnType>::value ? 1 : 0); 305 #else 298 306 unsigned currentArgCount = argSourceRegs.argCount(arg); 307 #endif 299 308 if (currentArgCount < numArgRegisters) { 300 309 auto updatedArgSourceRegs = argSourceRegs.pushRegArg(arg, InfoType::toArgumentRegister(currentArgCount)); … … 386 395 static_assert(!std::is_floating_point<CURRENT_ARGUMENT_TYPE>::value, "We don't support immediate floats/doubles in setupArguments"); 387 396 auto numArgRegisters = GPRInfo::numberOfArgumentRegisters; 388 if (numGPRArgs < numArgRegisters) { 397 #if OS(WINDOWS) && CPU(X86_64) 398 auto currentArgCount = numGPRArgs + numFPRArgs + (std::is_same<RESULT_TYPE, SlowPathReturnType>::value ? 1 : 0); 399 #else 400 auto currentArgCount = numGPRArgs; 401 #endif 402 if (currentArgCount < numArgRegisters) { 389 403 setupArgumentsImpl<OperationType>(argSourceRegs.addGPRArg(), args...); 390 move(arg, GPRInfo::toArgumentRegister( numGPRArgs));404 move(arg, GPRInfo::toArgumentRegister(currentArgCount)); 391 405 return; 392 406 } … … 437 451 438 452 #undef CURRENT_ARGUMENT_TYPE 453 #undef RESULT_TYPE 439 454 440 455 // Base case; set up the argument registers. -
trunk/Source/JavaScriptCore/jit/JIT.h
r229957 r229989 717 717 MacroAssembler::Call appendCallWithExceptionCheck(const FunctionPtr, PtrTag); 718 718 #if OS(WINDOWS) && CPU(X86_64) 719 MacroAssembler::Call appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr, PtrTag = NoPtrTag);719 MacroAssembler::Call appendCallWithExceptionCheckAndSlowPathReturnType(const FunctionPtr, PtrTag); 720 720 #endif 721 721 MacroAssembler::Call appendCallWithCallFrameRollbackOnException(const FunctionPtr, PtrTag); … … 739 739 } 740 740 741 template<typename OperationType, typename... Args> 742 MacroAssembler::Call callOperation(OperationType operation, PtrTag tag, Args... args) 743 { 741 #if OS(WINDOWS) && CPU(X86_64) 742 template<typename OperationType, typename... Args> 743 std::enable_if_t<std::is_same<typename FunctionTraits<OperationType>::ResultType, SlowPathReturnType>::value, MacroAssembler::Call> 744 callOperation(OperationType operation, PtrTag tag, Args... args) 745 { 746 setupArguments<OperationType>(args...); 747 return appendCallWithExceptionCheckAndSlowPathReturnType(operation, tag); 748 } 749 750 template<typename Type> 751 static constexpr bool is64BitType() { return sizeof(Type) <= 8; } 752 753 template<> 754 static constexpr bool is64BitType<void>() { return true; } 755 756 template<typename OperationType, typename... Args> 757 std::enable_if_t<!std::is_same<typename FunctionTraits<OperationType>::ResultType, SlowPathReturnType>::value, MacroAssembler::Call> 758 callOperation(OperationType operation, PtrTag tag, Args... args) 759 { 760 static_assert(is64BitType<typename FunctionTraits<OperationType>::ResultType>(), "Win64 cannot use standard call when return type is larger than 64 bits."); 744 761 setupArguments<OperationType>(args...); 745 762 return appendCallWithExceptionCheck(operation, tag); 746 763 } 764 #else // OS(WINDOWS) && CPU(X86_64) 765 template<typename OperationType, typename... Args> 766 MacroAssembler::Call callOperation(OperationType operation, PtrTag tag, Args... args) 767 { 768 setupArguments<OperationType>(args...); 769 return appendCallWithExceptionCheck(operation, tag); 770 } 771 #endif // OS(WINDOWS) && CPU(X86_64) 747 772 748 773 template<typename OperationType, typename... Args> -
trunk/Source/JavaScriptCore/jit/JITOperations.h
r229957 r229989 261 261 typedef size_t (JIT_OPERATION *S_JITOperation_EReoJss)(ExecState*, RegExpObject*, JSString*); 262 262 typedef size_t (JIT_OPERATION *S_JITOperation_J)(EncodedJSValue); 263 typedef SlowPathReturnType (JIT_OPERATION *Sprt_JITOperation_E Z)(ExecState*,int32_t);263 typedef SlowPathReturnType (JIT_OPERATION *Sprt_JITOperation_EUi)(ExecState*, uint32_t); 264 264 typedef void (JIT_OPERATION *V_JITOperation)(); 265 265 typedef void (JIT_OPERATION *V_JITOperation_E)(ExecState*);
Note: See TracChangeset
for help on using the changeset viewer.