Age | Commit message (Collapse) | Author |
|
* nox/fix-dbg_ieval-exporting-rules/OTP-11553:
compiler tests: Test exporting rules for andalso/orelse
Fix evaluation of andalso and orelse in the debugger
|
|
|
|
Compiling programs with very many uses of the "dot notation"
for extracting a record element could be very slow. The reason
is that each extraction of a record element (R#r.a) would first be
transformed to code like this:
case R of
{r,rec0,_,_} -> rec0;
_ -> error({badrecord,r})
end
In Core Erlang, each '_' would be become a new variable. The
resulting code would be optimized by sys_core_fold, but the
optimization process could be very slow.
Profiling shows that sub_del_var/2 was the worst bottleneck, and the
sub_is_val/2 the second worst bottleneck. In both cases, the culprit
is the linear traversal of a very long list (the list of variable
substitutions). Fortunately, there already is a gb_set (the scope)
which contains all variables that are currently live. If a variable is
not known to be live, it is no point in doing the linear operation on
the list.
|
|
erlc is wired to treat *.core files as core and build them as
compile:file(File, [from_core]), but this is not documented. There's
also an udocumented compile:file/2 option called 'from_core'. This has
been in place and in use for a long time. Therefore, it should be
supported officially.
To fix that, make the following changes:
* document erlc handling of *.core files
* document 'from_core'
|
|
erlc is wired to treat *.S files as assembler and build them as
compile:file(File, [from_asm]), but this is not documented. There's also
a documented compile:file/2 option called 'asm' (mapping to 'from_asm'),
but the wording discourages its use. All of this has been in place and
in use for a long time. Therefore, it should be supported officially.
To fix that, make the following changes:
* document erlc handling of *.core files
* un-document 'asm' and document 'from_asm' instead
* deprecate 'asm'
While at it, fix a minor typo in the test suite.
|
|
|
|
This makes applying the pass a second time a no-op.
|
|
|
|
Any init instruction following an allocate is put in the Inits list of the
corresponding alloc tuple.
|
|
If an allocate_zero instruction is fed to beam_block and the beam_type
pass is not used afterwards (e.g. with erlc +no_topt), the 'no_opt' atom
will be rejected by beam_flatten.
|
|
The compiler shouldn't crash when fed an already-optimised BEAM assembly file.
|
|
|
|
This adds optional names to fun expressions. A named fun expression
is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse.
If a fun expression has a name, it must be present and be the same in
every of its clauses. The function name shadows the environment of the
expression shadowing the environment and it is shadowed by the
environment of the clauses' arguments. An unused function name triggers
a warning unless it is prefixed by _, just as every variable.
Variable _ is allowed as a function name.
It is not an error to put a named function in a record field default
value.
When transforming to Core Erlang, the named fun Fun is changed into
the following expression:
letrec 'Fun'/Arity =
fun (Args) ->
let <Fun> = 'Fun'/Arity
in Case
in 'Fun'/Arity
where Args is the list of arguments of 'Fun'/Arity and Case the
Core Erlang expression corresponding to the clauses of Fun.
This transformation allows us to entirely skip any k_var to k_local
transformation in the fun's clauses bodies.
|
|
The R16B03 release
Conflicts:
lib/sasl/vsn.mk
|
|
|
|
* maint:
Rename otp_8949_a/0 which common_test interprets as an info function
|
|
Before running a test case named testcase/1, common_test will call
testcase/0 (the info function). Exceptions and illegal return values
would be silently ignored. In a planned update to common_test, errors
will instead cause the test case to fail.
The test case otp_8949_a/1 has a helper function called otp_8949_a/0.
Rename it to do_otp_8949_a/0.
While at it, also fix a copy and paste bug in the list of test cases.
otp_8949_a was run twice; otp_8949_b was never run.
|
|
|
|
|
|
|
|
* fenollp/treewide_remove_unexpected_0xff/OTP-11323:
Remove ^L characters hidden randomly in the code. Not those used in text files as delimiters.
|
|
* nox/lift-after/OTP-11267:
Lift 'after' blocks to zeroary functions
|
|
The R16B02 release
Conflicts:
lib/sasl/vsn.mk
|
|
|
|
files as delimiters.
While working on a tool that processes Erlang code and testing it against this repo,
I found out about those little sneaky 0xff. I thought it may be of help to other
people build such tools to remove non-conforming-to-standard characters.
|
|
* maint:
core_lint: Correct the type error() to conform to the code
|
|
Commit 60984ade updated the code, but not the type spec.
Noticed-by: Kostis Sagonas
|
|
* bjorn/xml-encoding-fix/OTP-11310:
Change encoding of troublesome notes.xml files to utf-8
Convert some notes.xml files from latin-1 to utf-8
|
|
* maint:
compiler: Conform returned errors to the documented format
|
|
Most notes.xml files will be updated in every release and cause
the kind of the problems described in the previous commit.
|
|
ErrorInfo is documented to be:
{ErrorLine,Module,ErrorDescriptor}
but for some errors with line numbers it would look like:
{Module,ErrorDescriptor}
Ensure that all ErrorInfo tuples have three elements. Use 'none'
instead of a line number:
{none,Module,ErrorDescriptor}
There already are errors that return 'none' when no line number is
available, but that convention was not documented. Mention it in the
documentation.
Also make sure that the compiler will not print 'none' as a line
number in error messages (if the 'report_errors' option is given) as
that looks stupid. That is, when attempting to compile a non-existing
module, the error message should be:
non-existing.erl: no such file or directory
and not:
non-existing.erl:none: no such file or directory
|
|
* maint: (26 commits)
genop.tab: Add documentation for many BEAM instructions
asn1ct_constucted_per: Directly call asn1ct_gen_per
Clean up handling of .asn1db files
PER, UPER: Fix encoding/decoding of open types greater than 16K
PER, UPER: Optimize table constraints
PER, UPER: Optimize encoding using an intermediate format
Refactor decoding of components of SEQUENCE OF / SET OF
PER,UPER: Get rid of unused 'telltype' argument in decoding functions
Optimize the generated encode/2 function
UPER: Optimize complete/1
Clean up checking of objects
Improve tests of deep table constraints
BER: Handle multiple optional SEQUENCE fields with table constraints
Test OPTIONAL and DEFAULT for open types
PER/UPER: Fix encoding of an object set with multiple inlined constructs
Remove broken support for multiple UNIQUE
Extend the test for parameterized information objects
asn1_SUITE: Remove off-topic (and slow) smp/1 test case
SeqOf: Add more tricky SEQUENCE OF tests
Clean up handling of extension addition groups
...
|
|
By Erik Stenman (happi) with corrections by me.
|
|
|
|
* nox/match-context-return/OTP-11247:
Added primary bootstrap
Forbid returning a match context in beam_validator
|
|
* maint:
Fix compiler crash for 'B and B' guard
|
|
|
|
If a match context is returned from a function without being converted
back to a plain old binary, the whole VM will crash.
|
|
Conflicts:
bootstrap/lib/compiler/ebin/v3_core.beam
|
|
* nox/fix-comp-warnings/OTP-11212:
Bootstrap
Silence a misleading warning with some comprehensions
|
|
Conflicts:
bootstrap/lib/compiler/ebin/cerl_inline.beam
|
|
* nox/fix-fname-inlining/OTP-11211:
Added primary bootstrap
Restrict inlining of local fun references
|
|
If 'after' blocks are not lifted, the ids of functions in their bodies
must be killed and it can make stacktraces more confusing than they
should. We lift them to zeroary functions to avoid unnecessary killings
and duplication of code.
|
|
|
|
* jw/fix-float-middle-endian/OTP-11201:
Fix binary construction on floating point middle-endian machines
Fix binary matching on floating point middle-endian machines
Fix erlang:phash2() on floating point middle-endian machines
Fix external term format BIFs on floating point middle-endian machines
|
|
Local fun references look like plain old variables in the Core Erlang
AST but should not be treated as such. Inlining of such expressions is
now restricted to application contexts as a local fun reference should
never occur in a guard.
This is not perfect as it forbids inlining in some safe situations, but
that is still better than a compiler crash.
|
|
* nox/illegal-bitstring-gen-pattern/OTP-11186:
Bootstrap added
Simplify v3_core's translation of bit string generators
Forbid unsized fields in patterns of binary generators
|
|
The R16B01 release
Conflicts:
lib/sasl/vsn.mk
|
|
|
|
This complements 933e701 (OTP-10209). Without this patch the test cases
"in_guard/1" and "coerce_to_float/1" in bs_construct_SUITE fail.
The added lines in bs_construct_SUITE cover all branches that were not
covered before (small and big numbers if BIT_OFFSET(erts_bin_offset) != 0).
|