Closed Bug 576733 Opened 14 years ago Closed 14 years ago

JM: PICs for not-escaped call objects

Categories

(Core :: JavaScript Engine, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: dvander, Assigned: dvander)

References

Details

Attachments

(1 file, 1 obsolete file)

bz's test case in 576687 comment #7 is 7-8X slower in JM versus TM. We should be able to generate special-case PICs for scope chains.
blocking2.0: --- → ?
Mysteriously, something about my 32-bit TM appears to be busted on this test case. But not in debug mode.

dvander@dvander:~/mozilla/moo/js/src$ ~/mozilla/tracemonkey/js/src/Opt32/js -j k.js 
533
dvander@dvander:~/mozilla/moo/js/src$ ~/mozilla/tracemonkey/js/src/Debug32/js -j k.js 
1095
dvander@dvander:~/mozilla/moo/js/src$ ~/mozilla/tracemonkey/js/src/Opt64/js -j k.js 
5916
Attached patch WIP v1 (obsolete) — Splinter Review
This patch adds a PIC for JSOP_NAME. If the property is found on a Call object, it emits a scope chain walk. Each link is tested for non-NULL and shape identity. Any links that are non-cacheable cause the PIC to be disabled.

Notes:
 * Only js_GetCallArg and js_GetCallVar are supported right now.
 * Escaped frames are not yet supported.
 * Properties found on the global are not supported.

On my machine, this brings the score from 822 to 1452 - tracing's got 6,000, so still work to do.
Assignee: general → dvander
Status: NEW → ASSIGNED
Remaining culprits:

[jaeger] PICs     setprop disabled: setter (k.js: 6)
[jaeger] PICs     setprop disabled: setter (k.js: 7)

This patch halves the number of NAME slow-calls in v8, which was not very many (~130k). Will investigate what the others are tomorrow.
Attached patch WIP v2Splinter Review
PIC for SETNAME w/ non-escaped callobj. This brings our score to 2800.
Attachment #455936 - Attachment is obsolete: true
http://hg.mozilla.org/users/danderson_mozilla.com/moo/rev/18b8df733e33
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Summary: JM: PICs for call objects → JM: PICs for not-escaped call objects
Hmm.  Any idea why this is still so much slower than tracing?  Fwiw, V8 and current nitro are faster than tracing on the attached testcase....

Looking at the patch, we do generate code to directly poke dslots, right?
(In reply to comment #6)

With your test case, or the A* benchmark? For the test case, the closure doesn't escape. This patch only optimized non-escaping call objects, i.e. poke at fp->argv/slots rather than callobj->dslots.
My testcase.

It looks like that testcase wasn't quite a correct reduction of dromaeo, which uses escaping Call objects.  Filed bug 576926 on those.

But in any case, even my testcase is a lot slower that TM and definitely than v8/nitro....
Blocks: 577036
Blocks: 576688
blocking2.0: ? → betaN+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: