@@ -142,70 +142,70 @@ inline ti_types JITtype2tiType(CorInfoType type)
142
142
return g_ti_types_map[type];
143
143
};
144
144
145
- /* ****************************************************************************
146
- * Declares the typeInfo class, which represents the type of an entity on the
147
- * stack, in a local variable or an argument.
148
- *
149
- * Flags: LLLLLLLLLLLLLLLLffffffffffTTTTTT
150
- *
151
- * L = local var # or instance field #
152
- * x = unused
153
- * f = flags
154
- * T = type
155
- *
156
- * The lower bits are used to store the type component, and may be one of:
157
- *
158
- * TI_* (primitive) - see tyelist.h for enumeration (BYTE, SHORT, INT..)
159
- * TI_REF - OBJREF / ARRAY use m_cls for the type
160
- * (including arrays and null objref)
161
- * TI_STRUCT - VALUE type, use m_cls for the actual type
162
- *
163
- * NOTE carefully that BYREF info is not stored here. You will never see a
164
- * TI_BYREF in this component. For example, the type component
165
- * of a "byref TI_INT" is TI_FLAG_BYREF | TI_INT.
166
- *
167
- * NOTE carefully that Generic Type Variable info is
168
- * only stored here in part. Values of type "T" (e.g "!0" in ILASM syntax),
169
- * i.e. some generic variable type, appear only when verifying generic
170
- * code. They come in two flavours: unboxed and boxed. Unboxed
171
- * is the norm, e.g. a local, field or argument of type T. Boxed
172
- * values arise from an IL instruction such as "box !0".
173
- * The EE provides type handles for each different type
174
- * variable and the EE's "canCast" operation decides casting
175
- * for boxed type variable. Thus:
176
- *
177
- * (TI_REF, <type-variable-type-handle>) == boxed type variable
178
- *
179
- * (TI_REF, <type-variable-type-handle>)
180
- * + TI_FLAG_GENERIC_TYPE_VAR == unboxed type variable
181
- *
182
- * Using TI_REF for these may seem odd but using TI_STRUCT means the
183
- * code-generation parts of the importer get confused when they
184
- * can't work out the size, GC-ness etc. of the "struct". So using TI_REF
185
- * just tricks these backend parts into generating pseudo-trees for
186
- * the generic code we're verifying. These trees then get thrown away
187
- * anyway as we do verification of generic code in import-only mode.
188
- *
189
- */
145
+ /* ****************************************************************************
146
+ * Declares the typeInfo class, which represents the type of an entity on the
147
+ * stack, in a local variable or an argument.
148
+ *
149
+ * Flags: LLLLLLLLLLLLLLLLffffffffffTTTTTT
150
+ *
151
+ * L = local var # or instance field #
152
+ * x = unused
153
+ * f = flags
154
+ * T = type
155
+ *
156
+ * The lower bits are used to store the type component, and may be one of:
157
+ *
158
+ * TI_* (primitive) - see tyelist.h for enumeration (BYTE, SHORT, INT..)
159
+ * TI_REF - OBJREF / ARRAY use m_cls for the type
160
+ * (including arrays and null objref)
161
+ * TI_STRUCT - VALUE type, use m_cls for the actual type
162
+ *
163
+ * NOTE carefully that BYREF info is not stored here. You will never see a
164
+ * TI_BYREF in this component. For example, the type component
165
+ * of a "byref TI_INT" is TI_FLAG_BYREF | TI_INT.
166
+ *
167
+ * NOTE carefully that Generic Type Variable info is
168
+ * only stored here in part. Values of type "T" (e.g "!0" in ILASM syntax),
169
+ * i.e. some generic variable type, appear only when verifying generic
170
+ * code. They come in two flavours: unboxed and boxed. Unboxed
171
+ * is the norm, e.g. a local, field or argument of type T. Boxed
172
+ * values arise from an IL instruction such as "box !0".
173
+ * The EE provides type handles for each different type
174
+ * variable and the EE's "canCast" operation decides casting
175
+ * for boxed type variable. Thus:
176
+ *
177
+ * (TI_REF, <type-variable-type-handle>) == boxed type variable
178
+ *
179
+ * (TI_REF, <type-variable-type-handle>)
180
+ * + TI_FLAG_GENERIC_TYPE_VAR == unboxed type variable
181
+ *
182
+ * Using TI_REF for these may seem odd but using TI_STRUCT means the
183
+ * code-generation parts of the importer get confused when they
184
+ * can't work out the size, GC-ness etc. of the "struct". So using TI_REF
185
+ * just tricks these backend parts into generating pseudo-trees for
186
+ * the generic code we're verifying. These trees then get thrown away
187
+ * anyway as we do verification of generic code in import-only mode.
188
+ *
189
+ */
190
190
191
191
#define TI_FLAG_DATA_BITS 6
192
192
#define TI_FLAG_DATA_MASK ((1 << TI_FLAG_DATA_BITS) - 1 )
193
193
194
- // Flag indicating this item is uninitialized
195
- // Note that if UNINIT and BYREF are both set,
196
- // it means byref (uninit x) - i.e. we are pointing to an uninit <something>
194
+ // Flag indicating this item is uninitialized
195
+ // Note that if UNINIT and BYREF are both set,
196
+ // it means byref (uninit x) - i.e. we are pointing to an uninit <something>
197
197
198
198
#define TI_FLAG_UNINIT_OBJREF 0x00000040
199
199
200
- // Flag indicating this item is a byref <something>
200
+ // Flag indicating this item is a byref <something>
201
201
202
202
#define TI_FLAG_BYREF 0x00000080
203
203
204
- // This item is a byref generated using the readonly. prefix
205
- // to a ldelema or Address function on an array type. The
206
- // runtime type check is ignored in these cases, but the
207
- // resulting byref can only be used in order to perform a
208
- // constraint call.
204
+ // This item is a byref generated using the readonly. prefix
205
+ // to a ldelema or Address function on an array type. The
206
+ // runtime type check is ignored in these cases, but the
207
+ // resulting byref can only be used in order to perform a
208
+ // constraint call.
209
209
210
210
#define TI_FLAG_BYREF_READONLY 0x00000100
211
211
@@ -224,23 +224,23 @@ inline ti_types JITtype2tiType(CorInfoType type)
224
224
// This item contains resolved token. It is used for ctor delegate optimization.
225
225
#define TI_FLAG_TOKEN 0x00000400
226
226
227
- // This item contains the 'this' pointer (used for tracking)
227
+ // This item contains the 'this' pointer (used for tracking)
228
228
229
229
#define TI_FLAG_THIS_PTR 0x00001000
230
230
231
- // This item is a byref to something which has a permanent home
232
- // (e.g. a static field, or instance field of an object in GC heap, as
233
- // opposed to the stack or a local variable). TI_FLAG_BYREF must also be
234
- // set. This information is useful for tail calls and return byrefs.
235
- //
236
- // Instructions that generate a permanent home byref:
237
- //
238
- // ldelema
239
- // ldflda of a ref object or another permanent home byref
240
- // array element address Get() helper
241
- // call or calli to a method that returns a byref and is verifiable or SkipVerify
242
- // dup
243
- // unbox
231
+ // This item is a byref to something which has a permanent home
232
+ // (e.g. a static field, or instance field of an object in GC heap, as
233
+ // opposed to the stack or a local variable). TI_FLAG_BYREF must also be
234
+ // set. This information is useful for tail calls and return byrefs.
235
+ //
236
+ // Instructions that generate a permanent home byref:
237
+ //
238
+ // ldelema
239
+ // ldflda of a ref object or another permanent home byref
240
+ // array element address Get() helper
241
+ // call or calli to a method that returns a byref and is verifiable or SkipVerify
242
+ // dup
243
+ // unbox
244
244
245
245
#define TI_FLAG_BYREF_PERMANENT_HOME 0x00002000
246
246
@@ -252,12 +252,12 @@ inline ti_types JITtype2tiType(CorInfoType type)
252
252
// e.g. the result of a "box T" instruction.
253
253
#define TI_FLAG_GENERIC_TYPE_VAR 0x00004000
254
254
255
- // Number of bits local var # is shifted
255
+ // Number of bits local var # is shifted
256
256
257
257
#define TI_FLAG_LOCAL_VAR_SHIFT 16
258
258
#define TI_FLAG_LOCAL_VAR_MASK 0xFFFF0000
259
259
260
- // Field info uses the same space as the local info
260
+ // Field info uses the same space as the local info
261
261
262
262
#define TI_FLAG_FIELD_SHIFT TI_FLAG_LOCAL_VAR_SHIFT
263
263
#define TI_FLAG_FIELD_MASK TI_FLAG_LOCAL_VAR_MASK
@@ -283,7 +283,8 @@ class typeInfo
283
283
{
284
284
285
285
private:
286
- union {
286
+ union
287
+ {
287
288
struct
288
289
{
289
290
ti_types type : TI_FLAG_DATA_BITS;
@@ -301,7 +302,8 @@ class typeInfo
301
302
DWORD m_flags;
302
303
};
303
304
304
- union {
305
+ union
306
+ {
305
307
CORINFO_CLASS_HANDLE m_cls;
306
308
// Valid only for type TI_METHOD without IsToken
307
309
CORINFO_METHOD_HANDLE m_method;
@@ -405,8 +407,8 @@ class typeInfo
405
407
}
406
408
407
409
unsigned type = li.m_flags & TI_FLAG_DATA_MASK;
408
- assert (TI_ERROR <
409
- TI_ONLY_ENUM); // TI_ERROR looks like it needs more than enum. This optimises the success case a bit
410
+ assert (TI_ERROR < TI_ONLY_ENUM); // TI_ERROR looks like it needs more than enum. This optimises the success
411
+ // case a bit
410
412
if (type > TI_ONLY_ENUM)
411
413
{
412
414
return true ;
@@ -664,9 +666,9 @@ class typeInfo
664
666
// as primitives
665
667
bool IsValueClassWithClsHnd () const
666
668
{
667
- if ((GetType () == TI_STRUCT) ||
668
- (m_cls && GetType () != TI_REF && GetType () != TI_METHOD &&
669
- GetType () != TI_ERROR)) // necessary because if byref bit is set, we return TI_ERROR)
669
+ if ((GetType () == TI_STRUCT) || (m_cls && GetType () != TI_REF && GetType () != TI_METHOD &&
670
+ GetType () != TI_ERROR)) // necessary because if byref bit is set, we return
671
+ // TI_ERROR)
670
672
{
671
673
return true ;
672
674
}
0 commit comments