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