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
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
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
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
roytam1
0b1d6ceeb6
Merge remote-tracking branch 'origin/tracking' into custom
2023-04-30 09:31:17 +08:00
Martok
ffe6d48af5
No issue - Correct handling of async (arrow) functions declared inside constructors
...
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1462353 , but since we still support
legacy generators, this only corrects the handling and leaves the newTarget plumbing
intact.
2023-04-30 09:30:00 +08:00
roytam1
20b787a4df
Merge remote-tracking branch 'origin/tracking' into custom
2023-04-10 07:27:58 +08:00
FranklinDM
8e6d730463
Issue #2197 - Follow-up: Remove GC debug assertion on sandbox
...
There's no way to access GC from here.
2023-04-10 07:27:22 +08:00
FranklinDM
bbcfb62753
Issue #2197 - Part 4: Expose structuredClone in Sandbox
...
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1734320
2023-04-10 07:27:03 +08:00
roytam1
48247ca160
Merge remote-tracking branch 'origin/tracking' into custom
2023-04-07 08:12:29 +08:00
Job Bautista
7c9215f958
PR #2189 - Follow-up: Fix build bustage with GCC 9 related to checkExportedNamesForDeclaration
2023-04-07 07:06:24 +08:00
roytam1
d9c82b1e71
Merge remote-tracking branch 'origin/tracking' into custom
2023-04-05 07:36:09 +08:00
Martok
0132ae2101
Issue #2173 - Introduce FunctionNode::syntaxKind instead of JSOPs
...
This moves some "implementation details" to later in the emitter,
and also keeps syntax information available for later use.
Based-on: 1518391/{3+4}
2023-04-05 07:18:59 +08:00
Martok
0dac791851
Issue #2173 - Separate CodeNode into FunctionNode and ModuleNode
...
ModuleNode only has a body and FunctionNode has many more attributes,
and will get more in the following commit.
Based-on: 1518391/2
2023-04-05 07:18:42 +08:00
Martok
f21340f1a8
Issue #2173 - Remove unused case/code from function node ops
...
CodeNodes only ever use 3 JSOPs at this point in time.
Based-on: 1518391/1
2023-04-05 07:18:22 +08:00
Martok
661b1c534c
Issue #2173 - Allow constant folding to see inside functions when using the module pattern
...
(function() { ... })() IIFE pattern should get its body const-folded. This won't make much
runtime difference on JIT, but can be significant in interpreted code (and saves time for
JIT codegen).
Based-on: m-c 632020
2023-04-05 07:18:07 +08:00
Martok
287a2ad2e4
Issue #2173 - Fix remaining ParseNode* in FullParseHandler methods signature
...
The handlers should use the alias types exclusively in their interface.
Based-on: m-c 1479659/11
2023-04-05 07:17:52 +08:00
Martok
d4103253dd
Issue #2173 - Add TryNode
...
This is adjusted from upstream to follow our data structure with PNK_CATCHLIST
Based-on: m-c 1479659/8
2023-04-05 07:17:35 +08:00
Martok
3bd300e263
Issue #2173 - Add accessors to LexicalScopeNode
...
Based-on: m-c 1479659/7
2023-04-05 07:17:05 +08:00
Martok
a49f4d0483
Issue #2173 - Add accessors to NullaryNode and change LoopControlStatement arity to PN_LOOP
...
Based-on: m-c 1479659/6
2023-04-05 07:16:45 +08:00
Martok
ba730c488f
Issue #2173 - Add accessors to NameNode, CodeNode, RegExpLiteral, and add NumericLiteral
...
Based-on: m-c 1479659/{5,9,10}, m-c 1491147
2023-04-05 07:16:27 +08:00
Martok
68a407c935
Issue #2173 - Add accessors to UnaryNode and subclasses
...
Based-on: m-c 1479659/4
2023-04-05 07:16:07 +08:00
Martok
662419c507
Issue #2173 - Add accessors to BinaryNode and subclasses
...
Based-on: m-c 1479659/3
2023-04-05 07:15:49 +08:00
Martok
4726d96fd2
Issue #2173 - Add accessors to TernaryNode
...
Based-on: m-c 1479659/2
2023-04-05 07:15:31 +08:00
Martok
9c17ec0533
Issue #2173 - Add accessors to ListNode
...
Based-on: m-c 1479659/{1,12}
2023-04-05 07:15:09 +08:00
Martok
c02e109b79
Issue #2173 - Fix return value of MUST_MATCH_TOKEN* macros in Parser methods which returns bool
...
Based-on: m-c 1479659/0
2023-04-05 07:14:47 +08:00
Martok
36b5a56242
Issue #2173 - Store the info about the existence of the default case into the switch ParseNode
...
Based-on: m-c 1477157
2023-04-05 07:14:31 +08:00
Martok
fa1193b8c9
Issue #2173 - Add a new PNK_PROPERTYNAME to hold location information about property access name
...
Based-on: m-c 1378808/2
2023-04-05 07:14:09 +08:00
Martok
924140d400
Issue #2173 - Add a new PNK_ARGUMENTS node type for call argument lists
...
Also change PNK_GENEXP (not supported by upstream) to a PN_BINARY node
Based-on: m-c 1378808/1
2023-04-05 07:13:48 +08:00
Martok
0b2e8c4818
Issue #2173 - Fix exporting array and object binding patterns
...
Examples:
export const [name1, name2] = [1, 2];
export var {...name} = get;
Based-on: m-c 1446811, m-c 1462286
2023-04-05 07:13:27 +08:00
Martok
74032644f5
Issue #2155 - Follow-up: Reorder super-property evaluation order per latest spec change
...
Fix regression from difference between Interpreter (old) and ElemOpEmitter (new). We don't have
any Ion/IC support for these ops.
Based-on: m-c 1472211
2023-04-05 07:13:08 +08:00
roytam1
cc4ac7a04b
Merge remote-tracking branch 'origin/tracking' into custom
2023-03-28 13:30:04 +08:00
Job Bautista
66eaa872f8
Issue #62 - Always build Spidermonkey as shared lib in Windows.
...
Shared JS is confirmed working fine in Windows after a week of testing.
Non-Windows will have to wait unfortunately. The JS_SHARED_LIBRARY option is
kept for easy testing on those unsupported platforms.
2023-03-28 12:13:54 +08:00
Job Bautista
9ff14017e5
Issue #324 - Follow-up: Remove more traces of *INTL_API.
...
The trace in Spidermonkey's old-configure is causing the MOZ_CONFIG_ICU function
to be called twice, which is not desirable as it can cause the MOZ_SHARED_ICU
check in build/autoconf/icu.m4 to fail and build an ICU data file even if we're
building ICU as a shared library.
2023-03-28 12:12:42 +08:00
Job Bautista
bad884a7c7
Issue #2165 - Build ICU as a shared library if we're building Spidermonkey shared.
...
It seems that if we're going to enable JS_SHARED_LIBRARY, we need ICU to be a
shared library too in order to prevent code duplication in mozjs.dll bloating
it to a whopping 21 MB.
This unfortunately means we have to fold icudata back to icu itself. But since
icudata is still separated from libxul (which is what really matters for #1451 ),
I think this is a fair compromise.
Building ICU as shared is offered as an option via --enable-shared-icu. But
technically you really need --enable-shared-icu if you're going to use
--enable-shared-js. Unfortunately I can't make configure exit with an error if
MOZ_SHARED_ICU is not defined when JS_SHARED_LIBRARY is enabled, because options
are controlled by different configure scripts (icu is based on bash, while js is
based on python), and I have no idea how to pass MOZ_SHARED_ICU to js's
moz.configure.
Tag #62
2023-03-28 12:11:00 +08:00
Job Bautista
ed30a96467
Issue #62 - Fix xul.dll link bustage related to JS::ubi::DominatorTree.
...
This is the one I don't understand how it fixed the bustage. Why is it needed
to remove JS_PUBLIC_API..? It would seem counter-intuitive, but it wasn't...
2023-03-28 12:10:02 +08:00
Job Bautista
6890cdd9a1
Issue #62 - Fix xul.dll link bustage relating to JSErrorNotes.
2023-03-28 12:09:42 +08:00
Job Bautista
2c8387f4fa
Issue #62 - Fix xul.dll link bustage related to MovableCellHasher.
...
The unsafeSet method is based on Jon Coppeard's part 2 patch for Mozilla bug
1306008. This is needed because of the use of unsafeSet in rekey() of
MovableCellHasher<JS::Heap<T>>
2023-03-28 12:09:30 +08:00
Job Bautista
b171da18f9
Issue #62 - Get --enable-shared-js and --enable-export-js working again, and fix link bustage related to ICU when doing shared lib
2023-03-28 12:09:19 +08:00