Closed Bug 846648 Opened 12 years ago Closed 12 years ago

BaselineCompiler: Direct inline polymorphic SetProp and GetProp native object slot accesses in Ion.

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: djvj, Assigned: jandem)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

This is now straightforward to do by snooping Baseline's ICs.
Summary: BaselineCompiler: Direct inline polymorphic SetProp and GetProp native object slot accesses. → BaselineCompiler: Direct inline polymorphic SetProp and GetProp native object slot accesses in Ion.
Assignee: general → jdemooij
Status: NEW → ASSIGNED
Attached patch Patch (deleted) — Splinter Review
Adds two new instructions: GetPropertyPolymorphic and SetPropertyPolymorphic. These instructions use a list of shapes observed by the baseline IC. If the incoming object's shape matches one of these, we inline the property access, else we bailout. This wins at least 10% on Octane-deltablue (a few hundred points on the full Octane benchmark).
Attachment #743083 - Flags: review?(bhackett1024)
Attachment #743083 - Flags: review?(bhackett1024) → review+
This patch is another approach I made on friday, it build a stackTypeSet based on the content of the baseline IC and does not require adding a new instruction. I think this is a better approach than adding new instructions, and we should improve our usage of typeset to benefit both TI based info and baseline based info. Sorry for highjacking this bug. This patch also provide 10% improvement on deltablue and our score on Bug 835306 benchmark.
Attachment #743194 - Flags: review?(jdemooij)
(In reply to Nicolas B. Pierron [:nbp] from comment #2) > I think this is a better approach than adding new instructions, and we > should improve our usage of typeset to benefit both TI based info and > baseline based info. I think these patches fix different issues. For instance my patch also inlines polymorphic GETPROP (when there is a small number of shapes), there's no other way to do this. Also note that inlining SETPROP based on the TypeObject is only possible if the property is in a definite slot. We need the shape to inline non-definite properties, or if there are 2 TypeObject's with a different definite slot for a property.
Comment on attachment 743083 [details] [diff] [review] Patch Review of attachment 743083 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/IonBuilder.cpp @@ +7566,5 @@ > fixed->setNeedsBarrier(); > return resumeAfter(fixed); > } > > + Vector<Shape *> shapes(cx); You need a root vector of shapes, as … @@ +7601,5 @@ > + current->push(value); > + > + for (size_t i = 0; i < shapes.length(); i++) { > + RawShape objShape = shapes[i]; > + RawShape shape = objShape->search(cx, id); … this function call might trigger a GC.
Blocks: 835306
Actually, we can never trigger GCs anywhere inside AutoEnterCompilation, which includes IonBuilder and all other compilation activity. Additionally, Shape::search can no longer trigger a GC (it can do a linear search if it tries to tableify and would otherwise require a GC).
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Comment on attachment 743194 [details] [diff] [review] Take baseline typeset when TI typeset is unknown Review of attachment 743194 [details] [diff] [review]: ----------------------------------------------------------------- Resetting review flag per comment 6.
Attachment #743194 - Flags: review?(jdemooij)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: