+2014-12-08 David Malcolm <dmalcolm@redhat.com>
+
+ * notes.txt: Show the beginning and ending of
+ recording::context::compile vs playback::context::compile. Show
+ the creation and unlinking of the tempdir. Show toplev::finalize.
+ Move "RELEASE MUTEX" to the correct location. Show
+ gcc_jit_result_release, and indicate where the
+ dlopen/dlsym/dlclose occur.
+
2014-12-01 David Malcolm <dmalcolm@redhat.com>
* docs/examples/tut02-square.c (main): Release the context
│ . . . .
V . . gcc_jit_context_compile .
──────────────────────────> . .
+ . . │ start of recording::context::compile ()
. . │ . .
. . │ ACQUIRE MUTEX .
. . │ . .
+ . . │ start of playback::context::compile ()
+ . . │ (create tempdir) .
+ . . │ . .
. . V───────────────────────> toplev::main (for now)
. . . . │
. . . . (various code)
. . . . (the middle─end and backend)
. . . . ↓
. . <───────────────────────────── end of toplev::main
- . . │ RELEASE MUTEX .
. . │ . .
- . . │ Convert assembler to DSO
+ . . V───────────────────────> toplev::finalize
+ . . . . │ (purge internal state)
+ . . <──────────────────────── end of toplev::finalize
+ . . │ . .
+ . . │ Convert assembler to DSO ("fake.so")
+ . . │ . .
+ . . │ Load DSO (dlopen "fake.so")
. . │ . .
- . . │ Load DSO .
+ . . │ end of playback::context::compile ()
+ . . │ . .
+ . . │ playback::context dtor
+ . . ──> . .
+ . . │ Cleanup tempdir .
+ . . │ ("fake.so" is unlinked from the
+ . . │ filesystem at this point)
+ . . <── . .
+ . . │ . .
+ . . │ RELEASE MUTEX .
+ . . │ . .
+ . . │ end of recording::context::compile ()
<─────────────────────────── . .
│ . . . .
+ V . . gcc_jit_result_get_code .
+ ──────────────────────────> . .
+ . . │ dlsym () within loaded DSO
+ <─────────────────────────── . .
Get (void*). . . .
│ . . . .
│ Call it . . . .
. │ . . .
<─────────────── . . .
│ . . . .
+etc│ . . . .
+ │ . . . .
+ V . . gcc_jit_result_release .
+ ──────────────────────────> . .
+ . . │ dlclose () the loaded DSO
+ . . │ (code becomes uncallable)
+ <─────────────────────────── . .
│ . . . .
-etc