Skip to content

Commit f0513fa

Browse files
committed
perf chapter: repair tikz figures
1 parent ff61961 commit f0513fa

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

src/Measurement_Observation/Binary_Profiling/linux_perf.rst

+17-15
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ which is a constant that describes the kind of closure, for example, a
3838
which the garbage collector requires to collect :term:`CAF`'s. Lastly, the info
3939
table will hold the :term:`entry code` pointer for the heap object if one exists
4040
[#]_ . For more see :ghcSource:`InfoTables.h
41-
<rts/include/rts/storage/InfoTables.h>` for exact details and other variants.
41+
<rts/include/rts/storage/InfoTables.h>` and :ghcSource:`Closures.h
42+
<rts/include/rts/storage/Storage.h>` for exact details and variants.
4243

4344
Here is a depiction of the heap object layout without |TNTC| enabled. Code is
4445
represented in orange and data in blue. Boxes which have a dashed outline change
@@ -83,14 +84,15 @@ depending on the type of heap object and build:
8384
\draw[->, thick] (ip.south) |- (ecp.north west) node[midway] {};
8485
\draw[->, thick] (ecp.east) |- (ec.west) node[midway] {};
8586

86-
Tables-next-to-code does two things: first it removes the entry code pointer
87-
from the info table and second, it moves the entry code itself to the address
88-
immediately after the info table and sets the info table pointer itself to the
89-
address of the entry code. This setup allows the runtime system to save a
90-
pointer indirection because the info table pointer now points to the entry code.
91-
Thus, when jumping to the entry code, which is a common operation, the runtime
92-
system saves a single indirection, but can still reference the fields of the
93-
info table through a negative memory offset from the info table pointer.
87+
Tables-next-to-code does two things: first it removes the entry code pointer and
88+
places the type specific fields before the ``Closure Type``, and second, it
89+
moves the entry code itself to the address immediately after the info table and
90+
sets the info table pointer to the address of the entry code. This setup allows
91+
the runtime system to save a pointer indirection because the info table pointer
92+
now points to the entry code. Thus, when jumping to the entry code, which is a
93+
common operation, the runtime system saves a single indirection, but can still
94+
reference the fields of the info table through a negative memory offset from
95+
the info table pointer.
9496

9597
Here is a depiction with |TNTC| enabled:
9698

@@ -111,19 +113,19 @@ Here is a depiction with |TNTC| enabled:
111113
(6,2.25)--node[rotate=0, yshift=7mm](header){Object Header} (14,2.25);
112114

113115
\node[below of=ip, draw,rectangle, thick, fill=blue!10,
114-
minimum width=4cm, minimum height=2cm, xshift=5cm, yshift=-3cm] (layout) {Layout};
116+
minimum width=4cm, minimum height=2cm, xshift=5cm, yshift=-5cm] (layout) {Layout};
117+
118+
\node[above of=layout, draw,rectangle, thick, dashed, fill=blue!10,
119+
minimum width=4cm, minimum height=2cm, yshift=1cm] (other) {Type Specific
120+
Fields};
115121

116122
\node[below of=layout, draw,rectangle, thick, fill=blue!10,
117123
minimum width=4cm, minimum height=2cm, yshift=-1cm] (ct) {Closure Type};
118124

119125
\node[below of=ct, draw,rectangle, thick, fill=blue!10,
120126
minimum width=4cm, minimum height=2cm, yshift=-1cm] (srt) {SRT Bitmap};
121127

122-
\node[below of=srt, draw,rectangle, thick, dashed, fill=blue!10,
123-
minimum width=4cm, minimum height=2cm, yshift=-1cm] (other) {Type Specific
124-
Fields};
125-
126-
\node[below of=other, draw,rectangle, thick, fill=orange!20,
128+
\node[below of=srt, draw,rectangle, thick, fill=orange!20,
127129
minimum width=4cm, minimum height=2cm, yshift=-1cm] (ec) {Entry Code};
128130

129131
\draw[->, thick] (ip.south) |- (ec.north west) node[midway] {};

0 commit comments

Comments
 (0)