Closed Bug 1468252 Opened 2 years ago Closed 2 years ago

Remove JSObject::global()

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(8 files)

See bug 1466112. Let's start with JSObject::global().
For now this just forwards to JSObject::global, but at some point it will forward to nonCCWGlobal()/maybeGlobal() or something.
Attachment #8984886 - Flags: review?(luke)
Some places call environment->global() but could just use cx->global() or script->global() instead.
Attachment #8984889 - Flags: review?(luke)
Attachment #8984886 - Flags: review?(luke) → review+
Attachment #8984889 - Flags: review?(luke) → review+
Attachment #8984888 - Flags: review?(evilpies) → review+
GetInitialShapeProtoKey is only interested in certain builtin NativeObject protos, so let's just check for that. Then we can also just use NativeObject::global.
Attachment #8985067 - Flags: review?(jwalden+bmo)
This lets us call obj->zone() instead of obj->global().
Attachment #8985070 - Flags: review?(evilpies)
At this point there are a handful of JSObject::global calls left in some APIs and Debugger code. These need to be fixed/audited in follow-up bugs so this renames JSObject::global to deprecatedGlobal.
Attachment #8985072 - Flags: review?(luke)
Attachment #8985064 - Flags: review?(luke) → review+
Attachment #8985071 - Flags: review?(luke) → review+
Comment on attachment 8985072 [details] [diff] [review]
Part 8 - Rename JSObject::global to deprecatedGlobal

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

Great idea with the explicit deprecation
Attachment #8985072 - Flags: review?(luke) → review+
Attachment #8985070 - Flags: review?(evilpies) → review+
Attachment #8985067 - Flags: review?(jwalden+bmo) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/671e4d24c511
part 1 - Define NativeObject::global(). r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/09901c91248b
part 2 - Rename GetOriginalEval to GetRealmOriginalEval, remove scope argument. r=evilpie
https://hg.mozilla.org/integration/mozilla-inbound/rev/4face648a152
part 3 - Remove some environment->global() calls. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d767ed287af
part 4 - Add JSObject::nonCCWGlobal() and use it in a few places. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/e9c6358496ff
part 5 - Check for native objects in GetInitialShapeProtoKey. r=jwalden
https://hg.mozilla.org/integration/mozilla-inbound/rev/d2931773b28b
part 6 - Use isSelfHostingZone instead of isSelfHostingGlobal in getNonWrapperObjectForCurrentCompartment. r=evilpie
https://hg.mozilla.org/integration/mozilla-inbound/rev/5a19b871c590
part 7 - Replace more environment->global() calls. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/fc2ffbc36c07
part 8 - Rename JSObject::global to deprecatedGlobal. r=luke
You need to log in before you can comment on or make changes to this bug.