@@ -15,13 +15,13 @@ $(H2 Phases of Compilation)
15
15
$(P The process of compiling is divided into multiple phases. Each phase is
16
16
independent of subsequent phases. For example, the scanner is not affected by
17
17
the semantic analyzer. This separation of passes makes language tools like
18
- syntax directed editors relatively easy to create. It is also possible to
18
+ syntax- directed editors relatively easy to create. It is also possible to
19
19
compress D source by storing it in $(SINGLEQUOTE tokenized) form.)
20
20
21
21
$(OL
22
22
$(LI $(B source character set)$(BR)
23
23
24
- The source file is checked to see which encoding it is using,
24
+ The source file is checked to determine its encoding
25
25
and the appropriate scanner is loaded. 7-bit ASCII and UTF
26
26
encodings are accepted.
27
27
)
34
34
35
35
$(LI $(B lexical analysis)$(BR)
36
36
37
- The source file is divided up into a sequence of tokens.
37
+ The source file is divided into a sequence of tokens.
38
38
$(DDSUBLINK spec/lex, specialtokens, Special tokens)
39
39
are replaced with other tokens.
40
40
$(GLINK_LEX SpecialTokenSequence)s
49
49
$(LI $(B semantic analysis)$(BR)
50
50
51
51
The syntax trees are traversed to declare variables, load symbol tables, assign
52
- types, and in general determine the meaning of the program.
52
+ types, and determine the meaning of the program.
53
53
)
54
54
55
55
$(LI $(B optimization)$(BR)
56
56
57
- Optimization is an optional pass that tries to rewrite the program
58
- in a semantically equivalent, but faster executing , version.
57
+ Optimization is an optional pass that attempts to rewrite the program
58
+ in a semantically equivalent, more performant , version.
59
59
)
60
60
61
61
$(LI $(B code generation)$(BR)
62
62
63
63
Instructions are selected from the target architecture to implement
64
64
the semantics of the program. The typical result will be
65
- an object file, suitable for input to a linker.
65
+ an object file suitable for input to a linker.
66
66
)
67
67
)
68
68
69
69
70
70
$(H2 Memory Model)
71
71
72
- $(P A $(I byte) is the fundamental unit of storage. Each byte has 8 bits, and is stored at
72
+ $(P The $(I byte) is the fundamental unit of storage. Each byte has 8 bits and is stored at
73
73
a unique address. A $(I memory location) is a sequence of one or more bytes of the exact size
74
74
required to hold a scalar type. Multiple threads can access separate memory locations
75
75
without interference.
@@ -78,30 +78,31 @@ $(H2 Memory Model)
78
78
$(P Memory locations come in three groups:)
79
79
80
80
$(OL
81
- $(LI $(I Thread local memory locations) are accessible from only one thread at a time.)
81
+ $(LI $(I Thread- local memory locations) are accessible from only one thread at a time.)
82
82
$(LI $(I Immutable memory locations) cannot be written to during their lifetime. Immutable
83
83
memory locations can be read from by multiple threads without synchronization.)
84
84
$(LI $(I Shared memory locations) are accessible from multiple threads.)
85
85
)
86
86
87
- $(UNDEFINED_BEHAVIOR Allowing multiple threads to access a thread local memory
87
+ $(UNDEFINED_BEHAVIOR Allowing multiple threads to access a thread- local memory
88
88
location results in undefined behavior.)
89
89
90
90
$(UNDEFINED_BEHAVIOR Writing to an immutable memory location during its lifetime
91
91
results in undefined behavior.)
92
92
93
- $(UNDEFINED_BEHAVIOR Unless synchronized, writing to a shared memory location in
94
- one thread while other threads read or write to it results in undefined behavior.)
93
+ $(UNDEFINED_BEHAVIOR Writing to a shared memory location in
94
+ one thread while one or more additional threads read from or write to the same location is
95
+ undefined behavior unless all of the reads and writes are synchronized.)
95
96
96
- $(P Execution of a single thread on thread local and immutable memory locations
97
- is $(I sequentially consistent). This means the result of the operations
97
+ $(P Execution of a single thread on thread- local and immutable memory locations
98
+ is $(I sequentially consistent). This means the collective result of the operations
98
99
is the same as if they were executed in the same order that the operations appear in the program.
99
100
)
100
101
101
- $(P A memory location can be transferred from thread local to immutable or shared
102
+ $(P A memory location can be transferred from thread- local to immutable or shared
102
103
if there is only one reference to the location.)
103
104
104
- $(P A memory location can be transferred from shared to immutable or thread local
105
+ $(P A memory location can be transferred from shared to immutable or thread- local
105
106
if there is only one reference to the location.)
106
107
107
108
$(P A memory location can be temporarily transferred from shared to local if
@@ -111,7 +112,7 @@ $(H2 Memory Model)
111
112
112
113
$(H2 Object Model)
113
114
114
- $(P An $(I object) is created when one of the following is executed :
115
+ $(P An $(I object) is created in the following circumstances :
115
116
)
116
117
117
118
$(UL
@@ -122,22 +123,22 @@ $(H2 Object Model)
122
123
)
123
124
124
125
$(P An object spans a sequence of memory locations which may or may not
125
- be contiguous. It exists during construction, its lifetime , and destruction .
126
- Each object has a type, which is determined either statically or by runtime
126
+ be contiguous. Its lifetime encompasses construction, destruction , and the period in between .
127
+ Each object has a type which is determined either statically or by runtime
127
128
type information.
128
- The memory locations may include any combination of thread local, immutable, or
129
- shared memory locations .
129
+ The object's memory locations may include any combination of thread- local, immutable, or
130
+ shared.
130
131
)
131
132
132
- $(P Objects can be composed into a $(I composed object). The objects that make up
133
- the composed object are $(I subobjects). An object that is not the subobject
133
+ $(P Objects can be composed into a $(I composed object). Objects that make up
134
+ a composed object are $(I subobjects). An object that is not the subobject
134
135
of another object is a $(I complete object). The lifetime of a subobject
135
- is always within the lifetime of its complete object.
136
+ is always within the lifetime of the complete object to which it belongs .
136
137
)
137
138
138
139
$(P An object's address is the address of the first byte of the first memory
139
- location for that object. Object addresses are distinct from each other
140
- unless one of the objects is nested within the other.
140
+ location for that object. Object addresses are distinct unless one
141
+ object is nested within the other.
141
142
)
142
143
143
144
$(SPEC_SUBNAV_NEXT lex, Lexical)
0 commit comments