Bug 52528

Summary: Strict mode restrictions on arguments and eval usage aren't complete
Product: WebKit Reporter: Oliver Hunt <oliver>
Component: New BugsAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch ggaren: review+

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>