]> git.kaiwu.me - njs.git/commit
Moving child function declaration instantiation to bytecode.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 10 Jun 2025 01:38:15 +0000 (18:38 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 17 Jun 2025 00:36:31 +0000 (17:36 -0700)
commit60e28d7bde0f83adf825976fbabf9f73ccae698c
tree78d16eae6e61cbcd119e4b3f0dbc5eff06a5d5ec
parent3a22f42628e57f711bfc328e10388b2345f58647
Moving child function declaration instantiation to bytecode.

Children functions need to be hoisted and instantiated at the beginning
of a function call. Previously, it was done as a part of C code
that implements JS function call.

Now, each child function is instantiated by FUNCTION instruction at a
function prelude. This makes global and function code similar, which in
turn allows to get rid of FUNCTION COPY instruction which was only
needed for global code.
src/njs_disassembler.c
src/njs_function.c
src/njs_function.h
src/njs_generator.c
src/njs_parser.h
src/njs_variable.c
src/njs_vm.c
src/njs_vmcode.c
src/njs_vmcode.h