Closed Bug 1643948 Opened 4 years ago Closed 4 years ago

CacheIR: Optimize arguments[Symbol.iterator]

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: evilpie, Assigned: anba)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

The Symbol.iterator property is lazily resolved on the arguments object. This is why we need a specialized stub similar to what we have for length.

Severity: -- → N/A
Priority: -- → P3

Both arguments objects resolve hook were defining the iterator property, but
didn't set the corresponding ITERATOR_OVERRIDDEN_BIT flag. We don't need to
apply a similar change for the other resolved properties, because they're
using the (Un)MappedArgGetter and (Un)MappedArgSetter property functions.

In preparation for part two, the code to retrieve ArrayValues was already
moved into a separate function.

Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

This change allows to retrieve arguments[Symbol.iterator] without calling the
resolve hook and without actually adding the iterator function to the arguments
object.

Depends on D91030

And remove calls from helper functions like emitLoadTypedElementResult()
and emitStoreTypedElement().

Depends on D91032

Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cdbe54a4b28f
Part 1: Reify the arguments object iterator in the resolve hook. r=jandem
https://hg.mozilla.org/integration/autoland/rev/ebc80496d7c1
Part 2: Optimise arguments[Symbol.iterator] in CacheIR. r=jandem
https://hg.mozilla.org/integration/autoland/rev/e8a33b1a8a73
Part 3: Transpile GuardArgumentsObjectNotOverriddenIterator. r=jandem
https://hg.mozilla.org/integration/autoland/rev/3acf673e3bc1
Part 4: Add missing JitSpew_Codegen calls. r=jandem

Backed out for hazard failures on CacheIR.cpp

backout: https://hg.mozilla.org/integration/autoland/rev/53277b7f7f25f07c0fa18213ff6dffbb802a12dc

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=linux%2Cx64%2Cdebug%2Cspidermonkey%2Cbuilds%2Chazard-linux64-shell-haz%2Fdebug%2Ch&revision=3acf673e3bc151db9160387f0fd0d09433577677&selectedTaskRun=NyJZWijATBqinc8m3vshIQ.1

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=316717908&repo=autoland&lineNumber=7220

[task 2020-09-25T13:13:34.280Z] TinderboxPrint: rooting hazards<br/>1
[task 2020-09-25T13:13:34.280Z] TinderboxPrint: (unsafe references to unrooted GC pointers)<br/>74
[task 2020-09-25T13:13:34.280Z] TinderboxPrint: (unnecessary roots)<br/>1052
[task 2020-09-25T13:13:34.280Z] TinderboxPrint: missing expected hazards<br/>0
[task 2020-09-25T13:13:34.281Z] TinderboxPrint: heap write hazards<br/>0
[task 2020-09-25T13:13:34.282Z] TEST-UNEXPECTED-FAIL | hazards | unrooted 'args' of type 'js::ArgumentsObject*' live across GC call at js/src/jit/CacheIR.cpp:2035
[task 2020-09-25T13:13:34.282Z] TEST-UNEXPECTED-FAIL | hazards | 1 rooting hazards detected

Flags: needinfo?(andrebargull)
Flags: needinfo?(andrebargull)
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/adc3ef732895
Part 1: Reify the arguments object iterator in the resolve hook. r=jandem
https://hg.mozilla.org/integration/autoland/rev/37b19e77ff1b
Part 2: Optimise arguments[Symbol.iterator] in CacheIR. r=jandem
https://hg.mozilla.org/integration/autoland/rev/9ec497f02595
Part 3: Transpile GuardArgumentsObjectNotOverriddenIterator. r=jandem
https://hg.mozilla.org/integration/autoland/rev/a8e63273be0e
Part 4: Add missing JitSpew_Codegen calls. r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: