Commit graph

837 commits

Author SHA1 Message Date
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
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
Job Bautista
7c9215f958 PR #2189 - Follow-up: Fix build bustage with GCC 9 related to checkExportedNamesForDeclaration 2023-04-07 07:06:24 +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
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
Martok
2554a83d1d Issue #2155 - Add SwitchEmitter
Based-on: m-c 1456006/{0,1}
2023-03-28 09:29:39 +08:00
Martok
70e1654c3c Issue #2155 - Move TryEmitter and ForOfLoopControl to TryEmitter.{cpp.h} and ForOfLoopControl.{cpp.h}
Based-on: m-c 1460489/5
2023-03-28 09:29:18 +08:00
Martok
a8ac1cac3d Issue #2155 - Move NestableControl classes except ForOfLoopControl to BytecodeControlStructures.{cpp.h}
Based-on: m-c 1460489/3
2023-03-28 09:28:59 +08:00
Martok
81691afbc3 Issue #2155 - Split Nestable to ds/ and EmitterScope to EmitterScope.{cpp.h}
Based-on: m-c 1351107/17, m-c 1460489/2
2023-03-28 09:28:30 +08:00
Martok
fbb5f73459 Issue #2155 - Fix wrong assertion
(x) = function() {..} is an extremely sparsely documented way to prevent function name inference.
Modeled after how BytecodeEmitter::emitInitializer does it.
2023-03-23 09:02:31 +08:00
Martok
76c2030142 Issue #2155 - Fix debug build 2023-03-23 09:02:07 +08:00
Martok
5dc6be1bcb Issue #2155 - Remove now-unused functions 2023-03-23 09:01:35 +08:00
Martok
e88f946c01 Issue #2155 - Fix BytecodeEmitter::emitArguments for our ParseNode tree
This resolves the differences in storage of call arguments between Mozilla's and our ParseNode tree.
2023-03-23 09:01:19 +08:00
Martok
89e6820006 Issue #2155 - Add PropOpEmitter, ElemOpEmitter, NameOpEmitter, CallOrNewEmitter
Attn: this plain patch port still contains issues caused by differences in the
ParseNode tree that will be fixed in the following commits.

Based-on: m-c 1466000/{7-10}
2023-03-23 09:01:02 +08:00
Martok
a2fd8846b6 Issue #2155 - Refactor BytecodeEmitter in preparation for *Emitter work
This removed a bit of reduncancy and makes stack building easier to follow.

- Move call context handling from BytecodeEmitter::emitGetNameAtLocation to BytecodeEmitter::emitCalleeAndThis
- Add stack comments for prop and elem related methods in BytecodeEmitter
- Remove emitAtopOp with NameNode*
- Pass JSOp to BytecodeEmitter::emitAssignment (modified)
- Add BytecodeEmitter::emitGetFunctionThis variant with offset

Based-on: m-c 1466000/{2-6}
2023-03-23 09:00:45 +08:00
Martok
da05c050e3 Issue #2155 - Simplify BytecodeEmitter::isRestParameter 2023-03-23 09:00:25 +08:00
Martok
e8fee20566 Issue #2155 - Split TDZCheckCache, IfEmitter/InternalIfEmitter, JumpList from BytecodeEmitter 2023-03-23 09:00:10 +08:00
Moonchild
82a2a67f07 No Issue - Ensure more OsiSpace
ensureOsiSpace(); was very much under-used. This adds more instances
where it makes sense to ensure Osi space before placing masm calls.
2023-03-20 10:43:36 +08:00
FranklinDM
0365f940fe Issue #2148 - Make Vector not use AlignedStorage for its inline element storage
See Bug 1338374 1/2
2023-03-15 22:50:40 +08:00
Job Bautista
cdd91edd79 Issue #2148 - Discard RegExpShared data tables when discarding regexp JIT code.
Based on Mozilla bug 1378736's part 2.
Should fix the double-free.
Follow-up for #2083
2023-03-15 22:50:24 +08:00
Job Bautista
ad8d9639a4 Issue #2148 - Don't null out RegExpObject -> RegExpShared pointer on GC.
Follow-up for issue #2083.
Taken from Mozilla bug 1378736.
2023-03-15 22:50:01 +08:00
Job Bautista
a2d6260cd6 Issue #2046 - Follow-up: Fix deprot in builtin/intl
Missing a couple of includes.
Tag #80
2023-03-15 22:49:18 +08:00
Job Bautista
c2c95eff97 Issue #80 - Move implementation of CPOWTimer::CPOWTimer to header.
Fixes link bustage in xul.dll
Inline functions must be implemented in the header.
2023-03-14 22:11:46 +08:00
Job Bautista
0b039ff7a6 Issue #80 - Fix deprot in js/xpconnect.
I think we never deunified js/xpconnect before. But if we're going to ever build
this tree deunified in the future, there's nothing stopping us now!
2023-03-14 22:11:28 +08:00
Job Bautista
261dc37ad8 Issue #80 - Fix deprot in js/ipc.
I think we never deunified js/ipc before. But if we're going to build this tree
deunified ever in the future, there's nothing stopping us now!
2023-03-14 22:11:14 +08:00