Changeset 205283 in webkit
- Timestamp:
- Sep 1, 2016 1:22:21 AM (8 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r205278 r205283 1 2016-09-01 Saam Barati <sbarati@apple.com> 2 3 JITMathIC was misusing maxJumpReplacementSize 4 https://bugs.webkit.org/show_bug.cgi?id=161356 5 <rdar://problem/28065560> 6 7 Reviewed by Benjamin Poulain. 8 9 JITMathIC was assuming that maxJumpReplacementSize is the size 10 you'd get if you emitted a patchableJump() using the macro assembler. 11 This is not true, however. It happens to be true on arm64, x86 and x86-64, 12 however, it is not true on armv7. This patch introduces an alternative to 13 maxJumpReplacementSize called patchableJumpSize, and switches JITMathIC 14 to use that number instead. 15 16 * assembler/ARM64Assembler.h: 17 (JSC::ARM64Assembler::patchableJumpSize): 18 (JSC::ARM64Assembler::maxJumpReplacementSize): Deleted. 19 * assembler/ARMv7Assembler.h: 20 (JSC::ARMv7Assembler::patchableJumpSize): 21 (JSC::ARMv7Assembler::maxJumpReplacementSize): Deleted. 22 * assembler/MacroAssemblerARM64.h: 23 (JSC::MacroAssemblerARM64::patchableJumpSize): 24 * assembler/MacroAssemblerARMv7.h: 25 (JSC::MacroAssemblerARMv7::patchableJumpSize): 26 * assembler/MacroAssemblerX86Common.h: 27 (JSC::MacroAssemblerX86Common::patchableJumpSize): 28 * assembler/X86Assembler.h: 29 (JSC::X86Assembler::patchableJumpSize): 30 (JSC::X86Assembler::maxJumpReplacementSize): Deleted. 31 * jit/JITMathIC.h: 32 (JSC::JITMathIC::generateInline): 33 1 34 2016-08-31 Yusuke Suzuki <utatane.tea@gmail.com> 2 35 -
trunk/Source/JavaScriptCore/assembler/ARM64Assembler.h
r202214 r205283 2513 2513 return 4; 2514 2514 } 2515 2516 static constexpr ptrdiff_t patchableJumpSize() 2517 { 2518 return 4; 2519 } 2515 2520 2516 2521 static void replaceWithLoad(void* where) -
trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r202214 r205283 2341 2341 #endif 2342 2342 } 2343 2344 static constexpr ptrdiff_t patchableJumpSize() 2345 { 2346 return 10; 2347 } 2343 2348 2344 2349 static void replaceWithLoad(void* instructionStart) -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
r204912 r205283 3250 3250 } 3251 3251 3252 static ptrdiff_t patchableJumpSize() 3253 { 3254 return ARM64Assembler::patchableJumpSize(); 3255 } 3256 3252 3257 RegisterID scratchRegisterForBlinding() 3253 3258 { -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
r203365 r205283 1351 1351 } 1352 1352 1353 static ptrdiff_t patchableJumpSize() 1354 { 1355 return ARMv7Assembler::patchableJumpSize(); 1356 } 1357 1353 1358 // Forwards / external control flow operations: 1354 1359 // -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
r203390 r205283 2632 2632 { 2633 2633 return X86Assembler::maxJumpReplacementSize(); 2634 } 2635 2636 static ptrdiff_t patchableJumpSize() 2637 { 2638 return X86Assembler::patchableJumpSize(); 2634 2639 } 2635 2640 -
trunk/Source/JavaScriptCore/assembler/X86Assembler.h
r203390 r205283 2814 2814 return 5; 2815 2815 } 2816 2817 static constexpr ptrdiff_t patchableJumpSize() 2818 { 2819 return 5; 2820 } 2816 2821 2817 2822 #if CPU(X86_64) -
trunk/Source/JavaScriptCore/jit/JITMathIC.h
r204025 r205283 82 82 // once we have an idea about the types of lhs and rhs. 83 83 state.slowPathJumps.append(jit.patchableJump()); 84 size_t inlineSize = jit.m_assembler.buffer().codeSize() - startSize; 85 ASSERT_UNUSED(inlineSize, static_cast<ptrdiff_t>(inlineSize) <= MacroAssembler::patchableJumpSize()); 84 86 state.shouldSlowPathRepatch = true; 85 87 state.fastPathEnd = jit.label(); 86 88 ASSERT(!m_generateFastPathOnRepatch); // We should have gathered some observed type info for lhs and rhs before trying to regenerate again. 87 89 m_generateFastPathOnRepatch = true; 88 size_t inlineSize = jit.m_assembler.buffer().codeSize() - startSize;89 ASSERT_UNUSED(inlineSize, static_cast<ptrdiff_t>(inlineSize) <= MacroAssembler::maxJumpReplacementSize());90 90 return true; 91 91 } … … 97 97 case JITMathICInlineResult::GeneratedFastPath: { 98 98 size_t inlineSize = jit.m_assembler.buffer().codeSize() - startSize; 99 if (static_cast<ptrdiff_t>(inlineSize) < MacroAssembler:: maxJumpReplacementSize()) {100 size_t nopsToEmitInBytes = MacroAssembler:: maxJumpReplacementSize() - inlineSize;99 if (static_cast<ptrdiff_t>(inlineSize) < MacroAssembler::patchableJumpSize()) { 100 size_t nopsToEmitInBytes = MacroAssembler::patchableJumpSize() - inlineSize; 101 101 jit.emitNops(nopsToEmitInBytes); 102 102 }
Note: See TracChangeset
for help on using the changeset viewer.