Age | Commit message (Collapse) | Author |
|
The actual bs_match_string instruction has four operands:
bs_match_string {f,Lbl} Ctxt NumBits {string,ListOfBytes}
However, v3_codegen emits a more compact representation where
the bits to match are packaged in a bitstring:
bs_match_string {f,Lbl} Ctxt Bitstring
Currently, beam_clean:clean_labels/1 will rewrite the compact
representation to the final representation. That is unfortunate
since clean_labels/1 is called by beam_dead, which means that
the less compact representation will be introduced long before
it is actually needed by beam_asm. It will also complicate any
optimizations that we might want to do.
Move the rewriting of bs_match_string from beam_clean:clean_labels/1
to the beam_z pass, which is the last pass executed before
beam_validator and beam_asm.
|
|
Commit b76588fb5a introduced an optimization of the compile time of
huge functions with many bs_match_string instructions. The
optimization is done in two passes. The first pass coalesces adjacent
bs_match_string instructions. To avoid copying bitstrings multiple
times, the bitstrings in the instructions are combined in to a (deep)
list. The second pass goes through all instructions in the function
and combines the list of bitstrings to a single bitstring in all
bs_match_string instructions.
The second pass (fix_bs_match_string) is run on all instructions in
each function, even if there are no bs_match_instructions in the
function. While fix_bs_match_string is not a bottleneck (it is a
linear pass), its execution time is noticeable when profiling some
modules.
Move the execution of the second pass to the select_binary()
function so that it will only be executed for instructions that
do binary matching. Also take the opportunity to optimize away
uses of bs_restore2 that occour directly after a bs_save2. That
optimimization is currently done in beam_block, but it can be
done essentially for free in the same pass that fixes up
bs_match_string instructions.
|
|
Profiling shows that the execution time for "turning" y registers
is noticeable for some modules (e.g. S1AP-PDU-Contents from the
asn1 test suite). We can reduce the impact on running time by
special-casing important instructions. In particular, there is
no need to look for y registers in the list argument for a
select_val instruction.
|
|
Profiling shows that subst_vsub/3 dominates the running time. It
is therefore worthwhile optimizing it.
|
|
As a minor optimization, eliminate unnecessary cons operations
in store/3, append/3, append_list/3, update/4, and update_counter/3.
|
|
To run eprof for a compiler pass:
erlc +'{eprof,beam_asm}' file.erl
The name of the compiler pass is the name as printed when
'time' option is used. It is usually, but not always, the module
name for the compiler pass.
|
|
Several compiler passes have unnecessary wrapper functions that
can be easily eliminated.
|
|
If we want to have test cases that run eprof, we must make sure that
there are no modules loaded that don't have a working module_info/1
function, since eprof calls module_info(functions) to retrieve the
list of functions in the module. Some test cases load modules compiled
from Core Erlang that don't have any module_info/1 functions, so
we will need make sure that all such modules have been unloaded.
Add z_SUITE:loaded/1 to run after all other test cases to verify that
all modules that the code server consider loaded are indeed loaded and
all have working module_info/0,1 functions.
|
|
For tidiness, always place .core files in data directories.
|
|
The .core or .S files that are compiled in the test cases
may lack module_info/0,1 functions, which will cause problems if
we (for example) try to run eprof later. To avoid that problem,
unload each module directly after testing it.
|
|
* hb/hipe/opaque_bugfix/OTP-12666:
hipe: Fix a bug in the handling of opaque types
|
|
* ia/pr/678/OTP-1267:
Revert "Add workaround for problems with s_client defaults"
ssl: Add unit test case
ssl: Ignore signature_algorithm (TLS 1.2 extension) sent to TLS 1.0/1 server
|
|
This reverts commit a3cf4eb4cdd2ce178d81b62faa9f47485fd82331.
This workaround is no longer needed as the, TLS-1.2 extension,
signature_algorithm is now correctly ignored by previous TLS versions.
|
|
* sverk/etp-map:
erts: Add map support to gdb etp command
erts: Add etp_the_non_value
|
|
An opaque type ?opaque(_) was put in a list where #opaque{} was
expected.
|
|
* mikpe/configure-linux-spelling:
erts/configure.in: handle more 'linux' spellings
|
|
* vinoski/minor-erlang-el-fixes:
Minor fixes to emacs erlang-mode
|
|
* zandra/fix-ssl-obsolete-arity:
add arity to obsolete_1(ssl, negotiated_next_protocol, 1)
|
|
* egil/fix-halfword-cmp:
erts: Fix halfword compare
|
|
|
|
|
|
When the Server header has empty info (or 'none' in config), it is not generated. This is for limiting Banner Grabbing attempts.
|
|
For limiting Banner Grabbing attempts.
|
|
|
|
The 'time' option currently uses statistics(runtime) to measure
execution times. Typically, statistics(runtime) only returns
result with two significant figures.
Use the new erlang:monotonic_time/0 function to get three
significant figures.
|
|
|
|
|
|
By using environment variable HEART_KILL_SIGNAL, heart can now use
a different signal to kill the old running Erlang.
By default the signal is SIGKILL but SIGABRT may also be used by
setting environment variable: HEART_KILL_SIGNAL=SIGABRT
|
|
Don't unload modules using BIFs; use the code server to ensure
that code:all_loaded/0 only lists code that is actually loaded.
|
|
* wmalik/slave-specs:
Remove unused comments
Fix Host and Name type in slave.erl
|
|
A warning for an unmatched return was introduced in aaa7c917.
The caller of openzip_close/1 ignores the return value, which
could be an error tuple. In this situation, handling a fatal
error, it is OK to ignore the return value; thus, we only need
to make it explicit that we are ignoring the return value.
|
|
pre TLS 1.2 server should ignore the signature_algorithms extension.
The server code would attempt to select the signature/hash algorithm
even when using TLS 1.0 or 1.1. Instead it should simply use the default
algorithm on those versions.
|
|
The configuration code which canonicalizes the operating system
name into OPSYS requires Linux to be spelled 'linux' or 'Linux'.
This is a problem in some build environments, e.g. RPM, which
supply --build and --host using the longer 'linux-gnu' spelling.
The effect is that OPSYS becomes 'noopsys' and some checks in
erts/configure.in do not work as expected, e.g. the auto-enabling
of HiPE may not happen.
Fixed by matching on 'linux*' not just 'linux'.
On ARM there are even longer variants such as 'linux-gnueabi' and
'linux-gnueabihf': these are also correctly mapped to 'linux' now.
|
|
Fix "Unbalanced parentheses" error when indenting particular map
constructs. Add new test cases for this fix.
To prevent infinite looping when the programmer mistakenly enters
incorrect syntax, detect cases where erlang-partial-parse fails to
advance when called within a loop, and raise an "Illegal syntax"
error.
|
|
|
|
* ia/public_key/bitstring/OTP-12110:
ssl: Adjust to public_key application removing legacy compact_bit_string switch
public_key: Update vsn for OTP 18
public_key: Reject bad signatures as early as possible
public_key: Remove legacy switch compact_bit_string
|
|
|
|
|
|
Erlang bitstring type only uses as many bits as required, and
does not use padding to create complete bytes as ASN1 compact_bitstring
did. crypto:verify/5 will now fail, for some incorrect signatures
as it expects complete bytes which an incorrect signature may not have.
Instead of catching the failing crypto function and then returning
false we check the input and reject it right away.
|
|
* E.I bitstrings will not be decode as {Unused, Binary}, they are now
Erlang bitstrings.
* Also the compact_bit_string implies the legacy_erlang_types switch
- So removing the switch will also make OCTET STRING values be represented
as binaries.
- Undecoded open type will now be wrapped in a asn1_OPENTYPE tuple.
We need to handle this in pubkey_pbe.erl, maybe this can be eliminated
later by updating/refreshing ASN1-specs.
This will change some values in records returned by the public_key API
making this change a potentiall incompatibility.
|
|
* egil/cmp-immediate-optimization/OTP-12663:
erts: Optimize comparison operator for frequent immediates
|
|
* egil/fix-icount:
erts: Assume counting opcodes are correctly generated
erts: Remove instruction_count command option
|
|
* ia/ssl/inet-dep:
ssl: Add runtime depenency due to commit 4e0a5e36b38e3f15ed8f7d700d26f2424a47111c
|
|
* Assertion is only removed because we are in icount mode.
|
|
* We use compile directive icount instead
|
|
* egil/fix-percept/OTP-12662:
percept: Fix http server config
|
|
* egil/maps-refactor:
erts: Use make_small for size terms on flat maps
Conflicts:
erts/emulator/beam/erl_bif_guard.c
|
|
|
|
* bjorn/maps:
Document the new {badmap,Term} and {badkey,Key} exceptions
Raise more descriptive error messages for failed map operations
erl_term.h: Add is_not_map() macro
Tigthen code for the i_get_map_elements/3 instruction
Pre-compute hash values for the general get_map_elements instruction
Teach the loader to pre-compute the hash value for single-key lookups
Optimize use of i_get_map_element/4
beam_emu: Slightly optimize update_map_{assoc,exact}
v3_codegen: Don't sort map keys in map creation/update
beam_validator: No longer require strict literal term order
Sort maps keys in the loader
De-optimize the has_map_fields instructions
erts/map_SUITE.erl: Add a test case that tests has_map_fields
Fully evaluate is_map/1 for literals at load-time
map_SUITE: Add tests of is_map/1 with literal maps
Run a clone of map_SUITE without optimizations
Remove the fail label operand of the new_map instruction
Correct transformation of put_map_assoc to new_map
Remove support for put_map_exact without a source map
|
|
4e0a5e36b38e3f15ed8f7d700d26f2424a47111c
|