Bug 76127 - [JSC] Remove redundant arguments from [Supplemental] custom methods
Summary: [JSC] Remove redundant arguments from [Supplemental] custom methods
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks: 72138
  Show dependency treegraph
 
Reported: 2012-01-11 16:50 PST by Kentaro Hara
Modified: 2013-04-08 22:54 PDT (History)
5 users (show)

See Also:


Attachments
Patch (11.56 KB, patch)
2012-01-11 17:10 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
rebased patch for commit (11.51 KB, patch)
2012-01-11 17:22 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-01-11 16:50:57 PST
Since in JSC a callback of custom methods is non-static, we do not need to pass a pointer of an implementation object.

Before (JSTestInterface.cpp):
JSValue jsTestInterfaceSupplementalStr3(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
    TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
    return castedThis->supplementalStr3(impl, exec);
}

After (JSTestInterface.cpp):
JSValue jsTestInterfaceSupplementalStr3(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
     return castedThis->supplementalStr3(exec);  // JSTestInterface knows 'impl'.
}

We should also remove redundant arguments from JSDOMWindowWebSocketCustom.cpp and JSDOMWindowWebAudioCustom.cpp.
Comment 1 Kentaro Hara 2012-01-11 17:10:58 PST
Created attachment 122135 [details]
Patch
Comment 2 Kentaro Hara 2012-01-11 17:22:23 PST
Created attachment 122138 [details]
rebased patch for commit
Comment 3 WebKit Review Bot 2012-01-11 17:58:01 PST
Comment on attachment 122138 [details]
rebased patch for commit

Clearing flags on attachment: 122138

Committed r104778: <http://trac.webkit.org/changeset/104778>
Comment 4 Takeshi Yoshino 2013-04-08 22:54:05 PDT
Looks like it's ok to close this. Reopen if not.