Skip to content

Commit

Permalink
Update Compiler Passes diagram
Browse files Browse the repository at this point in the history
- Removed "scale" option of diita
- Adjusted the diagrams so that it looks better when there are multiple
  boxes
- Fix equal sign rendered by diita, by using arrow symbol instead of
  equal sign
  • Loading branch information
hirotnk authored and happi committed Apr 22, 2020
1 parent 8d9893a commit 639b0f8
Showing 1 changed file with 110 additions and 113 deletions.
223 changes: 110 additions & 113 deletions chapters/compiler.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,119 +61,116 @@ xref:fig_compiler_passes[].

[[fig_compiler_passes]]
.Compiler Passes
[ditaa, scale=0.6]
----
[] = Compiler options, () = files, {} = erlang terms, boxes = passes
(.erl)
|
v
+---------------+
| Scanner |
| (Part of epp) |
+---------------+
|
v
+---------------+
| Pre-processor |
| epp |
+---------------+
|
v
+---------------+ +---------------+
| Parse | -> | user defined |
| Transform | <- | transformation|
+---------------+ +---------------+
|
+---------> (.Pbeam) [makedep]
+---------> {dep} [makedep, binary]
|
+---------> (.pp) [dpp]
+---------> {AST} [dpp, binary]
|
v
+---------------+
| Linter |
| |
+---------------+
|
+---------> (.P) ['P']
+---------> {AST} ['P',binary]
|
v
+---------------+
| Save AST |
| |
+---------------+
|
v
+---------------+
| Expand |
| |
+---------------+
|
+---------> (.E) ['E']
+---------> {.E} ['E', binary]
|
v
+---------------+
| Core |
| Erlang |
+---------------+
|
+---------> (.core) [dcore|to_core0]
+---------> {core} [to_core0,binary]
|
v
+---------------+
| Core |+
| Passes ||+
+---------------+||
+---------------+|
+---------------+
|
+---------> (.core) [to_core]
+---------> {core} [to_core,binary]
|
v
+---------------+
| Kernel |
| Erlang |
+---------------+
|
v
+---------------+
| Kernel |+
| Passes ||+
+---------------+||
+---------------+|
+---------------+
|
v
+---------------+
| BEAM Code |
| |
+---------------+
|
v
+---------------+
| ASM |+
| Passes ||+
+---------------+||
+---------------+|
+---------------+
|
+---------> (.S) ['S']
+---------> {.S} ['S', binary]
|
v
+---------------+
| Native Code |
| |
+---------------+
|
v
(.beam)</pre>
[ditaa]
----
[] ⇒ Compiler options
() ⇒ files
{} ⇒ erlang terms
boxes ⇒ passes
(.erl)
|
v
+---------------+
| Scanner |
| (Part of epp) |
+---------------+
|
v
+---------------+
| Pre processor |
| epp |
+---------------+
|
v
+---------------+ +---------------+
| Parse | --> | user defined |
| Transform | <-- | transformation|
+---------------+ +---------------+
|
+---------> (.Pbeam) [makedep]
+---------> {dep} [makedep, binary]
|
+---------> (.pp) [dpp]
+---------> {AST} [dpp, binary]
|
v
+---------------+
| Linter |
| |
+---------------+
|
+---------> (.P) ['P']
+---------> {AST} ['P',binary]
|
v
+---------------+
| Save AST |
| |
+---------------+
|
v
+---------------+
| Expand |
| |
+---------------+
|
+---------> (.E) ['E']
+---------> {.E} ['E', binary]
|
v
+---------------+
| Core |
| Erlang |
+---------------+
|
+---------> (.core) [dcore|to_core0]
+---------> {core} [to_core0,binary]
|
v
+---------------+ +---------------+ +---------------+
| Core | ... | Core | ... | Core |
| Pass 0 | | Pass 1 | | Pass N |
+---------------+ +---------------+ +---------------+
|
+---------> (.core) [to_core]
+---------> {core} [to_core,binary]
|
v
+---------------+
| Kernel |
| Erlang |
+---------------+
|
v
+---------------+ +---------------+ +---------------+
| Kernal | ... | Kernal | ... | Kernal |
| Pass 0 | | Pass 1 | | Pass N |
+---------------+ +---------------+ +---------------+
|
v
+---------------+
| BEAM Code |
| |
+---------------+
|
v
+---------------+ +---------------+ +---------------+
| ASM | ... | ASM | ... | ASM |
| Pass 0 | | Pass 1 | | Pass N |
+---------------+ +---------------+ +---------------+
|
+---------> (.S) ['S']
+---------> {.S} ['S', binary]
|
v
+---------------+
| Native Code |
| |
+---------------+
|
v
(.beam)
----

If you want to see a complete and up to date list of compiler passes
Expand Down

0 comments on commit 639b0f8

Please sign in to comment.