diff options
author | Sverker Eriksson <[email protected]> | 2017-11-15 14:42:06 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-15 14:42:06 +0100 |
commit | 0d9d1f1915ac70ba00418fd24a4293bb22c4fade (patch) | |
tree | 49df7cdfbd1e211dc7aace5db5ce7e3af6e40909 /erts | |
parent | 1836281f02004db2cc0185b877552377cd436d9a (diff) | |
parent | 7503303b0cba1e02320bdf604e0d0997b7c2ff59 (diff) | |
download | otp-0d9d1f1915ac70ba00418fd24a4293bb22c4fade.tar.gz otp-0d9d1f1915ac70ba00418fd24a4293bb22c4fade.tar.bz2 otp-0d9d1f1915ac70ba00418fd24a4293bb22c4fade.zip |
Merge PR-1621 from margnus1/hipe-literal-tag
HiPE: Support for literal tag, tests and bugfixes
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/erl_term.h | 3 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_bif_list.m4 | 2 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_mkliterals.c | 9 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_native_bif.c | 10 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_native_bif.h | 4 |
5 files changed, 15 insertions, 13 deletions
diff --git a/erts/emulator/beam/erl_term.h b/erts/emulator/beam/erl_term.h index 5ec6b6b44b..7d42d1b396 100644 --- a/erts/emulator/beam/erl_term.h +++ b/erts/emulator/beam/erl_term.h @@ -55,9 +55,6 @@ struct erl_node_; /* Declared in erl_node_tables.h */ #if defined(ARCH_64) # define TAG_PTR_MASK__ 0x7 # if !defined(ERTS_HAVE_OS_PHYSICAL_MEMORY_RESERVATION) -# ifdef HIPE -# error Hipe on 64-bit needs a real mmap as it does not support the literal tag -# endif # define TAG_LITERAL_PTR 0x4 # else # undef TAG_LITERAL_PTR diff --git a/erts/emulator/hipe/hipe_bif_list.m4 b/erts/emulator/hipe/hipe_bif_list.m4 index 7e3851f20e..625d8486fd 100644 --- a/erts/emulator/hipe/hipe_bif_list.m4 +++ b/erts/emulator/hipe/hipe_bif_list.m4 @@ -222,7 +222,7 @@ standard_bif_interface_2(nbif_rethrow, hipe_rethrow) standard_bif_interface_3(nbif_find_na_or_make_stub, hipe_find_na_or_make_stub) standard_bif_interface_2(nbif_nonclosure_address, hipe_nonclosure_address) nocons_nofail_primop_interface_0(nbif_fclearerror_error, hipe_fclearerror_error) -standard_bif_interface_2(nbif_is_divisible, hipe_is_divisible) +noproc_primop_interface_2(nbif_is_divisible, hipe_is_divisible) noproc_primop_interface_1(nbif_is_unicode, hipe_is_unicode) /* diff --git a/erts/emulator/hipe/hipe_mkliterals.c b/erts/emulator/hipe/hipe_mkliterals.c index 6ea120c65c..de00994d64 100644 --- a/erts/emulator/hipe/hipe_mkliterals.c +++ b/erts/emulator/hipe/hipe_mkliterals.c @@ -462,6 +462,15 @@ static const struct rts_param rts_params[] = { 0 #endif }, + /* This flag is always defined, but its value is configuration-dependent. */ + { 17, "ERTS_USE_LITERAL_TAG", + 1, +#if defined(TAG_LITERAL_PTR) + 1 +#else + 0 +#endif + }, /* This parameter is always defined, but its value depends on ERTS_SMP. */ { 19, "MSG_MESSAGE", 1, offsetof(struct erl_mesg, m[0]) diff --git a/erts/emulator/hipe/hipe_native_bif.c b/erts/emulator/hipe/hipe_native_bif.c index f5471285c2..99c34532b9 100644 --- a/erts/emulator/hipe/hipe_native_bif.c +++ b/erts/emulator/hipe/hipe_native_bif.c @@ -497,16 +497,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; } } diff --git a/erts/emulator/hipe/hipe_native_bif.h b/erts/emulator/hipe/hipe_native_bif.h index a4919f4886..d5081b8438 100644 --- a/erts/emulator/hipe/hipe_native_bif.h +++ b/erts/emulator/hipe/hipe_native_bif.h @@ -68,7 +68,7 @@ AEXTERN(Eterm,nbif_bs_put_utf16le,(Process*,Eterm,byte*,unsigned int)); AEXTERN(Eterm,nbif_bs_get_utf16,(void)); AEXTERN(Uint,nbif_is_unicode,(Eterm)); AEXTERN(Eterm,nbif_bs_validate_unicode_retract,(void)); -AEXTERN(void,nbif_is_divisible,(Process*,Uint,Uint)); +AEXTERN(Uint,nbif_is_divisible,(Uint,Uint)); AEXTERN(void,nbif_select_msg,(Process*)); AEXTERN(Eterm,nbif_cmp_2,(void)); @@ -94,7 +94,7 @@ BIF_RETTYPE nbif_impl_hipe_bs_put_utf16le(NBIF_ALIST_3); Uint hipe_is_unicode(Eterm); struct erl_bin_match_buffer; int hipe_bs_validate_unicode_retract(struct erl_bin_match_buffer*, Eterm); -BIF_RETTYPE nbif_impl_hipe_is_divisible(NBIF_ALIST_2); +Uint hipe_is_divisible(Uint, Uint); #ifdef NO_FPE_SIGNALS AEXTERN(void,nbif_emulate_fpe,(Process*)); |