From 32be05dcaa4c32596bfe5372451b0b89ccd2f151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 9 Nov 2010 15:49:06 +0100 Subject: BEAM loader: Pack more instructions using a new 'Q' type Introduce a new 'Q' type, similar to 'P' except that it can be packed. --- erts/emulator/utils/beam_makeops | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'erts/emulator/utils/beam_makeops') diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 38c2f5bcfe..ea06a48d29 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -129,7 +129,8 @@ my %arg_size = ('r' => 0, # x(0) - x register zero 't' => 1, # untagged integer -- can be packed 'b' => 1, # pointer to bif 'A' => 1, # arity value - 'P' => 1, # byte offset into tuple + 'P' => 1, # byte offset into tuple or stack + 'Q' => 1, # like 'P', but packable 'h' => 1, # character 'l' => 1, # float reg 'q' => 1, # literal term @@ -168,6 +169,7 @@ my @tag_type; $type_bit{'U'} = $type_bit{'u'}; $type_bit{'e'} = $type_bit{'u'}; $type_bit{'P'} = $type_bit{'u'}; + $type_bit{'Q'} = $type_bit{'u'}; } # @@ -809,6 +811,7 @@ sub basic_generator { 'I' => 1, 't' => 1, 'P' => 1, + 'Q' => 1, ); # Pick up the macro to use and its flags (if any). @@ -959,7 +962,7 @@ sub do_pack { # arguments, packing is not possible. # for ($i = 0; $i < @args; $i++) { - if ($args[$i] =~ /[xyt]/) { + if ($args[$i] =~ /[xytQ]/) { $packable_args++; } elsif ($args[$i] =~ /[sd]/) { return ('', '', @args); @@ -1005,7 +1008,7 @@ sub do_pack { for ($i = 0; $i < @args; $i++) { my($reg) = $args[$i]; my($this_size) = $arg_size{$reg}; - if ($reg =~ /[xyt]/) { + if ($reg =~ /[xytQ]/) { $this_size = 0; $did_some_packing = 1; -- cgit v1.2.3