Closed Bug 1335862 Opened 5 years ago Closed 5 years ago

Implement mayResolve for arguments objects

Categories

(Core :: JavaScript Engine, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: evilpie, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

jQuery uses this pattern where they lookup 'nodeType' on everything you pass to it to check if it's a Node. Arguments objects are also used in such a way, but we don't attach property not found IC stubs, because arguments objects have a resolve function, but don't implement mayResolve. This should be an easy perf win.
Priority: -- → P2
I had a patch for this anyway, and I just saw this as an insignificant problem that showed up on Browsermark.
Assignee: nobody → evilpies
Status: NEW → ASSIGNED
Attachment #8837215 - Flags: review?(jdemooij)
Attachment #8837215 - Attachment is patch: true
Comment on attachment 8837215 [details] [diff] [review]
Implement mayRresolve for arguments

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

Good find.

::: js/src/vm/ArgumentsObject.cpp
@@ +436,5 @@
> +        return true;
> +
> +    JSAtom* atom = JSID_TO_ATOM(id);
> +    uint32_t index;
> +    if (atom->isIndex(&index))

obj_resolve actually only checks for JSID_IS_INT, probably because we don't support args length > JSID_INT_MAX/INT32_MAX.
Attachment #8837215 - Flags: review?(jdemooij) → review+
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b9ee87240799
Implement mayResolve for arguments objects. r=jandem
https://hg.mozilla.org/mozilla-central/rev/b9ee87240799
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.