Commit 74092cb
authored
Subroutine calls using the new JAL instruction (#7085)
## Description
This PR contains an initial implementtion of subroutine calls using the
in-progress [jump-and-link instruction
`JAL`](FuelLabs/fuel-specs#630). It
substantially reduces the function call overhead: the old code used 4
instructions per call, while the new version uses 1-3 depending on the
distance to the called function.
### Future optimizations
* Reorder functions, so those that call each other are adjacent
* Use absolute or IS-relative jumps where it makes sense, see
#7267
## Checklist
- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.1 parent 8b75246 commit 74092cb
File tree
42 files changed
+513
-370
lines changed- forc-plugins/forc-client/tests
- forc/tests
- sway-core/src
- asm_generation/fuel
- optimizations
- programs
- asm_lang
- test/src
- e2e_vm_tests/test_programs
- should_fail/language/const_generics
- should_pass
- language
- attributes_deprecated
- configurable_consts
- configurable_dedup_decode
- const_generics
- intrinsics/dbg
- panic_expression
- panic_handling_in_unit_tests
- panicking_contract
- panicking_lib
- panicking_script
- u256/u256_abi
- panic_in_non_statement_positions
- require_contract_deployment
- array_of_structs_caller/src
- asset_ops_test/src
- bal_opcode/src
- call_abi_with_tuples/src
- call_basic_storage/src
- call_contract_with_type_aliases/src
- call_increment_contract/src
- call_storage_enum/src
- caller_auth_test/src
- caller_context_test/src
- nested_struct_args_caller/src
- storage_access_caller/src
- ir_generation/tests
- sdk-harness/test_projects/auth
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
42 files changed
+513
-370
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
| 424 | + | |
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
476 | | - | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
0 commit comments