Changeset 269783 in webkit
- Timestamp:
- Nov 13, 2020, 9:44:14 AM (6 years ago)
- Location:
- releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
b3/B3ReduceStrength.cpp (modified) (1 diff)
-
b3/testb3.h (modified) (1 diff)
-
b3/testb3_1.cpp (modified) (1 diff)
-
b3/testb3_5.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore/ChangeLog
r266594 r269783 1 2020-08-19 Tadeu Zagallo <tzagallo@apple.com> 2 3 B3 IntRange is incorrect for negative masks 4 https://bugs.webkit.org/show_bug.cgi?id=215536 5 <rdar://problem/67130430> 6 7 Reviewed by Michael Saboff and Robin Morisset. 8 9 In the B3 ReduceStrength phase, we compute rangeForMask as (0, mask). This is correct for 10 positive values, but incorrect when negative. To fix it, we use `(INT_MIN & mask, INT_MAX & mask)` 11 as the range for negative masks. 12 13 * b3/B3ReduceStrength.cpp: 14 * b3/testb3.h: 15 * b3/testb3_1.cpp: 16 (run): 17 * b3/testb3_5.cpp: 18 (testCheckSubBitAnd): 19 1 20 2020-09-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 21 -
releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore/b3/B3ReduceStrength.cpp
r261755 r269783 124 124 if (!(mask + 1)) 125 125 return top<T>(); 126 if (mask < 0) 127 return IntRange(INT_MIN & mask, mask & INT_MAX); 126 128 return IntRange(0, mask); 127 129 } -
releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore/b3/testb3.h
r254832 r269783 805 805 void testCheckSubBadImm(); 806 806 void testCheckSub(); 807 void testCheckSubBitAnd(); 807 808 double doubleSub(double, double); 808 809 void testCheckSub64(); -
releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore/b3/testb3_1.cpp
r263635 r269783 497 497 RUN(testCheckSubBadImm()); 498 498 RUN(testCheckSub()); 499 RUN(testCheckSubBitAnd()); 499 500 RUN(testCheckSub64()); 500 501 RUN(testCheckSubFold(100, 200)); -
releases/WebKitGTK/webkit-2.30/Source/JavaScriptCore/b3/testb3_5.cpp
r259786 r269783 1124 1124 CHECK(invoke<double>(*code, 42, 42) == 0.0); 1125 1125 CHECK(invoke<double>(*code, -2147483647, 42) == -2147483689.0); 1126 } 1127 1128 void testCheckSubBitAnd() 1129 { 1130 Procedure proc; 1131 if (proc.optLevel() < 1) 1132 return; 1133 BasicBlock* root = proc.addBlock(); 1134 Value* zero = root->appendNew<Const32Value>(proc, Origin(), 0); 1135 Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); 1136 Value* truncatedArg1 = root->appendNew<Value>(proc, Trunc, Origin(), arg1); 1137 Value* minusTwo = root->appendNew<Const32Value>(proc, Origin(), -2); 1138 Value* bitAnd = root->appendNew<Value>(proc, BitAnd, Origin(), truncatedArg1, minusTwo); 1139 CheckValue* checkSub = root->appendNew<CheckValue>(proc, CheckSub, Origin(), zero, bitAnd); 1140 checkSub->setGenerator([&] (CCallHelpers& jit, const StackmapGenerationParams&) { 1141 AllowMacroScratchRegisterUsage allowScratch(jit); 1142 jit.move(CCallHelpers::TrustedImm32(42), GPRInfo::returnValueGPR); 1143 jit.emitFunctionEpilogue(); 1144 jit.ret(); 1145 }); 1146 root->appendNewControlValue(proc, Return, Origin(), checkSub); 1147 1148 auto code = compileProc(proc); 1149 1150 CHECK_EQ(invoke<int>(*code, 1), 0); 1151 CHECK_EQ(invoke<int>(*code, 2), -2); 1152 CHECK_EQ(invoke<int>(*code, 3), -2); 1153 CHECK_EQ(invoke<int>(*code, -1), 2); 1154 CHECK_EQ(invoke<int>(*code, -2), 2); 1155 CHECK_EQ(invoke<int>(*code, -3), 4); 1156 CHECK_EQ(invoke<int>(*code, INT_MAX), -(INT_MAX - 1)); 1157 CHECK_EQ(invoke<int>(*code, INT_MIN), 42); 1126 1158 } 1127 1159
Note:
See TracChangeset
for help on using the changeset viewer.