aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-27 15:11:17 +0200
committerBjörn Gustavsson <[email protected]>2017-10-05 12:37:57 +0200
commit43f1817f3367bf3aa346c8b3dae10862d3723515 (patch)
treed67e2ea1c4ce790a7bb4454187ade420a07005ff /erts/emulator
parente86262c45eb3ccbd055034239ddcd19472e56b2f (diff)
downloadotp-43f1817f3367bf3aa346c8b3dae10862d3723515.tar.gz
otp-43f1817f3367bf3aa346c8b3dae10862d3723515.tar.bz2
otp-43f1817f3367bf3aa346c8b3dae10862d3723515.zip
beam_makeops: Print the instruction name for fatal packing errors
Having the instruction name available in the functions that implement packing also simplifies debugging.
Diffstat (limited to 'erts/emulator')
-rwxr-xr-xerts/emulator/utils/beam_makeops14
1 files changed, 7 insertions, 7 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops
index d1c51e5dad..a705ba27b7 100755
--- a/erts/emulator/utils/beam_makeops
+++ b/erts/emulator/utils/beam_makeops
@@ -1346,7 +1346,7 @@ sub code_gen {
my $c_code_ref = $c_code{$name};
if (defined $c_code_ref and $name ne 'catch') {
- ($var_decls, $pack_spec, @args) = do_pack($offset, $pack_options, @args);
+ ($var_decls, $pack_spec, @args) = do_pack($name, $offset, $pack_options, @args);
}
#
@@ -1623,13 +1623,13 @@ sub needs_do_wrapper {
}
sub do_pack {
- my($offset,$pack_options,@args) = @_;
+ my($name,$offset,$pack_options,@args) = @_;
@args = map { s/[?]$//; $_ } @args;
my $ret = ['', ':', @args];
my $score = 0;
foreach my $options (@$pack_options) {
- my($this_score,$this_result) = do_pack_one($options, $offset, @args);
+ my($this_score,$this_result) = do_pack_one($name, $options, $offset, @args);
if ($this_score > $score) {
$ret = $this_result;
$score = $this_score;
@@ -1639,7 +1639,7 @@ sub do_pack {
}
sub do_pack_one {
- my($options,$offset,@args) = @_;
+ my($name,$options,$offset,@args) = @_;
my($packable_args) = 0;
my @bits_needed; # Bits needed for each argument.
my $pack_in_iw = $options & PACK_IN_INSTR_WORD;
@@ -1798,7 +1798,7 @@ sub do_pack_one {
my $pack_word_size = ($pack_in_iw && $word == 0) ? 32 : $wordsize;
my($shref,$mref,$iref,$unpack_suffix) =
- get_pack_parameters($args_per_word, $pack_word_size,
+ get_pack_parameters($name, $args_per_word, $pack_word_size,
$need_wide_mask[$word]);
my @shift = @$shref;
my @mask = @$mref;
@@ -1860,7 +1860,7 @@ sub do_pack_one {
}
sub get_pack_parameters {
- my($args_per_word,$pack_word_size,$wide_mask) = @_;
+ my($name,$args_per_word,$pack_word_size,$wide_mask) = @_;
my(@shift,@mask,@instr);
my $unpack_suffix = 'b';
@@ -1913,7 +1913,7 @@ sub get_pack_parameters {
}
unless (@shift) {
- error("internal error: args_per_word=$args_per_word, " .
+ error("$name: internal packing error: args_per_word=$args_per_word, " .
"pack_word_size=$pack_word_size");
}