Skip to content

Instantly share code, notes, and snippets.

@vtjnash
Created February 10, 2015 00:47
Show Gist options
  • Save vtjnash/019b4d5d63b64a772a31 to your computer and use it in GitHub Desktop.
Save vtjnash/019b4d5d63b64a772a31 to your computer and use it in GitHub Desktop.
cfunction lambdas

cfunction lambda can be created in the following fashion:

  • create a wrapper cfunction cache that is specialized on the exact function type signature, but reserve one register in that function
  • have this function call as jl_apply_generic(%R9, args, nargs)
  • return a stub function, manually created, that does a movq $fptr %R9; movq $lambda, %RAX; jmp %RAX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment