Closed Bug 1705665 Opened 2 years ago Closed 2 years ago

Add an iterator class for iterating over a shape's properties

Categories

(Core :: JavaScript Engine, task, P2)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(5 files)

We can convert most uses of Shape::Range to a more modern C++ iterator that doesn't expose the property's shape. Similar to the changes in bug 1704744, this decouples properties from shapes.

This was probably needed for ExclusiveContext back then.

The iterator is based on Shape::Range, but is a bit more ergonomic and doesn't expose
the property's Shape. This means when we change the shape's property representation
later on we only have to change the iterator implementation.

Also start using shape() instead of lastProperty() because lastProperty will
either be removed or changed in the future, to decouple shapes and properties more.

The code generated by Clang for some of these functions looks good: the compiler
is able to optimize away the iterator and ShapePropertyWithKey code.

Depends on D112328

These uses are a bit more complicated because they collect the properties in a Vector.

Depends on D112329

This probably became dead code when shapes started implying a realm.

Depends on D112331

Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1e5eb554fed8
part 1 - Remove CX template parameter from FakeRooted constructors. r=jonco
https://hg.mozilla.org/integration/autoland/rev/e111cd4049f1
part 2 - Add ShapePropertyIter and start using it. r=jonco
https://hg.mozilla.org/integration/autoland/rev/823a64b174ca
part 3 - Use ShapePropertyIter in more places. r=jonco
https://hg.mozilla.org/integration/autoland/rev/dd64062d0672
part 4 - Use ShapePropertyIter instead of manually walking over the shape list in a few places. r=jonco
https://hg.mozilla.org/integration/autoland/rev/830e4956fb49
part 5 - Remove dead code in AddLengthProperty. r=jonco
You need to log in before you can comment on or make changes to this bug.