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