New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Reflection #104
WIP: Reflection #104
Conversation
d5d4fe3
to
1ed3123
Compare
Seems like this branch is possibly complete enough to merge in. It does have its own tests, and it passes the other tests. It needs another update to bring it in line with the current This should also be accompanied with some documentation somewhere about the state of the reflection feature, and what is still missing. @aykevl what do you think? |
Yeah I think this could be merged. I've intentionally kept it so that it can be merged at each point. EDIT: rebased on top of current master. |
This is the beginning of true reflection support in TinyGo.
This makes sure the most commonly used types have the lowest type codes. This was intended to be the case, but apparently I forgot to sort them the right way.
Some instructions emitted by LLVM (like movaps) expect 16-byte alignment, while the allocator assumed that 8-byte alignment is good enough. TODO: this issue came to light with LLVM optimizing a complex128 store to the movaps instruction, which must be aligned. It looks like this means that the <2 x double> IR type is actually 16-byte aligned instead of 8-byte like a double. If this is the case, the alignment of complex numbers needs to be updated in the whole compiler.
This commit makes sure all Go types can be encoded in the interface type code, so that Type.Kind() always returns a proper type kind for any non-nil interface.
d0cb8be
to
81ef4c4
Compare
Now merging into |
HI @aykevl
This branch have been merged, that means we can use more standard libraries now? |
Yes. For example, this was necessary to support the fmt package.
That's indeed on the todo list. It should be autogenerated so it can easily be updated. |
No description provided.