1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00
serenity/Userland/Libraries/LibJS/Tests/builtins
Anonymous 745b998774 LibJS: Get rid of unnecessary work from canonical_numeric_index_string
The spec version of canonical_numeric_index_string is absurdly complex,
and ends up converting from a string to a number, and then back again
which is both slow and also requires a few allocations and a string
compare.

Instead this patch moves away from using Values to represent canonical
a canonical index. In most cases all we need to know is whether a
PropertyKey is an integer between 0 and 2^^32-2, which we already
compute when we construct a PropertyKey so the existing is_number()
check is sufficient.

The more expensive case is handling strings containing numbers that
don't roundtrip through string conversion. In most cases these turn
into regular string properties, but for TypedArray access these
property names are not treated as normal named properties.
TypedArrays treat these numeric properties as magic indexes that are
ignored on read and are not stored (but are evaluated) on assignment.

For that reason there's now a mode flag on canonical_numeric_index_string
so that only TypedArrays take the cost of the ToString round trip test.
In order to improve the performance of this path this patch includes
some early returns to avoid conversion in cases where we can quickly
know whether a property can round trip.
2022-02-14 21:06:49 +00:00
..
AggregateError LibJS: Implement the Error Cause proposal 2021-06-11 21:34:05 +01:00
Array LibJS: Add tests for all the unscopable Array prototype properties 2022-01-05 20:31:25 +01:00
ArrayBuffer LibJS: ArrayBuffer.prototype.slice 2021-04-03 16:24:44 +02:00
Atomics LibJS: Implement Atomics.isLockFree 2021-07-14 22:13:15 +01:00
BigInt LibJS: Implement BigInt.asUintN 2022-02-06 15:49:54 +00:00
Boolean LibJS: Change wording of ErrorType::NotA to be independent of context 2021-09-12 00:16:39 +02:00
DataView LibJS: Use Checked<T> for offsets in the SetViewValue AO 2021-08-11 22:56:58 +01:00
Date LibJS: Explicitly handle invalid Date objects in UTC time setters 2022-02-04 13:47:50 +00:00
Error LibJS: Implement the Error Cause proposal 2021-06-11 21:34:05 +01:00
FinalizationRegistry test-js: Add a mark_as_garbage method to force GC to collect that object 2021-09-08 08:53:02 +01:00
Function LibJS: Don't coerce this value to an object in Function.prototype.call 2022-02-10 08:45:03 +00:00
functions LibJS: Correcly handle surrogates in escape() 2022-01-14 10:59:46 +01:00
Infinity Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Intl LibJS: Implement Intl %SegmentIteratorPrototype%.next ( ) 2022-01-31 21:05:04 +02:00
JSON LibJS: Fix JSON.stringify with stale surrogate codepoints 2022-02-07 13:53:36 +00:00
Map LibJS: Fix Map Iterators when elements are deleted during iteration 2022-02-10 14:09:39 +00:00
Math LibJS: Correctly handle mixing +0 and -0 in Math.{min,max}() 2021-04-23 20:51:48 +02:00
NaN Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Number LibJS/Tests: Enable Number.isInteger() test that now passes 2022-01-24 20:39:01 +00:00
Object Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
Promise LibJS: Don't coerce this value to object in Promise.prototype.finally() 2021-11-14 15:27:46 +00:00
Proxy LibJS: Throw InternalErrors instead of Errors on CallStackSizeExceeded 2021-11-27 01:58:05 +02:00
Reflect LibJS: Implement [[Call]] and [[Construct]] internal slots properly 2021-10-09 14:29:20 +01:00
RegExp LibJS: Create the RegExpExec result's "input" field last 2021-11-08 01:36:29 +01:00
Set LibJS: Add tests for Set.prototype.keys which is an alias for values 2022-02-10 14:09:39 +00:00
ShadowRealm LibJS: Remove the name prefix for wrapped functions 2022-02-12 16:06:37 +00:00
String LibRegex: Do not continue searching input when the sticky bit is set 2022-02-05 19:06:50 +03:30
Symbol LibJS: Rename OrdinaryFunctionObject to ECMAScriptFunctionObject 2021-09-25 17:51:30 +02:00
Temporal LibJS: Enable Temporal tests that now pass 2022-02-06 15:49:54 +00:00
TypedArray LibJS: Get rid of unnecessary work from canonical_numeric_index_string 2022-02-14 21:06:49 +00:00
WeakMap test-js: Add a mark_as_garbage method to force GC to collect that object 2021-09-08 08:53:02 +01:00
WeakRef LibJS: Add the WeakRef.prototype.deref method 2021-06-12 18:39:23 +01:00
WeakSet test-js: Add a mark_as_garbage method to force GC to collect that object 2021-09-08 08:53:02 +01:00