diff options
author | Björn Gustavsson <[email protected]> | 2010-09-29 10:24:29 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-01-17 15:23:38 +0100 |
commit | 7738e604909c52ebac606eed5f6314291747e938 (patch) | |
tree | 50f499f73372aea2760f2c27a753b1df185f6483 | |
parent | 7062f8dff2ddd110ec95c1b162273ea63c37897f (diff) | |
download | otp-7738e604909c52ebac606eed5f6314291747e938.tar.gz otp-7738e604909c52ebac606eed5f6314291747e938.tar.bz2 otp-7738e604909c52ebac606eed5f6314291747e938.zip |
BEAM loader: Omit type tests for instructions that don't need them
-rwxr-xr-x | erts/emulator/utils/beam_makeops | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index c2fb101846..8a5b8047eb 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -1301,13 +1301,22 @@ sub tr_gen_from { my($var, $type, $type_val, $cond, $val) = @$op; if ($type ne '' && $type ne '*') { - my($types) = ''; - my($type_mask) = 0; - foreach (split('', $type)) { - $types .= "$_ "; - $type_mask |= $type_bit{$_}; + # + # The is_bif, is_not_bif, and is_func instructions have + # their own built-in type test and don't need to + # be guarded with a type test instruction. + # + unless ($cond eq 'is_bif' or + $cond eq 'is_not_bif' or + $cond eq 'is_func') { + my($types) = ''; + my($type_mask) = 0; + foreach (split('', $type)) { + $types .= "$_ "; + $type_mask |= $type_bit{$_}; + } + push(@code, &make_op($types, 'is_type', $type_mask)); } - push(@code, &make_op($types, 'is_type', $type_mask)); } if ($cond eq 'is_func') { |