summaryrefslogtreecommitdiffstats
path: root/src/linker.c
diff options
context:
space:
mode:
authorMuh Muhten <muh.muhten@gmail.com>2019-02-20 01:48:56 -0500
committerNico Williams <nico@cryptonector.com>2019-02-20 19:43:13 -0600
commite843a4fdf9f6f446f5ddebf2c108cb7d4dda867b (patch)
tree55ad29089dbf9146706690eda70ee0753c925a1d /src/linker.c
parentb2b0bd37a13c449806acae3312169edc297ab1d9 (diff)
Make builtin binding fast again by binding only referenced symbols
Avoid doing the internal binding of top-level symbols in the parser, leaving that work to be done in a post-processing step. For builtins, this lets us do a reference-aware bind step (block_bind_incremental) *after* generating builtins/0. Libraries are a bit trickier since they may be bound multiple times, so instead of thinking through the implications I added (block_bind_self) to resolve all internal symbols immediately.
Diffstat (limited to 'src/linker.c')
-rw-r--r--src/linker.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/linker.c b/src/linker.c
index 5c3845f4..aa1ff137 100644
--- a/src/linker.c
+++ b/src/linker.c
@@ -336,6 +336,7 @@ static int load_library(jq_state *jq, jv lib_path, int is_data, int raw, const c
jv_string(dirname(lib_origin)),
&program, lib_state);
free(lib_origin);
+ program = block_bind_self(program, OP_IS_CALL_PSEUDO);
}
}
state_idx = lib_state->ct++;