Bug 126026

Summary: CStack Branch: Fix call operationStackCheck to check the proper stack
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch mark.lam: review+

Description Michael Saboff 2013-12-19 16:10:54 PST
JITOperations::operationStackCheck() always checks the JSStack.  It should check the correct stack based on the state of ENABLE(LLINT_CLOOP).
Comment 1 Michael Saboff 2013-12-19 16:14:52 PST
Created attachment 219698 [details]
Patch
Comment 2 Mark Lam 2013-12-19 16:18:16 PST
Comment on attachment 219698 [details]
Patch

r=me.  This is actually more conservative than it needs to be, it’s good enough for now until JSStack can be refactored to handle the check for both cases (coming soon).
Comment 3 Michael Saboff 2013-12-19 16:19:07 PST
Committed r160871: <http://trac.webkit.org/changeset/160871>
Comment 4 Geoffrey Garen 2013-12-19 16:27:34 PST
Comment on attachment 219698 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219698&action=review

> Source/JavaScriptCore/jit/JITOperations.cpp:89
> +    if (!exec->vm().isSafeToRecurse(-codeBlock->stackPointerOffset() * sizeof(Register)))

Since you're counting registers, you should use frameRegisterCount(), instead of manually converting based on SP.
Comment 5 Michael Saboff 2013-12-19 16:30:55 PST
(In reply to comment #4)
> (From update of attachment 219698 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219698&action=review
> 
> > Source/JavaScriptCore/jit/JITOperations.cpp:89
> > +    if (!exec->vm().isSafeToRecurse(-codeBlock->stackPointerOffset() * sizeof(Register)))
> 
> Since you're counting registers, you should use frameRegisterCount(), instead of manually converting based on SP.

I change it.
Comment 6 Michael Saboff 2013-12-19 16:36:49 PST
(In reply to comment #4)
> (From update of attachment 219698 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219698&action=review
> 
> > Source/JavaScriptCore/jit/JITOperations.cpp:89
> > +    if (!exec->vm().isSafeToRecurse(-codeBlock->stackPointerOffset() * sizeof(Register)))
> 
> Since you're counting registers, you should use frameRegisterCount(), instead of manually converting based on SP.

Landed this update in change set r160874: <http://trac.webkit.org/changeset/160874>