aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_native_bif.c
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2017-04-09 13:27:51 +0200
committerMagnus Lång <[email protected]>2017-11-05 19:07:07 +0100
commit354f6d1c29ecaabab8a5aa3f1c95a4188a0aa542 (patch)
tree6e193c79976cb6e2c4e7121e39f790a0e234b7b1 /erts/emulator/hipe/hipe_native_bif.c
parentd71a2715c181f4659251723575eea79ee531729a (diff)
downloadotp-354f6d1c29ecaabab8a5aa3f1c95a4188a0aa542.tar.gz
otp-354f6d1c29ecaabab8a5aa3f1c95a4188a0aa542.tar.bz2
otp-354f6d1c29ecaabab8a5aa3f1c95a4188a0aa542.zip
HiPE: Make is_divisible a primop
Since gcunsafe values are live over is_divisible calls (although only the happy path, which never GCd), it should be a primop so there cannot be any GCs.
Diffstat (limited to 'erts/emulator/hipe/hipe_native_bif.c')
-rw-r--r--erts/emulator/hipe/hipe_native_bif.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/erts/emulator/hipe/hipe_native_bif.c b/erts/emulator/hipe/hipe_native_bif.c
index 4d20fbdb90..e444e3dc5d 100644
--- a/erts/emulator/hipe/hipe_native_bif.c
+++ b/erts/emulator/hipe/hipe_native_bif.c
@@ -506,16 +506,12 @@ int hipe_bs_validate_unicode_retract(ErlBinMatchBuffer* mb, Eterm arg)
return 1;
}
-/* Called via standard_bif_interface_2 */
-BIF_RETTYPE nbif_impl_hipe_is_divisible(NBIF_ALIST_2)
+Uint hipe_is_divisible(Uint dividend, Uint divisor)
{
- /* Arguments are Eterm-sized unsigned integers */
- Uint dividend = BIF_ARG_1;
- Uint divisor = BIF_ARG_2;
if (dividend % divisor) {
- BIF_ERROR(BIF_P, BADARG);
+ return 0;
} else {
- return NIL;
+ return 1;
}
}