diff options
author | Björn Gustavsson <[email protected]> | 2017-02-01 12:44:04 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-02-01 12:44:04 +0100 |
commit | 4c8881fdf397757ee7bdbebf6aa9d0c01d5066ab (patch) | |
tree | 5a9cb98eda8f106a31d8f7bc9c5193c9b7d9529d /lib/compiler/src/beam_dict.erl | |
parent | 3d81b5c93865c621372330ffb826eba157c8d0f7 (diff) | |
parent | 26b59dfe67ef551cd94765557cdd8c79794bcc38 (diff) | |
download | otp-4c8881fdf397757ee7bdbebf6aa9d0c01d5066ab.tar.gz otp-4c8881fdf397757ee7bdbebf6aa9d0c01d5066ab.tar.bz2 otp-4c8881fdf397757ee7bdbebf6aa9d0c01d5066ab.zip |
Merge branch 'josevalim/atu8-chunk/PR-1078/OTP-14178'
* josevalim/atu8-chunk/PR-1078/OTP-14178:
Add new AtU8 beam chunk
Diffstat (limited to 'lib/compiler/src/beam_dict.erl')
-rw-r--r-- | lib/compiler/src/beam_dict.erl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/compiler/src/beam_dict.erl b/lib/compiler/src/beam_dict.erl index 719d799fd7..990e86062a 100644 --- a/lib/compiler/src/beam_dict.erl +++ b/lib/compiler/src/beam_dict.erl @@ -24,7 +24,7 @@ -export([new/0,opcode/2,highest_opcode/1, atom/2,local/4,export/4,import/4, string/2,lambda/3,literal/2,line/2,fname/2, - atom_table/1,local_table/1,export_table/1,import_table/1, + atom_table/2,local_table/1,export_table/1,import_table/1, string_table/1,lambda_table/1,literal_table/1, line_table/1]). @@ -197,15 +197,15 @@ fname(Name, #asm{fnames=Fnames}=Dict) -> end. %% Returns the atom table. -%% atom_table(Dict) -> {LastIndex,[Length,AtomString...]} --spec atom_table(bdict()) -> {non_neg_integer(), [[non_neg_integer(),...]]}. +%% atom_table(Dict, Encoding) -> {LastIndex,[Length,AtomString...]} +-spec atom_table(bdict(), latin1 | utf8) -> {non_neg_integer(), [[non_neg_integer(),...]]}. -atom_table(#asm{atoms=Atoms}) -> +atom_table(#asm{atoms=Atoms}, Encoding) -> NumAtoms = maps:size(Atoms), Sorted = lists:keysort(2, maps:to_list(Atoms)), {NumAtoms,[begin - L = atom_to_list(A), - [length(L)|L] + L = atom_to_binary(A, Encoding), + [byte_size(L),L] end || {A,_} <- Sorted]}. %% Returns the table of local functions. |