Bug 128570

Summary: Removing limitation on JSLock’s lockDropDepth
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, fpizlo, ggaren, mhahnenberg, msaboff, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
the patch.
none
patch 2: fixed typos.
none
patch 3: rebased, and fixed more typo fails. ggaren: review+

Description Mark Lam 2014-02-10 18:03:42 PST
Now that we’ve switched to using the C stack, we no longer need to limit the lockDropDepth to 2.

For C loop builds which still uses the separate JSStack, The JSLock will enforce ordering for re-grabbing the lock after dropping it.  Ordering is achieved by JSLock::dropAllLocks() stashing away the JSLock:: m_lockDropDepth in its dropper’s DropAllLocks::m_dropDepth before unlocking the lock.  JSLock::grabAllLocks() will ensure that JSLocks::m_lockDropDepth equals its dropper’s DropAllLocks::m_dropDepth before allowing the lock to be re-grabbed.  Otherwise, it will yield and retry again later.
Comment 1 Mark Lam 2014-02-10 18:45:12 PST
Created attachment 223785 [details]
the patch.
Comment 2 Mark Lam 2014-02-10 18:47:22 PST
Comment on attachment 223785 [details]
the patch.

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

> Source/JavaScriptCore/ChangeLog:8
> +        Now that weâve switched to using the C stack, we no longer need to limit

Will fix the non-ascii character.

> Source/JavaScriptCore/ChangeLog:25
> +        JSLock, yield, and the relock it again later before retrying the check.

typo: “the relock” ==> “then relock”.
Comment 3 Mark Lam 2014-02-10 18:48:51 PST
Created attachment 223786 [details]
patch 2: fixed typos.
Comment 4 Mark Lam 2014-02-10 18:55:55 PST
Created attachment 223787 [details]
patch 3: rebased, and fixed more typo fails.
Comment 5 Geoffrey Garen 2014-02-10 20:37:02 PST
Comment on attachment 223787 [details]
patch 3: rebased, and fixed more typo fails.

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

r=me

> Source/JavaScriptCore/runtime/JSLock.h:117
> +            friend class JSLock;

Let's make the accessor functions public instead of making JSLock a friend.
Comment 6 Mark Lam 2014-02-10 20:44:15 PST
Thanks for the review.  Landed in r163855: <http://trac.webkit.org/r163855>.