Bug 122363 - FTL: Optimize IsString(@2<String>) -> JSConst(true) + Phantom()
Summary: FTL: Optimize IsString(@2<String>) -> JSConst(true) + Phantom()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-04 17:19 PDT by Nadav Rotem
Modified: 2013-10-07 15:07 PDT (History)
3 users (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2013-10-04 17:19 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff
Patch (1.80 KB, patch)
2013-10-04 17:35 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff
Patch (1.93 KB, patch)
2013-10-07 14:34 PDT, Nadav Rotem
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nadav Rotem 2013-10-04 17:19:17 PDT
FTL: Optimize IsString(@2<String) -> JSConst(true) + Phantom()
Comment 1 Nadav Rotem 2013-10-04 17:19:52 PDT
Created attachment 213424 [details]
Patch
Comment 2 Darin Adler 2013-10-04 17:28:44 PDT
Comment on attachment 213424 [details]
Patch

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

> Source/JavaScriptCore/dfg/DFGFixupPhase.cpp:894
> +        case IsString: {
> +            if (node->child1().useKind() == StringUse) {
> +                m_insertionSet.insertNode(m_indexInBlock, SpecNone, Phantom, node->codeOrigin,
> +                    Edge(node->child1().node(), StringUse));
> +                node->convertToConstant(1);
> +                break;
> +            }
> +        }

While I am not qualified to review this, I do have two small style comments: We should break rather than falling through at the end of this case. Also, there is no need for the outer braces around the if statement, so please remove them.
Comment 3 Nadav Rotem 2013-10-04 17:35:34 PDT
Created attachment 213426 [details]
Patch
Comment 4 Nadav Rotem 2013-10-07 14:34:47 PDT
Created attachment 213617 [details]
Patch
Comment 5 WebKit Commit Bot 2013-10-07 15:07:26 PDT
Comment on attachment 213617 [details]
Patch

Clearing flags on attachment: 213617

Committed r157059: <http://trac.webkit.org/changeset/157059>
Comment 6 WebKit Commit Bot 2013-10-07 15:07:29 PDT
All reviewed patches have been landed.  Closing bug.