Commit graph

1,055 commits

Author SHA1 Message Date
Martok
e923c48f4f Issue #2259 - Improve ResolveLocale performance when initializing the default Intl objects
Based-on: m-c 1365650
2023-07-03 15:08:00 +08:00
Martok
e3dbf7c5e7 Issue #2259 - Support Unicode extensions with multiple value subtags in BCP47 language tags
Based-on: m-c 1321789
2023-07-03 15:07:26 +08:00
Martok
8d97bd437a Issue #2259 - Reimplement String.prototype.toLocale{Lower,Upper}Case per ECMAScript Intl specification
- Update make_unicode to output SpecialCasing
- Handle special casing
- Use realloc instead of malloc when resizing a newly created string buffer

Based-on: m-c 1318403, 1431957
2023-07-03 15:07:03 +08:00
Martok
949f69ef4b Issue #2259 - Implement caseFirst option in Intl.Collator
Based-on: m-c 866473
2023-07-03 15:06:40 +08:00
Martok
85612accf2 Issue #2046 - Introduce mozIntl.DateTimeFormat with mozExtensions
Based-on: m-c 1329904
2023-07-03 15:06:04 +08:00
Martok
30157344fe Issue #2259 - Update Intl.* Object-ness to ECMA-402, 4th edition
- turn each Intl object into a NativeObject subclass
- create them as PlainObject
- ensure correct type is passed in self-hosted code
- implement legacy constructor semantics for DateTime&NumberFormat
- store internals on object slot instead of JS WeakMap

Based-on: m-c 1328386, 1332604
2023-07-03 15:05:30 +08:00
Martok
adffcb127a Issue #2259 - Introduce helper for self-hosted hasOwnProperty calls in intl 2023-07-03 15:04:42 +08:00
Martok
a7d752deff Issue #2259 - Adjust self-hosted Array.prototype.sort to ES2018
The comparator to ArraySort must be optional also in self-hosted code, where calling the
implementation directly is generally faster than calling between JS and C++ multiple times.
2023-07-03 15:04:14 +08:00
Martok
f8f7aed528 Issue #2259 - Add JS::StackGCVector and JS::RootedVector
Based-on: m-c 1521732/{1,3}, 1527881
2023-07-03 15:03:45 +08:00
Martok
4c2e378613 Issue #2259 - Add mozilla::Result<V, E> and JS::Result<> for fallible return values
Based-on: m-c 1283562, 1277368/1, 1324828
2023-07-03 15:03:29 +08:00
Martok
5a531ea80c Issue #1969 Follow-Up: Error reporting arguments in RelativeTimeFormat/DateTimeFormat 2023-07-03 15:02:30 +08:00
Moonchild
890e1eb84d Fix debug builds 2023-07-03 14:59:18 +08:00
Moonchild
24b1a0f166 Avoid TLS lookups when checking if zones need to be marked for GC.
This converts the fromPointer() calls to an object cast to (hopefully)
avoid the GC crashes. Logic is reversed from MustSkipMarking to
ShouldMark with appropriate renames.
2023-07-03 14:59:02 +08:00
Moonchild
95a1e4b7a3 Simplify incremental GC sweeping
Splitting several parts of `SweepPhase` into constituent parts to
separate out sweeping code from code that handles yielding to the
mutator and resuming.
2023-07-03 14:58:44 +08:00
roytam1
0c3fa71099 Merge remote-tracking branch 'origin/tracking' into custom 2023-06-02 10:39:38 +08:00
Moonchild
2a7ff7ce1a Issue #2257 - Remove rematerialized frames after bailouts and exceptions.
This ensures that rematerialized frames used by the devtools debugger
are properly removed so that no stale data is used during bailouts.
2023-06-02 10:35:31 +08:00
Moonchild
77bd81595d Issue #2256 - Implement Object.hasOwn(object, property)
This is a convenience access function to hasOwnProperty.

Trivial, self-hosted implementation providing the interface to the
already existing hasOwnProperty cpp function with additional toObject
for spec compliance.

Resolves #2256
2023-06-02 10:35:08 +08:00
roytam1
7338649176 Merge remote-tracking branch 'origin/tracking' into custom 2023-05-18 09:40:23 +08:00
Job Bautista
a00793acff Issue #2221 - Follow-up: Simplify jit_ioncheck{1|2|3}_deunified_sources assignment. 2023-05-18 09:39:50 +08:00
Job Bautista
a2b45a9d53 Issue #2221 - Follow-up: Ensure jit_ioncheck{1|2|3}_deunified_sources is defined.
Should fix build bustage in armhf, as well as prevent bustage in mips32.
2023-05-18 09:39:39 +08:00
Job Bautista
bbb91e4833 Issue #2246 - Implement Array find from last.
Based on the implementation from Mozilla bug 1704385.
2023-05-18 09:39:18 +08:00
roytam1
a7a525c65e Merge remote-tracking branch 'origin/tracking' into custom 2023-05-15 09:19:37 +08:00
Job Bautista
ec2fb72568 Issue #2241 - Part 1: Move {js::,JS_}{{Strictly,Loosely}Equal,SameValue} into their own header and implementation files
Backported from Mozilla bug 1516742.

The .from* methods are going to depend on SameValueZero, which needs to be
visible to /dom. This patch provides the foundation for that.
2023-05-15 09:09:41 +08:00
roytam1
e70aa9a4a1 Merge remote-tracking branch 'origin/tracking' into custom 2023-05-10 11:57:40 +08:00
Brian Smith
1c70f64e7c Issue #2236 - Fix import.meta module error in lambdas by moving parseGoal() into SharedContext. Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1604792 Also remove ParseGoal being passed through Parser introduced in #1691 Part 2. 2023-05-10 11:55:55 +08:00
FranklinDM
2d6c419661 Issue #2234 - Part 3: Update tests
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1402649 and https://bugzilla.mozilla.org/show_bug.cgi?id=1382306
2023-05-09 11:39:39 +08:00
FranklinDM
e52da4707d Issue #2234 - Part 2: Ensure that the created async function wrapper is valid
This excludes the GC-related changes (cell pointer asserts) since we don't have them. This bug should be revisited if we'd ever plan on porting those asserts over.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1402649
2023-05-09 11:39:17 +08:00
FranklinDM
ab1c0a384d Issue #2234 - Part 1: Create async function wrapper when instantiating module functions
This excludes the change that removes "excessive" rooting from the Lambda* methods in Interpreter.cpp.

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1382306
2023-05-09 11:39:03 +08:00
Job Bautista
9693552c5c Issue #2232 - Parse exported async functions. 2023-05-09 11:38:49 +08:00
roytam1
6235ca420d Merge remote-tracking branch 'origin/tracking' into custom 2023-05-04 10:47:54 +08:00
Moonchild
e6ff567de7 Issue #1656 - remove vim control lines from js/src
With recent work a bunch more vim control lines were re-introduced.
This nukes them again.
2023-05-04 10:46:02 +08:00
roytam1
fa52ac972f Issue #2142 - follow-up rev 51db22ff, removing static keyword from upstream force-push rev aa6d42e5fc..63a00fdd25 2023-05-03 21:39:40 +08:00
roytam1
75c6c6d5b5 Merge remote-tracking branch 'origin/tracking' into custom 2023-05-01 23:35:51 +08:00
Martok
a7d8cecdb9 Issue #2097 - Handle Logical Assignment in Ion CFG 2023-05-01 23:35:25 +08:00
roytam1
a248550543 Merge remote-tracking branch 'origin/tracking' into custom 2023-05-01 14:44:54 +08:00
Martok
10951a169c Issue #2097 - Implement logical assignment operators
Based-on: 1629106/1, 1684020
2023-05-01 13:27:04 +08:00
Martok
ba9647a12a Issue #2142 - Remove the temporary fields option
Now that everything is finished, we don't need the feature flag any more.
2023-05-01 13:27:04 +08:00
Martok
1fac189aea Issue #2142 - Implement class static block
Based-on: m-c 1712138/{2,3}, 1713155/2
2023-05-01 13:27:03 +08:00
Martok
22a9d46ef1 Issue #2142 - Track isFieldInitializer on JSScript instead of Scope
Introduce a FunctionSyntaxKind for FieldInitializer since special rules
(around `arguments`) apply. At the same time we can move the flag from the
scope to the JSScript. This is similar to how derived constructors are handled
and makes the initWithEnclosingScope code closer to initWithEnclosingContext.

This version is a bit more complex than Mozilla's due to different storage of
bit flags on JSScript.

Based-on: m-c 1636800
2023-05-01 13:27:03 +08:00
Martok
c3b19191f3 Issue #2142 - Parse and process static class fields
Based-on: m-c 1535804/{6,7}
2023-05-01 13:27:03 +08:00
Martok
b187006a7e Issue #2142 - Support SuperProperty in field initializers
Based-on: m-c 1555037/2
2023-05-01 13:27:03 +08:00
Martok
e0b5528c29 Issue #2142 - Optimize .initializers scoping and emitter
* Refactor code for emitting the .initializers array into ClassEmitter
* Only emit .initializers scope when actually required
* Remove unfinished code to handle non-present class field initialisers
* Use predicate count_if and any_of of ListNode
* Remove unnecessary parameters for class field parsing

Based-on: m-c 1553744, 1555979, 1555037/1, 1535804/{1-5}
2023-05-01 13:27:03 +08:00
Martok
c206114966 Issue #2142 - Set anonymous function name in field initializer
This was done wildly different in m-c 1552875, in the interest of keeping
|setOrEmitSetFunName| around it is implemented differently here.
2023-05-01 13:27:03 +08:00
Martok
f0b06f5ad6 Issue #2142 - Don't treat PNK_NAME specially emitAssignmentOrInit
If there ever was a point where this structure "avoids duplication", at least since the
*OpEmitter refactor emitting PNK_NAME differently makes it actually harder to follow.

Mozilla makes the same change at a different time.
2023-05-01 13:27:02 +08:00
Martok
f374ab472d Issue #2142 - Emit field keys in correct order
Based-on: m-c 1552229
2023-05-01 13:27:02 +08:00
Martok
1031b1fc43 Issue #2142 - Pass through arguments in synthesized constructors for derived classes
Based-on: m-c 1552022
2023-05-01 13:27:02 +08:00
Martok
bcb6203e4f Issue #2142 - Fix several scoping issues in field initializers
Based-on: m-c 1540789, 1547130, 1547467
2023-05-01 13:27:02 +08:00
Martok
8c6750014c Issue #2142 - Restrict contents of direct eval in fields
Based-on: m-c 1542406
2023-05-01 13:27:02 +08:00
Martok
849ab4417c Issue #2142 - Use JSOP_INITPROP for field initializers
We don't want to call setters for field initialization.

Based-on: m-c 1535471, 1547035
2023-05-01 13:27:01 +08:00
Martok
447261cf87 Issue #2142 - Implement ASI for fields
Based-on: m-c 1529772/{3,4}
2023-05-01 13:27:01 +08:00