py/nlr: Factor out common NLR code to macro and generic funcs in nlr.c.

Each NLR implementation (Thumb, x86, x64, xtensa, setjmp) duplicates a lot
of the NLR code, specifically that dealing with pushing and popping the NLR
pointer to maintain the linked-list of NLR buffers.  This patch factors all
of that code out of the specific implementations into generic functions in
nlr.c, along with a helper macro in nlr.h.  This eliminates duplicated
code.
This commit is contained in:
Damien George
2017-12-28 16:46:30 +11:00
parent 5bf8e85fc8
commit b25f92160b
8 changed files with 76 additions and 103 deletions

View File

@@ -103,6 +103,7 @@ endif
# py object files
PY_O_BASENAME = \
mpstate.o \
nlr.o \
nlrx86.o \
nlrx64.o \
nlrthumb.o \