aboutsummaryrefslogtreecommitdiff
path: root/py/py.mk
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-12-18 18:57:15 +1100
committerDamien George <damien.p.george@gmail.com>2017-12-20 15:42:06 +1100
commit6a3a742a6c9caaa2be0fd0aac7a5df4ac816081c (patch)
treecb91633e1592d474a5bc51db97f6442616d1cf63 /py/py.mk
parentd8d633f15658911369d7b1b912777fa74efd3ea6 (diff)
py/nlr: Factor out common NLR code to generic functions.
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. This eliminates duplicated code. The factoring also allows to make the machine-specific NLR code pure assembler code, thus allowing nlrthumb.c to use naked function attributes in the correct way (naked functions can only have basic inline assembler code in them). There is a small overhead introduced (typically 1 machine instruction) because now the generic nlr_jump() must call nlr_jump_tail() rather than them being one combined function.
Diffstat (limited to 'py/py.mk')
-rw-r--r--py/py.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/py/py.mk b/py/py.mk
index 0b5d5f8c4..de82a971b 100644
--- a/py/py.mk
+++ b/py/py.mk
@@ -103,6 +103,7 @@ endif
# py object files
PY_O_BASENAME = \
mpstate.o \
+ nlr.o \
nlrx86.o \
nlrx64.o \
nlrthumb.o \