Bug 140097

Summary: CreateArguments should take a LexicalEnvironment as a parameter
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: mark.lam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 140148, 140233, 140236    
Bug Blocks: 139827    

Mark Lam
Reported 2015-01-05 14:03:22 PST
After https://bugs.webkit.org/show_bug.cgi?id=139827, a few test failures will start failing. One of them is arguments.js, which can be run this way: $ jsc --useFTLJIT=false --enableFunctionDotArguments=true --enableConcurrentJIT=false --thresholdForJITAfterWarmUp=100 --thresholdForJITAfterWarmUp=10 --thresholdForJITSoon=10 --thresholdForOptimizeAfterWarmUp=20 --thresholdForOptimizeAfterLongWarmUp=20 --thresholdForOptimizeSoon=20 --thresholdForFTLOptimizeAfterWarmUp=20 --thresholdForFTLOptimizeSoon=20 resources/standalone-pre.js arguments.js resources/standalone-post.js The relevant code is as follows: function tear_off_live_2(a, b, c) { var args = arguments; return function() { args[1] = 2; return b; }; } In the generated DFG IR, the fact that CreateArguments replies on the result of CreateActivation is not explicitly spelled out. CreateArguments relies on the created activation (aka LexicalEnvironment) having been stored in the designated lexicalEnvironment local previously. However, without knowing that CreateArgument relies on that local value, CFA declares the store of that local unnecessary and dead code elimination removed it. As a result, the Arguments factory crashes when it use the lexicalEnvironment local but discovers that it is uninitialized. The fix is to pass the result of CreateActivation to CreateArguments as an argument instead of having it implicitly load the lexicalEnvironment from its designated local.
Attachments
Radar WebKit Bug Importer
Comment 1 2015-01-05 14:04:12 PST
Mark Lam
Comment 2 2015-04-20 14:36:02 PDT
This issue was resolved as part of the changes for https://bugs.webkit.org/show_bug.cgi?id=141174. *** This bug has been marked as a duplicate of bug 141174 ***
Note You need to log in before you can comment on or make changes to this bug.