Changeset 244058 in webkit
- Timestamp:
- Apr 8, 2019, 5:00:24 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/is-rope-check-in-string-slice-should-not-jump-over-register-allocations.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r244057 r244058 1 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] isRope jump in StringSlice should not jump over register allocations 4 https://bugs.webkit.org/show_bug.cgi?id=196716 5 6 Reviewed by Saam Barati. 7 8 * stress/is-rope-check-in-string-slice-should-not-jump-over-register-allocations.js: Added. 9 (foo.bar): 10 (foo): 11 1 12 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r244057 r244058 1 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] isRope jump in StringSlice should not jump over register allocations 4 https://bugs.webkit.org/show_bug.cgi?id=196716 5 6 Reviewed by Saam Barati. 7 8 Jumping over the register allocation code in DFG (like the following) is wrong. 9 10 auto jump = m_jit.branchXXX(); 11 { 12 GPRTemporary reg(this); 13 GPRReg regGPR = reg.gpr(); 14 ... 15 } 16 jump.link(&m_jit); 17 18 When GPRTemporary::gpr allocates a new register, it can flush the previous register value into the stack and make the register usable. 19 Jumping over this register allocation code skips the flushing code, and makes the DFG's stack and register content tracking inconsistent: 20 DFG thinks that the content is flushed and stored in particular stack slot even while this flushing code is skipped. 21 In this patch, we perform register allocations before jumping to the slow path based on `isRope` condition in StringSlice. 22 23 * dfg/DFGSpeculativeJIT.cpp: 24 (JSC::DFG::SpeculativeJIT::compileStringSlice): 25 1 26 2019-04-08 Yusuke Suzuki <ysuzuki@apple.com> 2 27 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r243959 r244058 1548 1548 1549 1549 GPRTemporary temp(this); 1550 GPRTemporary temp2(this); 1551 GPRTemporary startIndex(this); 1552 1550 1553 GPRReg tempGPR = temp.gpr(); 1554 GPRReg temp2GPR = temp2.gpr(); 1555 GPRReg startIndexGPR = startIndex.gpr(); 1551 1556 1552 1557 m_jit.loadPtr(CCallHelpers::Address(stringGPR, JSString::offsetOfValue()), tempGPR); 1553 1558 auto isRope = m_jit.branchIfRopeStringImpl(tempGPR); 1554 1555 GPRTemporary temp2(this);1556 GPRTemporary startIndex(this);1557 1558 GPRReg temp2GPR = temp2.gpr();1559 GPRReg startIndexGPR = startIndex.gpr();1560 1559 { 1561 1560 m_jit.load32(MacroAssembler::Address(tempGPR, StringImpl::lengthMemoryOffset()), temp2GPR);
Note:
See TracChangeset
for help on using the changeset viewer.