This is really just a type alias for NonnullGCPtr<T>, but it provides
a way to have non-owning non-visited NonnullGCPtr<T> without getting
yelled at by the Clang plugin for catching GC errors.
(cherry picked from commit 6a6618f5eab6e6a2c7c3fc03f8063cc6b497a0ec)
We were previously dumping the address of the cell pointer instead of
the address of the cell itself. This was causing mysterious orphans
in GC dumps, and it took me way too long to figure this out.
(cherry picked from commit e240084437ea0bfe03d83dc3533d4ee6214b7206)
The following syntax is valid:
```js
e?.example / 1.2
```
Previously, the `/` would be treated as a unterminated regex literal,
because it was calling the regular `consume` instead of
`consume_and_allow_division`.
This is what is done when parsing IdentifierNames in
parse_secondary_expression when a period is encountered.
Allows us to parse clients-main-[hash].js on https://ubereats.com/
(cherry picked from commit bd4c29322c945647c52ff4d8045c7529f8152b08)
There is no need to do a full linear search from start to end when
we can just remember the position and continue where we left off.
(cherry picked from commit f4e24762846cfb7a98054f700319d940173086bb)
If statements without an else clause generated jumps to the next
instruction, this commit fixes the if statement generation so that it
dosen't produce them anymore.
This is an example of JS code that generates the useless jumps
(a => if(a){}) ();
(cherry picked from commit 7865fbfe6d04a79a253a38eaec5c21c2bde110b5)
This avoids having to do O(n) contains() in the various flag accessors.
Yields a ~20% speed-up on the following microbenchmark:
const re = /foo/dgimsvy;
for (let i = 0; i < 1_000_000; ++i)
re.flags;
(cherry picked from commit 257ebea3645ab709be4a984100cc6478b289d0e6)
`find_binding_and_index` was doing a linear search, and while most
environments are small, websites using JavaScript bundlers can have
functions with very large environments, like youtube.com, which has
environments with over 13K bindings, causing environment lookups to
take a noticeable amount of time, showing up high while profiling.
Adding a HashMap significantly increases performance on such websites.
(cherry picked from commit 78ecde9923e954e8ae9bb8d7a8ceefc08a8130ae)
This proposal has reached stage 4 and was merged into the ECMA-262 spec.
See: https://github.com/tc39/ecma262/commit/961f269
(cherry picked from commit 84ad36de0692b8890a2aa7ab66ed4d679cf630c8;
amended to replace one ASSERT() with VERIFY())
This proposal has reached stage 4 and was merged into the ECMA-262 spec.
See: https://github.com/tc39/ecma262/commit/d72630f
(cherry picked from commit 3aca12d2fadca1628a4dd2f800050b4e54194d65)
This implements the proposed update to the ShadowRealm proposal for
integrating the ShadowRealm specification into the web platform.
(cherry picked from commit d1fc76bffdafe5a057c0da5855d9d643608bd726)
This allows us to align our implementation in the same order as the
specification.
No functional change with the current implementation of this AO.
However, this change is required in order to correctly implement a
proposed update of the shadow realm proposal for integration with
the HTML spec host bindings in order to give the ShadowRealm
object the correct 'intrinsic' realm.
This is due to that proposed change adding a step which manipulates the
currently executing Javascript execution context, making the ordering
important.
(cherry picked from commit 0ec8af5b70702e9ee2edc7269c103fa49e6987c1)
We were storing these in Handle (strong GC roots) hanging off of
ECMAScriptFunctionObject which effectively turned into world leaks.
(cherry picked from commit 5aa1d7837fe37dd203763178df3325ff8b24abbd)
https://github.com/whatwg/console/pull/240 is an editorial change to use
the term "implementation-defined" more consistently. This seems to be
the only instance in the spec text which we quote verbatim.
(cherry picked from commit 51f82c1d939dd28a3e719d7fa495cf9f30d0921c)
Fixes a bug when "'Await' expression is not allowed in formal parameters
of an async function" is thrown for "await" encountered in a function
definition assigned to a default function parameter.
Fixes loading of https://excalidraw.com/
(cherry picked from commit 10064d0e1a89a4f48dc1e896de35a65f2ab946f4)
This didn't make any sense, and was already handled by pushing a new
execution context anyway.
By simply removing these bogus lines of code, we fix a bug where
throwing inside a function whose bytecode was shorter than the calling
function would crash trying to generate an Error stack trace (because
the bytecode offset we were trying to symbolicate was actually from
the longer caller function, and not valid in the callee function.)
This makes --log-all-js-exceptions less crash prone and more helpful.
(cherry picked from commit b3f77e47690cfd07058d824ea6f0b652489778bf)
This makes https://cling.com/ load, and more of the animated elements
on https://shopify.com/ start appearing.
(cherry picked from commit 0f9444fa06031e7d8e3c1ad36e701090e0b17ec1)
Before this change, we were hard-coding 4 KiB. This meant that systems
with a 16 KiB native page size were wasting 12 KiB per HeapBlock on
nothing, leading to worse locality and more mmap/madvise churn.
We now query the system page size on startup and use that as the
HeapBlock size.
The only downside here is that some of the pointer math for finding the
base of a HeapBlock now has to use a runtime computed value instead of a
compile time constant. But that's a small price to pay for what we get.
(cherry picked from commit a6bf253602702c052453d5ccb45a40d8fbb368ba)
- Expose table from console object
- Add new Table log level
- Create a JS object that represents table rows and columns
- Print table as HTML using WebContentConsoleClient
(cherry picked from commit 785180dd45ef6dcce4d847e564eca52ed0ad955b)
The proposal reached stage 4 and was merged into the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/2006dea
(cherry picked from commit 9f1517492cc85c5f12cb52436dc72ec21e594b7a)
The proposal reached stage 4 and was merged into the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/44bb0e0
(cherry picked from commit bf3e7d3ac43a16a8183b03c299b88702f493af82)
The `deepEquals` algorithm used for testing was naive, and incorrectly
evaluated equality of objects in some cases. The new algorithm considers
that the second object could have more keys than the first, and compares
the prototypes of the objects.
(cherry picked from commit cb629e18bbcb8f5a6c6fd535e290a34da7a5cfb6)
We don't need to remember these by (line, column, offset). Just the
offset should be enough.
(cherry picked from commit 2e06d26ddb0c13b8c90933e619876281ce8eeab2)
By checking the lengths and then looking directly at the bytes, the
generated code becomes a lot nicer.
This gives a 1.23x speedup when parsing the JS from x.com
(cherry picked from commit 93a4d7395f60e25f5eba2103fa562d0278a91a9a)
Loading Ladybird on Github results in 37 debug logs about being unable
to parse an empty Date string. This log is intended to catch Date
formats we do not support to detect web compatability problems, which
makes this case not particuarly useful to log.
Instead of trying to parse all of the different date formats and
logging that the string is not valid, let's just return NAN immediately.
(cherry picked from commit ee35e93eb23996923db12f39ba17ece61da4e39b)
We were already caching UTF-8 and byte strings, so let's add a cache
for UTF-16 strings as well. This is particularly profitable whenever we
run regular expressions, since the output of regex execution is a set of
UTF-16 strings.
Note that this is a weak cache like the other JS string caches, meaning
that strings are removed from the cache as they are garbage collected.
This avoids billions of PrimitiveString allocations across a run of WPT,
significantly reducing GC activity.
(cherry picked from commit 206479b2b5fc2641a619eb0d05c1185d869ef844)
Printing the whole array causes wpt
console/console-log-large-array.any.html to crash.
This limits logged arrays to 100 elements and
truncates the rest with ...
(cherry picked from commit 9650cf8b15a941aaf71c8a4d7db6ee899e367cbd)
1.25x speed-up on this microbenchmark:
let o = { get x() { return 1; } };
for (let i = 0; i < 10_000_000; ++i)
o.x;
I looked into this because I noticed getter invocation when profiling
long-running WPT tests. We already had the mechanism for non-getter
properties, and the change to support getters turned out to be trivial.
(cherry picked from commit 3c5819a6d27883907237bf8137fd4dc24ed04e72)
This allows date strings like "01 February 2013" to be parsed.
auth0.com also loads now because of this :^)
Add test for date parsing
(cherry picked from commit 179641a297ab0b4bafcce3a6361be2c4ed0c51ea)