Closed Bug 792631 Opened 13 years ago Closed 13 years ago

IonMonkey: Slow property access perf regression.

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19
Tracking Status
firefox18 + fixed
firefox19 --- fixed

People

(Reporter: mbx, Assigned: nbp)

References

(Blocks 1 open bug)

Details

(Keywords: regression, Whiteboard: [ion:p2])

Attachments

(2 files)

The following code is ~ 10x slower in IonMonkey, 65s (js) vs 6s with (js --no-ion) on a MacPro 2x2.4 GHz Quad-Core Intel Xeon: function bar() { var a = {x: 1}, b = {y: 2}; var o = a; var s = 0; for (var i = 0; i < 500000000; i++) { s += o.x !== undefined ? o.x : (o.y !== undefined ? o.y : 3); if (i === 1000) { o = b; } } return s; } print(bar());
Blocks: IonSpeed
Some more context: optimizing ActionScript property accesses in Shumway (the Flash-in-JS research project) depends on this being fast.
Testcase spends all its time in the GetPropertyCache, never actually caching anything, searching through ShapeTables, etc. When a shape lookup fails, we don't cache |undefined| return.
JM has a missing property IC to handle this case, I believe...
Keywords: regression
Assignee: general → nicolas.b.pierron
Status: NEW → ASSIGNED
Attachment #673524 - Flags: review?(dvander)
Comment on attachment 673524 [details] [diff] [review] Add Ion IC for missing properties. Review of attachment 673524 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/IonCaches.cpp @@ +1168,5 @@ > if (!JSObject::lookupProperty(cx, obj, name, &holder, &shape)) > return false; > > + if (!IsCacheableGetPropReadSlot(obj, holder, shape) && > + !IsCacheableNoProperty(obj, holder, shape, NULL, output())) { I fixed a failure here, I added the pc and checked for JSOP_CALLELEM in IsCacheableNoProperty to prevent IC with __noSuchMethod__.
Comment on attachment 673524 [details] [diff] [review] Add Ion IC for missing properties. Review of attachment 673524 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/ion/IonCaches.cpp @@ +283,5 @@ > + Address(holderReg, JSObject::offsetOfShape()), > + ImmGCPtr(holder->lastProperty()), > + &prototypeFailures); > + } else { > + // The property does not exists. Guard on everything in the s/does not exists/does not exist/
Attachment #673524 - Flags: review?(dvander) → review+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
This patch includes the original patch plus Bug 807035 and Bug 807047 with a little modification (in methodjit/PolyIC.cpp) to change the MarkNotIdempotent call because the unsafeGet function does not exists in Aurora. [Approval Request Comment] Bug caused by (feature/regressing bug #): N/A, a similar feature was added to JM in fx17, and Ion was added in fx18 without the equivalent. The goal is to back-port this change to fx18 to avoid regressions User impact if declined: Prevent IonMonkey regression feeling. Testing completed (on m-c, etc.): Yes, Bug 807035 and Bug 807047 are now fixed an no new bug seems to blame this patch. Risk to taking this patch (and alternatives if risky): Low risk. String or UUID changes made by this patch: N/A
Attachment #679760 - Flags: approval-mozilla-aurora?
Comment on attachment 679760 [details] [diff] [review] Backport patches. Approving on Aurora . Bug is tracking 18,been on central for a week,low risk & is needed to avoid possible regressions due to IonMonkey landing in 18.
Attachment #679760 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Depends on: 830086
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: