2008-04-28 Jb Evain <jbevain@novell.com>
[mono.git] / mcs / class / System.Core / System.Linq.Expressions / ChangeLog
1 2008-04-28  Jb Evain  <jbevain@novell.com>
2
3         * EmitContext.cs: deal with globals when encountering them while
4         compiling, and not ahead of time with a dedicated visitor.
5
6 2008-04-27  Jb Evain  <jbevain@novell.com>
7
8         * ConstantExpression.cs (Emit): emit properly null nullable types.
9
10 2008-04-27  Jb Evain  <jbevain@novell.com>
11
12         * Expression.cs: improve method finder.
13
14 2008-04-24  Jb Evain  <jbevain@novell.com>
15
16         * UnaryExpression.cs, EmitContext.cs: implement compilation
17         of Quote as a global load.
18
19 2008-04-23  Jb Evain  <jbevain@novell.com>
20
21         * UnaryExpression.cs: start implementing EmitConvert.
22
23 2008-04-23  Jb Evain  <jbevain@novell.com>
24
25         * ConstantExpression.cs (Emit): properly Emit null constants.
26
27 2008-04-23  Jb Evain  <jbevain@novell.com>
28
29         * Expression.cs (Constant): check for assignability, not for type
30         equality, when a type is passed.
31
32 2008-04-23  Jb Evain  <jbevain@novell.com>
33
34         * ExpressionPrinter.cs: ToString convert properly.
35
36 2008-04-22  Jb Evain  <jbevain@novell.com>
37
38         * UnaryExpression.cs: implement IsLiftedToNull properly.
39         * Expression.cs (Convert, ConvertChecked): implemented computing
40         of IsLifted and IsLiftedToNull for conversions.
41
42 2008-04-22  Jb Evain  <jbevain@novell.com>
43
44         * Expression.cs (Convert, ConvertChecked): implement.
45
46 2008-04-21  Jb Evain  <jbevain@novell.com>
47
48         * Expression.cs (Call): don't rely on the fact that if the
49         instance expression is null, then it's a static call. Explicitely
50         check on the MethodInfo for that.
51         * EmitContext.cs (EmitCall): same pattern.
52
53 2008-04-20  Jb Evain  <jbevain@novell.com>
54
55         * MemberMemberBinding.cs (Emit): implement.
56
57 2008-04-19  Jb Evain  <jbevain@novell.com>
58
59         * EmitContext.cs: infrastructure work to attach a compiled
60         lambda expression to an execution scope, and to detect and store
61         external globals in the scope.
62         * ConstantExpression.cs: load globals from the scope.
63
64 2008-04-19  Jb Evain  <jbevain@novell.com>
65
66         * ExpressionVisitor.cs (Visit): don't die because of Power.
67
68 2008-04-09  Jb Evain  <jbevain@novell.com>
69
70         * Expression.cs: check for illegal booleab unary expressions.
71
72 2008-04-09  Jb Evain  <jbevain@novell.com>
73
74         * UnaryExpression.cs: implement compilation of negate.
75
76 2008-04-09  Jb Evain  <jbevain@novell.com>
77
78         * UnaryExpression.cs, Expression.cs: implement IsLifted and IsLifted
79         to null for simple unary operators. Implement Not compilation.
80
81 2008-04-08  Jb Evain  <jbevain@novell.com>
82
83         * ElementInit.cs: emit pop if the add method doesn't return void.
84
85 2008-03-20  Jb Evain  <jbevain@novell.com>
86
87         * Expression.cs: use the new and more complete IsAssignableTo
88         instead of IsAssignableFrom.
89
90 2008-03-19  Jb Evain  <jbevain@novell.com>
91
92         * LambdaExpression.cs: use the new standardified IsAssignableTo,
93         fixes ExpressionTest_NewArrayBounds.TestArrayAssignability.
94
95 2008-03-19  Jb Evain  <jbevain@novell.com>
96
97         * Extensions.cs (Type.IsAssignableTo): deal with arrays.
98
99 2008-03-13  Jb Evain  <jbevain@novell.com>
100
101         * NewArrayExpression.cs (EmitNewArrayBounds): implement.
102
103 2008-03-12  Jb Evain  <jbevain@novell.com>
104
105         * NewArrayExpression.cs (Emit): naive implementation of emit support
106         for array initialization.
107
108 2008-03-11  Jb Evain  <jbevain@novell.com>
109
110         * BinaryExpression.cs: very naive implementation of emitting
111         array accesses.
112
113 2008-03-11  Jb Evain  <jbevain@novell.com>
114
115         * *.cs: Move the different Emit* helpers to EmitContext,
116         so that they get used more naturally by the non Expression
117         types.
118
119 2008-03-10  Jb Evain  <jbevain@novell.com>
120
121         * TypeBinaryExpression.cs, Expression.cs: refactor an EmitIsInst.
122         * UnaryExpression.cs: implement TypeAs using the EmitIsInst.
123
124 2008-03-10  Jb Evain  <jbevain@novell.com>
125
126         * TypeBinaryExpression.cs (Emit): implement.
127
128 2008-03-08  Jb Evain  <jbevain@novell.com>
129
130         * MemberListBinding.cs (Emit): implement.
131         * MemberBinding.cs (EmitLoadMember): add helper.
132
133 2008-03-08  Jb Evain  <jbevain@novell.com>
134
135         * MemberAssignment.cs (Emit): implement.
136
137 2008-03-08  Jb Evain  <jbevain@novell.com>
138
139         * ElementInit.cs (Emit): implement.
140
141 2008-03-06  Jb Evain  <jbevain@novell.com>
142
143         * EmitContext.cs: the DebugContext delegate the CreateDelegate
144         to a DynamicContext to avoid visibility issues in debug mode.
145
146 2008-03-06  Jb Evain  <jbevain@novell.com>
147
148         * EmitContext.cs: Lambda methods bypass JIT visibility checks.
149
150 2008-03-06  Jb Evain  <jbevain@novell.com>
151
152         * MethodCallExpression.cs, Expression.cs: refactor method calling
153         into a more sophisticated EmitCall in Expression.
154         * InvocationExpression.cs (Emit): implement using the previous EmitCall.
155
156 2008-03-06  Jb Evain  <jbevain@novell.com>
157
158         * Expression.cs: add a EmitCall helper.
159         * MemberExpression.cs: implement property access.
160
161 2008-03-06  Jb Evain  <jbevain@novell.com>
162
163         * MethodCallExpression.cs, Expression.cs: refactor a EmitLoad in Expression.
164         * MemberExpression.cs: use EmitLoad to load the instance field if needed.
165
166 2008-03-06  Jb Evain  <jbevain@novell.com>
167
168         * BinaryExpression.cs, Expression.cs: move EmitStored from
169         BinaryExpression to Expression.
170         * MethodCallExpression.cs: allow method calls on structs.
171
172 2008-03-05  Jb Evain  <jbevain@novell.com>
173
174         * Expression.cs: Fix the Call method which takes an array
175         of type arguments.
176
177 2008-03-05  Jb Evain  <jbevain@novell.com>
178
179         * Expression.cs: fix for a good chunk of lifted/liftToNull tests.
180
181 2008-02-26  Jb Evain  <jbevain@novell.com>
182
183         * Expression.cs (Call): Guess the parameters type from the argument
184         types if needed.
185
186 2008-02-25  Jb Evain  <jbevain@novell.com>
187
188         * NewExpression.cs (Emit): deal with value types construction.
189
190 2008-02-25  Jb Evain  <jbevain@novell.com>
191
192         * Expression.cs, NewExpression.cs: deal with the fact that value types
193         don't have a parameterless constructor.
194
195 2008-02-24  Jb Evain  <jbevain@novell.com>
196
197         * LambdaExpression.cs, EmitContext.cs: make compilation
198         of delegate returning void work.
199
200 2008-02-24  Jb Evain  <jbevain@novell.com>
201
202         * MethodCallExpression.cs: emit call or callvirt depending
203         on the virtuality of the method.
204
205 2008-02-24  Jb Evain  <jbevain@novell.com>
206
207         * LambdaExpression.cs: properly format error message.
208
209 2008-02-21  Jb Evain  <jbevain@novell.com>
210
211         * BinaryExpression.cs (EmitCoalesce): fix setup_null.
212
213 2008-02-21  Jb Evain  <jbevain@novell.com>
214
215         * BinaryExpression.cs (Emit): fix the both_are_null case.
216
217 2008-02-20  Jb Evain  <jbevain@novell.com>
218
219         * Expression.cs, ExpressionPrinter.cs: implement MemberBind.
220
221 2008-02-20  Jb Evain  <jbevain@novell.com>
222
223         * Expression.cs, ExpressionPrinter.cs: implement ListInit.
224
225 2008-02-19  Jb Evain  <jbevain@novell.com>
226
227         * Expression.cs, ExpressionPrinter.cs: implement MemberInit.
228
229 2008-02-19  Jb Evain  <jbevain@novell.com>
230
231         * Expression.cs, ExpressionPrinter.cs: implement last New
232         overload for anonymous types.
233
234 2008-02-08  Jb Evain  <jbevain@novell.com>
235
236         * Expression.cs, InvocationExpression.cs, ExpressionPrinter.cs
237                 add support for Invoke.
238
239 2008-02-04  Jb Evain  <jbevain@novell.com>
240
241         * ExpressionPrinter.cs: fix printing of MemberListBinding.
242
243 2008-02-04  Jb Evain  <jbevain@novell.com>
244
245         * Expression.cs, NewExpression.cs: make New(Type) test pass.
246
247 2008-02-04  Jb Evain  <jbevain@novell.com>
248
249         * ExpressionPrinter.cs: fix and clean printing of ElementInit.
250
251 2008-02-02  Jb Evain  <jbevain@novell.com>
252
253         * Expression.cs: fix ListBind(MemberInfo,IEnumerable<ElementInit>).
254
255 2008-02-02  Jb Evain  <jbevain@novell.com>
256
257         * Expression.cs: fix ListBind(MethodInfo,IEnumerable<ElementInit>).
258
259 2008-02-01  Olivier Dufour  <olivier.duff@gmail.com>
260
261         * Expression.cs, ExpressionPrinter.cs:Add ListBind
262
263 2008-02-01  Olivier Dufour  <olivier.duff@gmail.com>
264
265         * Expression.cs, ExpressionPrinter.cs:Add Elementinit
266
267 2008-01-31  Jb Evain  <jbevain@novell.com>
268
269         * UnaryExpression.cs: emit array length.
270
271 2008-01-31  Jb Evain  <jbevain@novell.com>
272
273         * MemberExpression.cs: Simple support for emitting fields.
274
275 2008-01-30  Jb Evain  <jbevain@novell.com>
276
277         * MethodCallExpression.cs: very naive implementation of Emit.
278
279 2008-01-30  Jb Evain  <jbevain@novell.com>
280
281         * NewExpression.cs: add Emit support for reference types.
282
283 2008-01-30  Jb Evain  <jbevain@novell.com>
284
285         * LambdaExpression.cs, EmitContext.cs: small refactoring.
286         Extract the different EmitContexts to their own file.
287
288 2008-01-29  Jb Evain  <jbevain@novell.com>
289
290         * MethodCallExpression.cs, Expression.cs: complete Calls.
291
292 2008-01-29  Jb Evain  <jbevain@novell.com>
293
294         * Expression.cs, NewExpression.cs, ExpressionPrinter.cs:
295         implement the first flavors of New.
296
297 2008-01-27  Jb Evain  <jbevain@novell.com>
298
299         * ConditionalExpression.cs: implement Emit.
300
301 2008-01-27  Jb Evain  <jbevain@novell.com>
302
303         * Expression.cs: implement the last Lambda method.
304
305 2008-01-27  Jb Evain  <jbevain@novell.com>
306
307         * LambdaExpression.cs: fix the Type of the LambdaExpressions.
308
309 2008-01-27  Olivier Dufour  <olivier.duff@gmail.com>
310
311         * Expression.cs, InvocationExpession.cs,
312         ListInitExpression.cs, MemberInitExpression.cs
313         NewExpression.cs : Add all missing
314         constructor in Expressions and remove the base one
315
316 2008-01-25  Jb Evain  <jbevain@novell.com>
317
318         * Expression.cs, ExpressionPrinter.cs: implement Bind.
319
320 2008-01-25  Jb Evain  <jbevain@novell.com>
321
322         * MemberMemberBinding.cs, MemberListBinding.cs,
323         MemberAssignment.cs, MemberBinding.cs:
324         add constructors.
325
326 2008-01-25  Jb Evain  <jbevain@novell.com>
327
328         * Expression.cs: implement PropertyOrField.
329
330 2008-01-24  Jb Evain  <jbevain@novell.com>
331
332         * Expression.cs, MemberExpression.cs, ExpressionPrinter.cs:
333         implement Field and Property.
334
335 2008-01-22  Miguel de Icaza  <miguel@novell.com>
336
337         * BinaryExpression.cs: Unleash the power of cut and paste.
338
339         Bring a bunch of operatros from mcs/expression.cs
340
341         * Expression.cs: There is no op_LogicalAnd or op_LogicalOr, I just
342         used those from mcs, that was wrong.   use the proper ones, clean
343         up the result.
344
345         * BinaryExpression.cs: Add method invocations for binary methods.
346
347 2008-01-22  Jb Evain  <jbevain@novell.com>
348
349         * Expression.cs, ExpressionPrinter.cs: implement NewArrayList.
350
351 2008-01-22  Jb Evain  <jbevain@novell.com>
352
353         * Expression.cs, ExpressionPrinter.cs, NewArrayExpression.cs:
354         implement Expression.NewArrayBounds.
355
356 2008-01-22  Jb Evain  <jbevain@novell.com>
357
358         * ExpressionPrinter.cs: fix Lambda and Equal.
359
360 2008-01-22  Miguel de Icaza  <miguel@novell.com>
361
362         * BinaryExpression.cs (EmitCoalesce): Add support for emitting
363         code for Coalesce.
364
365         TODO: this does not use the "Conversion" Lambda, which am not sure
366         who generates this or what it is used for.
367
368         (EmitLogical): Fix a couple of bugs in AndAlso, OrElse.
369
370         * Expression.cs: Add support for Coalesce.
371         (BinaryCoreCheck): Move more checking here, instead of the helper
372         routines, will remove them next.
373
374         * LambdaExpression.cs (Compile): Create the delegate last, so we
375         manage to save the assembly while debugging in case of error
376
377 2008-01-21  Miguel de Icaza  <miguel@novell.com>
378
379         * Expression.cs (BinaryCoreCheck): Add checking for a few
380         operators here (to avoid doing a second pass, handles AndAlso and
381         OrElse).
382
383         (AndAlso, OrElse): Add some code.
384
385         * BinaryExpression.cs: Instead of using GetValueOrDefault use
386         get_Value, as we already probed for the lack of value.
387
388         Split out support for And/Or to a separate routine as the code is
389         not very easy to share with the arithmetics code.
390
391 2008-01-21  Marek Safar  <marek.safar@gmail.com>
392
393         * BinaryExpression.cs: Fixed initobj initialization.
394
395 2008-01-21  Jb Evain  <jbevain@novell.com>
396
397         * Expression.cs, UnaryExpression.cs, BinaryExpression.cs:
398         Move the IsUnsigned helper from BinaryExpression to Expression,
399         so it can be used in UnaryExpression.
400
401 2008-01-21  Miguel de Icaza  <miguel@novell.com>
402
403         * Start code generation for nullables, currently this generates
404         incorrect code for things like:
405
406         Expression<Func<int?, int?, int?>> e2 = (a, b) => a + b;
407         e2.Compile ().Invoke (null, 3))
408
409         This should return null, but returns something else.
410
411         * Introduce LINQ_DBG env variable, which generates a linq file in
412         /tmp;   It currently does not work as well as it should, as the
413         Func<> parameters do not mwatch the generated method.
414         Investigate.
415
416
417 2008-01-20  Miguel de Icaza  <miguel@novell.com>
418
419         Introduce support for Nullable arguments, no code is generated for
420         these yet, its only tests + node creation behavior at this point.
421
422         * Expression.cs (BinaryCoreCheck): Do not allow "int?" and "int"
423         as operators, they must both be nullable.
424
425         NullableTypes in the arguments are transformed into the underlying
426         values when doing the method validation.
427
428 2008-01-18  Miguel de Icaza  <miguel@novell.com>
429
430         * ParameterExpression.cs: Add emit support.
431
432 2008-01-18  Jb Evain  <jbevain@novell.com>
433
434         * Expression[Printer|Visitor].cs: implement UnaryPlus, Not, Negate.
435
436 2008-01-18  Miguel de Icaza  <miguel@novell.com>
437
438         * BinaryExpression.cs: Add support for emitting code for some
439         operators (ported from the Mono C# compiler).
440
441         Add tests.
442
443 2008-01-17  Miguel de Icaza  <miguel@novell.com>
444
445         Beginning of code generation framework for Linq.Expressions.
446         Some code was borrowed by from the C# compiler
447
448         * Expression_T.cs: Fill in the blanks.
449
450         * LambdaExpression.cs: Validation of parameters mostly, a tiny bit
451         of codegen.
452
453         * ConstantExpression.cs: Mostly done, need to write tests for
454         non-fundamental types and other ValueType initializations.
455
456 2008-01-17  Jb Evain  <jbevain@novell.com>
457
458         * Expression.cs: implement MakeMemberAccess.
459
460 2008-01-17  Jb Evain  <jbevain@novell.com>
461
462         * Expression.cs, ExpressionPrinter.cs, BinaryExpression.cs:
463         implement ArrayIndex.
464
465 2008-01-17  Jb Evain  <jbevain@novell.com>
466
467         * Expression.cs: Use TypeCode for IsInt and IsNumber.
468
469 2008-01-16  Miguel de Icaza  <miguel@novell.com>
470
471         * Expression.cs: Add support for user-defined operators.
472
473         Put back various binary operator tests.
474
475 2008-01-16  Jb Evain  <jbevain@novell.com>
476
477         * Expression.cs, ExpressionPrinter.cs: fix call for static methods.
478
479 2008-01-15  Miguel de Icaza  <miguel@novell.com>
480
481         * Expression.cs: Do validation on the method parameters and use
482         the return type if provided.
483
484 2008-01-15  Jb Evain  <jbevain@novell.com>
485
486         * MethodCallExpression.cs, Expression.cs
487         ExpressionPrinter.cs: Implement Call (Expression, ...)
488
489 2008-01-15  Jb Evain  <jbevain@novell.com>
490
491         * Expression.cs, ConditionalExpressionExpression.cs
492         ExpressionPrinter.cs : implement Expression.Condition.
493
494 2008-01-15  Jb Evain  <jbevain@novell.com>
495
496         * Expression.cs,
497         ParameterExpression.cs,
498         ExpressionPrinter.cs: implement Expression.Parameter
499
500 2008-01-15  Jb Evain  <jbevain@novell.com>
501
502         * ExpressionPrinter.cs (VisitBinaryExpression): simple
503         implementation (probably misses a few cases).
504
505 2008-01-14  Miguel de Icaza  <miguel@novell.com>
506
507         * Expression.cs: Bring back the (most) of binary operators.  Added
508         type checking as well and reorganized the source file by topic
509         instead of alphabetical sorting.
510
511 2008-01-14  Jb Evain  <jbevain@novell.com>
512
513         * ExpressionPrinter.cs: print ArrayLength.
514
515 2008-01-14  Jb Evain  <jbevain@novell.com>
516
517         * Expression.cs: TypeAs can't take value types.
518         * ExpressionPrinter.cs: implement TypeAs.
519
520 2008-01-14  Jb Evain  <jbevain@novell.com>
521
522         * Expression.cs: implement TypeIs.
523         * ExpressionPrinter.cs: implement VisitTypeBinaryExpression.
524         * TypeBinaryExpression.cs: add proper ctor.
525
526 2008-01-14  Jb Evain  <jbevain@novell.com>
527
528         * Expression.cs, ExpressionPrinter.cs: fix for Quote's type.
529
530 2008-01-14  Jb Evain  <jbevain@novell.com>
531
532         * BinaryExpression.cs,
533         * Expression.cs: revert part of Miguel's last patch.
534         MakeBinary is expected to call the appropriate factory
535         methods. Whose methods that are responsible for creating
536         the good BinaryExpression, wether they use a custom method
537         or not.
538
539 2008-01-14  Jb Evain  <jbevain@novell.com>
540
541         * Expression.cs: MakeUnary is expected to call the appropriate
542         factory methods.
543
544 2008-01-14  Miguel de Icaza  <miguel@novell.com>
545
546         * Expression.cs (Constant, MakeBinary and consumers of it): Some
547         more fill-up changes.
548
549         MakeBinary will need much more work to support user-provided
550         types.
551
552 2008-01-13  Jb Evain  <jbevain@novell.com>
553
554         * *.cs: fresh implementation.