JM+TI: direct GNAME accesses

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: bhackett, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
Using invalidation/recompilation we can statically guard against changes to global object properties (deletion, change configuration) that affect GNAME accesses in the code, removing the need for an IC (make these as fast as GLOBAL opcodes).  We can also statically guard against slot reallocation on the global object, which would make these accesses as fast as those on escaping locals/args (i.e. we can't keep them in registers and still have to load/store on every access).

These could be made even faster in loops by carrying the globals in registers, writing them out after assignments and reloading them after stub/scripted calls, a la loop invariants.  That would depend on this though and would require some FrameState changes, good followup fodder I think.
(Reporter)

Comment 1

7 years ago
Landed on JM.

http://hg.mozilla.org/projects/jaegermonkey/rev/b442ad97a2fb

This statically guards against both slot reallocation and configuration change, which was significantly faster than only guarding against configuration and having to reload the slots pointer on each access.  The machinery for configuration guards will be reused for optimizing instance property accesses.

n = 100000000;
for (i = 0; i < n; i++) {}

js -m -n (old): 585
js -m -n (new): 223
js -j: 192
js -m: 575
d8: 1116
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Depends on: 649339
You need to log in before you can comment on or make changes to this bug.