aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-08-19 16:45:45 +0200
committerSverker Eriksson <[email protected]>2014-08-29 16:20:30 +0200
commit5d66bc37e4583074abd00cb05f9a377f39e2081f (patch)
tree8e9c8be8a014a7caea730dab383b62eb6e488dbf /erts/emulator/beam/global.h
parentc1676f09ea1176116b503de88604816a2da36ac5 (diff)
downloadotp-5d66bc37e4583074abd00cb05f9a377f39e2081f.tar.gz
otp-5d66bc37e4583074abd00cb05f9a377f39e2081f.tar.bz2
otp-5d66bc37e4583074abd00cb05f9a377f39e2081f.zip
erts: Optimize some repeated calls to {E,W}STACK_PUSH
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index 02b8f399b5..7f1bd36b28 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -479,6 +479,17 @@ do { \
*s.sp++ = (z); \
} while(0)
+#define ESTACK_PUSH4(s, E1, E2, E3, E4) \
+do { \
+ if (s.sp > s.end - 4) { \
+ erl_grow_estack(&s, ESTK_DEF_STACK(s)); \
+ } \
+ *s.sp++ = (E1); \
+ *s.sp++ = (E2); \
+ *s.sp++ = (E3); \
+ *s.sp++ = (E4); \
+} while(0)
+
#define ESTACK_COUNT(s) (s.sp - s.start)
#define ESTACK_ISEMPTY(s) (s.sp == s.start)
#define ESTACK_POP(s) (*(--s.sp))
@@ -619,6 +630,20 @@ do { \
*s.wsp++ = (A4); \
*s.wsp++ = (A5); \
} while(0)
+
+#define WSTACK_PUSH6(s, A1, A2, A3, A4, A5, A6) \
+do { \
+ if (s.wsp > s.wend - 6) { \
+ erl_grow_wstack(&s, WSTK_DEF_STACK(s)); \
+ } \
+ *s.wsp++ = (A1); \
+ *s.wsp++ = (A2); \
+ *s.wsp++ = (A3); \
+ *s.wsp++ = (A4); \
+ *s.wsp++ = (A5); \
+ *s.wsp++ = (A6); \
+} while(0)
+
#define WSTACK_COUNT(s) (s.wsp - s.wstart)
#define WSTACK_ISEMPTY(s) (s.wsp == s.wstart)
#define WSTACK_POP(s) (*(--s.wsp))