aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1
AgeCommit message (Collapse)Author
2013-05-31Eliminate general use of #typereference{}Björn Gustavsson
The record #typereference{} is only used internally within the asn1ct_parser2 module (the parser translates it to an #'Externaltypereference{} record).
2013-05-31PER/UPER: Share all code except encoding of primitivesBjörn Gustavsson
The only code that is really different between the PER and UPER backends is encoding of primitive types.
2013-05-31Eliminate duplicated code in gen_inlined_{dec,enc}_funs()Björn Gustavsson
2013-05-31Remove unused function pgen/4 in all backendsBjörn Gustavsson
2013-05-31UPER: Fix bug in encoding/decoding of default typesBjörn Gustavsson
The wrong backend was used.
2013-05-31testInfObj: Introduce roundtrip/3 to simplify the test suiteBjörn Gustavsson
2013-05-31Remove unnecessary code duplication in gen_objset_{dec,enc}()Björn Gustavsson
2013-05-31asn1ct_constructed_per: Optimize decoding of OPTIONALBjörn Gustavsson
2013-05-31asn1ct_constructed_per: Break out part of gen_dec_comp_call()Björn Gustavsson
Improve readability and maintainability.
2013-05-31asn1_constructed_per: Optimize decoding of CHOICEBjörn Gustavsson
Optimize the decoding of CHOICE. Most important is to inline decoding of the extension bit (if present) and decoding of the choice index to give the BEAM compiler more opportunities for optimization. We will also change the structure of the generated code. The current code uses a flattened case for both the root and extension alternatives: case Choice + NumRootChoices * Ext of %% Root alternatives. 0 - ...; : LastRootAlternative -> ...; %% Extension alternatives. LastRootAlternative+1 -> ...; : %% Unknown extension. _ -> ...; end We will instead generate nested cases: case Ext of 0 -> case Choice of %% Root alternatives. 0 - ...; : LastRootAlternative -> ... end; 1 -> %% Extension alternatives. <Decode the open type here> case Choice of 0 -> ...; : LastExtensionAlternative -> ...; %% Unknown extension. _ -> ...; end end Nested cases should be slightly faster. For decoding of the extensions, it also makes it possible to hoist the decoding of the open type up from each case to before the case switching on the extension index, thus reducing the size of the generated code. We will also do another change to the structure. Currently, the big flat clase is wrapped in code that repackages the return values: {Alt,{Value,RemainingEncodedData}} = case Choice + NumRootChoices * Ext of : end, {{Value,Alt},RemainingEncodedData}. We still need to do the repackaging, but we can push it down to the case arm for decoding each alternative. In many cases, that will give the BEAM compiler the opportunity to avoid building the temporary tuples.
2013-05-31Refactor decoding of items in SEQUENCEs and CHOICEsBjörn Gustavsson
We will need more explicit control of decoding of open types for CHOICEs, so refactor the gen_dec_line() and gen_dec_line_imm() to break out the decoding of the open types. Note that gen_dec_line_special() will not generate correct code if Ext =/= noext; thus, we can eliminate the Ext parameter.
2013-05-31asn1ct_constructed_per: Refactor gen_dec_choice2()Björn Gustavsson
gen_dec_choice2() is unnecessarily complicated. Code is duplicated merely to avoid outputting a ";" separator after the last item, and there is code to skip extensionmarks that are never actually present. While at it, eliminate the the wrap_gen_dec_line() function which is not needed. It puts a {component_type,C} key in the process dictionary, but that is actually never used. Besides that, it only shuffles the argument.
2013-05-31asn1_constructed_per: Refactor gen_enc_choice2()Björn Gustavsson
gen_enc_choice2() duplicates code merely to avoid outputting a ";" separator after the last item.
2013-05-31Don't call asn1ct_name:clear/0 directly after asn1ct_name:start/0Björn Gustavsson
Ensure that asn1ct_name:start/0 will call asn1ct_name:clear/0 if the name server process is already running so that we can be sure that the variables are cleared.
2013-05-31asn1ct_name: Remove broken active/1Björn Gustavsson
active/1 always returned 'true' (curr(Var) can never return 'nil', except if Var =:= 'nil'). Therefore, we can eliminate its use and remove it.
2013-05-31asnct1_name: Optimize clean/1Björn Gustavsson
clean/1 is used quite lot; while not a bottleneck it does seem unnecessary to stop and start the name server just to clear the variables. Since the change to clean/1 makes stop/1 unused, we can remove it.
2013-05-31asn1ct_name: Make new/1 asynchronousBjörn Gustavsson
Since new/1 does not return any useful value and cannot fail, there is no reason to wait for a response from the name server process.
2013-05-31asn1ct_name: Use a monitor instead of an arbitrary timeoutBjörn Gustavsson
2013-05-31asn1ct_name: Simplify the data structures of the name server processBjörn Gustavsson
Since we no longer need to support push/1 and pop/1, we can simplify the data structures used for keeping track of the variables. Each entry in the list can be simply {Var,integer()} instead of {Var,[integer()]}. While at it, eliminate calls to the obsolete lists:keysearch/3 function, don't use integer_to_list/0 within a call to lists:concat/1, and the catch all clause in get_prev/2 and get_next/2.
2013-05-31asn1ct_name: Remove unused functionsBjörn Gustavsson
asn1ct_name:delete/1 is used from asn1ct_gen_ber_bin_v2:add_removed_bytes/1, but that function is not used.
2013-04-27Fix some Makefile rules that didn't support silent rulesAnthony Ramine
2013-04-18Merge branch 'maint-r16' into maintBjörn Gustavsson
* maint-r16: Prepare release Prepare release Do not count offline run-queues as empty Prepare release Prevent loss of objects after the extension marker Don't lose the extension mark for object set parameters Conflicts: erts/vsn.mk
2013-04-18Prepare releaseErlang/OTP
2013-04-16Merge branch 'bjorn/asn1/fix-lost-extension-mark/OTP-10995' into maint-r16Erlang/OTP
* bjorn/asn1/fix-lost-extension-mark/OTP-10995: Prevent loss of objects after the extension marker Don't lose the extension mark for object set parameters
2013-04-08Remove unused Postscript filesHans Bolinder
2013-04-03Prevent loss of objects after the extension markerBjörn Gustavsson
In an object set with a single root object, objects after the extension marker would be lost.
2013-04-03Don't lose the extension mark for object set parametersBjörn Gustavsson
When an object set is an actual parameter, the extension marker for the object set could get lost.
2013-03-15Eliminate latin1 encoded charactersBjörn Gustavsson
Characters encoded in latin1 (with no encoding comment) will not work in R17 since the default encoding will be UTF-8. The asn1 test suite contains two instances of comments written in Swedish. The comment in the .asn1config file is hard to understand and possibly out-of-date. Since the comment is not essential, simply delete it. Translate the comment in the other file to English.
2013-03-13Prepare releaseErlang/OTP
2013-03-12PER: Ensure that the complete encoding is at least one byteBjörn Gustavsson
If the encoding is empty (i.e. if a top-level type is single-valued and therefore not encoding), the result should be a single zero byte.
2013-03-08PER/UPER: Correct decoding of ENUMERATEDs with a single valueBjörn Gustavsson
An ENUMERATED with as single value is not encoded. The decoder incorrectly assumed that it was encoded in one bit.
2013-02-25Prepare releaseOTP_R16BErlang/OTP
2013-02-22Update copyright yearsBjörn-Egil Dahlberg
2013-02-18Remove unused test casesBjörn Gustavsson
2013-02-18Run more tests with all backendsBjörn Gustavsson
Some tests are are only run with BER backend. Unless there is a special reason that the PER and UPER backends will not work, we should run all tests with all backends to get the best possible code coverage.
2013-02-18asn1_SUITE: Remove unused codeBjörn Gustavsson
2013-02-16asn1ct: Eliminate use of obsolete size/1Björn Gustavsson
Also teach otp_SUITE:call_to_size/1 that calls to size/1 is no longer allowed within the asn1 application.
2013-02-16Eliminate use of obsolete size/1 in generated codeBjörn Gustavsson
It is recommended to use byte_size/1 or tuple_size/1 instead of size/1.
2013-02-15BER: Fix broken table constraints inside a SET OF/SEQUENCE OFBjörn Gustavsson
2013-02-14Smoke test the 'der' optionBjörn Gustavsson
2013-02-14der: Correct code generation for checking of empty setsBjörn Gustavsson
The ASN.1 compiler would generate an Erlang module with incorrect syntax for: T DEFINITIONS AUTOMATIC TAGS ::= BEGIN Empty ::= SET { } S ::= SEQUENCE { e Empty DEFAULT {} } END
2013-02-14per,uper: Fix breakage of compilation of InformationFrameworkBjörn Gustavsson
Commit f16f43446a04c459486356c0b4ad517cc9201895 broke compilation of InformationFramework for per and uper.
2013-02-14Add NullTestBjörn Gustavsson
Was broken in some backends in R15. Make sure that we will notice if it breaks again.
2013-02-14asn1_SUITE: Shorten the path to case-specific directoryBjörn Gustavsson
On Windows, there is a limit to the number of characters in a filename. Therefore, we don't want unnecessarily use any longer path than necessary for case-specific directory. Since all test cases that put anything into priv_dir is asn1_SUITE, it is not necessary to include "asn1_SUITE" as part of the case-specific directory.
2013-02-14asn1_SUITE: Don't add priv_dir to the code pathBjörn Gustavsson
All generated and compiled code are now put into separate sub directories below priv_dir, so there is no point in adding priv_dir to the code path.
2013-02-14asn1 tests: Remove obsolete duplicates of ASN.1 specsBjörn Gustavsson
2013-02-07Merge branch 'maint'Björn Gustavsson
* maint: Prepare release Don't run testX420/1 on old slow Sparc systems testX420: Pass Options to the ASN.1 compiler asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1 Revert "Prepare release" Conflicts: lib/asn1/doc/src/notes.xml lib/asn1/test/asn1_SUITE.erl
2013-02-07Merge branch 'maint-r15' into maintBjörn Gustavsson
* maint-r15: Prepare release Don't run testX420/1 on old slow Sparc systems testX420: Pass Options to the ASN.1 compiler asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1 Fix a bug for multiple extension addition groups
2013-02-06Prepare releaseErlang/OTP
2013-02-06Merge branch 'bjorn/asn1/open-type-error/OTP-10805' into maint-r15Erlang/OTP
* bjorn/asn1/open-type-error/OTP-10805: asn1_erl_nif: Correct broken length encoding asn1_SUITE: Mend broken test_modified_x420/1