Closed Bug 1366470 Opened 7 years ago Closed 2 years ago

Ion compile functions with an extra var environment

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: evilpie, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Keywords: triage-deferred)

Attachments

(4 files)

Currently we don't compile scripts with an extra var environment. The source code for this cites bug 1273858, which is fixed nowadays. Apparently we ran into this with bug 1366372, where we didn't ion compile Array.fom!
It would be good to know what actually needs to be done to remove this abort.
There are at least two pieces: 

1. Support PUSHVARENV/POPVARENV, which are like PUSHLEXICALENV/POPLEXICALENV for var envs instead of lexical envs.
2. Check that Ion doesn't assume anywhere that the var environment is already on the env chain at the start of function code.
Keywords: triage-deferred
Priority: -- → P3

Some refactoring to have a function we can call for Warp. This is similar to
other environment objects.

Assignee: nobody → jdemooij
Status: NEW → ASSIGNED

For function frames, the "initial environment" includes the Call and NamedLambda
environments but never VarEnvironmentObject.

For eval frames, the initial environment is a VarEnvironmentObject, but we don't
support optimizing eval scripts yet.

This means the bailout code doesn't need to do anything special to support this,
similar to lexical environments.

Depends on D145429

Depends on D145431

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/04f478b31ca6
part 1 - Add VarEnvironmentObject::create for Warp. r=iain
https://hg.mozilla.org/integration/autoland/rev/ed69fc85ccbf
part 2 - Bailout changes to support var environments. r=iain
https://hg.mozilla.org/integration/autoland/rev/91027e567af6
part 3 - Warp-compile JSOp::PushVarEnv. r=iain
https://hg.mozilla.org/integration/autoland/rev/e8ff2e01409a
part 4 - Add tests. r=iain
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: