- use $(shell) make command to test if closefrom() is available
- use closefrom() if available in js_os_exec()
- limit the fallback loop to 1024 handles to avoid costly loop on linux alpine.
PR inspired by @nicolas-duteil-nova
* Move fuzz target sources from the oss-fuzz repository here
* Add support to build libFuzzer targets
* Simplify the fuzz_eval and fuzz_compile targets
The use of JS_NewContext instead of JS_NewContextRaw spares to call
JS_AddIntrinsic<XYZ> functions from the fuzz target, since the public
JS_NewContext API does exactly the same.
* Simplify the fuzz_regexp target
fuzz_regexp doesn't need to be dependant on libquickjs since the
runtime and the context - that were provided by libquickjs - were
only created to call two simple functions implemented in libquickjs
which could be mimicked by the fuzzer.
The removal of runtime and context objects implicated further
simplifications, like the omission of their one-time creation.
Finally, writing the result of the regexp operations into a file
is also superfluous, since it's not used by anybody.
* Recreate and destroy JS runtime and context in fuzz_eval and fuzz_compile targets
Before this patch, the test executions were not independent,
since all the executed tests used the same JavaScript runtime and
context, causing irreproducible failure reports.
* Enable bignumber support in eval and compile targets
Big numbers are used by the input corpus, but the targets were not
able to interpret them since they were not compiled into them.
This change improved the inital coverage of the fuzz_eval target with
21% and the coverage of the fuzz_compile target with 25% when using
the official corpus.
* Ensure std and os modules are available in the fuzz_eval and fuzz_compile targets
* Add fuzzer dictionary with builtin and variable names. Furthermore, added a JS script that collects all the builtin
names from the executing engine.
* Move common fuzzer code into one place
* Enable to define the LIB_FUZZING_ENGINE variable to ease the oss-fuzz integration
* Add README to fuzzers
- ensure handler behavior does not depend on n argument
- load and save reference file in node.js
- add -s filename option to name the output reference file
- add targets in Makefile for tests and bencharks using node.js
- fix incorrect timings when not using high resolution timer
- use performance timer in node.js
- output performance factor instead of percentage
- use smaller threshold by default
- add benchmarks for:
date_parse(), prop_update(), prop_clone(), array_slice()
global_func_call(),
- use `double` arithmetic where necessary to match the spec
- use `volatile` to ensure correct order of evaluation
and prevent FMA code generation
- reject some border cases.
- avoid undefined behavior in `double` -> `int64_t` conversions
- improved tests/test_builtin.js `assert` function to compare
values more reliably.
- added some tests in `test_date()`
- disable some of these tests on win32 and cygwin targets
- add -t to show timings
- add -C to select compact progress meter
- default to compact progress meter if not attached to console
- set agent stack size to 2MB
- compute module filename relative to current path
- ignore `testdir` for -d and -f options
- return non zero status on errors changes
- split test_bigfloat.js from test_bignum.js
- make test_date() compatible with node
- document Date constructor string argument format:
should add test cases for invalid strings
- test_argument_scope(): only test this syntax error in strict mode:
`var f = function(a = eval("var arguments")) {};`
- Use uint32_t arithmetics and Standard conformant conversion to
avoid UB in js_math_imul.
- add builtin tests
- use specific object directories for SAN targets
- add more cases of in place string concatenation
this temporary hack improves the microbench timing by 30% but
has little impact on the test262 timings.