Age | Commit message (Collapse) | Author |
|
* bjorn/compiler/beam_jump:
beam_jump: Eliminate pathologically slow compilation
|
|
* bjorn/compiler/beam_validator:
beam_validator: Exit immediately on crashes
beam_validator: Remove the file/1 and files/1 functions
beam_validator: Remove support for all other unsupported instructions
beam_validator: Remove support for unsupported bit syntax instructions
|
|
* bjorn/compiler/maps:
beam_validator: Tighten and simplify map validation code
beam_utils: Correct test for has_map_fields in is_pure_test/1
map_SUITE: Cover comparisons of 'nil' in v3_codegen
|
|
José Valim noticed that code such as:
match(1) -> 1;
match(2) -> 2;
match(3) -> 3;
...
match(1000) -> 1000.
would compile very slowly. The culprit is opt/3 in beam_jump.
What happens is that opt/3 will rewrite this code:
select_val ...
label 1
jump 1000
label 2
jump 1000
...
label 999
jump 1000
label 1000
return
very slowly to this code:
select_val ...
label 1
label 2
...
label 999
label 1000
return
The reason for the slowness is that when opt/3 sees this
sequence:
label 1
jump 1000
...
it will remove the label (storing it in a dictionary),
and pick up the previously processed instruction from
the accumulator:
select_val ...
jump 1000
label 2
jump 1000
...
That is done in order to process all labels before the
jump and also to get rid of the jump instruction if the
previous instruction is an "unreachable after". In this
case, re-processing the sequence will remove the now
unreachable jump instruction:
select_val ...
label 2
jump 1000
...
The problem is that re-processing the select_val instruction is
expensive. The instruction has a list of 1000 labels, all of which
will be added (again) to the set of referenced labels. The
select_val instruction will be re-processed again and again
until all labels and jumps have been gobbled up.
In the original version of beam_jump, opt/3 was not called
repeatedly until a fixpoint was found, but was expected to do
all its optimizations in one pass. The fixpoint iteration was
added later.
Since we now have the fixpoint iteration, there is no need
to do everything in a single pass. When we encounter a jump, we will
collect all previously seen labels and put them into the dictionary,
and then we will move on.
As a further optimization, we will look for sequences like this:
jump X
label ...
jump X
and replace them with:
label ...
jump X
In the example above, that will avoid 1000 updates of the dictionary.
After applying this optimization, compilation of the
pattern went from roughly 55 s to 0.1 s for the example
above but with 10000 clauses.
Reported-by: José Valim
|
|
|
|
* ethercrow/export_gen_udp_socket:
Export type gen_udp:socket/0
|
|
* dgud/erlang/pr/116:
observer: Add SASL log view for processes
|
|
Add a new menu to toggle log view.
Disabled by default.
Disabled if rb_server already started on observed node,
in order not to interfere with somebody else.
If enabled, add a tab in process view where log entries
related to pid process are shown.
Need an observed node with at least a version R16B2,
due to the use of newly capability to rb to write into
a file descriptor (on the observing node).
|
|
* ia/ssl/delete-vs-remove:
ssl: remove -> delete
|
|
The beam_validator catches all exceptions and collect them.
It makes more sense to don't catch 'error' and 'exit' exceptions,
but to just print out the name of the current function and pass
on the exception just as all other compilation passes do. Those
kind of exceptions are the symptoms of the kind of severe but
easily catched bugs that occur during development.
|
|
Before the beam_validator was added as compiler pass, it was a
standalone module that could analyse existing .beam files and .S
files.
Even though beam_validator has been part of the compiler for many
releases, it still supports the analysis of .beam and .S files.
To reduce the code bloat and to improve coverage of beam_validator,
remove the file/1 and files/1 functions and all associated help
functions. We'll need to update the test suite, since some of the
checked in .S files have errors that beam_validator ignores, but
that will not be accepted when running them throught the compiler
using the 'from_asm' option. In particular, we will need to export
all functions that should be validated (since the beam_clean pass
will remove any function that is not possible to call).
|
|
|
|
|
|
The assert_strict_literal_termorder/1 function is used to validate the
get_map_elements and has_map_fields instructions. In neither case is
it useful to allow an empty lists of fields, so we should no longer
allow an empty list.
The mmap/2 function is cute, but it is used in only one place, so it
is much simpler to write a special-purpose function to extract the
keys from the list of map pairs.
|
|
The has_map_fields test was not recognized in is_pure_test/1,
because beam_a has rewritten the {list,_} part of instruction.
|
|
|
|
* bjorn/stdlib/string-tokens/OTP-12422:
Optimize string:tokens/2
Modernize and strengthen the test case for string:tokens/2
|
|
We can save some time by reversing the original string
before starting the tokenization.
When there is only one separator, we can save even more time
by treating that case specially so that we don't have to call
lists:member/2 for each character.
|
|
|
|
* richcarl/shell-module-md5-info:
make c:m/1 show module MD5
OTP-12500
|
|
* siri/cuddle-with-tests:
[sasl] Make test unreliable of kernel.appup
|
|
* siri/test-upgrade:
[ct] Improve support for upgrade test of application
|
|
|
|
* stevendanna/eldap-anon-auth-fix:
Correctly process anon_auth option for eldap:open()
|
|
Correct mistake
|
|
|
|
* studzien/ct_cover_paths:
Add tests for absolute incl_dirs path and for excl_dirs
[ct_cover] Fix paths of incl_dirs in cover spec
OTP-12498
|
|
* bjorn/compiler/clean-up/OTP-12497:
cerl: Teach is_literal_term/1 to handle maps
cerl: Add missing is_c_map/1 function
v3_core: Simplify translation of maps
sys_core_fold: Simplify opt_simple_let_2/6
Break out inlining of 'lists' functions to a new module
sys_core_fold: Add is_int_type/2 and is_tuple_type/2
sys_core_fold: Refactor type information access
core_lib: Deprecate functions that are no longer used by the compiler
Eliminate use of core_lib:literal_value/1
Eliminate all uses of core_lib:get_anno/1 and core_lib:set_anno/2
core_lint: Eliminate call to core_lib:is_literal/1
test_lib: Include test_server.hrl using -include_lib
sys_core_fold: Rename add_scope/2 to fit in the sub_* family
v3_core: Suppress compiler-generated calls in guards
v3_core: Remove out-commented code
v3_core: Remove unused function argument for bc_tq()
v3_core: Use Core Erlang annotations in a type-safe way
|
|
|
|
* ia/ssl/soft-upgrade-test:
ssl: Prepare for 18
ssl: Add soft upgrade test suite
|
|
|
|
Complements commit 450773958165539951cd431a9233ce7666ec20e2
|
|
|
|
|
|
* emauton/mnesia_create_table_docfix:
Fix index for #person.address in create_table/2
|
|
|
|
* crownedgrouse/fix_mnesia_subscribe_doc:
Fix xml doc return value mnesia:(un)subscribe
|
|
|
|
|
|
|
|
* origin/hb/dialyzer/fix_map_type/OTP-12472:
[dialyzer] Fix a bug concerning map() types
|
|
|
|
|
|
There is no need to always introduce a new variable to hold a map.
Maps are novars (constructs that don't export variables).
|
|
In cd1eaf0116190, opt_simple_let_2/6 was updated to do the same
optimizations in 'value' and 'effect' context.
Coalesce the clauses for 'value' and 'effect' context to one to
make it clear that they do the same thing.
|
|
The code for inlining high-order functions from the lists module
is quite annoying when you try to navigate the sys_core_fold
module. Break out the code into its own module.
|
|
Those functions allow us to clean up some more code.
|
|
Introduce access functions to hide the low-level details of how
type information is implemented.
|
|
|
|
Essentially, core_lib:literal_value/1 became useless when literals
were introduced in R12. Since we always create #c_literal{} records
whenever possible, literal_value/1 would *only* succeed when it was
passed a #c_literal{} argument.
|