From e337151a9bc869367032af334ebd479d92dfbdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 23 Aug 2017 12:56:36 +0200 Subject: beam_makeops: Stop using the Arg() macro Generated code uses 'I' explicitly in other places, so it can as well use 'I' when accessing the operands for instructions. --- erts/emulator/utils/beam_makeops | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'erts/emulator') diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index c12073d943..6c54ab3421 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -1244,7 +1244,7 @@ sub basic_generator { last SWITCH; }; /[lxyS]/ and do { - push(@f, $_ . "b(Arg($arg_offset))"); + push(@f, $_ . "b(" . arg_offset($arg_offset) . ")"); last SWITCH; }; /n/ and do { @@ -1261,13 +1261,13 @@ sub basic_generator { last SWITCH; }; /d/ and do { - $var_decls .= "Eterm dst = Arg($arg_offset);\n" . + $var_decls .= "Eterm dst = " . arg_offset($arg_offset) . ";\n" . "Eterm* dst_ptr = REG_TARGET_PTR(dst);\n"; push(@f, "*dst_ptr"); last SWITCH; }; defined $arg_size{$_} and do { - push(@f, "Arg($arg_offset)"); + push @f, arg_offset($arg_offset); last SWITCH; }; @@ -1349,6 +1349,11 @@ sub basic_generator { ($size+1, $code, $pack_spec); } +sub arg_offset { + my $offset = shift; + "I[" . ($offset+1) . "]"; +} + sub expand_all { my($code,$bindings_ref) = @_; my %bindings = %{$bindings_ref}; @@ -1595,7 +1600,8 @@ sub do_pack { $did_some_packing = 1; if ($ap == 0) { - $pack_prefix .= "Eterm $packed_var = Arg($size);\n"; + $pack_prefix .= "Eterm $packed_var = " . + arg_offset($size) . ";\n"; $up .= "p"; $down = "P$down"; $this_size = 1; -- cgit v1.2.3