Bug 72546 - De-virtualize ScriptExecutable::unlinkCalls
Summary: De-virtualize ScriptExecutable::unlinkCalls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 14:17 PST by Mark Hahnenberg
Modified: 2011-11-16 17:36 PST (History)
0 users

See Also:


Attachments
Patch (8.45 KB, patch)
2011-11-16 14:23 PST, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2011-11-16 14:17:13 PST
We'll add some extra type info to JSType to include the subclasses of ScriptExecutable and test them to determine which function to call.
Comment 1 Mark Hahnenberg 2011-11-16 14:23:31 PST
Created attachment 115447 [details]
Patch
Comment 2 Geoffrey Garen 2011-11-16 15:22:33 PST
Comment on attachment 115447 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/Executable.h:692
> +        switch (structure()->typeInfo().type()) {

i'd like to understand better when we use ClassInfo and when we use a JSType. Do you have a rule for that?

> Source/JavaScriptCore/runtime/JSType.h:56
> +    StaticScopeObjectType = 22,

Yeah, I really think you want to remove the explicit numeric values for these enumerated constants.
Comment 3 Mark Hahnenberg 2011-11-16 15:30:11 PST
> i'd like to understand better when we use ClassInfo and when we use a JSType. Do you have a rule for that?

I don't have a specific rule.  I figured it might be easier for the compiler to optimize a switch with JSType since the values we're testing are clustered together.  This patch does actually seem to be a small perf win according to bencher.
Comment 4 Mark Hahnenberg 2011-11-16 17:36:44 PST
Committed r100537: <http://trac.webkit.org/changeset/100537>