Changeset 245813 in webkit
- Timestamp:
- May 28, 2019, 9:03:02 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/microbenchmarks/get-by-val-negative-array-index.js (modified) (1 diff)
-
JSTests/microbenchmarks/put-by-val-negative-array-index.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/jit/JITOperations.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r245769 r245813 1 2019-05-28 Tadeu Zagallo <tzagallo@apple.com> 2 3 JITOperations putByVal should mark negative array indices as out-of-bounds 4 https://bugs.webkit.org/show_bug.cgi?id=198271 5 6 Reviewed by Saam Barati. 7 8 * microbenchmarks/get-by-val-negative-array-index.js: 9 (foo): 10 Update the getByVal microbenchmark added in r245769. This now shows that r245769 11 is 4.2x faster than the previous commit. 12 13 * microbenchmarks/put-by-val-negative-array-index.js: Added. 14 (foo): 15 1 16 2019-05-25 Tadeu Zagallo <tzagallo@apple.com> 2 17 -
trunk/JSTests/microbenchmarks/get-by-val-negative-array-index.js
r245769 r245813 1 1 function foo(arr, index) { 2 for (let i = 0; i < 1e2; i++) { 3 let x = {}; 4 x.x = arr; 5 } 6 2 7 return arr[index]; 3 8 } 4 9 noInline(foo); 5 10 6 const arr = new Array(10 00).fill({});7 for (let i = 0; i < 1e 7; i++) {11 const arr = new Array(10).fill({}); 12 for (let i = 0; i < 1e6; i++) { 8 13 foo(arr, i % arr.length); 9 if (!(i % 1e3)) 14 } 15 for (let i = 0; i < 1e6; i++) { 16 foo(arr, i % arr.length); 17 if (!(i % arr.length)) 10 18 foo(arr, -1); 11 19 } -
trunk/Source/JavaScriptCore/ChangeLog
r245808 r245813 1 2019-05-28 Tadeu Zagallo <tzagallo@apple.com> 2 3 JITOperations putByVal should mark negative array indices as out-of-bounds 4 https://bugs.webkit.org/show_bug.cgi?id=198271 5 6 Reviewed by Saam Barati. 7 8 Similar to what was done to getByVal in r245769, we should also mark put_by_val as out-of-bounds 9 when we exit from DFG for putting to a negative index. This avoids the same scenario where we keep 10 recompiling a CodeBlock with DFG and exiting at the same bytecode. 11 12 This is a 3.7x improvement in the microbenchmark being added: put-by-val-negative-array-index.js. 13 14 * jit/JITOperations.cpp: 15 1 16 2019-05-28 Yusuke Suzuki <ysuzuki@apple.com> 2 17 -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r245769 r245813 654 654 baseValue.putByIndex(callFrame, i, value, callFrame->codeBlock()->isStrictMode()); 655 655 return; 656 } else if (subscript.isInt32()) { 657 byValInfo->tookSlowPath = true; 658 if (baseValue.isObject()) 659 byValInfo->arrayProfile->setOutOfBounds(); 656 660 } 657 661
Note:
See TracChangeset
for help on using the changeset viewer.