BrowserWorks / Waterfox-Classic

The Waterfox Classic repository, for legacy systems and customisation.
https://classic.waterfox.net
Mozilla Public License 2.0
177 stars 33 forks source link

Add nullish coalescing support #101

Closed Chocohead closed 2 years ago

Chocohead commented 2 years ago

Based on the suggestion in #35. Should work™, but haven't tested yet.

buttercookie42 commented 2 years ago

Nice. I was looking at trying to apply those patches myself, but was still in the middle of getting a PGO build going.

One wish regarding future source code archeology: Could you include the notes which Bugzilla bugs this was ported from in the commit message (i.e. assuming it's this patch, bugs 1566141 part 1-3 and 5-8, 1593415 and 1599163)?

buttercookie42 commented 2 years ago

I'm hitting a build error with this:

 2:51.16 In file included from c:/Waterfox/Waterfox-Classic/js/src/jsarray.cpp:7:
 2:51.16 In file included from c:/Waterfox/Waterfox-Classic/js/src/jsarrayinlines.h:16:
 2:51.16 In file included from c:/Waterfox/Waterfox-Classic/js/src/vm/ArgumentsObject-inl.h:14:
 2:51.16 In file included from c:/Waterfox/Waterfox-Classic/js/src/jsscriptinlines.h:13:
 2:51.16 In file included from c:/Waterfox/Waterfox-Classic/js/src/jit/IonAnalysis.h:13:
 2:51.16 c:/Waterfox/Waterfox-Classic/js/src/jit/MIR.h(13183,11): error: no matching constructor for initialization of 'js::jit::MUnaryInstruction'
 2:51.16         : MUnaryInstruction(classOpcode, value) {
 2:51.16           ^                 ~~~~~~~~~~~~~~~~~~
 2:51.16 c:/Waterfox/Waterfox-Classic/js/src/jit/MIR.h(1288,14): note: candidate constructor not viable: requires single argument 'ins', but 2 arguments were provided
 2:51.16     explicit MUnaryInstruction(MDefinition* ins)
 2:51.16              ^
 2:51.16 c:/Waterfox/Waterfox-Classic/js/src/jit/MIR.h(1285,7): note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
 2:51.16 class MUnaryInstruction : public MAryInstruction<1>
 2:51.16       ^
 2:51.16 c:/Waterfox/Waterfox-Classic/js/src/jit/MIR.h(1285,7): note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 2 were provided
 2:51.16 1 error generated.
 2:51.16 mozmake.EXE[5]: *** [c:/Waterfox/Waterfox-Classic/config/rules.mk;1033: jsarray.obj] Error 1
Chocohead commented 2 years ago

Not sure how I managed to miss committing that line the first time, updated the message too

buttercookie42 commented 2 years ago

I've noticed that backported patches for this have also appeared in the official repository for Seamonkey 2.53 (originally here). I haven't extensively compared them, but did immediately notice that the older patch based on https://src.fedoraproject.org/rpms/seamonkey/tree/39f13400 I guess (?) is e.g. missing some bits in ReflectParse.cpp. I guess they're not crucial to most everyday usage of the coalescing operator, but it still seems a little suspicious.

Out of curiosity I'm trying to see if I can backport the "official" Seamonkey patches, although that does mean backporting quite a few other Seamonkey backports for SpiderMonkey, too, which I'm currently right in the middle of…

buttercookie42 commented 2 years ago

I've also finally finished my project to attempt this based on the "official" Seamonkey 2.53.12 patches, which basically involved backporting most of the Spidermonkey frontend changes listed here, plus a few bits in other parts of the JS engine code.

The only problem is that what with all the additional backports the whole thing amounts to 145 commits. Because Github doesn't support stacked pull requests across forks and I've already got the similarly ginormous Windows PGO pull request (#104) up in a holding pattern, I've temporarily put them up herenote that that branch includes all my other WIP changesets as well, though. The proper subset that is "just" the various backports plus the nullish operator is this one. (Edit: No longer applies, as the commits have been re-ordered in preparation for the pull requests)

Sa-Ja-Di commented 2 years ago

https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1901

Was successfully implemented in Pale Moon and can be revisited for Waterfox Classic too!

buttercookie42 commented 2 years ago

Put up #124, apologies to @Chocohead for duplicating your work.

Chocohead commented 2 years ago

No bother, a comprehensive port is probably better anyway