From 4caf17efa6065765c91f42f95d978e4fa8703572 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 4 Apr 2012 17:34:22 +0200 Subject: [PATCH] Reduce size of generated bytecode, part 7. Replace `NPUSHB' with less than nine arguments with `PUSHB_X'. --- lib/tabytecode.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/tabytecode.c b/lib/tabytecode.c index 4ba241a..94f10ca 100644 --- a/lib/tabytecode.c +++ b/lib/tabytecode.c @@ -430,8 +430,13 @@ TA_sfnt_build_glyph_scaler(SFNT* sfnt, { nargs = (num_args - i > 255) ? 255 : num_args - i; - BCI(NPUSHW); - BCI(nargs); + if (nargs <= 8) + BCI(PUSHW_1 - 1 + nargs); + else + { + BCI(NPUSHW); + BCI(nargs); + } for (j = 0; j < nargs; j++) { BCI(HIGH(*arg)); @@ -446,8 +451,13 @@ TA_sfnt_build_glyph_scaler(SFNT* sfnt, { nargs = (num_args - i > 255) ? 255 : num_args - i; - BCI(NPUSHB); - BCI(nargs); + if (nargs <= 8) + BCI(PUSHB_1 - 1 + nargs); + else + { + BCI(NPUSHB); + BCI(nargs); + } for (j = 0; j < nargs; j++) { BCI(*arg); -- 2.11.4.GIT