diff options
author | Rickard Green <[email protected]> | 2016-10-28 18:34:14 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2017-01-12 15:22:26 +0100 |
commit | 95ec5d385cfba23c770d946871c0197bf374ff3c (patch) | |
tree | 4eabd4401d83066c07a77d7dec34600deac64edd /erts/emulator/utils | |
parent | 5aff60d96efac96a41b514ed167f13eb787a415f (diff) | |
download | otp-95ec5d385cfba23c770d946871c0197bf374ff3c.tar.gz otp-95ec5d385cfba23c770d946871c0197bf374ff3c.tar.bz2 otp-95ec5d385cfba23c770d946871c0197bf374ff3c.zip |
Optimize handling of BIF errors
Diffstat (limited to 'erts/emulator/utils')
-rwxr-xr-x | erts/emulator/utils/make_tables | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/erts/emulator/utils/make_tables b/erts/emulator/utils/make_tables index 1d3023ee9a..47e1528958 100755 --- a/erts/emulator/utils/make_tables +++ b/erts/emulator/utils/make_tables @@ -37,6 +37,7 @@ use File::Basename; # <-src>/erl_bif_table.c # <-src>/erl_bif_wrap.c # <-src>/erl_dirty_bif_wrap.c +# <-src>/erl_guard_bifs.c # <-src>/hipe_nbif_impl.c # <-include>/hipe_nbif_impl.h # <-include>/erl_atom_table.h @@ -228,11 +229,18 @@ typedef struct bif_entry { typedef struct erts_gc_bif { BifFunction bif; BifFunction gc_bif; + int exp_ix; } ErtsGcBif; +typedef struct erts_u_bif { + BifFunction bif; + int exp_ix; +} ErtsUBif; + extern BifEntry bif_table[]; extern Export* bif_export[]; extern const ErtsGcBif erts_gc_bifs[]; +extern const ErtsUBif erts_u_bifs[]; #define BIF_SIZE $bif_size @@ -304,18 +312,24 @@ for ($i = 0; $i < @bif; $i++) { # Generate erl_gc_bifs.c. # -open_file("$src/erl_gc_bifs.c"); +open_file("$src/erl_guard_bifs.c"); my $i; includes("export.h", "sys.h", "erl_vm.h", "global.h", "erl_process.h", "bif.h", "erl_bif_table.h"); print "const ErtsGcBif erts_gc_bifs[] = {\n"; for ($i = 0; $i < @bif; $i++) { next unless $bif_info[$i]->[0] eq 'gcbif'; - my $arity = $bif[$i]->[2]; - my $func = $bif[$i]->[3]; - print " {$func, erts_gc_$func},\n"; + print " {$bif[$i]->[3], erts_gc_$bif[$i]->[3], BIF_$bif[$i]->[5]},\n"; +} +print " {NULL, NULL, -1}\n"; +print "};\n"; + +print "const ErtsUBif erts_u_bifs[] = {\n"; +for ($i = 0; $i < @bif; $i++) { + next unless $bif_info[$i]->[0] eq 'ubif'; + print " {$bif[$i]->[3], BIF_$bif[$i]->[5]},\n"; } -print " {0, 0}\n"; +print " {NULL, -1}\n"; print "};\n"; # |