Commit graph

60 commits

Author SHA1 Message Date
wuggy
4b6afe41d7 Fix build error in SelfHosting.cpp 2026-06-29 06:55:57 +01:00
ownedbywuigi
d8c48d6830 Issue #451 part 2a - Enable OpenMP parallelization for CopyValues in SelfHosting.cpp 2026-04-25 09:49:36 +01:00
Moonchild
5fd304507d Issue #2692 - Part 7: De-globalize {*}CompileOptions.
Make all users of the various *CompileOptions classes #include "js/CompileOptions.h"
so that nothing but that file has to know about these classes having a
JS_PUBLIC_API on them, that would have to be present in forward-declarations.
2025-03-13 23:03:43 +08:00
Brian Smith
54e84f0f1d Issue #1442 - Part 3: Implement ReadableStream and associated classes in the JS engine. https://bugzilla.mozilla.org/show_bug.cgi?id=1272697 2023-10-04 09:53:29 +08:00
Brian Smith
90ca1f569a Issue #1442 - Part 1: Change ArrayBufferCopyData self-hosting intrinsic to take a start offset for the destination. This will be needed to manage stream chunks. https://bugzilla.mozilla.org/show_bug.cgi?id=1272697 2023-10-04 09:52:57 +08:00
Moonchild
50a4412750 Issue #2307 - Part 3: Remove SIMD.js support
This gets rid of the SIMD-specific scalar types in JS.
This considerably deviates from Mozilla's work because of our divergent
path.
2023-09-22 09:56:35 +08:00
Brian Smith
d972016c23 Issue #2026 - Part 2a - Support BigInt in NumberFormat and toLocaleString. https://bugzilla.mozilla.org/show_bug.cgi?id=1543677 2023-07-29 23:38:30 +08:00
Brian Smith
b64643e410 Issue #2026 - Part 1 - Implement BigInt64 and BigUint64Array. https://bugzilla.mozilla.org/show_bug.cgi?id=1456569 2023-07-29 23:38:09 +08:00
Martok
76052fcda8 Issue #2271 - Use declared names of self-hosted functions for cloning
Ensure that cloning a self-hosted function always has access to the declared
name from the source and that it doesn't get lost on successive clones.
This is done by storing the declared name in an extended slot on rename, and
cloning it with the function.

Based-on: m-c 1546232
2023-07-14 10:20:43 +08:00
Martok
3eb7729d04 Issue #2271 - Separate cloning of native and interpreted functions
Separate code paths make it easier to follow and specialize than a single
one-size-fits-all function.

Based-on: m-c 1405766, 1411954
2023-07-14 10:20:28 +08:00
Martok
4400677afe Issue #2046 - Implement Intl.DateTimeFormat's date-/timeStyle and hourCycle options
- remove mozExtensions flag and expose to client code

Based-on: m-c 1557718
2023-07-03 15:11:41 +08:00
Martok
e01ff1c5f9 Issue #1819 - Further align Intl.Locale to spec
- Reference updates (UTS 35)
- variant subtag and transform extension canonicalisation
2023-07-03 15:11:09 +08:00
Martok
4ad4a82a10 Issue #2259 - Performance improvements in Locale
- Move BestAvailableLocale function to C++
- Move default locale computation to C++
- Add available-locales set to SharedIntlData
- Remove separate sets for DateFormat and NumberFormat available locales.

Based-on: m-c 1373089
2023-07-03 15:10:02 +08:00
Martok
c10a29d96f Issue #1819 - Implement Intl.Locale proposal
This is according to spec for the mozilla71 cycle, a follow-up will further adjust to spec.

- Add Intl.Locale as native C++
- Port Unicode BCP 47 locale identifier parser to C++
- Port language tag parser to C++
- adjust make_intl_data to generate the data

Based-on: m-c 1433303, 1570370
2023-07-03 15:09:21 +08:00
Martok
3ee2c9dcf1 Issue #2259 - process Unicode langtags and locale identifiers according to BCP 47
Major spec change: text references are to BCP47 (not the implementing RFCs) and
the single source of truth is now Unicode CLDR.

- Switch from IANA to CLDR for make_unicode
- Update grandfathered tag handling directly in the parser
- Don't support extlang, irregular, privateuse or 4-letter subtags
- Adjust comments to refer to Unicode BCP 47 locale identifiers, remove RFC 5646
- Canonicalize/order langtags correctly
- Tokenize BCP47 in reusable class

