Closed Bug 883656 Opened 11 years ago Closed 11 years ago

Handle lazy scripts in b[a] lambda pattern matching

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: bhackett1024, Unassigned)

References

Details

Attachments

(1 file)

Attached patch patch (deleted) — Splinter Review
We use a specialized path in String.replace for lambdas of the form 'return b[a]'. This is pretty important for ss-string-unpack-code, but when the lambda has not yet been compiled this pattern matching doesn't work and we do the generic thing. Subsequent replace() calls with the lambda will work, but even the first time around costs quite a bit in this benchmark --- running with lazy parsing is about 20% slower than without. The attached patch fixes this oversight, and with it we get about the same scores on the benchmark whether lazy parsing is enabled or not.
Attachment #763265 - Flags: review?(luke)
It looks like you've inverted the meaning of LambdaIsGetElem? You return true when it's not a JSOP_GETALIASEDVAR.
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #1) > It looks like you've inverted the meaning of LambdaIsGetElem? You return > true when it's not a JSOP_GETALIASEDVAR. Adding the getOrCreateScript call means this method is now fallible so its return value is a success code. Whether it actually found a match is indicated through the (new) outparam pobj.
Comment on attachment 763265 [details] [diff] [review] patch Heh, any time ss-string-unpack-code we should just assume LambdaIsGetElem needs to be updated.
Attachment #763265 - Flags: review?(luke) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: