TypeInference: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
(Created page with "[https://bugzilla.mozilla.org/show_bug.cgi?id=557407 Type Inference] is Brian Hackett's type inference engine for JavaScript. It is a whole-program, hybrid static and dynamic ana...")
 
mNo edit summary
Line 37: Line 37:
Type inference has a somewhat invasive integration into the engine as a whole, but is designed to integrate with JaegerMonkey with as few changes to the compiler as possible. It uses the existing FrameState API to act as an oracle for JaegerMonkey's register allocator and type information queries.
Type inference has a somewhat invasive integration into the engine as a whole, but is designed to integrate with JaegerMonkey with as few changes to the compiler as possible. It uses the existing FrameState API to act as an oracle for JaegerMonkey's register allocator and type information queries.


The linear scan register allocator uses liveness information computed in a backwards pass.
The register allocator uses liveness information computed in a backwards pass. During loop compilation the compiler decides which values should be kept in registers across the backwards edge. That means the full set of loop-carried registers is not unknown until the bottom of the loop.
 
To account for this, there are two JM modifications:
* As loop-carried register are allocated, previously generated out-of-line paths need to be patched to restore the register.
* The entry of the loop is deferred until all loop-carried registers are unknown.


= Future optimizations =
= Future optimizations =
Confirmed users
156

edits

Navigation menu