Based-on: m-c 1407674(partial), 1451082, 1530320, 1522070, 1531091
2023-07-03 15:08:53 +08:00
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
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
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
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
Martok
5574b06ff5 Issue #2046 - Move builtin/Intl.* to builtin/intl/IntlObject.* 2023-02-21 08:17:20 +08:00
Martok
c7dab6c035 Issue #2046 - Move Intl.RelativeTimeFormat functionality into builtin/intl/RelativeTimeFormat.* 2023-02-21 08:16:37 +08:00
Martok
ed316832bf Issue #2046 - Move Intl.PluralRules functionality into builtin/intl/PluralRules.* 2023-02-21 08:16:19 +08:00
Martok
c981fb13ea Issue #2046 - Move Intl.DateTimeFormat functionality into builtin/intl/DateTimeFormat.* 2023-02-21 08:16:04 +08:00
Martok
53c2f58c5b Issue #2046 - Move Intl.Collator functionality into builtin/intl/Collator.* 2023-02-21 08:15:31 +08:00
Martok
e7565ff1ae Issue #2046 - Move Intl.NumberFormat functionality into builtin/intl/NumberFormat.* 2023-02-21 08:14:56 +08:00
Martok
f75e9d9441 Issue #2089 - Implement the Promise.any combinator
Based-on: m-c 1568903/9,1560300
2023-02-02 09:32:17 +08:00
Martok
1230808583 No issue - Cleanup unused function exports to self-hosted global
Based-on: m-c 1325696
2023-01-26 11:38:19 +08:00
Martok
6eead2deb4 Issue #1285 - Implement named capturing groups for replacing 2022-12-24 08:09:49 +08:00
Moonchild
5f23cd3017 Revert "Issue #1676 - Part 8: Fix up include for selfhosted.out.h"
This reverts commit bc450dab41695f85290f83c53c2c6914c1710883.
2022-09-07 11:00:53 +08:00
Job Bautista
3e6cbc6af3 Issue #1969 - Implement Intl.RelativeTimeFormat.
Based on Mozilla bugs 1270140, 1504656, 1483545, and 1504334.
Took note of Mozilla bug 1379222 which changed GetPrototypeFromCallableConstructor
 to GetPrototypeFromBuiltinConstructor.
There are many other changes I did myself since the initial implementation by
 Mozilla wouldn't work with this codebase.
2022-07-30 08:43:43 +08:00
Martok
53d6173cfb Issue #1952 - m-c 1365387: Optimize FinishBoundFunctionInit by delaying atomizing the function name 2022-07-03 06:54:09 +08:00
meatloaf
00a689060f Issue #1726 - Implement String.replaceAll()
This also implements IsRegExp, as this demands it.
Ported from https://bugzilla.mozilla.org/show_bug.cgi?id=1540021
2021-02-05 07:35:06 +08:00
Moonchild
0989dc6d2d [js] Remove unused promise selfhosting functions.
These are leftovers from when promises were fully self-hosted and could cause
confusion if left in place.
2021-02-03 10:04:44 +08:00
Moonchild
aa38ed97fa Issue #1701 - Implement Intl.PluralRules API 2020-12-24 09:36:34 +08:00
Matt A. Tobin
69b861a491 Issue #1676 - Part 8: Fix up include for selfhosted.out.h 2020-11-06 09:43:16 +08:00
Moonchild
dabd32f955 Issue #1656 - Part 7: Nuke vim config lines in JS 2020-09-25 22:04:24 +08:00
Moonchild
34db761758 Issue #618 - Simplify module resolve hook to be a function pointer
This is an ahead-of time port to try and address #1624.
This is based on BZ 1461751 and Jon Coppeard's work in it.
2020-08-29 08:08:41 +08:00
Moonchild
1cfaf06d8f Issue #618 - Use a single slot for the module's environment object.
According to the spec this isn't created until the module is instantiated, but
we create it when we compile the module.
We stored this previously in InitialEnvironmentSlot and copied it to
EnvironmentSlot when it was supposed to be created, but we can just store it in
the latter slot straight away and check the module's status and return null if
it shouldn't exist yet.

This reduces the number of slots needed on a moduleObject to 17.

Re: BZ 1420412 Part 1
We can't implement the second part to further reduce our number of slots,
because it relies on SetProxyReservedSlot which in turn relies on
rearchitecturing JS proxies to make reserved slots dynamic. That's a rabbit hole
we really don't want to fall into.
So, we'll end up being a bit slower because it can't be in-line allocated with
having more than 16 slots, but so be it. I sincerely doubt it will make any
practical difference.
2020-08-29 08:07:03 +08:00
Moonchild
0d874713ef Issue #618 - Align error handling for module scripts with the spec (again)
This updates module implementation to match spec regarding handling of
instantiation errors, after it was changed yet again, this time to not remember
instantiation errors, but instead immediately rethrow applicable ones.

Ref: BZ 1420420
2020-08-29 08:07:00 +08:00
Moonchild
9201808e0a Issue #618 - Report source position information (line/column)
Report source position information for module export resolution failures.

Ref: BZ 1362098
2020-07-10 22:18:10 +08:00
Moonchild
c7d195e633 Issue #618 - Align module instantiation/errors with the updated spec.
Store and re-throw module instantiation and evaluation errors.
Ref: BZ 1374239, 1394492
2020-07-10 22:17:41 +08:00
Gaming4JC
7eb5d46c11 Bug 1343481 - Part 1: Remove {JSFunction,JSScript,LazyScript}.isGenerator() method.
Tag #1287
2019-12-18 09:15:51 +08:00
Gaming4JC
4ce0bb5e0a Bug 1336705 - Part 2: Add self-hosting intrinsics for resolving/rejecting Promises and adding reactions.
Tag #1287
2019-12-18 09:15:50 +08:00
wolfbeast
c16e82c9b1 Issue #1302 - Add self-hosted implementation for string regex .matchAll
This resolves #1302.
2019-11-28 10:32:42 +08:00
André Bargull
ff54e6899f Issue #1283 - Implement Promise.prototype.finally()
This resolves #1283.
2019-11-15 14:23:09 +08:00
janekptacijarabaci
e82ffc59bb Bug 1326453 - Part 5: Remove no longer used ListIterator implementation 2019-11-11 21:57:42 +08:00
Gaming4JC
4f51cc381d 1344477 - Part 2: Optimize Array.prototype.splice with JSOP_NORVCALL. 2019-07-22 19:52:27 +08:00