System.Drawing: added email to icon and test file headers
[mono.git] / mcs / mcs / TODO
1 ===========================================
2
3 * Value Parameter
4
5         I believe that `Value Parameter' might have been introduced
6         after C# 1.0, also notice than in the treatment of Value Parameter
7         the parameters are defined in four categories:
8
9         Section 9.3 in the latest spec.
10
11
12 Large project:
13 --------------
14
15 New
16 ---
17
18         It would be nice to optimize the case of:
19
20                 Method (new ValueType ())
21
22         So that no temporary is created, and we only use a newobj call
23         that remains on the stack, as opposed to ldloca, initobj, ldloc
24         call.
25
26 NEW NOTES:
27 ----------
28
29         ImplicitStandardConversionExists and ImplicitStandardConversion
30         should always be the same, but there are a few diverging lines that
31         must be studied:
32
33                         if (expr_type == target_type && !(expr is NullLiteral))
34                                 return expr;
35
36         vs:
37
38                         if (expr_type == target_type)
39                                 return true;
40
41 ****************************************************************************************
42
43 *   The information on the rest of this file is mostly outdated, and its kept here for
44 *   historical reasons
45 *
46 ****************************************************************************************
47  
48 Error Reporting:
49 ----------------
50
51         * Make yyerror show a nice syntax error, instead of the current mess.
52
53 Optimization ideas
54 ------------------
55
56         Currently when we build a type cache, it contains private members,
57         internal members, and internal protected members;   We should trim
58         these out, as it shows up on the profile.
59
60         We create too many Arraylists;  When we know the size, we should create
61         an array;
62
63         During parsing we use arraylists to accumulate data, like this:
64
65                 thing:
66                 
67                 thing_list
68                         : thing { $$ =new ArrayList (); $$.Add ($1); }
69                         | thing_list thing { ArrayList a = $1; a.Add ($2); $$ = a; }
70
71         We probably could start using "Pairs" there:
72
73                 thing_list
74                         : thing { $$ = new Pair ($1, null); }
75                         | thing_list thing { Pair p = $1; $$ = new Pair ($2, $1); }
76
77
78 EmitContext.ResolveTypeTree
79 ---------------------------
80
81         We should investigate its usage.  The problem is that by default
82         this will be set when calling FindType, that triggers a more expensive
83         lookup.
84
85         I believe we should pass the current EmitContext (which has this turned off
86         by default) to ResolveType/REsolveTypeExpr and then have the routines that
87         need ResolveType to pass null as the emit context.
88
89 DeclareLocal audit
90 ------------------
91
92         DeclareLocal is used in various statements.  The audit should be done
93         in two steps:
94
95                 * Identify all the declare locals.
96
97                 * Identify its uses.
98
99                 * Find if we can make wrapper functions for all of them.
100
101         Then we can move DeclareLocal into a helper class.
102
103         This is required to fix foreach in iterators.
104
105 Ideas:
106 ------
107
108         Instead of the hack that *knows* about System.Object not having any children classes,
109         we should just make it simple for a probe to know that there is no need for it.
110
111 Dead Code Elimination bugs:
112 ---------------------------
113
114         I should also resolve all the children expressions in Switch, Fixed, Using.
115
116 Major tasks:
117 ------------
118         Properties and 17.6.3: Finish it.
119
120 readonly variables and ref/out
121         
122 BUGS
123 ----
124
125 * Break/Continue statements
126
127         A finally block should reset the InLoop/LoopBegin/LoopEnd, as
128         they are logically outside the scope of the loop.
129
130 * Break/continue part 2.
131
132         They should transfer control to the finally block if inside a try/catch
133         block.
134
135 *
136 > // CSC sets beforefieldinit
137 > class X {
138 >   // .cctor will be generated by compiler
139 >   public static readonly object O = new System.Object ();
140 >   public static void Main () {}
141 > }
142
143
144 PENDING TASKS
145 -------------
146
147 * Merge test 89 and test-34
148
149 * Code cleanup
150
151         The information when registering a method in InternalParameters
152         is duplicated, you can always get the types from the InternalParameters
153
154 * Emit modreq for volatiles
155
156         Handle modreq from public apis.
157
158 * Merge tree.cs, rootcontext.cs
159
160 OPTIMIZATIONS
161 -------------
162
163 * User Defined Conversions is doing way too many calls to do union sets that are not needed
164
165 * Add test case for destructors
166
167 * Places that use `Ldelema' are basically places where I will be
168   initializing a value type.  I could apply an optimization to 
169   disable the implicit local temporary from being created (by using
170   the method in New).
171
172 * Dropping TypeContainer as an argument to EmitContext
173
174         My theory is that I can get rid of the TypeBuilder completely from
175         the EmitContext, and have typecasts where it is used (from
176         DeclSpace to where it matters).  
177
178         The only pending problem is that the code that implements Aliases
179         is on TypeContainer, and probably should go in DeclSpace.
180
181 * Tests
182
183         Write tests for the various reference conversions.  We have
184         test for all the numeric conversions.
185
186 * Optimizations: variable allocation.
187
188         When local variables of a type are required, we should request
189         the variable and later release it when we are done, so that
190         the same local variable slot can be reused later on.
191
192 * Add a cache for the various GetArrayMethod operations.
193
194 * MakeUnionSet Callers
195
196         If the types are the same, there is no need to compute the unionset,
197         we can just use the list from one of the types.
198
199 * Factor the lookup code for class declarations an interfaces
200   (interface.cs:GetInterfaceByName)
201
202 RECOMMENDATIONS
203 ---------------
204
205 * Use of lexer.Location in the parser
206
207         Currently we do:
208
209         TOKEN nt TERMINAL nt TERMINAL nt3 {
210                 $$ = new Blah ($2, $4, $6, lexer.Location);
211         }
212
213         This is bad, because the lexer.Location is for the last item in `nt3'
214
215         We need to change that to use this pattern:
216
217         TOKEN { oob_stack.Push (lexer.Location) } nt TERMINAL nt TERMINAL nt3 {
218                 $$ = new Blah ($3, $5, $7, (Location) oob_stack.Pop ());
219         }
220
221         Notice how numbering of the arguments changes as the
222         { oob_stack.Push (lexer.Location) } takes a "slot"  in the productions.
223