diff mbox

[04/27] New file: gcc/jit/notes.txt

Message ID 1414774977-25605-5-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Oct. 31, 2014, 5:02 p.m. UTC
An earlier version of this was posted as part of:
      "[PATCH 06/10] Heart of the JIT implementation (was: Re: [PATCH 0/5] Merger of jit branch (v2))"
        https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01247.html

I've broken that up into separate patches for ease of review.

This first patch within gcc/jit adds a high-level overview
diagram of how the JIT library works.

gcc/jit/
	* notes.txt: New.
---
 gcc/jit/notes.txt | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 84 insertions(+)
 create mode 100644 gcc/jit/notes.txt

Comments

Jeff Law Oct. 31, 2014, 9:18 p.m. UTC | #1
On 10/31/14 11:02, David Malcolm wrote:
> An earlier version of this was posted as part of:
>        "[PATCH 06/10] Heart of the JIT implementation (was: Re: [PATCH 0/5] Merger of jit branch (v2))"
>          https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01247.html
>
> I've broken that up into separate patches for ease of review.
>
> This first patch within gcc/jit adds a high-level overview
> diagram of how the JIT library works.
>
> gcc/jit/
> 	* notes.txt: New.
OK.
jeff
diff mbox

Patch

diff --git a/gcc/jit/notes.txt b/gcc/jit/notes.txt
new file mode 100644
index 0000000..d337cb4
--- /dev/null
+++ b/gcc/jit/notes.txt
@@ -0,0 +1,84 @@ 
+Client Code   . Generated .            libgccjit.so
+              . code      .
+              .           . JIT API  . JIT "Frontend". (libbackend.a)
+....................................................................................
+   │          .           .          .               .
+    ──────────────────────────>      .               .
+              .           .    │     .               .
+              .           .    V     .               .
+              .           .    ──> libgccjit.c       .
+              .           .        │ (error-checking).
+              .           .        │                 .
+              .           .        ──> jit-recording.c
+              .           .              (record API calls)
+              .           .    <───────              .
+              .           .    │     .               .
+   <───────────────────────────      .               .
+   │          .           .          .               .
+   │          .           .          .               .
+   V          .           .  gcc_jit_context_compile .
+    ──────────────────────────>      .               .
+              .           .    │     .               .
+              .           .    │ ACQUIRE MUTEX       .
+              .           .    │     .               .
+              .           .    V───────────────────────> toplev::main (for now)
+              .           .          .               .       │
+              .           .          .               .   (various code)
+              .           .          .               .       │
+              .           .          .               .       V
+              .           .          .    <───────────────── langhook:parse_file
+              .           .          .    │          .
+              .           .          .    │ (jit_langhook_parse_file)
+              .           .          .    │          .
+..........................................│..................VVVVVVVVVVVVV...
+              .           .          .    │          .       No GC in here
+              .           .          .    │ jit-playback.c
+              .           .          .    │   (playback of API calls)
+              .           .          .    ───────────────> creation of functions,
+              .           .          .               .     types, expression trees
+              .           .          .    <──────────────── etc
+              .           .          .    │(handle_locations: add locations to
+              .           .          .    │ linemap and associate them with trees)
+              .           .          .    │          .
+              .           .          .    │          .       No GC in here
+..........................................│..................AAAAAAAAAAAAA...
+              .           .          .    │ for each function
+              .           .          .    ──> postprocess
+              .           .          .        │      .
+              .           .          .        ────────────> cgraph_finalize_function
+              .           .          .        <────────────
+              .           .          .     <──       .
+              .           .          .    │          .
+              .           .          .    ──────────────────> (end of
+              .           .          .               .       │ langhook_parse_file)
+              .           .          .               .       │
+              .           .          .               .   (various code)
+              .           .          .               .       │
+              .           .          .               .       ↓
+              .           .          .    <───────────────── langhook:write_globals
+              .           .          .    │          .
+              .           .          .    │ (jit_langhook_write_globals)
+              .           .          .    │          .
+              .           .          .    │          .
+              .           .          .    ──────────────────> finalize_compilation_unit
+              .           .          .               .       │
+              .           .          .               .   (the middle─end and backend)
+              .           .          .               .       ↓
+              .           .    <───────────────────────────── end of toplev::main
+              .           .    │ RELEASE MUTEX       .
+              .           .    │     .               .
+              .           .    │ Convert assembler to DSO
+              .           .    │     .               .
+              .           .    │ Load DSO            .
+   <───────────────────────────      .               .
+   │          .           .          .               .
+   Get (void*).           .          .               .
+   │          .           .          .               .
+   │ Call it  .           .          .               .
+   ───────────────>       .          .               .
+              .    │      .          .               .
+              .    │      .          .               .
+   <───────────────       .          .               .
+   │          .           .          .               .
+   │          .           .          .               .
+etc