[truetype] Remove code for static TrueType interpreter. This is a follow-up patch. * src/truetype/ttinterp.c, src/truetype/ttinterp.h [TT_CONFIG_OPTION_STATIC_INTERPRETER, TT_CONFIG_OPTION_STATIC_RASTER]: Remove macros and related code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
diff --git a/ChangeLog b/ChangeLog
index 12fe053..ca832a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2015-01-10 Werner Lemberg <wl@gnu.org>
+ [truetype] Remove code for static TrueType interpreter.
+
+ This is a follow-up patch.
+
+ * src/truetype/ttinterp.c, src/truetype/ttinterp.h
+ [TT_CONFIG_OPTION_STATIC_INTERPRETER,
+ TT_CONFIG_OPTION_STATIC_RASTER]: Remove macros and related code.
+
+2015-01-10 Werner Lemberg <wl@gnu.org>
+
* src/truetype/ttinterp.c (CUR): Remove by replacing with expansion.
This starts a series of patches that simplifies the code of the
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
index ffef8c0..d9bda32 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -55,63 +55,11 @@
/*************************************************************************/
/* */
- /* There are two kinds of implementations: */
- /* */
- /* a. static implementation */
- /* */
- /* The current execution context is a static variable, which fields */
- /* are accessed directly by the interpreter during execution. The */
- /* context is named `cur'. */
- /* */
- /* This version is non-reentrant, of course. */
- /* */
- /* b. indirect implementation */
- /* */
- /* The current execution context is passed to _each_ function as its */
- /* first argument, and each field is thus accessed indirectly. */
- /* */
- /* This version is fully re-entrant. */
- /* */
- /* The idea is that an indirect implementation may be slower to execute */
- /* on low-end processors that are used in some systems (like 386s or */
- /* even 486s). */
- /* */
- /* As a consequence, the indirect implementation is now the default, as */
- /* its performance costs can be considered negligible in our context. */
- /* Note, however, that we kept the same source with macros because: */
- /* */
- /* - The code is kept very close in design to the Pascal code used for */
- /* development. */
- /* */
- /* - It's much more readable that way! */
- /* */
- /* - It's still open to experimentation and tuning. */
- /* */
- /*************************************************************************/
-
-
-#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
-
- /*************************************************************************/
- /* */
/* This macro is used whenever `exec' is unused in a function, to avoid */
/* stupid warnings from pedantic compilers. */
/* */
#define FT_UNUSED_EXEC FT_UNUSED( exc )
-#else /* static implementation */
-
-#define FT_UNUSED_EXEC int __dummy = __dummy
-
- static
- TT_ExecContextRec cur; /* static exec. context variable */
-
- /* apparently, we have a _lot_ of direct indexing when accessing */
- /* the static `cur', which makes the code bigger (due to all the */
- /* four bytes addresses). */
-
-#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
-
/*************************************************************************/
/* */
@@ -8221,13 +8169,6 @@
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- if ( !exc )
- return FT_THROW( Invalid_Argument );
-
- cur = *exc;
-#endif
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
exc->iup_called = FALSE;
#endif /* TT_CONFIG_OPTION_SUBPIXEL_HINTING */
@@ -8981,22 +8922,12 @@
} while ( !exc->instruction_trap );
LNo_Error_:
-
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- *exc = cur;
-#endif
-
return FT_Err_Ok;
LErrorCodeOverflow_:
exc->error = FT_THROW( Code_Overflow );
LErrorLabel_:
-
-#ifdef TT_CONFIG_OPTION_STATIC_RASTER
- *exc = cur;
-#endif
-
/* If any errors have occurred, function tables may be broken. */
/* Force a re-execution of `prep' and `fpgm' tables if no */
/* bytecode debugger is run. */
diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h
index 333decc..c282471 100644
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -26,22 +26,11 @@
FT_BEGIN_HEADER
-#ifndef TT_CONFIG_OPTION_STATIC_INTERPRETER /* indirect implementation */
-
#define EXEC_OP_ TT_ExecContext exc,
#define EXEC_OP TT_ExecContext exc
#define EXEC_ARG_ exc,
#define EXEC_ARG exc
-#else /* static implementation */
-
-#define EXEC_OP_ /* void */
-#define EXEC_OP /* void */
-#define EXEC_ARG_ /* void */
-#define EXEC_ARG /* void */
-
-#endif /* TT_CONFIG_OPTION_STATIC_INTERPRETER */
-
/*************************************************************************/
/* */