<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/erts/preloaded/src/add_abstract_code, branch master</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Update copyright year</title>
<updated>2017-05-04T13:42:21+00:00</updated>
<author>
<name>Raimo Niskanen</name>
<email>raimo@erlang.org</email>
</author>
<published>2017-05-04T13:42:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=83e20c62057ebc1d8064bf57b01be560cd244e1d'/>
<id>83e20c62057ebc1d8064bf57b01be560cd244e1d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Store abstract code in the Dbgi chunk</title>
<updated>2017-04-25T11:24:22+00:00</updated>
<author>
<name>José Valim</name>
<email>jose.valim@plataformatec.com.br</email>
</author>
<published>2017-03-08T12:25:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=dfb899c0229f7ff7dbfad34d496e0429562728bf'/>
<id>dfb899c0229f7ff7dbfad34d496e0429562728bf</id>
<content type='text'>
The new Dbgi chunk returns data in the following format:

    {debug_info_v1, Backend, Data}

This allows compilers to store the debug info in different
formats. In order to retrieve a particular format, for
instance, Erlang Abstract Format, one may invoke:

    Backend:debug_info(erlang_v1, Module, Data, Opts)

Besides introducing the chunk above, this commit also:

  * Changes beam_lib:chunk(Beam, [:abstract_code]) to
    read from the new Dbgi chunk while keeping backwards
    compatibility with old .beams

  * Adds the {debug_info, {Backend, Data}} option to
    compile:file/2 and friends that are stored in the
    Dbgi chunk. This allows the debug info encryption
    mechanism to work across compilers

  * Improves dialyzer to work directly on Core Erlang,
    allowing languages that do not have the Erlang
    Abstract Format to be dialyzer as long as they emit
    the new chunk and their backend implementation is
    available

Backwards compatibility is kept across the board except
for those calling beam_lib:chunk(Beam, ["Abst"]), as the
old chunk is no longer available. Note however the "Abst"
chunk has always been optional.

Future OTP versions may remove parsing the "Abst" chunk
altogether from beam_lib once Erlang 19 and earlier is no
longer supported.

The current Dialyzer implementation still supports earlier
.beam files and such may also be removed in future versions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new Dbgi chunk returns data in the following format:

    {debug_info_v1, Backend, Data}

This allows compilers to store the debug info in different
formats. In order to retrieve a particular format, for
instance, Erlang Abstract Format, one may invoke:

    Backend:debug_info(erlang_v1, Module, Data, Opts)

Besides introducing the chunk above, this commit also:

  * Changes beam_lib:chunk(Beam, [:abstract_code]) to
    read from the new Dbgi chunk while keeping backwards
    compatibility with old .beams

  * Adds the {debug_info, {Backend, Data}} option to
    compile:file/2 and friends that are stored in the
    Dbgi chunk. This allows the debug info encryption
    mechanism to work across compilers

  * Improves dialyzer to work directly on Core Erlang,
    allowing languages that do not have the Erlang
    Abstract Format to be dialyzer as long as they emit
    the new chunk and their backend implementation is
    available

Backwards compatibility is kept across the board except
for those calling beam_lib:chunk(Beam, ["Abst"]), as the
old chunk is no longer available. Note however the "Abst"
chunk has always been optional.

Future OTP versions may remove parsing the "Abst" chunk
altogether from beam_lib once Erlang 19 and earlier is no
longer supported.

The current Dialyzer implementation still supports earlier
.beam files and such may also be removed in future versions.
</pre>
</div>
</content>
</entry>
<entry>
<title>update copyright-year</title>
<updated>2016-03-15T14:19:56+00:00</updated>
<author>
<name>Henrik Nord</name>
<email>henrik@erlang.org</email>
</author>
<published>2016-03-15T14:19:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6664eed554974336909d3ffe03f20349cc4c38fd'/>
<id>6664eed554974336909d3ffe03f20349cc4c38fd</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Change license text to APLv2</title>
<updated>2015-06-18T09:31:02+00:00</updated>
<author>
<name>Bruce Yinhe</name>
<email>bruce@erlang.org</email>
</author>
<published>2015-06-18T09:31:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=738c34d4bb8f1a3811acd00af8c6c12107f8315b'/>
<id>738c34d4bb8f1a3811acd00af8c6c12107f8315b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>add_abstract_code: Remove 'from_asm' option</title>
<updated>2014-06-13T10:57:35+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2014-06-13T10:57:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=ab8c6675511cb1968c57fab3dd8e47cc48037c06'/>
<id>ab8c6675511cb1968c57fab3dd8e47cc48037c06</id>
<content type='text'>
The purpose of add_abstract_code is to give Dialyzer some
abstract code so that it will not fail fatally when analysing
prim_eval which was compiled from BEAM assembly.

But if Dialyzer were to pass along the compiler options
that the module was compiled with when translating the
abstract code to Core Erlang, the 'from_asm' option would
crash the compilation. Thus, since we are already cheating,
we should cheat a little bit more and also remove the
'from_asm' option.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of add_abstract_code is to give Dialyzer some
abstract code so that it will not fail fatally when analysing
prim_eval which was compiled from BEAM assembly.

But if Dialyzer were to pass along the compiler options
that the module was compiled with when translating the
abstract code to Core Erlang, the 'from_asm' option would
crash the compilation. Thus, since we are already cheating,
we should cheat a little bit more and also remove the
'from_asm' option.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix receive support in erl_eval with a BEAM module</title>
<updated>2013-05-28T10:19:34+00:00</updated>
<author>
<name>Anthony Ramine</name>
<email>n.oxyde@gmail.com</email>
</author>
<published>2013-05-06T18:09:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=acb8ef5d18cc3976bf580a8e6925cb5641acd401'/>
<id>acb8ef5d18cc3976bf580a8e6925cb5641acd401</id>
<content type='text'>
Using the low-level BEAM instructions, we can loop over each message in
the process queue and removes the first message that matches, without
receiving them all to later send them back to itself.

The function prim_eval:'receive'/2 is equivalent to the
following pseudo-code:

  'receive'(F, T) -&gt;
    RESET MESSAGE QUEUE POINTER,
    LOOP:
      case PEEK CURRENT MESSAGE WITH TIMEOUT T of
        {ok,Msg} -&gt;
          case F(Msg) of
            nomatch -&gt;
              DECREMENT TIMEOUT T,
              ADVANCE MESSAGE QUEUE POINTER,
              GOTO LOOP;
            Result -&gt;
              RESET MESSAGE QUEUE POINTER,
              Result
          end;
        timeout -&gt;
          RESET MESSAGE QUEUE POINTER,
          timeout
      end.

To not break Dialyzer and other tools, we use a stub Erlang module which
abstract code is forcefully inserted into prim_inet.erl afterwards
compilation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using the low-level BEAM instructions, we can loop over each message in
the process queue and removes the first message that matches, without
receiving them all to later send them back to itself.

The function prim_eval:'receive'/2 is equivalent to the
following pseudo-code:

  'receive'(F, T) -&gt;
    RESET MESSAGE QUEUE POINTER,
    LOOP:
      case PEEK CURRENT MESSAGE WITH TIMEOUT T of
        {ok,Msg} -&gt;
          case F(Msg) of
            nomatch -&gt;
              DECREMENT TIMEOUT T,
              ADVANCE MESSAGE QUEUE POINTER,
              GOTO LOOP;
            Result -&gt;
              RESET MESSAGE QUEUE POINTER,
              Result
          end;
        timeout -&gt;
          RESET MESSAGE QUEUE POINTER,
          timeout
      end.

To not break Dialyzer and other tools, we use a stub Erlang module which
abstract code is forcefully inserted into prim_inet.erl afterwards
compilation.
</pre>
</div>
</content>
</entry>
</feed>
