<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/compiler/src/sys_core_inline.erl, branch OTP-17.4</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>Merge branch 'bg/compiler-inliner' into dev</title>
<updated>2010-04-01T05:34:09+00:00</updated>
<author>
<name>Erlang/OTP</name>
<email>otp@erlang.org</email>
</author>
<published>2010-04-01T05:34:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=263643a357e7a11724c599045ca35ba9aef2438c'/>
<id>263643a357e7a11724c599045ca35ba9aef2438c</id>
<content type='text'>
* bg/compiler-inliner:
  pmod_SUITE: Again test inlining parameterized modules
  compiler tests: Cope with missing args in function_clause for native code
  compiler tests: Compile a few more modules with 'inline'
  Consistently rewrite an inlined function_clause exception to case_clause
  compiler tests: Test the 'inline' option better
  compiler: Suppress bs_context_to_binary/1 for a literal operand
  compiler: Fix binary matching bug in the inliner
  sys_core_inline: Don't generated multiple compiler_generated annos

OTP-8552 bg/compiler-inliner

Several problems in the inliner have been fixed.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* bg/compiler-inliner:
  pmod_SUITE: Again test inlining parameterized modules
  compiler tests: Cope with missing args in function_clause for native code
  compiler tests: Compile a few more modules with 'inline'
  Consistently rewrite an inlined function_clause exception to case_clause
  compiler tests: Test the 'inline' option better
  compiler: Suppress bs_context_to_binary/1 for a literal operand
  compiler: Fix binary matching bug in the inliner
  sys_core_inline: Don't generated multiple compiler_generated annos

OTP-8552 bg/compiler-inliner

Several problems in the inliner have been fixed.</pre>
</div>
</content>
</entry>
<entry>
<title>Consistently rewrite an inlined function_clause exception to case_clause</title>
<updated>2010-03-26T07:09:26+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2010-03-18T07:45:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=0320836d1b58438ef4467832b00306672d22f8d6'/>
<id>0320836d1b58438ef4467832b00306672d22f8d6</id>
<content type='text'>
A function_clause exception is generated by jumping to a func_info/3
instruction at the beginning of the function. The x registers are
assumed to contain the arguments for the function. That means
that a func_info/3 instruction copied from another function
(or even from the same function if not at the top level) will
not work, so it must be replaced with an instruction that
generates a case_clause exception.

In Core Erlang, a func_info/3 instruction is represented as
a the primop match_fail({function_clause,Arg1,...ArgN}).

The current mechanism that is supposed to replace the
primop match_fail(function_clause) with match_fail(case_clause)
will fail to do that in the following circumstances:

1. If the inliner has inlined a function into itself.
Fix that by having the inliner clear the function_name annotations
on all match_fail primops in functions that are inlined. (To simplify
doing that, the annotation is now on the primop node itself and not on
the 'function_clause' atom inside it.)

2. If the inliner has rewritten the tuple node in the primop node
to a literal (when inlining a function call with literal arguments),
v3_kernel would not recognize the match_fail(function_clause) primop
and would not rewrite it. Fix it by making v3_kernel smarter.

Also simplify the "old" inliner (sys_core_inline) to only clear
the function_name annotations instead of rewriting function_clause
execptions to case_clause execptions itself.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A function_clause exception is generated by jumping to a func_info/3
instruction at the beginning of the function. The x registers are
assumed to contain the arguments for the function. That means
that a func_info/3 instruction copied from another function
(or even from the same function if not at the top level) will
not work, so it must be replaced with an instruction that
generates a case_clause exception.

In Core Erlang, a func_info/3 instruction is represented as
a the primop match_fail({function_clause,Arg1,...ArgN}).

The current mechanism that is supposed to replace the
primop match_fail(function_clause) with match_fail(case_clause)
will fail to do that in the following circumstances:

1. If the inliner has inlined a function into itself.
Fix that by having the inliner clear the function_name annotations
on all match_fail primops in functions that are inlined. (To simplify
doing that, the annotation is now on the primop node itself and not on
the 'function_clause' atom inside it.)

2. If the inliner has rewritten the tuple node in the primop node
to a literal (when inlining a function call with literal arguments),
v3_kernel would not recognize the match_fail(function_clause) primop
and would not rewrite it. Fix it by making v3_kernel smarter.

Also simplify the "old" inliner (sys_core_inline) to only clear
the function_name annotations instead of rewriting function_clause
execptions to case_clause execptions itself.
</pre>
</div>
</content>
</entry>
<entry>
<title>sys_core_inline: Don't generated multiple compiler_generated annos</title>
<updated>2010-03-26T07:03:42+00:00</updated>
<author>
<name>Björn Gustavsson</name>
<email>bjorn@erlang.org</email>
</author>
<published>2010-03-18T10:18:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=a2c88ff1875a2039c987c1099e6d911f1b6dfce6'/>
<id>a2c88ff1875a2039c987c1099e6d911f1b6dfce6</id>
<content type='text'>
Multiple compiler_generated annotations are harmless, but makes
listing files harder to read during debugging.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Multiple compiler_generated annotations are harmless, but makes
listing files harder to read during debugging.
</pre>
</div>
</content>
</entry>
<entry>
<title>The R13B03 release.</title>
<updated>2009-11-20T14:54:40+00:00</updated>
<author>
<name>Erlang/OTP</name>
<email>otp@erlang.org</email>
</author>
<published>2009-11-20T14:54:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=84adefa331c4159d432d22840663c38f155cd4c1'/>
<id>84adefa331c4159d432d22840663c38f155cd4c1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
