Not using getprop IC stubs for functions due to resolve hook

RESOLVED FIXED in mozilla36

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

(Blocks: 1 bug)

unspecified
mozilla36
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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);
(Assignee)

Comment 1

4 years ago
Created attachment 8525311 [details] [diff] [review]
Patch

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+
(Assignee)

Updated

4 years ago
Duplicate of this bug: 928896
https://hg.mozilla.org/mozilla-central/rev/bd55fa110906
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.