Commit 73cc00e reduced the number of emitted source locations a great
deal but it resulted in at least one observable regression:
export default async function f() {
return "abc" + x
}
f() // ReferenceError should point to 2:20 but pointed to 1:1
Emit source locations for expressions again. Increases the average
number of source locations by about 15%. Non-scientifically tested
by counting source locations emitted when parsing the test suite
before and after.
No test because we currently cannot easily test stack traces coming
from module imports.
Fixes: https://github.com/quickjs-ng/quickjs/issues/779
We were emitting gobs of inefficient bytecode that created an arguments
array on the stack, then applied it to the parent constructor.
Add a new opcode for initializing a derived class. Speeds up construction
by 500%, although sadly that is not visible in the web-tooling-benchmark,
only in micro-benchmarks.
Fixes: https://github.com/quickjs-ng/quickjs/issues/752
Its implementation was borderline wrong: calling it with is_arg=TRUE
segfaults because it looks up the var ref index in the wrong array.
Fortunately, there is only one caller and it only passes FALSE.
Switch to a hash table when the number of variables grows beyond
a threshold.
Speeds up the test case from the linked issue by about 70%.
Fixes: https://github.com/quickjs-ng/quickjs/issues/456
Emit source locations manually for more precise tracking. Don't infer
them from emitted bytecode opcodes because that leads to inaccurate
and sometimes surprising results.
Speeds up code generation (although infinitesimally) as a bonus.
Fixes: https://github.com/quickjs-ng/quickjs/issues/236
Introduced in commit 61c8fe6 from last month that moved the callback
into the job queue:
1. It leaked `fre->held_val` when no job was enqueued
2. It fumbled the reference count when enqueuing; JS_EnqueueJob already
takes care of incrementing and decrementing it
Reverts commit 0a70623 from earlier today because that didn't turn out
to be a complete fix.
Fixes: https://github.com/quickjs-ng/quickjs/issues/648
No test because I can only get it to trigger with qjs, not run-test262,
but the problem is that we need to run FinalizationRegistry finalizers
before asserting no objects remain.
Fixes: https://github.com/quickjs-ng/quickjs/issues/648
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
Can be reproduced on the CLI but not from a script:
# should throw "unsupported object class" TypeError
$ qjs --std -e 'bjson.write(function(){})'
/path/to/quickjs.c:6510:15: runtime error: applying zero offset to null pointer