138 Commits

Author SHA1 Message Date
Gaith Hallak
335d91b48a Add DBG_CALL and DBG_RETURN 2023-06-09 13:30:25 +03:00
Gaith Hallak
45b0df8aff Add dbg_loc in to_scode 2023-06-09 13:30:25 +03:00
Gaith Hallak
7e8db136b2 Remove dbg_loc before closure 2023-06-09 13:30:25 +03:00
Gaith Hallak
c6fbaaaf75 Split complicated code and add comment 2023-06-09 13:30:25 +03:00
Gaith Hallak
ef2bec69af Make debug ops impure 2023-06-09 13:30:25 +03:00
Gaith Hallak
a91ff6adbd List only needed attributes 2023-06-09 13:30:25 +03:00
Gaith Hallak
095d0f0d0a Use get_value/3 to handle default 2023-06-09 13:30:25 +03:00
Gaith Hallak
ed3e62b40a Remove the variable-register map from debug output 2023-06-09 13:30:25 +03:00
Gaith Hallak
864189ee5e Add DBG_LOC op to step at function sig 2023-06-09 13:24:07 +03:00
Gaith Hallak
9dc7ed3d97 Keep a single DBG_LOC instruction per line 2023-06-09 13:24:07 +03:00
Gaith Hallak
ef10b39fa6 Add missing dbg_loc in to_scode1 2023-06-09 13:24:07 +03:00
Gaith Hallak
90666d3f33 Remove column from DBG_LOC 2023-06-09 13:24:07 +03:00
Gaith Hallak
81da836b66 Rename DBGLOC to DBG_LOC 2023-06-09 13:24:07 +03:00
Gaith Hallak
c1bf063093 Fix dbg_undef for args 2023-06-09 13:24:07 +03:00
Gaith Hallak
6b7bc06c38 Do not use DBG_DEF and DBG_UNDEF on args 2023-06-09 13:24:07 +03:00
Gaith Hallak
04aed6670a Do not DBG_DEF vars with % prefix 2023-06-09 13:24:07 +03:00
Gaith Hallak
9619bb6071 Add DBG_DEF and DBG_UNDEF 2023-06-09 13:24:07 +03:00
Gaith Hallak
3ed7e36d29 Wrap args of DBGLOC in immediate tuple 2023-06-09 13:24:07 +03:00
Gaith Hallak
34d363f166 Return an empty string instead of no_file atom 2023-06-09 13:24:07 +03:00
Gaith Hallak
141eea74fd Include DBGLOC instructions in the compiler output 2023-06-09 13:24:07 +03:00
Gaith Hallak
793a6829f6 Save debug locations for child contracts 2023-06-09 13:23:36 +03:00
Gaith Hallak
a752fa5b48 Remove fann() from fsplit_pat() and fpat() 2023-06-09 13:23:36 +03:00
Gaith Hallak
9ddd29d63a Fix dialyzer warning 2023-06-09 13:23:36 +03:00
Gaith Hallak
eb16d2f77b Add file to fann() 2023-06-09 13:23:36 +03:00
Gaith Hallak
db3f63529d Change attributes for DBGLOC instruction 2023-06-09 13:23:36 +03:00
Gaith Hallak
354e49c5d3 Add line to fann() 2023-06-09 13:23:36 +03:00
Gaith Hallak
694646fa3d Fix compiler tests 2023-06-09 13:18:42 +03:00
Gaith Hallak
363a550402 Add instructions lines to the debugging result 2023-06-09 13:18:42 +03:00
Gaith Hallak
f0d6031fd5 Add dbgloc instruction to fate 2023-06-09 13:17:04 +03:00
Gaith Hallak
09638daa90
Return mapping from variables to registers in fate compilation (#411)
* Return mapping from variables to registers

* Fix dialyzer issues

* Record real names

* Report saved fresh names as part of fcode env

* Undo whitespace changes

* Fix dialyzer warnings

* Formatting fix

* Use function names as strings

* Manually handle making function names

* Update CHANGELOG

* Make variables registers optional

* Update docs about the new flag

* Remove empty saved_fresh_names map from fcode env
2022-10-25 09:42:02 +03:00
Radosław Rowicki
34b52739fd
Include all functions in the symbols map (#418)
* Include all functions in the symbols map

* .

* remove improper wording

* Use update_symbols exported from aebytecode

* Extract adding child symbols into a separate fun

* Make child contracts symbols optional

* Document include_child_contract_symbols option

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>
2022-10-07 15:57:37 +03:00
Gaith Hallak
1c83287d45
Add separate flags for each scode optimization (#410)
* Add separate flags for each scode optimization

* Add a list of available optimizations to docs

* Update CONTRIBUTING.md

* Update docs/aeso_compiler.md

Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>

* Prefix rules functions with optimize_ instead of r_

Co-authored-by: Radosław Rowicki <35342116+radrow@users.noreply.github.com>
2022-10-07 12:09:53 +03:00
Gaith Hallak
c1c169273c
Add options to enable/disable certain optimizations (#409)
* Add flags to enable/disable specific optimizations

* Fix typos

* Enable/disable scode optimization

* Update CHANGELOG.md

* Remove optimize_all option
2022-08-30 10:14:46 +03:00
Gaith Hallak
381a7c98cd
Handle all user generated code errors in the type checker (#394)
* Move the missing_definition error to the type checker

* Move the parameterised_event and parameterised_state errors to the type checker

* Remove check_state_and_event_types from ast_to_fcode

* Move missing_init_function to the type checker

* Remove the code error last_declaration_must_be_main_contract

* Expand the tests for missing init function

* Remove found_void error

* Move the higher order entrypoint error to type checker

* Move invalid_aens_resolve_type error to type checker

* Add more tests for AENS.resolve

* Add test for AENS.resolve with using

* Move invalid_oracle_type error to type checker

* Move old code errors tests to compilable_contracts

* Remove the file aeso_code_errors.erl

* Add comment about state type
2022-07-25 19:48:46 +04:00
Radosław Rowicki
4bec4e5107
Added support for EXIT op (#397)
* EXIT op

* changelog

* docs

* Update CHANGELOG.md
2022-07-08 15:56:29 +02:00
Gaith Hallak
b474bb22cd
Implement caching for compiled child contracts (#363) 2022-01-11 16:50:59 +04:00
Radosław Rowicki
e8b32a6875
Call.fee (#313)
* Call.fee

* nice align
2021-05-24 14:30:57 +02:00
Radosław Rowicki
1d9f59fec3
Contract factories and bytecode introspection (#305)
* Support for CREATE, CLONE and BYTECODE_HASH

* Add missing files

* Pushed the clone example through the typechecker

* CLONE compiles

* Fix dependent type in CLONE

* Bytecode hash fixes

* Refactor

* Refactor 2

* move some logic away

* Fixed some error messages. Type inference of child contract still does some random shit\n(mistakes arguments with result type)

* CREATE sometimes compiles and sometimes not

* Fix some scoping/constraint issues

* works, needs cleanup

* cleanup

* Fix some tests. Remove optimization of singleton tuples

* Fix default argument for clone

* Cleanup

* CHANGELOG

* Mention void type

* Address review, fix some dialyzer errors

* Please dialyzer

* Fix failing tests

* Write negative tests

* Docs

* TOC

* missing 'the'

* missing 'the'

* missing 'the'

* missing 'the'

* mention pre-fund

* format

* pre-fund clarification

* format

* Grammar in docs
2021-05-18 12:21:57 +02:00
Ulf Norell
fe2d93ea8a Compile protected calls to CALL_PGR 2020-03-02 11:35:55 +01:00
Hans Svensson
a38a365181 Change Char.to_lower/upper into String.to_lower/upper 2020-02-26 14:15:49 +01:00
Hans Svensson
b9acf24dca Make String.aes a stdlib + add more string functions
This means moving the FATE operations to StringInternal and adding to/from_list (and Char.to/from_int
+ Char.to_upper/lower).
2020-02-21 09:45:11 +01:00
Hans Svensson
bbc8555331 Auth.tx implementation and types
The arities field of the Chain.base_tx constructor is 22 integers long... This isn't very pretty but
that is the design we've chosen.
2020-02-11 10:00:46 +01:00
Hans Svensson
c3426f0e65 Add AENS.lookup
Also move Pointee-constructors inside AENS namespace.
2020-02-03 12:52:00 +01:00
Hans Svensson
db01e237c1 Add Oracle.expiry 2020-02-03 12:24:27 +01:00
Hans Svensson
760d2841d1 From Iris (with AENS.update) AENS.resolve is not Pure 2020-02-03 12:22:34 +01:00
Hans Svensson
cf1072140e Merge 'origin/lima' into merge_lima_to_master 2019-12-19 15:09:48 +01:00
Ulf Norell
d019e44924 Compile values to immediates when possible 2019-12-16 17:04:49 +01:00
Ulf Norell
954af13f59 Fix debug printing of store registers 2019-12-12 09:14:34 +01:00
Ulf Norell
a403a9d227 Unbox singleton tuples and records 2019-12-10 12:24:05 +01:00
Hans Svensson
1c24a700dc Add BLS12-381 operations (to FATE) 2019-11-27 10:57:24 +01:00