Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r224539 - AccessCase::generateImpl() should exclude the result …
…register when restoring registers after a call. https://bugs.webkit.org/show_bug.cgi?id=179355 <rdar://problem/35263053> Reviewed by Saam Barati. JSTests: * stress/regress-179355.js: Added. Source/JavaScriptCore: In the Transition case in AccessCase::generateImpl(), we were restoring registers using restoreLiveRegistersFromStackForCall() without excluding the scratchGPR where we previously stashed the reallocated butterfly. If the generated code is under heavy register pressure, scratchGPR could have been from the set of preserved registers, and hence, would be restored by restoreLiveRegistersFromStackForCall(). As a result, the restoration would trash the butterfly result we stored there. This patch fixes the issue by excluding the scratchGPR in the restoration. * bytecode/AccessCase.cpp: (JSC::AccessCase::generateImpl):
- Loading branch information
1 parent
bc05fce
commit 035fd11
Showing
4 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var arr0 = [1,2,3,4]; | ||
var arr1 = new Array(1000); | ||
|
||
Array.prototype.__defineGetter__(1, function() { | ||
[].concat(arr1); //generate to invalid JIT code here? | ||
}); | ||
|
||
Array.prototype.__defineGetter__(Symbol.isConcatSpreadable, (function() { | ||
for(var i=0;i<10000;i++) { | ||
if(i==0) | ||
arr1[i]; | ||
this.x = 1.1; | ||
arr1.legnth = 1; | ||
} | ||
})); | ||
|
||
var exception; | ||
try { | ||
arr1[1].toString(); | ||
} catch (e) { | ||
exception = e; | ||
} | ||
|
||
if (exception != "RangeError: Maximum call stack size exceeded.") | ||
throw "FAILED"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters