[Webkit-unassigned] [Bug 114487] New: JSLockHolder in JSCMainThreadExecState::evaluate seems redundant

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 11 19:58:53 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=114487

           Summary: JSLockHolder in JSCMainThreadExecState::evaluate seems
                    redundant
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sg5.lee at samsung.com


Hello,

In Source/WebCore/bindings/js/JSMainThreadExecState.h


static JSC::JSValue evaluate(JSC::ExecState* exec, const JSC::SourceCode& source, JSC::JSValue thisValue, JSC::JSValue* exception)
{
    JSMainThreadExecState currentState(exec);
    JSC::JSLockHolder lock(exec);
    return JSC::evaluate(exec, source, thisValue, exception);
};


The statement "JSC::JSLockHolder lock(exec);" seems redundant since JSC::evaluate always locks same JSGlobalData like followings:

In JSC::evaluate(), 

JSValue evaluate(ExecState* exec, const SourceCode& source, JSValue thisValue, JSValue* returnedException)
{       
    JSLockHolder lock(exec);
    ....
}

Although JSLock uses spinlock and lightweight, therefore the overhead may be insignificant, it seems redundant.

Is it right? Or am I missing something?
Could you tell me the reason of locking twice?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list