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