Changeset 192599 in webkit
- Timestamp:
- Nov 18, 2015 4:30:37 PM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r192597 r192599 1 2015-11-18 Mark Lam <mark.lam@apple.com> 2 3 Remove some unnecessary jumps in snippet code. 4 https://bugs.webkit.org/show_bug.cgi?id=151415 5 6 Reviewed by Geoffrey Garen. 7 8 Previously, the snippet generators always emit a jump at the end of the fast 9 path. In the baseline JIT and FTL, this results in a jump to the very next 10 instruction. I've change it to assume that the fast path will just fall thru, 11 and let the client decide instead if it wants/needs a jump or not after the fast 12 path. 13 14 I also changed the generators to provide a didEmitFastPath() query explicitly 15 declare if they actually generated the fast path, instead of having the client 16 infer it from an empty endJumpList. 17 18 Benchmarks show that perf is neutral with this change (tested on x86_64). 19 20 * dfg/DFGSpeculativeJIT.cpp: 21 (JSC::DFG::SpeculativeJIT::compileValueAdd): 22 (JSC::DFG::SpeculativeJIT::compileArithSub): 23 * ftl/FTLCompile.cpp: 24 (JSC::FTL::mmAllocateDataSection): 25 * jit/JITAddGenerator.cpp: 26 (JSC::JITAddGenerator::generateFastPath): 27 * jit/JITAddGenerator.h: 28 (JSC::JITAddGenerator::didEmitFastPath): 29 (JSC::JITAddGenerator::endJumpList): 30 (JSC::JITAddGenerator::slowPathJumpList): 31 * jit/JITArithmetic.cpp: 32 (JSC::JIT::emit_op_add): 33 (JSC::JIT::emit_op_sub): 34 * jit/JITSubGenerator.cpp: 35 (JSC::JITSubGenerator::generateFastPath): 36 * jit/JITSubGenerator.h: 37 (JSC::JITSubGenerator::didEmitFastPath): 38 (JSC::JITSubGenerator::endJumpList): 39 (JSC::JITSubGenerator::slowPathJumpList): 40 1 41 2015-11-18 Commit Queue <commit-queue@webkit.org> 2 42 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r192531 r192599 2881 2881 gen.generateFastPath(m_jit); 2882 2882 2883 ASSERT(gen.didEmitFastPath()); 2884 gen.endJumpList().append(m_jit.jump()); 2885 2883 2886 gen.slowPathJumpList().link(&m_jit); 2884 2887 … … 3240 3243 leftFPR, rightFPR, scratchGPR, scratchFPR); 3241 3244 gen.generateFastPath(m_jit); 3245 3246 ASSERT(gen.didEmitFastPath()); 3247 gen.endJumpList().append(m_jit.jump()); 3242 3248 3243 3249 gen.slowPathJumpList().link(&m_jit); -
trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp
r192590 r192599 463 463 gen.generateFastPath(fastPathJIT); 464 464 465 ASSERT(gen.didEmitFastPath()); 465 466 gen.endJumpList().link(&fastPathJIT); 466 467 context.restoreRegisters(fastPathJIT); -
trunk/Source/JavaScriptCore/jit/JITAddGenerator.cpp
r192531 r192599 45 45 46 46 if (!m_leftType.mightBeNumber() || !m_rightType.mightBeNumber()) { 47 m_slowPathJumpList.append(jit.jump());47 ASSERT(!m_didEmitFastPath); 48 48 return; 49 49 } 50 51 m_didEmitFastPath = true; 50 52 51 53 if (m_leftIsConstInt32 || m_rightIsConstInt32) { … … 138 140 jit.addDouble(m_rightFPR, m_leftFPR); 139 141 jit.boxDouble(m_leftFPR, m_result); 140 141 m_endJumpList.append(jit.jump());142 142 } 143 143 -
trunk/Source/JavaScriptCore/jit/JITAddGenerator.h
r192531 r192599 59 59 void generateFastPath(CCallHelpers&); 60 60 61 bool didEmitFastPath() const { return m_didEmitFastPath; } 61 62 CCallHelpers::JumpList endJumpList() { return m_endJumpList; } 62 63 CCallHelpers::JumpList slowPathJumpList() { return m_slowPathJumpList; } … … 76 77 GPRReg m_scratchGPR; 77 78 FPRReg m_scratchFPR; 79 bool m_didEmitFastPath { false }; 78 80 79 81 CCallHelpers::JumpList m_endJumpList; -
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r192535 r192599 959 959 gen.generateFastPath(*this); 960 960 961 if ( !gen.endJumpList().empty()) {961 if (gen.didEmitFastPath()) { 962 962 gen.endJumpList().link(this); 963 963 emitPutVirtualRegister(result, resultRegs); … … 965 965 addSlowCase(gen.slowPathJumpList()); 966 966 } else { 967 gen.slowPathJumpList().link(this); 967 ASSERT(gen.endJumpList().empty()); 968 ASSERT(gen.slowPathJumpList().empty()); 968 969 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add); 969 970 slowPathCall.call(); … … 1007 1008 1008 1009 gen.generateFastPath(*this); 1010 1011 ASSERT(gen.didEmitFastPath()); 1009 1012 gen.endJumpList().link(this); 1010 1013 emitPutVirtualRegister(result, resultRegs); -
trunk/Source/JavaScriptCore/jit/JITSubGenerator.cpp
r191713 r192599 41 41 ASSERT(m_scratchFPR != InvalidFPRReg); 42 42 #endif 43 44 m_didEmitFastPath = true; 45 43 46 CCallHelpers::Jump leftNotInt = jit.branchIfNotInt32(m_left); 44 47 CCallHelpers::Jump rightNotInt = jit.branchIfNotInt32(m_right); … … 82 85 jit.subDouble(m_rightFPR, m_leftFPR); 83 86 jit.boxDouble(m_leftFPR, m_result); 84 85 m_endJumpList.append(jit.jump());86 87 } 87 88 -
trunk/Source/JavaScriptCore/jit/JITSubGenerator.h
r191713 r192599 52 52 void generateFastPath(CCallHelpers&); 53 53 54 bool didEmitFastPath() const { return m_didEmitFastPath; } 54 55 CCallHelpers::JumpList endJumpList() { return m_endJumpList; } 55 56 CCallHelpers::JumpList slowPathJumpList() { return m_slowPathJumpList; } … … 65 66 GPRReg m_scratchGPR; 66 67 FPRReg m_scratchFPR; 68 bool m_didEmitFastPath { false }; 67 69 68 70 CCallHelpers::JumpList m_endJumpList;
Note: See TracChangeset
for help on using the changeset viewer.