-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
68 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "ll/api/memory/Closure.h" | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
#include <cstring> | ||
|
||
#include "ll/api/base/StdInt.h" | ||
#include "ll/api/memory/Memory.h" | ||
#include "ll/core/LeviLamina.h" | ||
|
||
namespace ll::memory { | ||
extern "C" { // from trampoline | ||
std::size_t generate_trampoline(void* jit_code_address, const void* call_target, int = 0); | ||
void* _asm_get_this_pointer(); | ||
} | ||
void* ClosureBase::getClosureData() { return _asm_get_this_pointer(); } | ||
|
||
ClosureBase::ClosureBase(void const* impl) { | ||
storage.alloc(sizeof(PackedSelf)); | ||
generate_trampoline(new (storage.writable()) PackedSelf{.self = this}, impl); | ||
} | ||
} // namespace ll::memory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters