Commit graph

5,357 commits

Author SHA1 Message Date
Martok
afa7bddc96 Issue #2142 - Add internal option for fields, but always true
This allows us to perform bisects on the following commits without causing runtime issues.

Based-on: m-c 1529758
2023-05-01 12:27:22 +08:00
Martok
6abb54ff11 Issue #2142 - Reduce calls to FindReservedWord when checking for forbidden identifiers during parsing
Based-on: m-c 1351913/{1,2}
2023-05-01 12:27:10 +08:00
Martok
faed047e3f Issue #2142 - Ensure 'await' is always a restricted identifier when parsing modules
Based-on: m-c 1356189
2023-05-01 06:55:30 +08:00
Martok
3b9b111b2f Issue #2142 - Add predicate functions count_if and any_of to ListNode iterator 2023-05-01 06:55:15 +08:00
Martok
627d0da7dc Issue #2142 - Change InitPropertyOperation to accept a PropertyName directy and use DefineDataProperty
Based-on: m-c 1413907, 1547129
2023-05-01 06:55:00 +08:00
Martok
6f56a494e6 Issue #2142 - Extend newSuperCall for JSOP_SPREADSUPERCALL
Based-on: m-c 1537936
2023-05-01 06:54:43 +08:00
Martok
014ebe8ae2 Issue #2142 - Fold BytecodeEmitter::checkTypeSet into BytecodeEmitter::emitCheck
The bytecode emitter used to call checkTypeSet for each JOF_TYPESET op. Despite
correctness asserts in the TypeScript code, this was pretty error prone.

The solution is to move this check to BytecodeEmitter::emitCheck (called for
each opcode we emit), so we don't have to worry about this anymore.

Based-on: m-c 1521491/3
2023-05-01 06:54:25 +08:00
Martok
73a99c155d Issue #1691 - Follow-up: use error message with no arguments for bad import statements 2023-05-01 06:54:10 +08:00
Job Bautista
51426d1053 Issue #1862 - Follow-up: Replace deprecated Harfbuzz functions with current ones.
Based on Mozilla bug 1500356.
2023-05-01 06:53:51 +08:00
Job Bautista
45b34592b6 Issue #1691 - Follow-up: Fix CallSelfHostedFunction deprot introduced by Part 4. 2023-05-01 06:53:08 +08:00
Job Bautista
b592711bb2 Issue #2221 - Enable link-time optimization for Spidermonkey by default if building it shared.
Currently only Windows can take advantage of this.

The reason why the arrays of deunified sources are named like that in
Spidermonkey's moz.build is to avoid UnsortedErrors in python. There's probably
a better way to handle that, but I just want something that works for now.

