aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-12-09 18:10:04 +0100
committerAyke van Laethem <[email protected]>2018-12-09 18:47:39 +0100
commit564b1b3312b02a0b664b3cf55320236e1227bd82 (patch)
tree0c5a65583cb8e510244250d4fb026480e6d958ef /docs
parent3fec22e819206f1748a010705304beb8c8b47af4 (diff)
downloadtinygo-564b1b3312b02a0b664b3cf55320236e1227bd82.tar.gz
tinygo-564b1b3312b02a0b664b3cf55320236e1227bd82.zip
compiler: always use fat function pointers with context
This reduces complexity in the compiler without affecting binary sizes too much. Cortex-M0: no changes Linux x64: no changes WebAssembly: some testcases (calls, coroutines, map) are slightly bigger
Diffstat (limited to 'docs')
-rw-r--r--docs/internals.rst13
1 files changed, 5 insertions, 8 deletions
diff --git a/docs/internals.rst b/docs/internals.rst
index a1b3016c2..5cf61d611 100644
--- a/docs/internals.rst
+++ b/docs/internals.rst
@@ -77,14 +77,11 @@ interface
interface.go for a detailed description of how typeasserts and interface
calls are implemented.
-function pointer
- A function pointer has two representations: a literal function pointer and a
- fat function pointer in the form of ``{context, function pointer}``. Which
- representation is chosen depends on the AnalyseFunctionPointers pass in
- `ir/passes.go <https://github.com/aykevl/tinygo/blob/master/ir/passes.go>`_:
- it tries to use a raw function pointer but will use a fat function pointer
- if there is a closure or bound method somewhere in the program with the
- exact same signature.
+function value
+ A function value is a fat function pointer in the form of ``{context,
+ function pointer}`` where context is a pointer which may have any value.
+ The function pointer is expected to be called with the context as the last
+ parameter in all cases.
goroutine
A goroutine is a linked list of `LLVM coroutines