diff options
author | Björn Gustavsson <[email protected]> | 2015-04-15 09:59:05 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-04-22 10:14:55 +0200 |
commit | 37225949b6cf177934848fff21a1a551b7f6faee (patch) | |
tree | 090c584959ca6736df3ccd79e5df6dbebf50be87 /lib/compiler/src/beam_utils.erl | |
parent | 2e2d583a49939026ec9b959f9b7941d3c2d084f2 (diff) | |
download | otp-37225949b6cf177934848fff21a1a551b7f6faee.tar.gz otp-37225949b6cf177934848fff21a1a551b7f6faee.tar.bz2 otp-37225949b6cf177934848fff21a1a551b7f6faee.zip |
beam_block: Optimize matching of binary literals
When matching a binary literal as in:
<<"abc">> = Bin
the compiler will produce a sequence of three instructions
(some details in the instructions removed for simplicity):
bs_start_match2 Fail BinReg CtxtReg
bs_match_string Fail CtxtReg "abc"
bs_test_tail2 Fail CtxtReg 0
The sequence can be replaced with:
is_eq_exact Fail BinReg "abc"
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
0 files changed, 0 insertions, 0 deletions