Bug 72548 - De-virtualize ExecutableBase::intrinsic
Summary: De-virtualize ExecutableBase::intrinsic
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:28 PST by Mark Hahnenberg
Modified: 2011-11-18 14:13 PST (History)
1 user (show)

See Also:


Attachments
Patch (4.90 KB, patch)
2011-11-16 14:31 PST, Mark Hahnenberg
no flags Details | Formatted Diff | Diff
Patch (3.34 KB, patch)
2011-11-16 17:04 PST, Mark Hahnenberg
no flags 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:28:08 PST
We can leverage JSType again by adding a new value for NativeExecutable, which is the only class that overrides intrinsic.
Comment 1 Mark Hahnenberg 2011-11-16 14:31:01 PST
Created attachment 115450 [details]
Patch
Comment 2 Geoffrey Garen 2011-11-16 15:20:07 PST
Comment on attachment 115450 [details]
Patch

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

r=me

> Source/JavaScriptCore/runtime/Executable.cpp:57
> +    if (structure()->typeInfo().type() == NativeExecutableType)
> +        return jsCast<const NativeExecutable*>(this)->intrinsic();

Could just use classInfo here instead of a type flag. 

I mention this because it might be nice to deploy jsDynamicCast here, and I assume jsDynamicCast would be based on ClassInfo.

> Source/JavaScriptCore/runtime/JSType.h:54
>  };

Do we really need to spell these constants out explicitly? Do their bits have any meaning?
Comment 3 Mark Hahnenberg 2011-11-16 17:04:01 PST
Created attachment 115486 [details]
Patch
Comment 4 WebKit Review Bot 2011-11-18 14:13:54 PST
Comment on attachment 115486 [details]
Patch

Clearing flags on attachment: 115486

Committed r100810: <http://trac.webkit.org/changeset/100810>
Comment 5 WebKit Review Bot 2011-11-18 14:13:58 PST
All reviewed patches have been landed.  Closing bug.