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