Bug 110769 - [V8] Generate a wrapper function for method callbacks
Summary: [V8] Generate a wrapper function for method callbacks
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: 110667
  Show dependency treegraph
 
Reported: 2013-02-25 10:56 PST by Kentaro Hara
Modified: 2013-02-25 13:33 PST (History)
1 user (show)

See Also:


Attachments
Patch (89.64 KB, patch)
2013-02-25 11:33 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 2013-02-25 10:56:10 PST
This is one of steps to insert TRACE_EVENT_STATE() macros into DOM bindings. This patch introduces an indirection function for xxxMethod(), like this:

// For non-custom methods
void xxxMethodCallback(...) {
  xxxMethod(...);
}

// For custom methods
void xxxMethodCallback(...) {
  return xxxMethodCustom(...);
}
Comment 1 Kentaro Hara 2013-02-25 11:33:26 PST
Created attachment 190097 [details]
Patch
Comment 2 Kentaro Hara 2013-02-25 11:36:28 PST
Comment on attachment 190097 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1473
> -sub GenerateOverloadedFunctionCallback
> +sub GenerateOverloadedFunction

The diff is confusing, but basically I just factored ${name}MethodCallback() out of GenerateOverloadedFunctionCallback().

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:1533
> +        push(@implContentDecls, "    return ${v8InterfaceName}::${name}MethodCustom(args);\n");
> +    } else {
> +        push(@implContentDecls, "    return ${interfaceName}V8Internal::${name}Method(args);\n");
> +    }

And this is the essential part of the patch. Other diffs are just for making this part workable.
Comment 3 Kentaro Hara 2013-02-25 13:33:14 PST
Committed r143967: <http://trac.webkit.org/changeset/143967>