And yes, the deunified sources will be reunified if LTO is disabled.
2023-05-01 06:52:48 +08:00
Martok
0a74a57585 Issue #1285 - Follow-up: Correctly handle follow-up compilations of RegExp with named capturing groups 2023-05-01 06:52:29 +08:00
Martok
aece6260fb Issue #1894 - Follow-up: Fix return value ordering in IonMonkey nullish coalescing 2023-05-01 06:52:12 +08:00
Martok
e31a058ce9 Issue #2173 - Follow-up: Use common ancestor of PNK_(OPT)DOT in ASTSerializer::expression 2023-05-01 06:51:57 +08:00
Martok
a27e8bf989 Issue #2213 - Follow-up: Fix derieved Generator prototypes after previous change 2023-05-01 06:51:42 +08:00
Job Bautista
61874576e3 [Basilisk] Issue MoonchildProductions/UXP#1451 - Support hunspell as shared library 2023-04-30 21:43:17 +08:00
Job Bautista
2be4e3e69f [Pale-Moon] Issue MoonchildProductions/UXP#1451 - Support hunspell as shared library 2023-04-30 21:42:24 +08:00
FranklinDM
b7f217e5ad Issue #2073 - Follow-up: Use internal Move instead of std::move for consistency 2023-04-30 21:25:05 +08:00
FranklinDM
93644fd33e Issue #2218 - Part 2: Make SurfaceCache free ImageSurfaceCache objects outside of the lock
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1389479
2023-04-30 21:24:49 +08:00
FranklinDM
fa787f4a6a Issue #2218 - Part 1: Add nsExpirationTracker::NotifyEndTransaction(Locked) callbacks for subclasses to know when an aging iteration is complete
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1389479
2023-04-30 21:24:37 +08:00
FranklinDM
62e2fbc4e9 Bug 1432272 - Make Fetch API use the global's base URL instead of the entry document's base URL 2023-04-30 21:23:32 +08:00
Brian Smith
1ac1e90b6a Issue #1691 - Part 16: Dynamically imported modules can throw any value as an exception. https://bugzilla.mozilla.org/show_bug.cgi?id=1508672
(cherry picked from commit 910a37b53f1826a863cc3ab6eb61fc369f4505a0)
2023-04-30 21:23:02 +08:00
Brian Smith
f2b179156b Issue #1691 - Part 15: Make |new import()| a syntax error. https://bugzilla.mozilla.org/show_bug.cgi?id=1508672
(cherry picked from commit 45fda91268b6a3ca8471c8094f2d640ebad682f9)
2023-04-30 21:22:42 +08:00
Brian Smith
79ea755b7f Issue #1691 - Part 14: Fix a debug assert and memory leak. PNK_IMPORT_META and PNK_CALL_IMPORT are binary nodes... They function similar to list nodes, so they worked there, but debug mode asserts because of the wrong type. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Fixed a memory leak due to missing code in SourceScriptObject::finalize(). Thanks FranklinDM!
(cherry picked from commit 15e81193c692c2c2aec665e7e5a88d98a9b85eca)
2023-04-30 21:22:26 +08:00
Brian Smith
bc895eba9b Issue #1691 - Part 13: Remove MUST_MATCH_TOKEN* macros in Parser. https://bugzilla.mozilla.org/show_bug.cgi?id=1501928 This was helpful in debugging one of the crashes, the macros made debugging a nightmare.
(cherry picked from commit 7bceec3f7dff086305c3f50939a8c830ca7f107b)
2023-04-30 21:22:12 +08:00
Brian Smith
a892a75903 Issue #1691 - Part 12: Fix return value in ExecScript() and debug assert in ParseTask. https://bugzilla.mozilla.org/show_bug.cgi?id=1331662 Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. ExecutionContext: The mRetValue is not used even though it is checked in various asserts. This is how it is in the Mozilla code even years later, only the passed in value is used. ParseTask: JoinDecode() and JoinCompile() run the same code but the type is different causing a debug assert when it checks the type Script vs ScriptDecode.
(cherry picked from commit 8f577428b7834b7d0f0d5afacbe060fbb1ff2136)
2023-04-30 21:22:00 +08:00
Brian Smith
edb82ec9f2 Issue #1691 - Part 11: Fix incorrect reference counting in ModuleScript class.
(cherry picked from commit 4ef1fa98c9518f5c107424667229ddb6f9f97767)
2023-04-30 21:21:45 +08:00
Brian Smith
7e056a6f72 Issue #1691 - Part 10: Add and use method to annotate CC crashes with a class name. https://bugzilla.mozilla.org/show_bug.cgi?id=1277260 Make PtrInfo into a class and mark it final. Also fix an erroneous debug assert because mBaseURL not set in one code path.
(cherry picked from commit a1890054011adf0cf87be0d56047418c9f201420)
2023-04-30 21:21:31 +08:00
Brian Smith
be916ef7ca Issue #1691 - Part 9: Make import() work when the active script is in another document. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Associate event handler with active script when they are compiled.
(cherry picked from commit 1a3cc5d6828a05a6309d959fad3c7e959ab9eb8d)
2023-04-30 21:21:19 +08:00
Brian Smith
1109559a5d Issue #1691 - Part 8: Fix --enable-debug builds and continue dynamic module import changes. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Support import from timeout handlers by associating the initiating script with the compiled JSScript. Fix error message that covers all import() failures that don't throw a JS exception. https://bugzilla.mozilla.org/show_bug.cgi?id=1331662 Partial - Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. Left EvaluateString() in nsXBLProtoImplField.cpp until ExecutionContext errors can be fixed.
(cherry picked from commit 22fcfc77971a9bb204df664c474681f4dcf54211)
2023-04-30 21:21:06 +08:00
Brian Smith
c69a47c393 Issue #1691 - Part 7f: Split up compile and execute so we can use ClassicScript. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Refactor nsJSUtils::ExecutionContext to separate compilation and execution steps and allow extraction of compiled JSScript. https://bugzilla.mozilla.org/show_bug.cgi?id=1366773 Move buffer argument from JS::StartIncrementalEncoding to JS::FinishIncrementalEncoding.
(cherry picked from commit d4b520b08b958e116dfeeffdc61f3425610d1ce9)
2023-04-30 21:20:47 +08:00
Brian Smith
993476283d Issue #1691 - Part 7e: Dependencies for required to finish part 7d. https://bugzilla.mozilla.org/show_bug.cgi?id=1331662 Reimplement EvaluateString using the ExecutionContext class. https://bugzilla.mozilla.org/show_bug.cgi?id=1316078 Extract redudant code into StartOffThreadParseTask. Use an ExclusiveContext instead of a JSContext in XDR functions. Add a script decoder as a valid off-main-thread parse-task. https://bugzilla.mozilla.org/show_bug.cgi?id=900784 Add nsJSUtils functions for encoding and decoding the bytecode. https://bugzilla.mozilla.org/show_bug.cgi?id=1316081 Add XDRIncrementalEncoder to replace delazified LazyScript in the encoded XDR buffer. Add an XDRIncrementalEncoder instance on the ScriptSource. Expose a new JSAPI to incrementally encode bytecode when it is generated. https://bugzilla.mozilla.org/show_bug.cgi?id=1334091 XDR function use the sourceObject instead of the enclosingScript as argument.
(cherry picked from commit d6de9a669f4b2f5115670bd771cd53d7cfb3956a)
2023-04-30 21:20:33 +08:00
Brian Smith
d5d7bb5e47 Issue #1691 - Part 7d: Allow dynamic import in cases where there's no referencing script or module. Support dynamic import from classic scripts by creating ClassicScript objects and associating them with the compiled. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 This patch is incomplete, some code in ScriptLoader::EvaluateScript() could not be applied for missing dependencies. Part 7e will apply the missing dependencies and finish the patch.
(cherry picked from commit ce31a906e801b72f06385b0755710317ccf3658b)
2023-04-30 21:20:19 +08:00
Brian Smith
41eda05e57 Issue #1691 - Part 7c: Refactor ModuleScript into ClassicScript class and LoadedScript base class so we can represent all scripts that can perform dynamic import. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
(cherry picked from commit c37b8b55231f6609c87e49c84edf7e94a1bf5518)
2023-04-30 21:20:05 +08:00
Brian Smith
ba01d99e31 Issue #1691 - Part 7b: Make load request element optional. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
(cherry picked from commit 169bb5d2ada59026fb6407716a7b3862810c9b97)
2023-04-30 21:19:50 +08:00
Brian Smith
62be542166 Issue #1691 - Part 7a: Add a JS API to get the private value for the calling script or module. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
(cherry picked from commit e89e50d5047468e0bb02ee82f9cd0be282b24a1b)
2023-04-30 21:19:37 +08:00
Brian Smith
e7d0b58e56 Issue #1691 - Part 6e: Fix problems due to divergent codebases. This gets basic dynamic import working. Fix a problem in Part 5b where Mozilla used toGCThing() and we don't. Fix a problem in Part 4 where runtime() returns nullptr in our codebase since it runs on JS Helper thread. We need to get the runtime via runtimeFromAnyThread() instead.
(cherry picked from commit dddb46225bbd1adff11f635e32934aee36923e47)
2023-04-30 21:19:05 +08:00
Brian Smith
c3daecc218 Issue #1691 - Part 6d: Optimize handling of internally-created Promise objects. https://bugzilla.mozilla.org/show_bug.cgi?id=1358879 The patch uses a different test: PROMISE_FLAG_DEFAULT_REJECT_FUNCTION which doesn't exist in our codebase. It was added in this bug, which appears to be partly complete: https://bugzilla.mozilla.org/show_bug.cgi?id=1313049
(cherry picked from commit 97fc74b693813eaaa9ab833d9c51fc5868ff039f)
2023-04-30 21:18:51 +08:00
Brian Smith
9a19e9d165 Issue #1691 - Part 6c: Fix a few issues with the earlier commits. Need PNK_CALL_IMPORT and PNK_IMPORT_META in the node children list or it will abort. When porting ScriptFetchOptions support, I had 2 constructors, I picked the wrong one. Missed adding the preference javascript.options.dynamicImport to all.js.
(cherry picked from commit b95ccb711dc41b343d02ae69b3dc4747bbbe86fb)
2023-04-30 21:18:24 +08:00
Brian Smith
86e0057ea7 Issue #1691 - Part 6b: Initial browser support for dynamic import from module scripts. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Factor out script fetch options from script load request classes. https://bugzilla.mozilla.org/show_bug.cgi?id=1480720 Remove support for version parameter from script loader. https://bugzilla.mozilla.org/show_bug.cgi?id=1428745
(cherry picked from commit 3ec2529aa6303f6950622e3cb91a23580649c73b)
2023-04-30 21:18:11 +08:00
Brian Smith
1b811bd711 Issue #1691 - Part 6a: Support private values which contain pointers to cycle-collected C++ objects https://bugzilla.mozilla.org/show_bug.cgi?id=1342012
(cherry picked from commit 1286cca73d58332ba0becd0011f747713b8acfac)
2023-04-30 21:17:54 +08:00
Brian Smith
5c09a3b3cc Issue #1691 - Part 5b: Stop modules from entraining the top-level JSScript. https://bugzilla.mozilla.org/show_bug.cgi?id=1489477
(cherry picked from commit 6ce0af856186e65fb4987daf4e06dc68fb3f7483)
2023-04-30 21:17:38 +08:00
Brian Smith
c965fbdd10 Issue #1691 - Part 5: Don't pre-create module metadata object when compiling. https://bugzilla.mozilla.org/show_bug.cgi?id=1489477
(cherry picked from commit d83bad49f6b03894548fbf85fc18ad7e8cc19a93)
2023-04-30 21:17:26 +08:00
Brian Smith
7a6dab0b38 Issue #1691 - Part 4: Finish implementing call import. https://bugzilla.mozilla.org/show_bug.cgi?id=1499140
(cherry picked from commit 7bf7d64887944b127a72090dd62eb57f67c5089d)
2023-04-30 21:17:13 +08:00
Brian Smith
3f4985ce6c Issue #1691 - Part 3: Finish implementing import meta. https://bugzilla.mozilla.org/show_bug.cgi?id=1427610
(cherry picked from commit a8625238ac846fb7eb103646ddb8634a5860f067)
2023-04-30 21:17:00 +08:00
Brian Smith
a8ab41b4c6 Issue #1691 - Part 2: Implement call import and import meta in the parser. https://bugzilla.mozilla.org/show_bug.cgi?id=1427610 https://bugzilla.mozilla.org/show_bug.cgi?id=1484948
(cherry picked from commit 6be083187f49e444de1bb116bb5930b20125190b)
2023-04-30 21:16:43 +08:00
Brian Smith
1a6b3a822c Issue #1691 - Part 1: Provide a way of associating a private value with a script or module.
This is a prerequisite for dynamic import

(cherry picked from commit 2e2972647ee29340df51a804f05e40fc1da2c89b)
2023-04-30 21:16:28 +08:00
Job Bautista
d75c6c1815 Issue #1451 - Fix hunspell build bustage in FreeBSD.
Thanks to dbsoft for this patch!
2023-04-30 21:16:02 +08:00
Job Bautista
cbbc15ad81 Issue #1451 - Split hunspell library out of xul.
utf_info.cxx imported from 1.4.1 upstream.

Also moved unicode_info struct to the header to fix bustage with compiling the
new utf_info.cxx.

I've also gone ahead and deunified this new shared library as unified building
is busting in hunspell.cxx, complaining about config.h not being found. Weird
that it only happens in unified mode.

This reduces libxul size on all platforms by ~200 KB.
2023-04-30 21:15:46 +08:00
FranklinDM
2048f4df51 No issue - [MailNews] Fix build bustage due to recent MIME API changes 2023-04-30 09:30:17 +08:00