aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_dict.erl
AgeCommit message (Collapse)Author
2017-01-30Add new AtU8 beam chunkJosé Valim
The new chunk stores atoms encoded in UTF-8. beam_lib has also been modified to handle the new 'utf8_atoms' attribute while the 'atoms' attribute may be a missing chunk from now on. The binary_to_atom/2 BIF can now encode any utf8 binary with up to 255 characters. The list_to_atom/1 BIF can now accept codepoints higher than 255 with up to 255 characters (thanks to Björn Gustavsson).
2017-01-12beam_dict: Add missing types and specsBjörn Gustavsson
2017-01-12beam_dict: Simplify the internal format of the lambda tableBjörn Gustavsson
Since Index =:= OldIndex and OldUniq =:= 0, there is no need to store OldIndex and OldUniq in the internal data structure for the lambda table.
2016-03-15update copyright-yearHenrik Nord
2015-11-11beam_dict: Speed up storage of funsBjörn Gustavsson
For huge modules with many funs (such as NBAP-PDU-Contents in the asn1 test suite), the call to length/1 in beam_dict:lambda/3 will dominate the running time of the beam_asm pass.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-21beam_dict: Use Maps to map function name indicesBjörn-Egil Dahlberg
2015-05-21beam_dict: Use Maps to map line indicesBjörn-Egil Dahlberg
2015-05-21beam_dict: Use Maps to map atom indicesBjörn-Egil Dahlberg
2015-04-29beam_dict: Correct comparison in opcode/2Björn Gustavsson
The intention of the comparison is to avoid unnecessary updates of the ">=" instead of ">". With the ">" comparison, typically every line instruction would cause the #asm{} record to be updated.
2014-02-23Deprecate pre-defined built-in typesHans Bolinder
The types array(), dict(), digraph(), gb_set(), gb_tree(), queue(), set(), and tid() have been deprecated. They will be removed in OTP 18.0. Instead the types array:array(), dict:dict(), digraph:graph(), gb_set:set(), gb_tree:tree(), queue:queue(), sets:set(), and ets:tid() can be used. (Note: it has always been necessary to use ets:tid().) It is allowed in OTP 17.0 to locally re-define the types array(), dict(), and so on. New types array:array/1, dict:dict/2, gb_sets:set/1, gb_trees:tree/2, queue:queue/1, and sets:set/1 have been added.
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-23Revert "Merge branch 'nox/rm-reverse-eta-conversion/OTP-10682'"Fredrik Gustafsson
This reverts commit 750ecdea08fa5fa7e32b7f3019eed96c1699427e, reversing changes made to 2cfa0466c3b3c7bd5e3621aff0f3e2ca30addb68.
2012-12-03Remove the reverse eta-conversion from v3_kernelAnthony Ramine
Local function references should be handled directly as a make_fun internal BIF call instead of creating an extra lambda function every time they are used.
2011-11-07beam_asm: Fix broken NewIndex in fun entriesBjörn Gustavsson
The calculation of the NewIndex field in fun entries is broken: the sys_pre_expand and v3_kernel modules keep separate index counters starting at zero; thus there is no guarantee that each fun within a module will have its own unique NewIndex. We don't really need the NewIndex any more (see below), but since we do need the NewUniq field, we should fix NewIndex for cleanliness sake. The simplest way is to assign NewIndex as late as possible, namely in beam_asm, and to set it to the same value as Index. Historical Note: Why NewIndex Was Introduced There was once an idea that the debugger should be able to interpret only a single function in a module (for speed). To make sure that interpreted funs could be called from BEAM code and vice versa, the fun identification must be visible in the abstract code. Therefore a NewIndex field was introduced in each fun in the abstract code. However, it turned out that interpreting single functions does not play well with aggressive code optimization. For example, in this code: f() -> X = 1, fun() -> X+2 end. the variable X will seem to be free in the fun, but an aggressive optimizer will replace X with 1 in the fun; thus the fun will no longer have any free variables. Therefore, the debugger will always interpret entire modules.
2011-11-07beam_asm: Strenghten the calculation of Uniq for funsBjörn Gustavsson
Funs are identified by a triple, <Module,Uniq,Index>, where Module is the module name, Uniq is a 27 bit hash value of some intermediate representation of the code for the fun, and index is a small integer. When a fun is loaded, the triple for the fun will be compared to previously loaded funs. If all elements in the triple in the newly loaded fun are the same, the newly loaded fun will replace the previous fun. The idea is that if Uniq are the same, the code for the fun is also the same. The problem is that Uniq is only based on the intermediate representation of the fun itself. If the fun calls local functions in the same module, Uniq may remain the same even if the behavior of the fun has been changed. See http://erlang.org/pipermail/erlang-bugs/2007-June/000368.htlm for an example. As a long-term plan to fix this problem, the NewIndex and NewUniq fields was added to each fun in the R8 release (where NewUniq is the MD5 of the BEAM code for the module). Unfortunately, it turns out that the compiler does not assign unique value to NewIndex (if it isn't tested, it doesn't work), so we cannot use the <Module,NewUniq,NewIndex> triple as identification. It would be possible to use <Module,NewUniq,Index>, but that seems ugly. Therefore, fix the problem by making Uniq more unique by taking 27 bits from the MD5 for the BEAM code. That only requires a change to the compiler. Also update a test case for cover, which now fails because of the stronger Uniq calculation. (The comment in test case about why the Pid2 process survived is not correct.)
2011-08-16Include location information for line instructions in BEAM filesBjörn Gustavsson
2011-03-29beam_dict: Eliminate the redundant next_atom record elementBjörn Gustavsson
It is not needed because it can be trivially calculated using gb_trees:size/1.
2011-03-29beam_dict: Fix typo in commentBjörn Gustavsson
2011-03-11Update copyright yearsBjörn-Egil Dahlberg
2010-07-29beam_asm: Simplify string table generation for beamsPaul Guyot
The code for generating the string table (which is now only used for bit syntax matching) in a BEAM file is quite complicated and potentially expensive when compiling modules with many thousands of clauses doing bit syntax matching. Simplify and optimize the code using bit syntax and binary:match/2 instead of the list operations in the original code.
2010-06-07compiler: Fix incorrect types and specsKostis Sagonas
While at it, do some other minor clean-ups.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP