diff options
author | John Högberg <[email protected]> | 2019-03-28 14:37:18 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-03-28 14:37:18 +0100 |
commit | 2367dc1397063f78cc49eafa8e95e7e3493979d1 (patch) | |
tree | d9ff148dde49c5192d85818c853bbede45e671ce /erts/emulator/beam | |
parent | 2f879097241d289e0100c7d1725485e2276a7f70 (diff) | |
parent | 0398c6868940af8561d3401c00441071c57d7ac5 (diff) | |
download | otp-2367dc1397063f78cc49eafa8e95e7e3493979d1.tar.gz otp-2367dc1397063f78cc49eafa8e95e7e3493979d1.tar.bz2 otp-2367dc1397063f78cc49eafa8e95e7e3493979d1.zip |
Merge branch 'john/erts/remove-destructive-bs_get_binary2/ERL-901'
* john/erts/remove-destructive-bs_get_binary2/ERL-901:
erts: Remove unsafe bs_get_binary2 optimization from loader
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 19 | ||||
-rw-r--r-- | erts/emulator/beam/bs_instrs.tab | 11 | ||||
-rw-r--r-- | erts/emulator/beam/ops.tab | 1 |
3 files changed, 6 insertions, 25 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 69e49e97f3..941c3ebbbe 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -3354,19 +3354,12 @@ gen_get_binary2(LoaderState* stp, GenOpArg Fail, GenOpArg Ms, GenOpArg Live, NATIVE_ENDIAN(Flags); if (Size.type == TAG_a && Size.val == am_all) { - if (Ms.type == Dst.type && Ms.val == Dst.val) { - GENOP_NAME_ARITY(op, i_bs_get_binary_all_reuse, 3); - op->a[0] = Ms; - op->a[1] = Fail; - op->a[2] = Unit; - } else { - GENOP_NAME_ARITY(op, i_bs_get_binary_all2, 5); - op->a[0] = Ms; - op->a[1] = Fail; - op->a[2] = Live; - op->a[3] = Unit; - op->a[4] = Dst; - } + GENOP_NAME_ARITY(op, i_bs_get_binary_all2, 5); + op->a[0] = Ms; + op->a[1] = Fail; + op->a[2] = Live; + op->a[3] = Unit; + op->a[4] = Dst; } else if (Size.type == TAG_i) { GENOP_NAME_ARITY(op, i_bs_get_binary_imm2, 6); op->a[0] = Ms; diff --git a/erts/emulator/beam/bs_instrs.tab b/erts/emulator/beam/bs_instrs.tab index 652460a66d..9cad2b03c5 100644 --- a/erts/emulator/beam/bs_instrs.tab +++ b/erts/emulator/beam/bs_instrs.tab @@ -1136,7 +1136,6 @@ i_bs_get_utf16.execute(Fail, Flags, Dst) { } bs_context_to_binary := ctx_to_bin.fetch.execute; -i_bs_get_binary_all_reuse := ctx_to_bin.fetch_bin.execute; ctx_to_bin.head() { Eterm context; @@ -1159,16 +1158,6 @@ ctx_to_bin.fetch(Src) { } } -ctx_to_bin.fetch_bin(Src, Fail, Unit) { - context = $Src; - mb = ms_matchbuffer(context); - size = mb->size - mb->offset; - if (size % $Unit != 0) { - $FAIL($Fail); - } - offs = mb->offset; -} - ctx_to_bin.execute() { Uint hole_size; Uint orig = mb->orig; diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab index 3a95b1a37e..7a125b0f67 100644 --- a/erts/emulator/beam/ops.tab +++ b/erts/emulator/beam/ops.tab @@ -1262,7 +1262,6 @@ bs_get_binary2 Fail=f Ms=xy Live=u Sz=sq Unit=u Flags=u Dst=d => \ i_bs_get_binary_imm2 xy f? t W t d i_bs_get_binary2 xy f t? s t d i_bs_get_binary_all2 xy f? t t d -i_bs_get_binary_all_reuse xy f? t # Fetching float from binaries. bs_get_float2 Fail=f Ms=xy Live=u Sz=s Unit=u Flags=u Dst=d => \ |