diff options
author | Björn Gustavsson <[email protected]> | 2016-06-17 12:54:26 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-06-22 11:58:11 +0200 |
commit | 6a6c72801e6fb021851b4f2591b03ed136a27363 (patch) | |
tree | bccddc199ec2fe69a6bc01610731295f83eccc88 /erts/emulator/utils/beam_makeops | |
parent | 4443bc775442d568357f72d96e2fbdae2ea58c3d (diff) | |
download | otp-6a6c72801e6fb021851b4f2591b03ed136a27363.tar.gz otp-6a6c72801e6fb021851b4f2591b03ed136a27363.tar.bz2 otp-6a6c72801e6fb021851b4f2591b03ed136a27363.zip |
beam_makeops: Separate static information from counters
The counters are only used in the special 'icount' emulator.
We will save some memory by including the counters in the
OpEntry. It will also make it possible to make opc 'const'.
Diffstat (limited to 'erts/emulator/utils/beam_makeops')
-rwxr-xr-x | erts/emulator/utils/beam_makeops | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/erts/emulator/utils/beam_makeops b/erts/emulator/utils/beam_makeops index 4407f7e289..acc0084145 100755 --- a/erts/emulator/utils/beam_makeops +++ b/erts/emulator/utils/beam_makeops @@ -566,7 +566,7 @@ sub emulator_output { $sep = ","; } $init .= "}"; - init_item($print_name, $init, $involves_r, $size, $pack, $sign, 0); + init_item($print_name, $init, $involves_r, $size, $pack, $sign); $op_to_name[$spec_opnum] = $instr; $spec_opnum++; } @@ -575,6 +575,15 @@ sub emulator_output { print "int num_instructions = $spec_opnum;\n\n"; # + # Print the array for instruction counts. + # + + print "#ifdef ERTS_OPCODE_COUNTER_SUPPORT\n"; + print "Uint erts_instr_count[$spec_opnum];\n"; + print "#endif\n"; + print "\n"; + + # # Generate transformations. # @@ -708,7 +717,7 @@ sub emulator_output { print "#define DEFINE_COUNTING_LABELS"; for ($i = 0; $i < @op_to_name; $i++) { my($name) = $op_to_name[$i]; - print " \\\nCountCase($name): opc[$i].count++; goto lb_$name;"; + print " \\\nCountCase($name): erts_instr_count[$i]++; goto lb_$name;"; } print "\n\n"; |