aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2014-11-03 18:07:02 +0100
committerSverker Eriksson <[email protected]>2014-11-03 18:07:02 +0100
commitc84fdab1ad76931b98cd298c3421d3202eb7b52a (patch)
treec8e954a4093f42942a3beec1eb91680b3759b7f3 /erts/emulator/beam/global.h
parentc3d006f6542e924c73dbfc76da64dacbeeeadfd0 (diff)
parentd3f0abb4daf5c823f05c3908fdc4f6ee01035937 (diff)
downloadotp-c84fdab1ad76931b98cd298c3421d3202eb7b52a.tar.gz
otp-c84fdab1ad76931b98cd298c3421d3202eb7b52a.tar.bz2
otp-c84fdab1ad76931b98cd298c3421d3202eb7b52a.zip
Merge branch 'sverk/yielding-distr-send/OTP-12232'
* sverk/yielding-distr-send/OTP-12232: erts: Add constant TERM_TO_BINARY_MEMCPY_FACTOR erts: Optimize some repeated calls to {E,W}STACK_PUSH erts: Yield in term_to_binary when encoding big maps erts: Remove unnecessary goto for fun encoding erts: Yield in term_to_binary while copying large binaries erts: Implement yielding for distributed send of large messages
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index da9f029a9f..ec8c1e3ccb 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -480,6 +480,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))
@@ -598,6 +609,42 @@ do { \
*s.wsp++ = (z); \
} while(0)
+#define WSTACK_PUSH4(s, A1, A2, A3, A4) \
+do { \
+ if (s.wsp > s.wend - 4) { \
+ erl_grow_wstack(&s, WSTK_DEF_STACK(s)); \
+ } \
+ *s.wsp++ = (A1); \
+ *s.wsp++ = (A2); \
+ *s.wsp++ = (A3); \
+ *s.wsp++ = (A4); \
+} while(0)
+
+#define WSTACK_PUSH5(s, A1, A2, A3, A4, A5) \
+do { \
+ if (s.wsp > s.wend - 5) { \
+ erl_grow_wstack(&s, WSTK_DEF_STACK(s)); \
+ } \
+ *s.wsp++ = (A1); \
+ *s.wsp++ = (A2); \
+ *s.wsp++ = (A3); \
+ *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))