This commit implements resizable ArrayBuffers - RABs for short - and
extends typed arrays (TAs) to support fixed-length and length-tracking
modes.
SharedArrayBuffers (SABs) also support the maxByteLength option now but
I cheated and allocate all memory upfront because atomically resizing
memory allocations is hard and this commit is already big and complex.
The lion's share is updating all the TA prototype methods to deal with
RABs resizing underneath them. Method arguments can be arbitrary objects
with arbitrary .valueOf methods and arbitrary side effects, like...
resizing the RAB we're currently operating on.
Fixes: https://github.com/quickjs-ng/quickjs/issues/477
This commit introduces a couple of changes in order to make run-test262
go brr and execute tests in parallel:
- Remove CONFIG_AGENT build option. The disabled version of the build
was already broken and no one noticed, Remove the define altogether.
- Remove the -C switch. Hard to support in multi-threaded mode.
I may bring it back some day because it _is_ useful.
- Remove the -r switch. Also hard to support and I never look at
test262_report.txt anyway so on the chopping block it goes.
- Judicious use of thread-local storage so I don't have to thread
through state everywhere and embiggen the diff even more.
This is what Real Programmers(TM) do: stay up coding way past midnight
just so the test suite finishes in one minute instead of four.
Fixes: https://github.com/quickjs-ng/quickjs/issues/547
test262/implementation-contributed/v8/mjsunit was removed upstream in
commit tc39/test262@a15874163e so this
commit also removes the v8 test runner; it's no longer functional.
Spec compliance bug: "await" is illegal inside initializer blocks
_except_ when used as an identifier in a function expression, like so:
class C {
static {
var f = function await() {}
}
}
It is somewhat complicated to make the parser understand the distinction
and such code is probably rare or non-existent so I decided to leave
well enough alone for now.