Skip to content
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

[TASK] Handle calling through function pointers #100

Open
2 of 3 tasks
iamrecursion opened this issue Nov 27, 2024 · 0 comments · May be fixed by #129
Open
2 of 3 tasks

[TASK] Handle calling through function pointers #100

iamrecursion opened this issue Nov 27, 2024 · 0 comments · May be fixed by #129
Labels
enhancement New feature or request

Comments

@iamrecursion
Copy link
Collaborator

iamrecursion commented Nov 27, 2024

Description

Currently both the call and invoke opcodes do not handle the ability to call via a function pointer argument. This is due to the fact that we think it is unlikely to be needed, at least initially. Nevertheless, this is something we want to support, and so both opcodes need to be enhanced to deal with it.

The primary difficulty relates to the memory model, and what it actually means to have a function pointer on our architecture. We need to work out how we get them, and how we then jump to them from the context of FLO.

Spec

  • Work out how function pointers relate to the memory model.
  • Work out how these function pointers are obtained and jumped to.
  • Update the implementations for call and invoke to handle these cases.
@iamrecursion iamrecursion added the enhancement New feature or request label Nov 27, 2024
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
@iamrecursion iamrecursion linked a pull request Jan 15, 2025 that will close this issue
2 tasks
@iamrecursion iamrecursion linked a pull request Jan 15, 2025 that will close this issue
2 tasks
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

Closes #100
iamrecursion added a commit that referenced this issue Jan 15, 2025
Function pointers are now handled according to the memory model
documentation, ensuring that we can generate code that will allow us to
call through opaque function pointers correctly.

Note that this commit only encompasses the compiler-side part of this
work, with more work to be done in the linker to handle generation of
the meta-dispatch functions for each function type.

It also makes some minor changes to the mangler to allow it to handle
reserved names in a more sensible way.

Closes #100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant