4 It would be nice to optimize the case of:
6 Method (new ValueType ())
8 So that no temporary is created, and we only use a newobj call
9 that remains on the stack, as opposed to ldloca, initobj, ldloc
15 ImplicitStandardConversionExists and ImplicitStandardConversion
16 should always be the same, but there are a few diverging lines that
19 if (expr_type == target_type && !(expr is NullLiteral))
24 if (expr_type == target_type)
31 Need to introduce the NullType concept into the compiler, to address a
32 few small buglets and remove the hardcoded values for NullLiteral.
34 NullLiteral will be the only expression that has the NullType as its type.
36 This is what must be used to test for Null literals, instead of `is NullLiteral',
37 and this will introduce a couple of fixes to the rules.
39 Revert Martin's patch to Conditional expression that worked around this bug:
41 Reference r = xx ? null : null
43 The right fix is to introduce NullType
45 ****************************************************************************************
47 * The information on the rest of this file is mostly outdated, and its kept here for
50 ****************************************************************************************
55 * Make yyerror show a nice syntax error, instead of the current mess.
59 * Reset should throw not implemented now.
64 Currently when we build a type cache, it contains private members,
65 internal members, and internal protected members; We should trim
66 these out, as it shows up on the profile.
68 We create too many Arraylists; When we know the size, we should create
71 During parsing we use arraylists to accumulate data, like this:
76 : thing { $$ =new ArrayList (); $$.Add ($1); }
77 | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; }
79 We probably could start using "Pairs" there:
82 : thing { $$ = new Pair ($1, null); }
83 | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); }
86 EmitContext.ResolveTypeTree
87 ---------------------------
89 We should investigate its usage. The problem is that by default
90 this will be set when calling FindType, that triggers a more expensive
93 I believe we should pass the current EmitContext (which has this turned off
94 by default) to ResolveType/REsolveTypeExpr and then have the routines that
95 need ResolveType to pass null as the emit context.
100 DeclareLocal is used in various statements. The audit should be done
103 * Identify all the declare locals.
107 * Find if we can make wrapper functions for all of them.
109 Then we can move DeclareLocal into a helper class.
111 This is required to fix foreach in iterators.
116 Drop FindMembers as our API and instead extract all the data
117 out of a type the first time into our own datastructures, and
118 use that to navigate and search the type instead of the
119 callback based FindMembers.
121 Martin has some some of this work with his TypeHandle code
122 that we could use for this.
127 Instead of the hack that *knows* about System.Object not having any children classes,
128 we should just make it simple for a probe to know that there is no need for it.
130 Dead Code Elimination bugs:
131 ---------------------------
133 I should also resolve all the children expressions in Switch, Fixed, Using.
137 Properties and 17.6.3: Finish it.
139 readonly variables and ref/out
144 * Break/Continue statements
146 A finally block should reset the InLoop/LoopBegin/LoopEnd, as
147 they are logically outside the scope of the loop.
149 * Break/continue part 2.
151 They should transfer control to the finally block if inside a try/catch
154 * Method Registration and error CS111
156 The way we use the method registration to signal 111 is wrong.
158 Method registration should only be used to register methodbuilders,
159 we need an alternate method of checking for duplicates.
162 > // CSC sets beforefieldinit
164 > // .cctor will be generated by compiler
165 > public static readonly object O = new System.Object ();
166 > public static void Main () {}
173 * Merge test 89 and test-34
177 The information when registering a method in InternalParameters
178 is duplicated, you can always get the types from the InternalParameters
180 * Emit modreq for volatiles
182 Handle modreq from public apis.
184 * Merge tree.cs, rootcontext.cs
189 * User Defined Conversions is doing way too many calls to do union sets that are not needed
191 * Add test case for destructors
193 * Places that use `Ldelema' are basically places where I will be
194 initializing a value type. I could apply an optimization to
195 disable the implicit local temporary from being created (by using
198 * Dropping TypeContainer as an argument to EmitContext
200 My theory is that I can get rid of the TypeBuilder completely from
201 the EmitContext, and have typecasts where it is used (from
202 DeclSpace to where it matters).
204 The only pending problem is that the code that implements Aliases
205 is on TypeContainer, and probably should go in DeclSpace.
209 Write tests for the various reference conversions. We have
210 test for all the numeric conversions.
212 * Optimizations: variable allocation.
214 When local variables of a type are required, we should request
215 the variable and later release it when we are done, so that
216 the same local variable slot can be reused later on.
218 * Add a cache for the various GetArrayMethod operations.
220 * MakeUnionSet Callers
222 If the types are the same, there is no need to compute the unionset,
223 we can just use the list from one of the types.
225 * Factor the lookup code for class declarations an interfaces
226 (interface.cs:GetInterfaceByName)
231 * Use of lexer.Location in the parser
235 TOKEN nt TERMINAL nt TERMINAL nt3 {
236 $$ = new Blah ($2, $4, $6, lexer.Location);
239 This is bad, because the lexer.Location is for the last item in `nt3'
241 We need to change that to use this pattern:
243 TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
244 $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
247 Notice how numbering of the arguments changes as the
248 { oob_stack.Push (lexer.Location) } takes a "slot" in the productions.