Bug 52528 - Strict mode restrictions on arguments and eval usage aren't complete
Summary: Strict mode restrictions on arguments and eval usage aren't complete
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-15 21:24 PST by Oliver Hunt
Modified: 2011-01-16 15:55 PST (History)
1 user (show)

See Also:


Attachments
Patch (28.92 KB, patch)
2011-01-15 21:44 PST, Oliver Hunt
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2011-01-15 21:24:38 PST
Strict mode restrictions on arguments and eval usage aren't complete
Comment 1 Oliver Hunt 2011-01-15 21:44:26 PST
Created attachment 79092 [details]
Patch
Comment 2 Geoffrey Garen 2011-01-16 13:36:40 PST
+            isEvalOrArguments = m_globalData->propertyNames->eval == *m_lastIdentifier || m_globalData->propertyNames->arguments == *m_lastIdentifier;

We usually write comparisons like this in the opposite order.

Did you test the performance of this change? I think it's worth a SunSpider --parse-only run.
Comment 3 Oliver Hunt 2011-01-16 14:20:07 PST
(In reply to comment #2)
> +            isEvalOrArguments = m_globalData->propertyNames->eval == *m_lastIdentifier || m_globalData->propertyNames->arguments == *m_lastIdentifier;
> 
> We usually write comparisons like this in the opposite order.

Just heading out, i'll fix this when i get back

> 
> Did you test the performance of this change? I think it's worth a SunSpider --parse-only run.
Of course :p

sunspider says no change but over many runs i estimate it is actually a slowdown, just very very slight.  I don't believe that there's anything that can be done about it though.
Comment 4 Geoffrey Garen 2011-01-16 15:01:23 PST
Comment on attachment 79092 [details]
Patch

If a slowdown happens in a forest, and SunSpider doesn't measure it, does it actually exist?

r=me with that one change
Comment 5 Oliver Hunt 2011-01-16 15:55:06 PST
Committed r75896: <http://trac.webkit.org/changeset/75896>