Changeset 259786 in webkit
- Timestamp:
- Apr 9, 2020 2:27:40 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r259781 r259786 1 2020-04-09 Mark Lam <mark.lam@apple.com> 2 3 Implement a more efficient tagCFunction() tool. 4 https://bugs.webkit.org/show_bug.cgi?id=210254 5 6 Reviewed by Keith Miller. 7 8 Putting tagCFunction() to use. 9 10 * b3/B3LowerMacros.cpp: 11 * b3/B3LowerMacrosAfterOptimizations.cpp: 12 * b3/B3MathExtras.cpp: 13 * b3/B3ReduceLoopStrength.cpp: 14 (JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy): 15 * b3/B3ReduceStrength.cpp: 16 * b3/testb3_5.cpp: 17 (testCallSimple): 18 (testCallRare): 19 (testCallRareLive): 20 (testCallSimplePure): 21 (testCallFunctionWithHellaArguments): 22 (testCallFunctionWithHellaArguments2): 23 (testCallFunctionWithHellaArguments3): 24 (testCallSimpleDouble): 25 (testCallSimpleFloat): 26 (testCallFunctionWithHellaDoubleArguments): 27 (testCallFunctionWithHellaFloatArguments): 28 (testLinearScanWithCalleeOnStack): 29 * b3/testb3_6.cpp: 30 (testInterpreter): 31 * b3/testb3_7.cpp: 32 (testLICMPure): 33 (testLICMPureSideExits): 34 (testLICMPureWritesPinned): 35 (testLICMPureWrites): 36 (testLICMReadsLocalState): 37 (testLICMReadsPinned): 38 (testLICMReads): 39 (testLICMPureNotBackwardsDominant): 40 (testLICMPureFoiledByChild): 41 (testLICMPureNotBackwardsDominantFoiledByChild): 42 (testLICMExitsSideways): 43 (testLICMWritesLocalState): 44 (testLICMWrites): 45 (testLICMFence): 46 (testLICMWritesPinned): 47 (testLICMControlDependent): 48 (testLICMControlDependentNotBackwardsDominant): 49 (testLICMControlDependentSideExits): 50 (testLICMReadsPinnedWritesPinned): 51 (testLICMReadsWritesDifferentHeaps): 52 (testLICMReadsWritesOverlappingHeaps): 53 (testLICMDefaultCall): 54 (testShuffleDoesntTrashCalleeSaves): 55 * dfg/DFGOSRExit.cpp: 56 (JSC::DFG::OSRExit::emitRestoreArguments): 57 * dfg/DFGOSRExitCompilerCommon.cpp: 58 (JSC::DFG::handleExitCounts): 59 (JSC::DFG::osrWriteBarrier): 60 * ftl/FTLLowerDFGToB3.cpp: 61 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): 62 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): 63 (JSC::FTL::DFG::LowerDFGToB3::compileCallEval): 64 * ftl/FTLOSRExitCompiler.cpp: 65 (JSC::FTL::compileStub): 66 * jit/AssemblyHelpers.cpp: 67 (JSC::AssemblyHelpers::callExceptionFuzz): 68 * jit/CCallHelpers.cpp: 69 (JSC::CCallHelpers::ensureShadowChickenPacket): 70 * jit/JITOperations.cpp: 71 * jit/ThunkGenerators.cpp: 72 (JSC::throwExceptionFromCallSlowPathGenerator): 73 (JSC::slowPathFor): 74 (JSC::nativeForGenerator): 75 (JSC::boundFunctionCallGenerator): 76 * wasm/WasmB3IRGenerator.cpp: 77 (JSC::Wasm::B3IRGenerator::addTableGet): 78 (JSC::Wasm::B3IRGenerator::addTableSet): 79 (JSC::Wasm::B3IRGenerator::addRefFunc): 80 (JSC::Wasm::B3IRGenerator::addTableSize): 81 (JSC::Wasm::B3IRGenerator::addTableGrow): 82 (JSC::Wasm::B3IRGenerator::addTableFill): 83 (JSC::Wasm::B3IRGenerator::addGrowMemory): 84 (JSC::Wasm::B3IRGenerator::setGlobal): 85 (JSC::Wasm::B3IRGenerator::emitWriteBarrierForJSWrapper): 86 (JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>): 87 (JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>): 88 * wasm/WasmThunks.cpp: 89 (JSC::Wasm::triggerOMGEntryTierUpThunkGenerator): 90 1 91 2020-04-08 Devin Rousso <drousso@apple.com> 2 92 -
trunk/Source/JavaScriptCore/b3/B3LowerMacros.cpp
r248686 r259786 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 129 129 } 130 130 131 auto* fmodDouble = tagCFunctionPtr<double (*)(double, double)>(fmod, B3CCallPtrTag); 131 double(*fmodDouble)(double, double) = fmod; 132 fmodDouble = tagCFunction<B3CCallPtrTag>(fmodDouble); 132 133 if (m_value->type() == Double) { 133 134 Value* functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, fmodDouble); -
trunk/Source/JavaScriptCore/b3/B3LowerMacrosAfterOptimizations.cpp
r248178 r259786 1 1 /* 2 * Copyright (C) 2015-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 101 101 if (m_value->type() == Double) { 102 102 double (*ceilDouble)(double) = ceil; 103 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction Ptr(ceilDouble, B3CCallPtrTag));103 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction<B3CCallPtrTag>(ceilDouble)); 104 104 } else if (m_value->type() == Float) 105 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction Ptr(ceilf, B3CCallPtrTag));105 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction<B3CCallPtrTag>(ceilf)); 106 106 else 107 107 RELEASE_ASSERT_NOT_REACHED(); … … 123 123 if (m_value->type() == Double) { 124 124 double (*floorDouble)(double) = floor; 125 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction Ptr(floorDouble, B3CCallPtrTag));125 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction<B3CCallPtrTag>(floorDouble)); 126 126 } else if (m_value->type() == Float) 127 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction Ptr(floorf, B3CCallPtrTag));127 functionAddress = m_insertionSet.insert<ConstPtrValue>(m_index, m_origin, tagCFunction<B3CCallPtrTag>(floorf)); 128 128 else 129 129 RELEASE_ASSERT_NOT_REACHED(); -
trunk/Source/JavaScriptCore/b3/B3MathExtras.cpp
r231027 r259786 1 1 /* 2 * Copyright (C) 2015-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 58 58 // Function call. 59 59 Value* yAsDouble = functionCallCase->appendNew<Value>(procedure, IToD, origin, y); 60 auto* powDouble = tagCFunctionPtr<double (*)(double, double)>(pow, B3CCallPtrTag); 60 double(*powDouble)(double, double) = pow; 61 powDouble = tagCFunction<B3CCallPtrTag>(powDouble); 61 62 Value* powResult = functionCallCase->appendNew<CCallValue>( 62 63 procedure, Double, origin, -
trunk/Source/JavaScriptCore/b3/B3ReduceLoopStrength.cpp
r253994 r259786 1 1 /* 2 * Copyright (C) 2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 445 445 Effects effects = Effects::forCall(); 446 446 memcpy->appendNew<CCallValue>(m_proc, B3::Void, origin, effects, 447 memcpy->appendNew<ConstPtrValue>(m_proc, origin, tagCFunction Ptr<void*>(fastForwardCopy32, B3CCallPtrTag)),447 memcpy->appendNew<ConstPtrValue>(m_proc, origin, tagCFunction<B3CCallPtrTag>(fastForwardCopy32)), 448 448 destination->appendAddr(m_proc, memcpy, destination->arrayBase), 449 449 source->appendAddr(m_proc, memcpy, source->arrayBase), -
trunk/Source/JavaScriptCore/b3/B3ReduceStrength.cpp
r250198 r259786 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1819 1819 // Turn this: Call(fmod, constant1, constant2) 1820 1820 // Into this: fcall-constant(constant1, constant2) 1821 auto* fmodDouble = tagCFunctionPtr<double (*)(double, double)>(fmod, B3CCallPtrTag); 1821 double(*fmodDouble)(double, double) = fmod; 1822 fmodDouble = tagCFunction<B3CCallPtrTag>(fmodDouble); 1822 1823 if (m_value->type() == Double 1823 1824 && m_value->numChildren() == 3 -
trunk/Source/JavaScriptCore/b3/testb3_5.cpp
r250199 r259786 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1917 1917 root->appendNew<CCallValue>( 1918 1918 proc, Int32, Origin(), 1919 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunction, B3CCallPtrTag)),1919 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunction)), 1920 1920 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 1921 1921 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))); … … 1944 1944 rare->appendNew<CCallValue>( 1945 1945 proc, Int32, Origin(), 1946 rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunction, B3CCallPtrTag)),1946 rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunction)), 1947 1947 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1), 1948 1948 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2))); … … 1973 1973 rare->appendNew<CCallValue>( 1974 1974 proc, Int32, Origin(), 1975 rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunction, B3CCallPtrTag)),1975 rare->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunction)), 1976 1976 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1), 1977 1977 rare->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR2)), … … 1991 1991 root->appendNew<CCallValue>( 1992 1992 proc, Int32, Origin(), Effects::none(), 1993 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunction, B3CCallPtrTag)),1993 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunction)), 1994 1994 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 1995 1995 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))); … … 2014 2014 CCallValue* call = root->appendNew<CCallValue>( 2015 2015 proc, Int32, Origin(), 2016 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionWithHellaArguments, B3CCallPtrTag)));2016 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionWithHellaArguments))); 2017 2017 call->appendArgs(args); 2018 2018 … … 2040 2040 CCallValue* call = root->appendNew<CCallValue>( 2041 2041 proc, Int64, Origin(), 2042 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionWithHellaArguments2, B3CCallPtrTag)));2042 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionWithHellaArguments2))); 2043 2043 call->appendArgs(args); 2044 2044 … … 2062 2062 CCallValue* call = root->appendNew<CCallValue>( 2063 2063 proc, Int32, Origin(), 2064 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionWithHellaArguments3, B3CCallPtrTag)));2064 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionWithHellaArguments3))); 2065 2065 call->appendArgs(args); 2066 2066 … … 2113 2113 root->appendNew<CCallValue>( 2114 2114 proc, Double, Origin(), 2115 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunctionDouble, B3CCallPtrTag)),2115 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunctionDouble)), 2116 2116 root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR0), 2117 2117 root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR1))); … … 2139 2139 root->appendNew<CCallValue>( 2140 2140 proc, Float, Origin(), 2141 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunctionFloat, B3CCallPtrTag)),2141 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunctionFloat)), 2142 2142 floatValue1, 2143 2143 floatValue2)); … … 2162 2162 CCallValue* call = root->appendNew<CCallValue>( 2163 2163 proc, Double, Origin(), 2164 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionWithHellaDoubleArguments, B3CCallPtrTag)));2164 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionWithHellaDoubleArguments))); 2165 2165 call->appendArgs(args); 2166 2166 … … 2186 2186 CCallValue* call = root->appendNew<CCallValue>( 2187 2187 proc, Float, Origin(), 2188 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionWithHellaFloatArguments, B3CCallPtrTag)));2188 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionWithHellaFloatArguments))); 2189 2189 call->appendArgs(args); 2190 2190 … … 2209 2209 root->appendNew<CCallValue>( 2210 2210 proc, Int32, Origin(), 2211 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(simpleFunction, B3CCallPtrTag)),2211 root->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(simpleFunction)), 2212 2212 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 2213 2213 root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1))); -
trunk/Source/JavaScriptCore/b3/testb3_6.cpp
r255394 r259786 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1769 1769 proc, Void, Origin(), 1770 1770 print->appendNew<ConstPtrValue>( 1771 proc, Origin(), tagCFunction Ptr<void*>(interpreterPrint, B3CCallPtrTag)),1771 proc, Origin(), tagCFunction<B3CCallPtrTag>(interpreterPrint)), 1772 1772 context, 1773 1773 print->appendNew<MemoryValue>(proc, Load, pointerType(), Origin(), dataPointerValue)); -
trunk/Source/JavaScriptCore/b3/testb3_7.cpp
r248178 r259786 1 1 /* 2 * Copyright (C) 2015-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2015-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 572 572 return loop->appendNew<CCallValue>( 573 573 proc, Int32, Origin(), Effects::none(), 574 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),574 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 575 575 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 576 576 }); … … 593 593 loop->appendNew<CCallValue>( 594 594 proc, Void, Origin(), effects, 595 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));595 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 596 596 597 597 return loop->appendNew<CCallValue>( 598 598 proc, Int32, Origin(), Effects::none(), 599 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),599 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 600 600 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 601 601 }); … … 618 618 loop->appendNew<CCallValue>( 619 619 proc, Void, Origin(), effects, 620 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));620 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 621 621 622 622 return loop->appendNew<CCallValue>( 623 623 proc, Int32, Origin(), Effects::none(), 624 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),624 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 625 625 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 626 626 }); … … 643 643 loop->appendNew<CCallValue>( 644 644 proc, Void, Origin(), effects, 645 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));645 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 646 646 647 647 return loop->appendNew<CCallValue>( 648 648 proc, Int32, Origin(), Effects::none(), 649 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),649 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 650 650 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 651 651 }); … … 666 666 return loop->appendNew<CCallValue>( 667 667 proc, Int32, Origin(), effects, 668 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),668 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 669 669 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 670 670 }); … … 687 687 return loop->appendNew<CCallValue>( 688 688 proc, Int32, Origin(), effects, 689 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),689 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 690 690 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 691 691 }); … … 708 708 return loop->appendNew<CCallValue>( 709 709 proc, Int32, Origin(), effects, 710 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),710 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 711 711 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 712 712 }); … … 728 728 return loop->appendNew<CCallValue>( 729 729 proc, Int32, Origin(), Effects::none(), 730 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),730 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 731 731 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 732 732 }); … … 745 745 return loop->appendNew<CCallValue>( 746 746 proc, Int32, Origin(), Effects::none(), 747 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),747 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 748 748 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 749 749 index); … … 766 766 return loop->appendNew<CCallValue>( 767 767 proc, Int32, Origin(), Effects::none(), 768 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),768 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 769 769 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0), 770 770 index); … … 786 786 return loop->appendNew<CCallValue>( 787 787 proc, Int32, Origin(), effects, 788 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),788 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 789 789 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 790 790 }); … … 805 805 return loop->appendNew<CCallValue>( 806 806 proc, Int32, Origin(), effects, 807 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),807 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 808 808 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 809 809 }); … … 824 824 return loop->appendNew<CCallValue>( 825 825 proc, Int32, Origin(), effects, 826 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),826 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 827 827 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 828 828 }); … … 843 843 return loop->appendNew<CCallValue>( 844 844 proc, Int32, Origin(), effects, 845 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),845 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 846 846 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 847 847 }); … … 862 862 return loop->appendNew<CCallValue>( 863 863 proc, Int32, Origin(), effects, 864 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),864 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 865 865 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 866 866 }); … … 883 883 return loop->appendNew<CCallValue>( 884 884 proc, Int32, Origin(), effects, 885 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),885 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 886 886 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 887 887 }); … … 905 905 return loop->appendNew<CCallValue>( 906 906 proc, Int32, Origin(), effects, 907 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),907 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 908 908 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 909 909 }); … … 924 924 loop->appendNew<CCallValue>( 925 925 proc, Void, Origin(), effects, 926 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));926 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 927 927 928 928 effects = Effects::none(); … … 930 930 return loop->appendNew<CCallValue>( 931 931 proc, Int32, Origin(), effects, 932 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),932 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 933 933 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 934 934 }); … … 949 949 loop->appendNew<CCallValue>( 950 950 proc, Void, Origin(), effects, 951 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));951 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 952 952 953 953 effects = Effects::none(); … … 955 955 return loop->appendNew<CCallValue>( 956 956 proc, Int32, Origin(), effects, 957 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),957 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 958 958 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 959 959 }); … … 976 976 loop->appendNew<CCallValue>( 977 977 proc, Void, Origin(), effects, 978 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));978 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 979 979 980 980 effects = Effects::none(); … … 982 982 return loop->appendNew<CCallValue>( 983 983 proc, Int32, Origin(), effects, 984 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),984 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 985 985 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 986 986 }); … … 1001 1001 loop->appendNew<CCallValue>( 1002 1002 proc, Void, Origin(), effects, 1003 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(noOpFunction, B3CCallPtrTag)));1003 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(noOpFunction))); 1004 1004 1005 1005 effects = Effects::none(); … … 1007 1007 return loop->appendNew<CCallValue>( 1008 1008 proc, Int32, Origin(), effects, 1009 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),1009 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 1010 1010 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 1011 1011 }); … … 1024 1024 return loop->appendNew<CCallValue>( 1025 1025 proc, Int32, Origin(), 1026 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(oneFunction, B3CCallPtrTag)),1026 loop->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(oneFunction)), 1027 1027 loop->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0)); 1028 1028 }); … … 1411 1411 unlikely->appendNew<CCallValue>( 1412 1412 proc, Void, Origin(), 1413 unlikely->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction Ptr<void*>(functionNineArgs, B3CCallPtrTag)),1413 unlikely->appendNew<ConstPtrValue>(proc, Origin(), tagCFunction<B3CCallPtrTag>(functionNineArgs)), 1414 1414 constNumber, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); 1415 1415 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r257721 r259786 1 1 /* 2 * Copyright (C) 2011-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 127 127 switch (recovery.technique()) { 128 128 case DirectArgumentsThatWereNotCreated: 129 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationCreateDirectArgumentsDuringExit)), GPRInfo::nonArgGPR0);129 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationCreateDirectArgumentsDuringExit)), GPRInfo::nonArgGPR0); 130 130 break; 131 131 case ClonedArgumentsThatWereNotCreated: 132 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationCreateClonedArgumentsDuringExit)), GPRInfo::nonArgGPR0);132 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationCreateClonedArgumentsDuringExit)), GPRInfo::nonArgGPR0); 133 133 break; 134 134 default: -
trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompilerCommon.cpp
r258874 r259786 1 1 /* 2 * Copyright (C) 2013-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 109 109 jit.setupArguments<decltype(operationTriggerReoptimizationNow)>(GPRInfo::regT0, GPRInfo::regT3, AssemblyHelpers::TrustedImmPtr(&exit)); 110 110 jit.prepareCallOperation(vm); 111 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationTriggerReoptimizationNow)), GPRInfo::nonArgGPR0);111 jit.move(AssemblyHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationTriggerReoptimizationNow)), GPRInfo::nonArgGPR0); 112 112 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); 113 113 AssemblyHelpers::Jump doneAdjusting = jit.jump(); … … 355 355 jit.setupArguments<decltype(operationOSRWriteBarrier)>(&vm, owner); 356 356 jit.prepareCallOperation(vm); 357 jit.move(MacroAssembler::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationOSRWriteBarrier)), scratch);357 jit.move(MacroAssembler::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationOSRWriteBarrier)), scratch); 358 358 jit.call(scratch, OperationPtrTag); 359 359 -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r259676 r259786 1 1 /* 2 * Copyright (C) 2013-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 9381 9381 }; 9382 9382 9383 auto callWithExceptionCheck = [&] (void * callee) {9384 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(callee)), GPRInfo::nonPreservedNonArgumentGPR0);9383 auto callWithExceptionCheck = [&] (void(*callee)(JSGlobalObject*)) { 9384 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(callee)), GPRInfo::nonPreservedNonArgumentGPR0); 9385 9385 jit.call(GPRInfo::nonPreservedNonArgumentGPR0, OperationPtrTag); 9386 9386 exceptions->append(jit.emitExceptionCheck(*vm, AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth)); … … 9479 9479 jit.setupArguments<decltype(operationThrowStackOverflowForVarargs)>(jit.codeBlock()->globalObjectFor(node->origin.semantic)); 9480 9480 jit.prepareCallOperation(jit.vm()); 9481 callWithExceptionCheck( bitwise_cast<void*>(operationThrowStackOverflowForVarargs));9481 callWithExceptionCheck(operationThrowStackOverflowForVarargs); 9482 9482 jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow); 9483 9483 … … 9721 9721 RELEASE_ASSERT(!allocator.numberOfReusedRegisters()); 9722 9722 9723 auto callWithExceptionCheck = [&] (void * callee) {9724 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(callee)), GPRInfo::nonPreservedNonArgumentGPR0);9723 auto callWithExceptionCheck = [&] (void(*callee)()) { 9724 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(callee)), GPRInfo::nonPreservedNonArgumentGPR0); 9725 9725 jit.call(GPRInfo::nonPreservedNonArgumentGPR0, OperationPtrTag); 9726 9726 exceptions->append(jit.emitExceptionCheck(*vm, AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth)); … … 9746 9746 jit.setupArguments<decltype(operationThrowStackOverflowForVarargs)>(jit.codeBlock()->globalObjectFor(node->origin.semantic)); 9747 9747 jit.prepareCallOperation(jit.vm()); 9748 callWithExceptionCheck(bitwise_cast<void *>(operationThrowStackOverflowForVarargs));9748 callWithExceptionCheck(bitwise_cast<void(*)()>(operationThrowStackOverflowForVarargs)); 9749 9749 jit.abortWithReason(DFGVarargsThrowingPathDidNotThrow); 9750 9750 … … 9754 9754 jit.setupArguments<decltype(operationSizeFrameForVarargs)>(jit.codeBlock()->globalObjectFor(node->origin.semantic), argumentsGPR, scratchGPR1, CCallHelpers::TrustedImm32(data->firstVarArgOffset)); 9755 9755 jit.prepareCallOperation(jit.vm()); 9756 callWithExceptionCheck(bitwise_cast<void *>(operationSizeFrameForVarargs));9756 callWithExceptionCheck(bitwise_cast<void(*)()>(operationSizeFrameForVarargs)); 9757 9757 9758 9758 jit.move(GPRInfo::returnValueGPR, scratchGPR1); … … 9763 9763 jit.setupArguments<decltype(operationSetupVarargsFrame)>(jit.codeBlock()->globalObjectFor(node->origin.semantic), scratchGPR2, argumentsGPR, CCallHelpers::TrustedImm32(data->firstVarArgOffset), scratchGPR1); 9764 9764 jit.prepareCallOperation(jit.vm()); 9765 callWithExceptionCheck(bitwise_cast<void *>(operationSetupVarargsFrame));9765 callWithExceptionCheck(bitwise_cast<void(*)()>(operationSetupVarargsFrame)); 9766 9766 9767 9767 jit.addPtr(CCallHelpers::TrustedImm32(sizeof(CallerFrameAndPC)), GPRInfo::returnValueGPR, CCallHelpers::stackPointerRegister); … … 9916 9916 jit.setupArguments<decltype(operationCallEval)>(globalObject, GPRInfo::regT1, GPRInfo::regT2); 9917 9917 jit.prepareCallOperation(vm); 9918 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationCallEval)), GPRInfo::nonPreservedNonArgumentGPR0);9918 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationCallEval)), GPRInfo::nonPreservedNonArgumentGPR0); 9919 9919 jit.call(GPRInfo::nonPreservedNonArgumentGPR0, OperationPtrTag); 9920 9920 exceptions->append(jit.emitExceptionCheck(state->vm(), AssemblyHelpers::NormalExceptionCheck, AssemblyHelpers::FarJumpWidth)); -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r254735 r259786 1 1 /* 2 * Copyright (C) 2013-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2013-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 338 338 CCallHelpers::TrustedImmPtr(materializationArguments)); 339 339 jit.prepareCallOperation(vm); 340 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationMaterializeObjectInOSR)), GPRInfo::nonArgGPR0);340 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationMaterializeObjectInOSR)), GPRInfo::nonArgGPR0); 341 341 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); 342 342 jit.storePtr(GPRInfo::returnValueGPR, materializationToPointer.get(materialization)); … … 368 368 CCallHelpers::TrustedImmPtr(materializationArguments)); 369 369 jit.prepareCallOperation(vm); 370 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationPopulateObjectInOSR)), GPRInfo::nonArgGPR0);370 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationPopulateObjectInOSR)), GPRInfo::nonArgGPR0); 371 371 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); 372 372 } -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
r254087 r259786 1 1 /* 2 * Copyright (C) 2011-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2011-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 252 252 // Set up one argument. 253 253 move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); 254 move(TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationExceptionFuzz)), GPRInfo::nonPreservedNonReturnGPR);254 move(TrustedImmPtr(tagCFunction<OperationPtrTag>(operationExceptionFuzz)), GPRInfo::nonPreservedNonReturnGPR); 255 255 prepareCallOperation(vm); 256 256 call(GPRInfo::nonPreservedNonReturnGPR, OperationPtrTag); -
trunk/Source/JavaScriptCore/jit/CCallHelpers.cpp
r251518 r259786 1 1 /* 2 * Copyright (C) 2016-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2016-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 63 63 setupArguments<decltype(operationProcessShadowChickenLog)>(TrustedImmPtr(&vm)); 64 64 prepareCallOperation(vm); 65 move(TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationProcessShadowChickenLog)), scratch1NonArgGPR);65 move(TrustedImmPtr(tagCFunction<OperationPtrTag>(operationProcessShadowChickenLog)), scratch1NonArgGPR); 66 66 call(scratch1NonArgGPR, OperationPtrTag); 67 67 move(TrustedImmPtr(shadowChicken->addressOfLogCursor()), scratch1NonArgGPR); -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r259676 r259786 1065 1065 1066 1066 return encodeResult( 1067 tagCFunction Ptr<void*, JSEntryPtrTag>(getHostCallReturnValue),1067 tagCFunction<void*, JSEntryPtrTag>(getHostCallReturnValue), 1068 1068 reinterpret_cast<void*>(callLinkInfo->callMode() == CallMode::Tail ? ReuseTheFrame : KeepTheFrame)); 1069 1069 } … … 1093 1093 } 1094 1094 1095 return encodeResult(tagCFunction Ptr<void*, JSEntryPtrTag>(getHostCallReturnValue), reinterpret_cast<void*>(KeepTheFrame));1095 return encodeResult(tagCFunction<void*, JSEntryPtrTag>(getHostCallReturnValue), reinterpret_cast<void*>(KeepTheFrame)); 1096 1096 } 1097 1097 -
trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp
r258063 r259786 1 1 /* 2 * Copyright (C) 2010-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2010-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 74 74 jit.setupArguments<decltype(operationLookupExceptionHandler)>(CCallHelpers::TrustedImmPtr(&vm)); 75 75 jit.prepareCallOperation(vm); 76 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationLookupExceptionHandler)), GPRInfo::nonArgGPR0);76 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationLookupExceptionHandler)), GPRInfo::nonArgGPR0); 77 77 emitPointerValidation(jit, GPRInfo::nonArgGPR0, OperationPtrTag); 78 78 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); … … 101 101 jit.addPtr(CCallHelpers::TrustedImm32(32), CCallHelpers::stackPointerRegister, GPRInfo::argumentGPR0); 102 102 jit.move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR1); 103 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(slowPathFunction)), GPRInfo::nonArgGPR0);103 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(slowPathFunction)), GPRInfo::nonArgGPR0); 104 104 emitPointerValidation(jit, GPRInfo::nonArgGPR0, OperationPtrTag); 105 105 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); … … 111 111 jit.addPtr(CCallHelpers::TrustedImm32(-maxFrameExtentForSlowPathCall), CCallHelpers::stackPointerRegister); 112 112 jit.setupArguments<decltype(slowPathFunction)>(GPRInfo::regT3, GPRInfo::regT2); 113 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(slowPathFunction)), GPRInfo::nonArgGPR0);113 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(slowPathFunction)), GPRInfo::nonArgGPR0); 114 114 emitPointerValidation(jit, GPRInfo::nonArgGPR0, OperationPtrTag); 115 115 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); … … 336 336 #endif 337 337 jit.move(CCallHelpers::TrustedImmPtr(&vm), JSInterfaceJIT::argumentGPR0); 338 jit.move(JSInterfaceJIT::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationVMHandleException)), JSInterfaceJIT::regT3);338 jit.move(JSInterfaceJIT::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationVMHandleException)), JSInterfaceJIT::regT3); 339 339 jit.call(JSInterfaceJIT::regT3, OperationPtrTag); 340 340 #if OS(WINDOWS) … … 1192 1192 jit.setupArguments<decltype(operationThrowStackOverflowErrorFromThunk)>(GPRInfo::regT3); 1193 1193 jit.prepareCallOperation(vm); 1194 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationThrowStackOverflowErrorFromThunk)), GPRInfo::nonArgGPR0);1194 jit.move(CCallHelpers::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationThrowStackOverflowErrorFromThunk)), GPRInfo::nonArgGPR0); 1195 1195 emitPointerValidation(jit, GPRInfo::nonArgGPR0, OperationPtrTag); 1196 1196 jit.call(GPRInfo::nonArgGPR0, OperationPtrTag); -
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
r256665 r259786 1 1 /* 2 * Copyright (C) 2016-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2016-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 699 699 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. 700 700 result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(Anyref), origin(), 701 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationGetWasmTableElement, B3CCallPtrTag)),701 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationGetWasmTableElement)), 702 702 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), index); 703 703 … … 718 718 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. 719 719 auto shouldThrow = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Int32, origin(), 720 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationSetWasmTableElement, B3CCallPtrTag)),720 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationSetWasmTableElement)), 721 721 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), index, value); 722 722 … … 738 738 739 739 result = m_currentBlock->appendNew<CCallValue>(m_proc, B3::Int64, origin(), 740 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationWasmRefFunc, B3CCallPtrTag)),740 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationWasmRefFunc)), 741 741 instanceValue(), addConstant(Type::I32, index)); 742 742 … … 748 748 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. 749 749 result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 750 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationGetWasmTableSize, B3CCallPtrTag)),750 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationGetWasmTableSize)), 751 751 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex)); 752 752 … … 757 757 { 758 758 result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 759 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationWasmTableGrow, B3CCallPtrTag)),759 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationWasmTableGrow)), 760 760 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), fill, delta); 761 761 … … 766 766 { 767 767 auto result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 768 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationWasmTableFill, B3CCallPtrTag)),768 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationWasmTableFill)), 769 769 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), offset, fill, count); 770 770 … … 801 801 { 802 802 result = m_currentBlock->appendNew<CCallValue>(m_proc, Int32, origin(), 803 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationGrowMemory, B3CCallPtrTag)),803 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationGrowMemory)), 804 804 framePointer(), instanceValue(), delta); 805 805 … … 905 905 m_currentBlock = doSlowPath; 906 906 907 Value* writeBarrierAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationWasmWriteBarrierSlowPath, B3CCallPtrTag));907 Value* writeBarrierAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationWasmWriteBarrierSlowPath)); 908 908 m_currentBlock->appendNew<CCallValue>(m_proc, B3::Void, origin(), writeBarrierAddress, cell, vm); 909 909 m_currentBlock->appendNewControlValue(m_proc, Jump, origin(), continuation); … … 958 958 m_currentBlock = doSlowPath; 959 959 960 Value* writeBarrierAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationWasmWriteBarrierSlowPath, B3CCallPtrTag));960 Value* writeBarrierAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationWasmWriteBarrierSlowPath)); 961 961 m_currentBlock->appendNew<CCallValue>(m_proc, B3::Void, origin(), writeBarrierAddress, cell, vm); 962 962 m_currentBlock->appendNewControlValue(m_proc, Jump, origin(), continuation); … … 2151 2151 #endif 2152 2152 2153 Value* funcAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(&operationPopcount32, B3CCallPtrTag));2153 Value* funcAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationPopcount32)); 2154 2154 result = m_currentBlock->appendNew<CCallValue>(m_proc, Int32, origin(), Effects::none(), funcAddress, arg); 2155 2155 return { }; … … 2172 2172 #endif 2173 2173 2174 Value* funcAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction Ptr<void*>(operationPopcount64, B3CCallPtrTag));2174 Value* funcAddress = m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunction<B3CCallPtrTag>(operationPopcount64)); 2175 2175 result = m_currentBlock->appendNew<CCallValue>(m_proc, Int64, origin(), Effects::none(), funcAddress, arg); 2176 2176 return { }; -
trunk/Source/JavaScriptCore/wasm/WasmThunks.cpp
r253140 r259786 1 1 /* 2 * Copyright (C) 2017-20 18Apple Inc. All rights reserved.2 * Copyright (C) 2017-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 89 89 90 90 jit.loadWasmContextInstance(GPRInfo::argumentGPR0); 91 jit.move(MacroAssembler::TrustedImmPtr(tagCFunction Ptr<OperationPtrTag>(operationWasmTriggerTierUpNow)), GPRInfo::argumentGPR2);91 jit.move(MacroAssembler::TrustedImmPtr(tagCFunction<OperationPtrTag>(operationWasmTriggerTierUpNow)), GPRInfo::argumentGPR2); 92 92 jit.call(GPRInfo::argumentGPR2, OperationPtrTag); 93 93 -
trunk/Source/WTF/ChangeLog
r259780 r259786 1 2020-04-09 Mark Lam <mark.lam@apple.com> 2 3 Implement a more efficient tagCFunction() tool. 4 https://bugs.webkit.org/show_bug.cgi?id=210254 5 6 Reviewed by Keith Miller. 7 8 The current tagCFunctionPtr() tool does some extra work that is not needed if 9 we are tagging a known function and not a potentially arbitrary pointer. For 10 example, 11 1. it doesn't need to do a null check. 12 2. it doesn't need to authenticate the function address. 13 3. The RELEASE_ASSERT used to enforce that authentication can also go away. 14 15 We should only use tagCFunction() (instead of tagCFunctionPtr()) if we know for 16 certain that we're operating on a C/C++ function, and not some arbitrary pointer. 17 18 * wtf/PtrTag.h: 19 (WTF::tagCFunction): 20 1 21 2020-04-08 David Kilzer <ddkilzer@apple.com> 2 22 -
trunk/Source/WTF/wtf/PtrTag.h
r254087 r259786 1 1 /* 2 * Copyright (C) 2018-20 19Apple Inc. All rights reserved.2 * Copyright (C) 2018-2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 321 321 inline PtrType tagCFunctionPtr(PtrType ptr) { return tagCFunctionPtr(ptr, tag); } 322 322 323 template<PtrTag newTag, typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type> 324 inline FunctionType tagCFunction(FunctionType func) 325 { 326 ASSERT(isTaggedWith(func, CFunctionPtrTag)); 327 ASSERT(newTag != CFunctionPtrTag); 328 return ptrauth_auth_and_resign(func, ptrauth_key_function_pointer, 0, ptrauth_key_process_dependent_code, newTag); 329 } 330 331 template<typename ReturnType, PtrTag newTag, typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type> 332 inline ReturnType tagCFunction(FunctionType func) 333 { 334 return bitwise_cast<ReturnType>(tagCFunction<newTag>(func)); 335 } 336 323 337 template<PtrTagAction tagAction, typename PtrType> 324 338 inline PtrType untagCFunctionPtrImpl(PtrType ptr, PtrTag tag) … … 522 536 inline PtrType tagCFunctionPtr(PtrType ptr) { return ptr; } 523 537 538 template<PtrTag newTag, typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type> 539 inline FunctionType tagCFunction(FunctionType func) { return func; } 540 541 template<typename ReturnType, PtrTag newTag, typename FunctionType, class = typename std::enable_if<std::is_pointer<FunctionType>::value && std::is_function<typename std::remove_pointer<FunctionType>::type>::value>::type> 542 inline ReturnType tagCFunction(FunctionType func) 543 { 544 return bitwise_cast<ReturnType>(tagCFunction<newTag>(func)); 545 } 546 524 547 template<typename T, typename PtrType, typename = std::enable_if_t<std::is_pointer<PtrType>::value && !std::is_same<T, PtrType>::value>> 525 548 inline T untagCFunctionPtr(PtrType ptr, PtrTag) { return bitwise_cast<T>(ptr); } … … 579 602 using WTF::retagCodePtr; 580 603 using WTF::removeCodePtrTag; 604 using WTF::tagCFunction; 581 605 using WTF::tagCFunctionPtr; 582 606 using WTF::untagCFunctionPtr;
Note: See TracChangeset
for help on using the changeset viewer.