Closed Bug 1100594 Opened 6 years ago Closed 6 years ago

Not using getprop IC stubs for functions due to resolve hook

Categories

(Core :: JavaScript Engine: JIT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See the micro-benchmark below. It takes ~850 ms here because LookupPropertyPureInline returns false due to the resolve hook.

If I check for fun_resolve there, it runs in 30 ms, about as fast as V8.

The Ember benchmark (bug 1097376) has some very slow cleanup code; this is responsible for at least a third of our time there.

function g() {};
function f() {
    var o = {call: null};
    var res = null;
    for (var i=0; i<10000000; i++) {
	var x = (i % 2 == 0) ? o : g;
	res = x.call;
    }
    return res;
}
var t = new Date;
f();
print(new Date - t);
Attached patch PatchSplinter Review
Calls FunctionHasResolveHook in LookupPropertyPureInline. This also fixes bug 928896.

ClassHasResolveHook in IonBuilder.cpp also calls FunctionHasResolveHook, but it also has a special case for array.length so I didn't use it here.
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attachment #8525311 - Flags: review?(bhackett1024)
Comment on attachment 8525311 [details] [diff] [review]
Patch

Review of attachment 8525311 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsobj.cpp
@@ +3274,5 @@
>              *propp = shape;
>              return true;
>          }
>  
>          /* Fail if there's a resolve hook. */

Comment needs updating.
Attachment #8525311 - Flags: review?(bhackett1024) → review+
Duplicate of this bug: 928896
https://hg.mozilla.org/mozilla-central/rev/bd55fa110906
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.