]> git.kaiwu.me - quickjs.git/log
quickjs.git
3 weeks agodoc update
Fabrice Bellard [Thu, 4 Jun 2026 09:31:14 +0000 (11:31 +0200)]
doc update

3 weeks agokeep more generic cpu_count() for non Linux systems
Fabrice Bellard [Thu, 4 Jun 2026 09:08:15 +0000 (11:08 +0200)]
keep more generic cpu_count() for non Linux systems

3 weeks agofixed microbench with d8
Fabrice Bellard [Thu, 4 Jun 2026 09:03:10 +0000 (11:03 +0200)]
fixed microbench with d8

3 weeks agofaster add, sub and mul for mixed integer floating point operands
Fabrice Bellard [Wed, 3 Jun 2026 15:25:16 +0000 (17:25 +0200)]
faster add, sub and mul for mixed integer floating point operands

3 weeks agoexclude few very slow and currently useless test262 tests
Fabrice Bellard [Wed, 3 Jun 2026 14:18:26 +0000 (16:18 +0200)]
exclude few very slow and currently useless test262 tests

3 weeks agofixed large performance regression with recent GCC versions
Fabrice Bellard [Wed, 3 Jun 2026 13:48:17 +0000 (15:48 +0200)]
fixed large performance regression with recent GCC versions

3 weeks agoadd optional define to add asm labels for each opcode to ease code inspection and...
Fabrice Bellard [Wed, 3 Jun 2026 13:19:05 +0000 (15:19 +0200)]
add optional define to add asm labels for each opcode to ease code inspection and profiling

4 weeks agoadded multi-threading support in run-test262 (initial patch by bnoordhuis) - fixed...
Fabrice Bellard [Tue, 2 Jun 2026 16:12:02 +0000 (18:12 +0200)]
added multi-threading support in run-test262 (initial patch by bnoordhuis) - fixed unsafe thread termination in show_progress() - use the number of physical cores by default - added -T option to force the number of threads - avoid hardcoding the maximum number of threads

4 weeks agoremoved CONFIG_AGENT
Fabrice Bellard [Tue, 2 Jun 2026 12:42:27 +0000 (14:42 +0200)]
removed CONFIG_AGENT

4 weeks agofixed win32 compilation
Fabrice Bellard [Tue, 2 Jun 2026 12:17:40 +0000 (14:17 +0200)]
fixed win32 compilation

4 weeks agoArrayBuffer.prototype.transfer: avoid destroying the old array buffer in case the...
Fabrice Bellard [Tue, 2 Jun 2026 12:08:19 +0000 (14:08 +0200)]
ArrayBuffer.prototype.transfer: avoid destroying the old array buffer in case the allocation of the new array buffer fails. Also avoid setting opaque = NULL for the custom array buffer free function

4 weeks agoadd line number info in variable initialization (#458)
Fabrice Bellard [Tue, 2 Jun 2026 10:14:13 +0000 (12:14 +0200)]
add line number info in variable initialization (#458)

4 weeks agouse the host malloc() for all allocations when ASAN is enabled
Fabrice Bellard [Tue, 2 Jun 2026 08:29:05 +0000 (10:29 +0200)]
use the host malloc() for all allocations when ASAN is enabled

4 weeks agofixed setuid() / setgid() ordering (#517)
Fabrice Bellard [Mon, 1 Jun 2026 16:47:42 +0000 (18:47 +0200)]
fixed setuid() / setgid() ordering (#517)

4 weeks agodisable inlining of malloc() wrappers to avoid problems with LTO (#515)
Fabrice Bellard [Mon, 1 Jun 2026 16:43:57 +0000 (18:43 +0200)]
disable inlining of malloc() wrappers to avoid problems with LTO (#515)

4 weeks agoadded poll() support so that the number of file handles is not limited (#502)
Fabrice Bellard [Mon, 1 Jun 2026 16:24:48 +0000 (18:24 +0200)]
added poll() support so that the number of file handles is not limited (#502)

4 weeks agoAdd run-test262 --no-can-block flag (#505)
Ivan Krasilnikov [Tue, 2 Jun 2026 08:39:16 +0000 (16:39 +0800)]
Add run-test262 --no-can-block flag (#505)

The flag is needed to pass the two CanBlockIsFalse tests from test262
when running individual preprocessed tests via run-test262 -N.

5 weeks agofixed compilation with clang
Fabrice Bellard [Thu, 21 May 2026 17:02:15 +0000 (19:02 +0200)]
fixed compilation with clang

5 weeks agoadded custom malloc for small blocks (11% faster on bench-v8)
Fabrice Bellard [Thu, 21 May 2026 16:37:42 +0000 (18:37 +0200)]
added custom malloc for small blocks (11% faster on bench-v8)

6 weeks agoAdd Uint8Array base64/hex methods (initial patch by saghul)
Fabrice Bellard [Thu, 14 May 2026 17:11:10 +0000 (19:11 +0200)]
Add Uint8Array base64/hex methods (initial patch by saghul)

6 weeks agomemcpy() (currently) has undefined behavior if a pointer is NULL with zero size ...
Fabrice Bellard [Thu, 14 May 2026 14:21:10 +0000 (16:21 +0200)]
memcpy() (currently) has undefined behavior if a pointer is NULL with zero size (#500)

6 weeks agofixed error handling in os.exec() (#503)
Fabrice Bellard [Thu, 14 May 2026 13:51:22 +0000 (15:51 +0200)]
fixed error handling in os.exec() (#503)

6 weeks agoadded missing NULL pointer check (#504)
Fabrice Bellard [Thu, 14 May 2026 13:43:42 +0000 (15:43 +0200)]
added missing NULL pointer check (#504)

6 weeks agouse __EMSCRIPTEN__ define instead of EMSCRIPTEN
Fabrice Bellard [Thu, 14 May 2026 13:41:29 +0000 (15:41 +0200)]
use __EMSCRIPTEN__ define instead of EMSCRIPTEN

6 weeks agofixed (again) JS atomics in case of typed array resizing - use same function name...
Fabrice Bellard [Thu, 14 May 2026 13:39:06 +0000 (15:39 +0200)]
fixed (again) JS atomics in case of typed array resizing - use same function name as quickjs-ng for js_atomics_get_buf() (#508)

6 weeks agoadded libunicode unicode version (#509)
Fabrice Bellard [Thu, 14 May 2026 12:57:49 +0000 (14:57 +0200)]
added libunicode unicode version (#509)

6 weeks agoMerge pull request #496 from bptato/fix-hex-access
bellard [Thu, 14 May 2026 14:34:46 +0000 (16:34 +0200)]
Merge pull request #496 from bptato/fix-hex-access

Fix member access on non-decimal numeric literals

6 weeks agoMerge pull request #495 from nickva/fix-initializer-string-warning
bellard [Thu, 14 May 2026 14:25:01 +0000 (16:25 +0200)]
Merge pull request #495 from nickva/fix-initializer-string-warning

Avoid initializer-string warning for the digits array

3 months agoFix member access on non-decimal numeric literals
bptato [Tue, 24 Mar 2026 18:44:11 +0000 (19:44 +0100)]
Fix member access on non-decimal numeric literals

In other engines, 0x0.toString() returns '0', but QJS would try to parse it
as a float and then throw.
Also removes remnants of hex float parsing which is no longer supported
anyway.

(Port of https://github.com/quickjs-ng/quickjs/pull/377)

3 months agoAvoid initializer-string warning for the digits array
Nick Vatamaniuc [Tue, 24 Mar 2026 04:46:16 +0000 (00:46 -0400)]
Avoid initializer-string warning for the digits array

Some newer compilers emit this warning:

```
warning: initializer-string for character array is too long, array size is 36
     but initializer has size 37 (including the null terminating character);
     did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization]
 12146 | static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
       |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

To avoid the warning initialize the array as individual characters

3 months agoadded JSON.parse source text access
Fabrice Bellard [Mon, 23 Mar 2026 17:45:52 +0000 (18:45 +0100)]
added JSON.parse source text access

3 months agoadded basic protection against too large function in serialized bytecode
Fabrice Bellard [Sat, 21 Mar 2026 16:49:40 +0000 (17:49 +0100)]
added basic protection against too large function in serialized bytecode

3 months agofixed use-after-free via re-entrant GC in FinalizationRegistry weak reference cleanup...
Fabrice Bellard [Sat, 21 Mar 2026 16:39:27 +0000 (17:39 +0100)]
fixed use-after-free via re-entrant GC in FinalizationRegistry weak reference cleanup (#494)

3 months agoFix async generator lifecycle bug (bnoordhuis) (quickjs-ng/quickjs#1355)
Fabrice Bellard [Sat, 21 Mar 2026 15:34:37 +0000 (16:34 +0100)]
Fix async generator lifecycle bug (bnoordhuis) (quickjs-ng/quickjs#1355)

3 months agofixed RegExp.escape
Fabrice Bellard [Sat, 21 Mar 2026 14:53:25 +0000 (15:53 +0100)]
fixed RegExp.escape

3 months agofixed buffer overflow in Atomics with resizable typed arrays
Fabrice Bellard [Sat, 21 Mar 2026 14:35:03 +0000 (15:35 +0100)]
fixed buffer overflow in Atomics with resizable typed arrays

3 months agotypo
Fabrice Bellard [Sat, 21 Mar 2026 13:31:19 +0000 (14:31 +0100)]
typo

3 months agoFix memory leak in Iterator.prototype.map (saghul) (#493)
Fabrice Bellard [Sat, 21 Mar 2026 13:26:00 +0000 (14:26 +0100)]
Fix memory leak in Iterator.prototype.map (saghul) (#493)

3 months agofixed buffer overflow in TypedArray.prototype.with (#492)
Fabrice Bellard [Sat, 21 Mar 2026 13:18:38 +0000 (14:18 +0100)]
fixed buffer overflow in TypedArray.prototype.with (#492)

3 months agoFix stack underflow with generator in iterable (saghul) (#488)
Fabrice Bellard [Sat, 21 Mar 2026 12:43:57 +0000 (13:43 +0100)]
Fix stack underflow with generator in iterable (saghul) (#488)

3 months agotest262 update
Fabrice Bellard [Sat, 21 Mar 2026 11:39:29 +0000 (12:39 +0100)]
test262 update

3 months agofixed TypedArray constructor semantics which removes a buffer overflow (#478)
Fabrice Bellard [Sat, 21 Mar 2026 11:23:53 +0000 (12:23 +0100)]
fixed TypedArray constructor semantics which removes a buffer overflow (#478)

3 months agofixed TypedArray sort semantics by copying the array before calling the comparison...
Fabrice Bellard [Sat, 21 Mar 2026 10:33:13 +0000 (11:33 +0100)]
fixed TypedArray sort semantics by copying the array before calling the comparison function. Fixed buffer overflow when the array is resized (#477)

3 months agomodified js_allocate_fast_array() so that the array is fully initialized. It is sligh...
Fabrice Bellard [Sat, 21 Mar 2026 09:55:57 +0000 (10:55 +0100)]
modified js_allocate_fast_array() so that the array is fully initialized. It is slightly slower but avoids several nasty bugs (#471)

6 months agoregexp: removed alloca() is lre_exec() - added specific opcodes for \s and \S to...
Fabrice Bellard [Mon, 22 Dec 2025 14:12:46 +0000 (15:12 +0100)]
regexp: removed alloca() is lre_exec() - added specific opcodes for \s and \S to have a smaller bytecode - optimized \b and \B

6 months ago\x{N} is a syntax error
Fabrice Bellard [Mon, 22 Dec 2025 14:05:37 +0000 (15:05 +0100)]
\x{N} is a syntax error

6 months agoslightly faster lexical variable assignment
Fabrice Bellard [Mon, 22 Dec 2025 14:03:43 +0000 (15:03 +0100)]
slightly faster lexical variable assignment

6 months agoDon't call well-known Symbol methods for RegExp on primitive values
Fabrice Bellard [Thu, 11 Dec 2025 18:27:19 +0000 (19:27 +0100)]
Don't call well-known Symbol methods for RegExp on primitive values

6 months agoremoved use after free in js_create_module_bytecode_function() (#467)
Fabrice Bellard [Thu, 11 Dec 2025 18:18:56 +0000 (19:18 +0100)]
removed use after free in js_create_module_bytecode_function() (#467)

6 months agoremoved memory leak in case of error in cpool_add() (#468)
Fabrice Bellard [Thu, 11 Dec 2025 18:17:38 +0000 (19:17 +0100)]
removed memory leak in case of error in cpool_add() (#468)

6 months agofixed fast array extension optimization when there are multiple realms
Fabrice Bellard [Wed, 3 Dec 2025 12:36:26 +0000 (13:36 +0100)]
fixed fast array extension optimization when there are multiple realms

6 months agoadded regexp duplicate named groups - fixed reset of captures with quantizers
Fabrice Bellard [Wed, 3 Dec 2025 12:30:33 +0000 (13:30 +0100)]
added regexp duplicate named groups - fixed reset of captures with quantizers

7 months agoupdated to unicode 17.0.0 - updated test262 version
Fabrice Bellard [Sat, 29 Nov 2025 14:14:41 +0000 (15:14 +0100)]
updated to unicode 17.0.0 - updated test262 version

7 months agoadded missing lre_poll_timeout()
Fabrice Bellard [Sat, 29 Nov 2025 12:13:18 +0000 (13:13 +0100)]
added missing lre_poll_timeout()

7 months agoregexp: cosmetic: make it clearer that there is now a set of registers instead of...
Fabrice Bellard [Sat, 29 Nov 2025 12:04:47 +0000 (13:04 +0100)]
regexp: cosmetic: make it clearer that there is now a set of registers instead of an auxiliary stack

7 months agoregexp: ensure that the bytecode size grows linearly with respect to
Fabrice Bellard [Sat, 29 Nov 2025 11:39:52 +0000 (12:39 +0100)]
regexp: ensure that the bytecode size grows linearly with respect to
the input regexp.

This way, pathological regexps such as
/(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(:?(?:a|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+|)+/ are no longer an issue. The generated bytecode is also simpler and
faster.

7 months agoremoved buffer overflows introduced in regexp optimizations
Fabrice Bellard [Sat, 22 Nov 2025 11:10:55 +0000 (12:10 +0100)]
removed buffer overflows introduced in regexp optimizations

7 months agofixed Worker freeing logic (#462)
Fabrice Bellard [Sat, 22 Nov 2025 10:03:45 +0000 (11:03 +0100)]
fixed Worker freeing logic (#462)

7 months ago- optimized Regexp.prototype.exec
Fabrice Bellard [Sat, 22 Nov 2025 10:00:50 +0000 (11:00 +0100)]
- optimized Regexp.prototype.exec
- optimized String.prototype.replace
- optimized 'arguments' object creation
- optimized access to non strict 'arguments' elements

7 months agofaster and simpler implementation of regexp backtracking
Fabrice Bellard [Sat, 22 Nov 2025 09:44:19 +0000 (10:44 +0100)]
faster and simpler implementation of regexp backtracking

7 months agofixed BJSON array serialization (#457)
Fabrice Bellard [Sat, 15 Nov 2025 13:52:50 +0000 (14:52 +0100)]
fixed BJSON array serialization (#457)

7 months ago- Added Iterator.concat (initial patch by bnoordhuis)
Fabrice Bellard [Sat, 15 Nov 2025 11:22:50 +0000 (12:22 +0100)]
- Added Iterator.concat (initial patch by bnoordhuis)
- optimized js_iterator_concat_next()
- added more guards against recursion in Iterator.concat operations

7 months agooptimized add/sub int32 overflow
Fabrice Bellard [Sat, 15 Nov 2025 11:18:18 +0000 (12:18 +0100)]
optimized add/sub int32 overflow

7 months agoadded error checking in JS_InstantiateFunctionListItem()
Fabrice Bellard [Sat, 15 Nov 2025 11:10:44 +0000 (12:10 +0100)]
added error checking in JS_InstantiateFunctionListItem()

7 months ago- Closure optimization (go from quadratic to linear time when the number
Fabrice Bellard [Sat, 15 Nov 2025 11:01:20 +0000 (12:01 +0100)]
- Closure optimization (go from quadratic to linear time when the number
of closure variables is large)
- Separated JSVarDef and JSBytecodeVarDef to simplify the code and save memory
- fixed debug info stripping with global variables

7 months agoRestore a mistakenly removed goto on error in js_build_module_ns() (igorburago)
Fabrice Bellard [Wed, 5 Nov 2025 10:46:20 +0000 (11:46 +0100)]
Restore a mistakenly removed goto on error in js_build_module_ns() (igorburago)

7 months agofixed JS_PROP_AUTOINIT handling in js_closure_define_global_var() (#455)
Fabrice Bellard [Wed, 5 Nov 2025 10:41:18 +0000 (11:41 +0100)]
fixed JS_PROP_AUTOINIT handling in js_closure_define_global_var() (#455)

7 months agofixed exception handling in put_var operation (regression introduced by commit a6816b...
Fabrice Bellard [Wed, 5 Nov 2025 10:29:03 +0000 (11:29 +0100)]
fixed exception handling in put_var operation (regression introduced by commit a6816be) (#454)

7 months agoMore informative "not a constructor" error message (initial patch by bnoordhuis)...
Fabrice Bellard [Mon, 3 Nov 2025 17:52:39 +0000 (18:52 +0100)]
More informative "not a constructor" error message (initial patch by bnoordhuis) (#368)

7 months agoFix length check in ArrayBuffer.prototype.slice (bnoordhuis) (#451)
Fabrice Bellard [Mon, 3 Nov 2025 17:38:20 +0000 (18:38 +0100)]
Fix length check in ArrayBuffer.prototype.slice (bnoordhuis) (#451)

7 months agofixed DataView resizing
Fabrice Bellard [Mon, 3 Nov 2025 17:29:10 +0000 (18:29 +0100)]
fixed DataView resizing

7 months agoFix use-after-free in ArrayBuffer.prototype.transfer (bnoordhuis) (#450) - use js_arr...
Fabrice Bellard [Mon, 3 Nov 2025 17:23:19 +0000 (18:23 +0100)]
Fix use-after-free in ArrayBuffer.prototype.transfer (bnoordhuis) (#450) - use js_array_buffer_update_typed_arrays() in JS_DetachArrayBuffer()

7 months agoqjs: added --strict option - don't consider included files as modules - allow module...
Fabrice Bellard [Mon, 3 Nov 2025 16:22:18 +0000 (17:22 +0100)]
qjs: added --strict option - don't consider included files as modules - allow module and strict code with -e option

7 months agoremoved duplicate test
Fabrice Bellard [Mon, 3 Nov 2025 16:14:12 +0000 (17:14 +0100)]
removed duplicate test

7 months agoMuch faster destructuring at the expense of a slight incompatibility
Fabrice Bellard [Mon, 3 Nov 2025 16:08:59 +0000 (17:08 +0100)]
Much faster destructuring at the expense of a slight incompatibility
with the spec when direct evals are present (v8 behaves the same way).

7 months agooptimized global variable access
Fabrice Bellard [Mon, 3 Nov 2025 15:57:20 +0000 (16:57 +0100)]
optimized global variable access

8 months agoremoved uninitialized variable
Fabrice Bellard [Sat, 18 Oct 2025 10:04:12 +0000 (12:04 +0200)]
removed uninitialized variable

8 months agoupdated test results
Fabrice Bellard [Sat, 18 Oct 2025 09:09:17 +0000 (11:09 +0200)]
updated test results

8 months agofixed operation order in Regexp constructor
Fabrice Bellard [Sat, 18 Oct 2025 09:05:05 +0000 (11:05 +0200)]
fixed operation order in Regexp constructor

8 months agochanged module rejection order according to spec change
Fabrice Bellard [Sat, 18 Oct 2025 08:50:51 +0000 (10:50 +0200)]
changed module rejection order according to spec change

8 months agooptimized Array.prototype.push
Fabrice Bellard [Thu, 16 Oct 2025 13:21:24 +0000 (15:21 +0200)]
optimized Array.prototype.push

8 months agoinlined the get_length operation
Fabrice Bellard [Thu, 16 Oct 2025 13:10:58 +0000 (15:10 +0200)]
inlined the get_length operation

8 months agoadded js_string_eq()
Fabrice Bellard [Thu, 16 Oct 2025 13:00:29 +0000 (15:00 +0200)]
added js_string_eq()

8 months agostricter year parsing in Date
Fabrice Bellard [Mon, 13 Oct 2025 12:51:37 +0000 (14:51 +0200)]
stricter year parsing in Date

8 months agofixed argument evaluation order in Date constructor and Date.UTC()
Fabrice Bellard [Mon, 13 Oct 2025 12:11:47 +0000 (14:11 +0200)]
fixed argument evaluation order in Date constructor and Date.UTC()

8 months agofaster and safer dbuf functions (#443)
Fabrice Bellard [Mon, 13 Oct 2025 11:51:25 +0000 (13:51 +0200)]
faster and safer dbuf functions (#443)

8 months agotest262 update
Fabrice Bellard [Sun, 12 Oct 2025 11:28:37 +0000 (13:28 +0200)]
test262 update

8 months agofixed regression in error message display introduced in commit 42eb279
Fabrice Bellard [Sun, 12 Oct 2025 11:23:50 +0000 (13:23 +0200)]
fixed regression in error message display introduced in commit 42eb279

8 months agocompilation fix for clang
Fabrice Bellard [Sat, 11 Oct 2025 09:13:13 +0000 (11:13 +0200)]
compilation fix for clang

8 months agoFaster context creation and exception checks in JS_NewContext (#404)
Fabrice Bellard [Sat, 11 Oct 2025 08:59:21 +0000 (10:59 +0200)]
Faster context creation and exception checks in JS_NewContext (#404)

- simplified internal object init
- check exceptions in JS_NewContext()
- preallocated std object properties
- preallocated more atoms

8 months agoupdate
Fabrice Bellard [Wed, 8 Oct 2025 12:16:51 +0000 (14:16 +0200)]
update

8 months agofaster appending of elements in arrays
Fabrice Bellard [Wed, 8 Oct 2025 12:11:27 +0000 (14:11 +0200)]
faster appending of elements in arrays

8 months agooptimized string_buffer_putc()
Fabrice Bellard [Wed, 8 Oct 2025 09:32:17 +0000 (11:32 +0200)]
optimized string_buffer_putc()

8 months agooptimized post_inc and post_dec
Fabrice Bellard [Tue, 7 Oct 2025 17:10:27 +0000 (19:10 +0200)]
optimized post_inc and post_dec

8 months agooptimized array access by inlining get_array_el, get_array_el2, get_array_el3 and...
Fabrice Bellard [Sat, 4 Oct 2025 08:46:29 +0000 (10:46 +0200)]
optimized array access by inlining get_array_el, get_array_el2, get_array_el3 and put_array_el

8 months agoremoved JS_PROP_NO_ADD
Fabrice Bellard [Fri, 3 Oct 2025 14:52:17 +0000 (16:52 +0200)]
removed JS_PROP_NO_ADD

8 months agoinlined fast path for get_field, get_field2 and put_field
Fabrice Bellard [Fri, 3 Oct 2025 13:41:21 +0000 (15:41 +0200)]
inlined fast path for get_field, get_field2 and put_field

8 months ago- optimized global variable access
Fabrice Bellard [Fri, 3 Oct 2025 12:26:13 +0000 (14:26 +0200)]
- optimized global variable access

- removed full compliance with the spec for strict mode variable
  assignment so that they are as fast as in non strict mode (V8,
  SpiderMonkey and JavascriptCore do the same, so IMHO the spec should
  be updated).

8 months agooptimize the create of arrays - optimized the rest and array_from opcodes
Fabrice Bellard [Fri, 3 Oct 2025 10:25:05 +0000 (12:25 +0200)]
optimize the create of arrays - optimized the rest and array_from opcodes

8 months agoImprove error handling in Promise.withResolvers (bnoordhuis)
Fabrice Bellard [Fri, 3 Oct 2025 10:00:26 +0000 (12:00 +0200)]
Improve error handling in Promise.withResolvers (bnoordhuis)