Maria Matejka
2e5bfeb73a
Merge remote-tracking branch 'origin/master' into backport
2022-07-11 11:08:10 +02:00
Ondrej Zajicek (work)
a2527ee53d
Filter: Improve handling of stack frames in filter bytecode
...
When f_line is done, we have to pop the stack frame. The old code just
removed nominal number of args/vars. Change it to use stored ventry value
modified by number of returned values. This allows to allocate variables
on a stack frame during execution of f_lines instead of just at start.
But we need to know the number of returned values for a f_line. It is 1
for term, 0 for cmd. Store that to f_line during linearization.
2022-06-27 21:13:32 +02:00
Ondrej Zajicek (work)
26bc4f9904
Filter: Implement direct recursion
...
Direct recursion almost worked, just crashed on function signature check.
Split function parsing such that function signature is saved before
function body is processed. Recursive calls are marked so they can be
avoided during f_same() and similar code walking.
Also, include tower of hanoi solver as a test case.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
fb1d8f6513
Filter: Apply constant promotion for FI_EQ / FI_NEQ
...
Equality comparison is defined on all values, even of different
types, but we still want to do constant promotion if possible.
2022-06-27 21:13:31 +02:00
Alexander Zubkov
b2d6d2948a
Filter: Add literal for empty set
...
Add literal for empty set [], which works both for tree-based sets
and prefix sets by using existing constant promotion mechanism.
Minor changes by committer.
2022-06-27 21:13:31 +02:00
Ondrej Zajicek (work)
9b302c133f
Filter: Ensure that all expressions declared return type
...
All instructions with a return value (i.e. expressions, ones with
non-zero outval, third argument in INST()) should declare their return
type. Check that automatically by M4 macros.
Set outval of FI_RETURN to 0. The instruction adds one value to stack,
but syntactically it is a statement, not an expression.
Add fake return type declaration to FI_CALL, otherwise the automatic
check would fail builds.
2022-06-27 21:13:31 +02:00
Maria Matejka
2c13759136
Reducing filter stack size to allow for lesser thread stack size
2021-09-10 18:11:28 +02:00
Maria Matejka
eb20251655
Filter: Additional consistency checks
2021-09-10 17:37:46 +02:00
Ondrej Zajicek (work)
d06a875b04
Filter: Recursive filter iteration code
...
Add macros for recursive filter iteration that allows to examine
all instructions reachable from a filter.
2021-02-07 19:21:42 +01:00
Maria Matejka
d65a926a67
Filter: Don't alloc varargs array if its length would be zero
2020-05-01 15:19:12 +02:00
Ondrej Zajicek (work)
ef8c45749c
Filter: Fix typecheck for AND/OR.
...
Do not apply dynamic type check for second argument of AND/OR, as it is
not evaluated immediately like regular argument would be.
Thanks to Mikael for the bugreport.
2020-01-07 01:24:30 +01:00
Ondrej Zajicek (work)
87512e9751
Filter: Improve typecheck error messages
2019-11-05 15:30:16 +01:00
Ondrej Zajicek (work)
c00c20a799
Filter: Better constant promotion
...
We use constant promotion from IPv4 to Router-ID values, as they have
same literals. Instead of ad-hoc code in filter instructions, add
constant promotion code to parse-time typecheck code.
2019-11-05 15:28:47 +01:00
Ondrej Zajicek (work)
26194bd684
Filter: Improved parse-time typechecks
2019-11-05 15:28:47 +01:00
Ondrej Zajicek
6fbcd8914a
Filter: Parse-time typechecks
...
Most expressions can be type-validated in parse time. It is not
strong enough to eliminate runtime checks, but at least one gets
errors immediately during reconfigure.
2019-11-05 15:28:47 +01:00
Maria Matejka
f634adc7dc
Filter: FID_MEMBER debug string is a C constant string
2019-07-15 15:17:04 +02:00
Maria Matejka
c0999a149c
Filter: Converted FI_PRINT and FI_PATHMASK_CONSTRUCT to VARARG
2019-07-15 15:12:18 +02:00
Maria Matejka
547be53b8c
Filter: Don't fail badly when trying to access non-existent route in config time
2019-07-15 12:03:13 +02:00
Maria Matejka
8816b6cdd9
Merge branch 'mq-filter-stack' of gitlab.labs.nic.cz:labs/bird into mq-filter-stack
2019-07-03 08:44:42 +02:00
Maria Matejka
0206c070ac
Filter: Split printing and dying
2019-07-03 08:27:56 +02:00
Maria Matejka
263fa2c4a6
Filter: Dropped some more irrelevant whitespace from generated files
2019-07-02 22:57:00 +02:00
Maria Matejka
84c58aabd0
Filter: Nicer whitespaces in generated inst-gen.h
2019-07-02 17:59:21 +02:00
Maria Matejka
550a6488c9
Filter: documentation of the M4 preprocessor
2019-07-02 17:39:56 +02:00
Maria Matejka
c376555cec
Filter: GCC, don't complain about indentation in generated code.
2019-07-02 13:13:29 +02:00
Maria Matejka
b40c0f028f
Filter: Pre-evaluation of constant expressions
2019-07-02 10:45:53 +02:00
Maria Matejka
26bfe59f45
Filter: Moved singleton member definitions to f-inst.c
2019-07-01 13:13:06 +02:00
Maria Matejka
4212c0e7e5
Filter: Moved f_inst allocation to separate function
2019-07-01 12:49:02 +02:00
Maria Matejka
f74d19765e
Filter: Getting rid of RESULT_OK. Adding RESULT_VOID.
...
This is a preparation for filter pre-evaluation.
2019-07-01 12:07:06 +02:00
Maria Matejka
236828d06f
Filter: The interpreter code now shares its diversion with constructor
...
This is a preparation for filter pre-evaluation.
2019-07-01 11:57:35 +02:00
Maria Matejka
63f49457dc
Filter: renaming pointers for consistency
...
The struct f_inst * is now always "what"
and the union member pointer is always "whati".
2019-06-28 11:26:36 +02:00
Maria Matejka
64bb1346c7
Filter: A little cleanup of M4 interpreter generator
2019-06-27 23:57:59 +02:00
Maria Matejka
a84b8b6ebb
Revert "Filter: Dropped the setter instructions in favor of direct result storage."
...
This reverts commit bd91338246
.
2019-06-19 14:09:57 +02:00
Maria Matejka
bd91338246
Filter: Dropped the setter instructions in favor of direct result storage.
...
This should help filter performance a bit.
2019-06-03 10:41:35 +02:00
Maria Matejka
1757a6fce5
Filter: Stacks moved to thread-local storage if available.
2019-05-29 21:03:52 +02:00
Jan Maria Matejka
23e3b1e665
Filter: Some people can't pronounce "postfixify" correctly. Let's try "linearize" instead.
...
This is just a naming change.
2019-05-22 15:20:02 +00:00
Jan Maria Matejka
96d757c13f
Filter: Store variables and function arguments on stack
2019-05-21 16:33:37 +00:00
Maria Matejka
d1039926f5
Filter: Interpreter merged into the common m4 generator.
...
The config-time partial evaluation of constant expressions in filters is nearby.
2019-02-20 22:30:55 +01:00
Maria Matejka
ea4f55e3dc
Filter: More cleanup -- customized structures also in struct f_line_item
2019-02-20 22:30:55 +01:00
Maria Matejka
0b39b1cbb7
Conf: Symbol implementation converted from void pointers to union
...
... and consted some declarations.
2019-02-20 22:30:55 +01:00
Maria Matejka
132529ce89
Filter: merged filter compare functions into common M4 file
2019-02-20 22:30:55 +01:00
Maria Matejka
dd4d409551
Filter: Merged postfixify routine
2019-02-20 22:30:54 +01:00
Maria Matejka
de12cd18fb
Filter: Merged filter line item dumpers into common generated source
2019-02-20 22:30:54 +01:00
Maria Matejka
b256f24145
Filter: auto-generating enum-to-string
2019-02-20 22:30:54 +01:00
Maria Matejka
041608129a
Filter generator: workaround for M4 claiming all the put-around code be on one line
2019-02-20 22:30:54 +01:00
Maria Matejka
87bd7cd7b0
Filter: split the constructors to a separate file
2019-02-20 22:30:54 +01:00
Maria Matejka
4f082dfa89
Filter: merged filter instruction constructors, counting line size on instruction construct
2019-02-20 22:30:54 +01:00