diff options
author | Sverker Eriksson <[email protected]> | 2015-05-06 14:59:13 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-05-06 14:59:13 +0200 |
commit | d4ad455c16a85ee6103d5916ff91cdda31247ca9 (patch) | |
tree | 9672b84e0654b5d73f2eb573f7a8fd352a643664 /erts/emulator/hipe | |
parent | 0440e0e45835de5adbe790f9437492d734c6c4e1 (diff) | |
parent | 2a3349420d33a298aa02b176100f385c0ab31c99 (diff) | |
download | otp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.tar.gz otp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.tar.bz2 otp-d4ad455c16a85ee6103d5916ff91cdda31247ca9.zip |
Merge branch 'sverk/hipe_match_wbin/OTP-12667'
* sverk/hipe_match_wbin/OTP-12667:
erts: Add debug assertions for match state sanity
hipe: Add test for matching of writable binary
erts,hipe: Optimize away calls to emasculate_binary
erts,hipe: Fix bug in binary matching of writable binary
Conflicts:
erts/emulator/hipe/hipe_bif0.c
Diffstat (limited to 'erts/emulator/hipe')
-rw-r--r-- | erts/emulator/hipe/hipe_bif0.c | 7 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_bif0.tab | 1 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_bif_list.m4 | 2 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_native_bif.h | 3 | ||||
-rw-r--r-- | erts/emulator/hipe/hipe_primops.h | 1 |
5 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c index 6c1de05a4c..099f4f90de 100644 --- a/erts/emulator/hipe/hipe_bif0.c +++ b/erts/emulator/hipe/hipe_bif0.c @@ -910,6 +910,13 @@ void hipe_emulate_fpe(Process* p) } #endif +void hipe_emasculate_binary(Eterm bin) +{ + ProcBin* pb = (ProcBin *) boxed_val(bin); + ASSERT(pb->thing_word == HEADER_PROC_BIN); + ASSERT(pb->flags != 0); + erts_emasculate_writable_binary(pb); +} /* * args: Module, {Uniq, Index, BeamAddress} diff --git a/erts/emulator/hipe/hipe_bif0.tab b/erts/emulator/hipe/hipe_bif0.tab index d715a0914b..a3e04802df 100644 --- a/erts/emulator/hipe/hipe_bif0.tab +++ b/erts/emulator/hipe/hipe_bif0.tab @@ -140,4 +140,5 @@ atom bs_get_utf16 atom bs_validate_unicode atom bs_validate_unicode_retract atom emulate_fpe +atom emasculate_binary diff --git a/erts/emulator/hipe/hipe_bif_list.m4 b/erts/emulator/hipe/hipe_bif_list.m4 index 96a849621f..370061bca1 100644 --- a/erts/emulator/hipe/hipe_bif_list.m4 +++ b/erts/emulator/hipe/hipe_bif_list.m4 @@ -250,6 +250,8 @@ gc_bif_interface_0(nbif_check_get_msg, hipe_check_get_msg) nocons_nofail_primop_interface_0(nbif_emulate_fpe, hipe_emulate_fpe) #endif +noproc_primop_interface_1(nbif_emasculate_binary, hipe_emasculate_binary) + /* * SMP-specific stuff */ diff --git a/erts/emulator/hipe/hipe_native_bif.h b/erts/emulator/hipe/hipe_native_bif.h index 3f460a5a5c..574e20e2e4 100644 --- a/erts/emulator/hipe/hipe_native_bif.h +++ b/erts/emulator/hipe/hipe_native_bif.h @@ -98,6 +98,9 @@ AEXTERN(void,nbif_emulate_fpe,(Process*)); void hipe_emulate_fpe(Process*); #endif +AEXTERN(void,nbif_emasculate_binary,(Eterm)); +void hipe_emasculate_binary(Eterm); + /* * Stuff that is different in SMP and non-SMP. */ diff --git a/erts/emulator/hipe/hipe_primops.h b/erts/emulator/hipe/hipe_primops.h index 52b4681cfe..236f6d0a29 100644 --- a/erts/emulator/hipe/hipe_primops.h +++ b/erts/emulator/hipe/hipe_primops.h @@ -80,6 +80,7 @@ PRIMOP_LIST(am_fclearerror_error, &nbif_fclearerror_error) #ifdef NO_FPE_SIGNALS PRIMOP_LIST(am_emulate_fpe, &nbif_emulate_fpe) #endif +PRIMOP_LIST(am_emasculate_binary, &nbif_emasculate_binary) PRIMOP_LIST(am_debug_native_called, &nbif_hipe_bifs_debug_native_called) #if defined(__sparc__) |