Changeset 280659 in webkit
- Timestamp:
- Aug 4, 2021, 2:17:57 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
b3/B3LowerToAir.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r280650 r280659 1 2021-08-04 Yijia Huang <yijia_huang@apple.com> 2 3 [ARM64] Fix Zoom black screen during video meeting on Safari 4 https://bugs.webkit.org/show_bug.cgi?id=228776 5 6 Reviewed by Saam Barati. 7 8 The problem (rdar://81434487) reports that Zoom turns to a black screen during the video 9 meeting on Safari. The reproduction of this problem is verified and bisected to the previous patch 10 (https://bugs.webkit.org/show_bug.cgi?id=228057). Previously, we introduce a pattern 11 matching for instruction EON-with-shift on ARM64, where the pattern is d = n ^ ((m ShiftType amount) ^ -1). 12 13 x = m ShiftType amount 14 y = x ^ -1 15 z = n ^ y 16 17 We check canBeInternal() on x but not on y based on the computing cost analysis in that patch, 18 which is totally wrong. If the pattern matching is triggered, then the compiler would not emit 19 the corresponding Air of x after lowering, leading to data corruption or system crash since y 20 depends on x. 21 22 In the real world example (Zoom video meeting), we find the B3 IR: 23 24 ... 25 Int32 b@528 = SShr(b@526, $31(b@527), Wasm: {opcode: I32ShrS, location: 0x26b}) 26 Int32 b@529 = BitXor(b@528, $-1(b@144), Wasm: {opcode: I32Xor, location: 0x26e}) 27 ... 28 Int32 b@551 = BitXor(b@446, b@529, Wasm: {opcode: I32Xor, location: 0x28e}) 29 ... 30 31 32 After Lowering to Air: 33 34 ... 35 Not32 %fp, %x2, b@529 36 ... 37 XorNotRightShift32 %tmp199, %tmp211, $31, %tmp209, b@551 38 ... 39 40 Since the implementation of the previous patch does commitInternal() on b@528, the operand of 41 b@529 turns to a frame pointer. To resolve this problem, we should either check canBeInternal() 42 on both b@528 and b@529 or not at all. 43 44 * b3/B3LowerToAir.cpp: 45 1 46 2021-08-04 Commit Queue <commit-queue@webkit.org> 2 47 -
trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp
r280583 r280659 3208 3208 XorNotRightShift32, XorNotRightShift64, 3209 3209 XorNotUnsignedRightShift32, XorNotUnsignedRightShift64); 3210 if (!isValidForm(opcode, Arg::Tmp, Arg::Tmp, Arg::Imm, Arg::Tmp) )3210 if (!isValidForm(opcode, Arg::Tmp, Arg::Tmp, Arg::Imm, Arg::Tmp) || !canBeInternal(right)) 3211 3211 return false; 3212 3212 Value* mValue = shiftValue->child(0); … … 3220 3220 3221 3221 append(opcode, tmp(nValue), tmp(mValue), imm(amountValue), tmp(m_value)); 3222 commitInternal(right); 3222 3223 commitInternal(shiftValue); 3223 3224 return true;
Note:
See TracChangeset
for help on using the changeset viewer.