aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-08-23 12:56:36 +0200
committerBjörn Gustavsson <[email protected]>2017-08-23 12:56:36 +0200
commite337151a9bc869367032af334ebd479d92dfbdee (patch)
tree5a644cdbffa56adce12b6252bb4e994c5b0376fb
parenteb8ffa6a071c3fe532389ba1907fc89aa9ea15eb (diff)
downloadotp-e337151a9bc869367032af334ebd479d92dfbdee.tar.gz
otp-e337151a9bc869367032af334ebd479d92dfbdee.tar.bz2
otp-e337151a9bc869367032af334ebd479d92dfbdee.zip
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.
-rwxr-xr-xerts/emulator/utils/beam_makeops14
1 files changed, 10 insertions, 4 deletions
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;