3 I believe that `Value Parameter' might have been introduced
4 after C# 1.0, also notice than in the treatment of Value Parameter
5 the parameters are defined in four categories:
7 Section 9.3 in the latest spec.
13 Reference type equality operators (15.9.6) introduced
14 operator == (C x, C y) where C is a reference type.
18 operator == (object a, object b)
20 Review our implementation.
25 It would be nice to optimize the case of:
27 Method (new ValueType ())
29 So that no temporary is created, and we only use a newobj call
30 that remains on the stack, as opposed to ldloca, initobj, ldloc
36 ImplicitStandardConversionExists and ImplicitStandardConversion
37 should always be the same, but there are a few diverging lines that
40 if (expr_type == target_type && !(expr is NullLiteral))
45 if (expr_type == target_type)
52 Need to introduce the NullType concept into the compiler, to address a
53 few small buglets and remove the hardcoded values for NullLiteral.
55 NullLiteral will be the only expression that has the NullType as its type.
57 This is what must be used to test for Null literals, instead of `is NullLiteral',
58 and this will introduce a couple of fixes to the rules.
60 Revert Martin's patch to Conditional expression that worked around this bug:
62 Reference r = xx ? null : null
64 The right fix is to introduce NullType
66 ****************************************************************************************
68 * The information on the rest of this file is mostly outdated, and its kept here for
71 ****************************************************************************************
76 * Make yyerror show a nice syntax error, instead of the current mess.
80 * Reset should throw not implemented now.
85 Currently when we build a type cache, it contains private members,
86 internal members, and internal protected members; We should trim
87 these out, as it shows up on the profile.
89 We create too many Arraylists; When we know the size, we should create
92 During parsing we use arraylists to accumulate data, like this:
97 : thing { $$ =new ArrayList (); $$.Add ($1); }
98 | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; }
100 We probably could start using "Pairs" there:
103 : thing { $$ = new Pair ($1, null); }
104 | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); }
107 EmitContext.ResolveTypeTree
108 ---------------------------
110 We should investigate its usage. The problem is that by default
111 this will be set when calling FindType, that triggers a more expensive
114 I believe we should pass the current EmitContext (which has this turned off
115 by default) to ResolveType/REsolveTypeExpr and then have the routines that
116 need ResolveType to pass null as the emit context.
121 DeclareLocal is used in various statements. The audit should be done
124 * Identify all the declare locals.
128 * Find if we can make wrapper functions for all of them.
130 Then we can move DeclareLocal into a helper class.
132 This is required to fix foreach in iterators.
137 Drop FindMembers as our API and instead extract all the data
138 out of a type the first time into our own datastructures, and
139 use that to navigate and search the type instead of the
140 callback based FindMembers.
142 Martin has some some of this work with his TypeHandle code
143 that we could use for this.
148 Instead of the hack that *knows* about System.Object not having any children classes,
149 we should just make it simple for a probe to know that there is no need for it.
151 Dead Code Elimination bugs:
152 ---------------------------
154 I should also resolve all the children expressions in Switch, Fixed, Using.
158 Properties and 17.6.3: Finish it.
160 readonly variables and ref/out
165 * Break/Continue statements
167 A finally block should reset the InLoop/LoopBegin/LoopEnd, as
168 they are logically outside the scope of the loop.
170 * Break/continue part 2.
172 They should transfer control to the finally block if inside a try/catch
175 * Method Registration and error CS111
177 The way we use the method registration to signal 111 is wrong.
179 Method registration should only be used to register methodbuilders,
180 we need an alternate method of checking for duplicates.
183 > // CSC sets beforefieldinit
185 > // .cctor will be generated by compiler
186 > public static readonly object O = new System.Object ();
187 > public static void Main () {}
194 * Merge test 89 and test-34
198 The information when registering a method in InternalParameters
199 is duplicated, you can always get the types from the InternalParameters
201 * Emit modreq for volatiles
203 Handle modreq from public apis.
205 * Merge tree.cs, rootcontext.cs
210 * User Defined Conversions is doing way too many calls to do union sets that are not needed
212 * Add test case for destructors
214 * Places that use `Ldelema' are basically places where I will be
215 initializing a value type. I could apply an optimization to
216 disable the implicit local temporary from being created (by using
219 * Dropping TypeContainer as an argument to EmitContext
221 My theory is that I can get rid of the TypeBuilder completely from
222 the EmitContext, and have typecasts where it is used (from
223 DeclSpace to where it matters).
225 The only pending problem is that the code that implements Aliases
226 is on TypeContainer, and probably should go in DeclSpace.
230 Write tests for the various reference conversions. We have
231 test for all the numeric conversions.
233 * Optimizations: variable allocation.
235 When local variables of a type are required, we should request
236 the variable and later release it when we are done, so that
237 the same local variable slot can be reused later on.
239 * Add a cache for the various GetArrayMethod operations.
241 * MakeUnionSet Callers
243 If the types are the same, there is no need to compute the unionset,
244 we can just use the list from one of the types.
246 * Factor the lookup code for class declarations an interfaces
247 (interface.cs:GetInterfaceByName)
252 * Use of lexer.Location in the parser
256 TOKEN nt TERMINAL nt TERMINAL nt3 {
257 $$ = new Blah ($2, $4, $6, lexer.Location);
260 This is bad, because the lexer.Location is for the last item in `nt3'
262 We need to change that to use this pattern:
264 TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
265 $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
268 Notice how numbering of the arguments changes as the
269 { oob_stack.Push (lexer.Location) } takes a "slot" in the productions.