Closed Bug 507683 Opened 15 years ago Closed 15 years ago

Trace native getters

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: jorendorff, Assigned: jorendorff)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(2 files, 2 obsolete files)

      No description provided.
Attached patch WIP 1 (obsolete) — Splinter Review
This patch doesn't make JIT code call native getters directly. Instead they call a builtin function, GetPropertyById, which does OBJ_GET_PROPERTY, which repeats the whole lookup.  So, it's sloppy, but I'd like bz to give it a spin and maybe even land it, with a promise to improve upon this soon.  Passes trace-tests.

It hardly seems possible, but I think this is a win on SunSpider. I occasionally get a bench.sh run under 1000ms now, which didn't happen for me before.

This might even trace non-quick-stubbed getters, if we can get through XPConnect without deep-aborting/deep-bailing.

TODO: Add a few trace-tests; try to make the violence to TR::prop()'s interface a little less horrible; probably bring back the special case for str.length.
Assignee: general → jorendorff
Forgot to mention that this patch goes on top of the one in bug 507665.
Depends on: 507665
We won't trace non-quick-stubbed XPConnect getters. We'll deep-bail in js_InternalInvoke every time. Memo to myself: add a check to prevent this patch from trying to record the JSPROP_GETTER case.
Attached patch WIP 2 (obsolete) — Splinter Review
This is what I'm sending to the Try server right about now.  (I can definitely squeeze a bit more speed out of it, but if it passes tests I'd rather land it and file the follow-up bug.)
Attachment #391927 - Attachment is obsolete: true
Attached patch v3Splinter Review
This isn't much different from WIP 2. Unbitrotted and a few tweaks here and there.

This removes a special hack for obj.length where obj is a String wrapper object. Now that will result in a call to the length getter, instead of emitting hand-coded LIR. I hope we can live without that.

I'll check SunSpider and v8 benchmarks before landing, but this shouldn't affect them much either way. Dromaeo should see a win at the margins--we still lose big because it calls across window objects though.
Attachment #392357 - Attachment is obsolete: true
Attachment #394153 - Flags: review?(gal)
Bug 508310 is the follow-up bug to call getters directly, eliminating GetPropertyWithNativeGetter.
Review ping.
Attachment #394153 - Flags: review?(gal) → review+
Comment on attachment 394153 [details] [diff] [review]
v3


{
   DeepBailState state; // or something like this? just a suggestion

}

>+    enterDeepBailCall();
>+    LIns* vp_ins = addName(lir->insAlloc(sizeof(jsval)), "vp");
>+    LIns* args[] = {vp_ins, INS_CONSTPTR(sprop), obj_ins, cx_ins};
>+    LIns* ok_ins = lir->insCall(&GetPropertyWithNativeGetter_ci, args);
>+    finishGetProp(obj_ins, vp_ins, ok_ins, outp);
>+    leaveDeepBailCall();
>+    return JSRS_CONTINUE;
>+}
>+
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/b7ef4e4816ed
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: