1 2008-08-30 Marek Safar <marek.safar@gmail.com>
3 * MemberBinding.cs: Made MemberBinding ctor public
5 2008-08-07 Jb Evain <jbevain@novell.com>
7 * Expression.cs (GetAssociatedProperty): strengthen accessors
10 2008-08-02 Zoltan Varga <vargaz@gmail.com>
12 * BinaryExpression.cs (EmitBinaryOperator): Mask out the upper bits of the
13 shift amount like mcs compiled code does.
15 2008-07-19 Jb Evain <jbevain@novell.com>
17 * Expression.cs (Call, Field, Property): disallow instance arguments
18 on static members. See ms connect #339351.
20 2008-07-18 Jb Evain <jbevain@novell.com>
22 * Expression.cs, BinaryExpression.cs: fix retrieval of true and false
25 2008-06-20 Jb Evain <jbevain@novell.com>
27 * LambdaExpression.cs, EmitContext.cs: refactor the emit context to
28 handle the fact that lambdas are compiled in a general context where
29 they share globals but are also able to use parameters from parent lambdas.
30 (Although parameter sharing is not implemented yet).
32 * BinaryExpression.cs (fix converted coalesce case to use the lambda
35 2008-06-09 Jb Evain <jbevain@novell.com>
37 * Extensions.cs (Type.IsExpression): add
38 * Expression.cs (CheckMethodArguments): modify the argument list
39 to quote arguments when if necessary.
42 2008-06-09 Jb Evain <jbevain@novell.com>
44 * Expression.cs (CheckLambda): quote body if required.
46 2008-06-07 Jb Evain <jbevain@novell.com>
48 * BinaryExpression.cs (EmitConvertedCoalesce): implement.
50 2008-06-05 Jb Evain <jbevain@novell.com>
52 * Expression.cs (GetUserConversionMethod): check for convertion
53 operators on both types.
55 2008-06-05 Jb Evain <jbevain@novell.com>
57 * Expression.cs (ConditionalBinaryCheck): if a method is passed,
58 checked that the operators true and false are also defined.
60 2008-06-05 Jb Evain <jbevain@novell.com>
62 * BinaryExpression.cs (Emit): deal with binary expressions
63 where only the left is lifted.
65 2008-06-05 Jb Evain <jbevain@novell.com>
67 * Extensions.cs: Add Type.MakeNullableType helper.
68 * Expression.cs (MakeSimpleBinary, MakeBoolBinar): Properly
69 creat lifted/lifted to null/not lifted
70 user defined binary expressions.
71 * BinaryExpression.cs (Emit): implement compilation of
72 lifted and lifted to null user defined binary operators.
74 2008-06-05 Jb Evain <jbevain@novell.com>
76 * Expression.cs (MakeSimpleUnary): properly create lifted/not lifted
77 unary expressions with user defined operators.
78 * UnaryExpression.cs (Emit): fix compilation of lifted user operators.
80 2008-05-30 Jb Evain <jbevain@novell.com>
82 * UnaryExpression.cs (Emit): fix convertion from nullable
85 2008-05-29 Jb Evain <jbevain@novell.com>
87 * Expression.cs (Power): allow bool?.
88 * BinaryExpression.cs: properly deal with lifted power expression.
90 2008-05-29 Jb Evain <jbevain@novell.com>
92 * BinaryExpression.cs (Emit): fix lifted andalso and orelse.
94 2008-05-29 Jb Evain <jbevain@novell.com>
96 * BinaryExpression.cs (Emit): properly emit lifted to null
97 relational binary expressions.
99 2008-05-28 Jb Evain <jbevain@novell.com>
101 * BinaryExpression.cs (Emit): rework compilation of
102 arithmetic and relational lifted binary expressions.
104 2008-05-28 Jb Evain <jbevain@novell.com>
106 * UnaryExpression.cs (Emit): implement support for compiling
107 lifted unary expressions.
109 2008-05-27 Jb Evain <jbevain@novell.com>
111 * UnaryExpression.cs (EmitConvert): implement nullable to nullable
114 2008-05-20 Roei Erez <roeie@mainsoft.com>
116 * Extensions.cs: Add 'IsGenericImplementationOf' extension method
118 2008-05-15 Jb Evain <jbevain@novell.com>
120 * UnaryExpression.cs, EmitContext.cs: emit convert from and
123 2008-05-15 Jb Evain <jbevain@novell.com>
125 * Extensions.cs: add a few useful extensions such as
126 IsGenericInstanceOf and MakeGenericFrom.
128 2008-05-15 Roei Erez <roeie@mainsoft.com>
130 * ExpressionTransformer.cs: Add a base class for transforming Expressions.
131 In use at AsQueryable() implementation.
133 2008-05-14 Jb Evain <jbevain@novell.com>
135 * EmitContext.cs: only generate a new lambda name if we're in
138 2008-05-14 Jb Evain <jbevain@novell.com>
140 * LambdaExpression.cs, EmitContext.cs: When encountering a lambda
141 inside an ET, compile it as a read of a global. Based on a patch
142 by Roei Erez <roeie@mainsoft.com>
144 2008-05-08 Jb Evain <jbevain@novell.com>
146 * Expression.cs, EmitContext.cs: deal with call to methods
147 with byref parameters.
149 2008-05-07 Roei Erez <roeie@mainsoft.com>
151 * Add ifdef TARGET_JVM
153 2008-05-03 Jb Evain <jbevain@novell.com>
155 * LambdaExpression.cs: move checks to Expression
156 * Expression.cs: apply check for both typed and untyped lambda
157 creation, so that the constructor does not throws exception.
158 Needed to create instances of Expression<> for untyped lambda
159 factory method. Fixes #386322.
161 2008-05-02 Jb Evain <jbevain@novell.com>
163 * Expression.cs: make Emit virtual instead of abstract,
164 to allow externals libraries to extend Expression.
165 Patch by Jan Oravec <jan.oravec@6com.sk>. Fixes #386097.
167 2008-04-29 Jb Evain <jbevain@novell.com>
169 * UnaryExpression.cs (EmitPrimitiveConversion): implement.
171 2008-04-28 Jb Evain <jbevain@novell.com>
173 * EmitContext.cs: deal with globals when encountering them while
174 compiling, and not ahead of time with a dedicated visitor.
176 2008-04-27 Jb Evain <jbevain@novell.com>
178 * ConstantExpression.cs (Emit): emit properly null nullable types.
180 2008-04-27 Jb Evain <jbevain@novell.com>
182 * Expression.cs: improve method finder.
184 2008-04-24 Jb Evain <jbevain@novell.com>
186 * UnaryExpression.cs, EmitContext.cs: implement compilation
187 of Quote as a global load.
189 2008-04-23 Jb Evain <jbevain@novell.com>
191 * UnaryExpression.cs: start implementing EmitConvert.
193 2008-04-23 Jb Evain <jbevain@novell.com>
195 * ConstantExpression.cs (Emit): properly Emit null constants.
197 2008-04-23 Jb Evain <jbevain@novell.com>
199 * Expression.cs (Constant): check for assignability, not for type
200 equality, when a type is passed.
202 2008-04-23 Jb Evain <jbevain@novell.com>
204 * ExpressionPrinter.cs: ToString convert properly.
206 2008-04-22 Jb Evain <jbevain@novell.com>
208 * UnaryExpression.cs: implement IsLiftedToNull properly.
209 * Expression.cs (Convert, ConvertChecked): implemented computing
210 of IsLifted and IsLiftedToNull for conversions.
212 2008-04-22 Jb Evain <jbevain@novell.com>
214 * Expression.cs (Convert, ConvertChecked): implement.
216 2008-04-21 Jb Evain <jbevain@novell.com>
218 * Expression.cs (Call): don't rely on the fact that if the
219 instance expression is null, then it's a static call. Explicitely
220 check on the MethodInfo for that.
221 * EmitContext.cs (EmitCall): same pattern.
223 2008-04-20 Jb Evain <jbevain@novell.com>
225 * MemberMemberBinding.cs (Emit): implement.
227 2008-04-19 Jb Evain <jbevain@novell.com>
229 * EmitContext.cs: infrastructure work to attach a compiled
230 lambda expression to an execution scope, and to detect and store
231 external globals in the scope.
232 * ConstantExpression.cs: load globals from the scope.
234 2008-04-19 Jb Evain <jbevain@novell.com>
236 * ExpressionVisitor.cs (Visit): don't die because of Power.
238 2008-04-09 Jb Evain <jbevain@novell.com>
240 * Expression.cs: check for illegal booleab unary expressions.
242 2008-04-09 Jb Evain <jbevain@novell.com>
244 * UnaryExpression.cs: implement compilation of negate.
246 2008-04-09 Jb Evain <jbevain@novell.com>
248 * UnaryExpression.cs, Expression.cs: implement IsLifted and IsLifted
249 to null for simple unary operators. Implement Not compilation.
251 2008-04-08 Jb Evain <jbevain@novell.com>
253 * ElementInit.cs: emit pop if the add method doesn't return void.
255 2008-03-20 Jb Evain <jbevain@novell.com>
257 * Expression.cs: use the new and more complete IsAssignableTo
258 instead of IsAssignableFrom.
260 2008-03-19 Jb Evain <jbevain@novell.com>
262 * LambdaExpression.cs: use the new standardified IsAssignableTo,
263 fixes ExpressionTest_NewArrayBounds.TestArrayAssignability.
265 2008-03-19 Jb Evain <jbevain@novell.com>
267 * Extensions.cs (Type.IsAssignableTo): deal with arrays.
269 2008-03-13 Jb Evain <jbevain@novell.com>
271 * NewArrayExpression.cs (EmitNewArrayBounds): implement.
273 2008-03-12 Jb Evain <jbevain@novell.com>
275 * NewArrayExpression.cs (Emit): naive implementation of emit support
276 for array initialization.
278 2008-03-11 Jb Evain <jbevain@novell.com>
280 * BinaryExpression.cs: very naive implementation of emitting
283 2008-03-11 Jb Evain <jbevain@novell.com>
285 * *.cs: Move the different Emit* helpers to EmitContext,
286 so that they get used more naturally by the non Expression
289 2008-03-10 Jb Evain <jbevain@novell.com>
291 * TypeBinaryExpression.cs, Expression.cs: refactor an EmitIsInst.
292 * UnaryExpression.cs: implement TypeAs using the EmitIsInst.
294 2008-03-10 Jb Evain <jbevain@novell.com>
296 * TypeBinaryExpression.cs (Emit): implement.
298 2008-03-08 Jb Evain <jbevain@novell.com>
300 * MemberListBinding.cs (Emit): implement.
301 * MemberBinding.cs (EmitLoadMember): add helper.
303 2008-03-08 Jb Evain <jbevain@novell.com>
305 * MemberAssignment.cs (Emit): implement.
307 2008-03-08 Jb Evain <jbevain@novell.com>
309 * ElementInit.cs (Emit): implement.
311 2008-03-06 Jb Evain <jbevain@novell.com>
313 * EmitContext.cs: the DebugContext delegate the CreateDelegate
314 to a DynamicContext to avoid visibility issues in debug mode.
316 2008-03-06 Jb Evain <jbevain@novell.com>
318 * EmitContext.cs: Lambda methods bypass JIT visibility checks.
320 2008-03-06 Jb Evain <jbevain@novell.com>
322 * MethodCallExpression.cs, Expression.cs: refactor method calling
323 into a more sophisticated EmitCall in Expression.
324 * InvocationExpression.cs (Emit): implement using the previous EmitCall.
326 2008-03-06 Jb Evain <jbevain@novell.com>
328 * Expression.cs: add a EmitCall helper.
329 * MemberExpression.cs: implement property access.
331 2008-03-06 Jb Evain <jbevain@novell.com>
333 * MethodCallExpression.cs, Expression.cs: refactor a EmitLoad in Expression.
334 * MemberExpression.cs: use EmitLoad to load the instance field if needed.
336 2008-03-06 Jb Evain <jbevain@novell.com>
338 * BinaryExpression.cs, Expression.cs: move EmitStored from
339 BinaryExpression to Expression.
340 * MethodCallExpression.cs: allow method calls on structs.
342 2008-03-05 Jb Evain <jbevain@novell.com>
344 * Expression.cs: Fix the Call method which takes an array
347 2008-03-05 Jb Evain <jbevain@novell.com>
349 * Expression.cs: fix for a good chunk of lifted/liftToNull tests.
351 2008-02-26 Jb Evain <jbevain@novell.com>
353 * Expression.cs (Call): Guess the parameters type from the argument
356 2008-02-25 Jb Evain <jbevain@novell.com>
358 * NewExpression.cs (Emit): deal with value types construction.
360 2008-02-25 Jb Evain <jbevain@novell.com>
362 * Expression.cs, NewExpression.cs: deal with the fact that value types
363 don't have a parameterless constructor.
365 2008-02-24 Jb Evain <jbevain@novell.com>
367 * LambdaExpression.cs, EmitContext.cs: make compilation
368 of delegate returning void work.
370 2008-02-24 Jb Evain <jbevain@novell.com>
372 * MethodCallExpression.cs: emit call or callvirt depending
373 on the virtuality of the method.
375 2008-02-24 Jb Evain <jbevain@novell.com>
377 * LambdaExpression.cs: properly format error message.
379 2008-02-21 Jb Evain <jbevain@novell.com>
381 * BinaryExpression.cs (EmitCoalesce): fix setup_null.
383 2008-02-21 Jb Evain <jbevain@novell.com>
385 * BinaryExpression.cs (Emit): fix the both_are_null case.
387 2008-02-20 Jb Evain <jbevain@novell.com>
389 * Expression.cs, ExpressionPrinter.cs: implement MemberBind.
391 2008-02-20 Jb Evain <jbevain@novell.com>
393 * Expression.cs, ExpressionPrinter.cs: implement ListInit.
395 2008-02-19 Jb Evain <jbevain@novell.com>
397 * Expression.cs, ExpressionPrinter.cs: implement MemberInit.
399 2008-02-19 Jb Evain <jbevain@novell.com>
401 * Expression.cs, ExpressionPrinter.cs: implement last New
402 overload for anonymous types.
404 2008-02-08 Jb Evain <jbevain@novell.com>
406 * Expression.cs, InvocationExpression.cs, ExpressionPrinter.cs
407 add support for Invoke.
409 2008-02-04 Jb Evain <jbevain@novell.com>
411 * ExpressionPrinter.cs: fix printing of MemberListBinding.
413 2008-02-04 Jb Evain <jbevain@novell.com>
415 * Expression.cs, NewExpression.cs: make New(Type) test pass.
417 2008-02-04 Jb Evain <jbevain@novell.com>
419 * ExpressionPrinter.cs: fix and clean printing of ElementInit.
421 2008-02-02 Jb Evain <jbevain@novell.com>
423 * Expression.cs: fix ListBind(MemberInfo,IEnumerable<ElementInit>).
425 2008-02-02 Jb Evain <jbevain@novell.com>
427 * Expression.cs: fix ListBind(MethodInfo,IEnumerable<ElementInit>).
429 2008-02-01 Olivier Dufour <olivier.duff@gmail.com>
431 * Expression.cs, ExpressionPrinter.cs:Add ListBind
433 2008-02-01 Olivier Dufour <olivier.duff@gmail.com>
435 * Expression.cs, ExpressionPrinter.cs:Add Elementinit
437 2008-01-31 Jb Evain <jbevain@novell.com>
439 * UnaryExpression.cs: emit array length.
441 2008-01-31 Jb Evain <jbevain@novell.com>
443 * MemberExpression.cs: Simple support for emitting fields.
445 2008-01-30 Jb Evain <jbevain@novell.com>
447 * MethodCallExpression.cs: very naive implementation of Emit.
449 2008-01-30 Jb Evain <jbevain@novell.com>
451 * NewExpression.cs: add Emit support for reference types.
453 2008-01-30 Jb Evain <jbevain@novell.com>
455 * LambdaExpression.cs, EmitContext.cs: small refactoring.
456 Extract the different EmitContexts to their own file.
458 2008-01-29 Jb Evain <jbevain@novell.com>
460 * MethodCallExpression.cs, Expression.cs: complete Calls.
462 2008-01-29 Jb Evain <jbevain@novell.com>
464 * Expression.cs, NewExpression.cs, ExpressionPrinter.cs:
465 implement the first flavors of New.
467 2008-01-27 Jb Evain <jbevain@novell.com>
469 * ConditionalExpression.cs: implement Emit.
471 2008-01-27 Jb Evain <jbevain@novell.com>
473 * Expression.cs: implement the last Lambda method.
475 2008-01-27 Jb Evain <jbevain@novell.com>
477 * LambdaExpression.cs: fix the Type of the LambdaExpressions.
479 2008-01-27 Olivier Dufour <olivier.duff@gmail.com>
481 * Expression.cs, InvocationExpession.cs,
482 ListInitExpression.cs, MemberInitExpression.cs
483 NewExpression.cs : Add all missing
484 constructor in Expressions and remove the base one
486 2008-01-25 Jb Evain <jbevain@novell.com>
488 * Expression.cs, ExpressionPrinter.cs: implement Bind.
490 2008-01-25 Jb Evain <jbevain@novell.com>
492 * MemberMemberBinding.cs, MemberListBinding.cs,
493 MemberAssignment.cs, MemberBinding.cs:
496 2008-01-25 Jb Evain <jbevain@novell.com>
498 * Expression.cs: implement PropertyOrField.
500 2008-01-24 Jb Evain <jbevain@novell.com>
502 * Expression.cs, MemberExpression.cs, ExpressionPrinter.cs:
503 implement Field and Property.
505 2008-01-22 Miguel de Icaza <miguel@novell.com>
507 * BinaryExpression.cs: Unleash the power of cut and paste.
509 Bring a bunch of operatros from mcs/expression.cs
511 * Expression.cs: There is no op_LogicalAnd or op_LogicalOr, I just
512 used those from mcs, that was wrong. use the proper ones, clean
515 * BinaryExpression.cs: Add method invocations for binary methods.
517 2008-01-22 Jb Evain <jbevain@novell.com>
519 * Expression.cs, ExpressionPrinter.cs: implement NewArrayList.
521 2008-01-22 Jb Evain <jbevain@novell.com>
523 * Expression.cs, ExpressionPrinter.cs, NewArrayExpression.cs:
524 implement Expression.NewArrayBounds.
526 2008-01-22 Jb Evain <jbevain@novell.com>
528 * ExpressionPrinter.cs: fix Lambda and Equal.
530 2008-01-22 Miguel de Icaza <miguel@novell.com>
532 * BinaryExpression.cs (EmitCoalesce): Add support for emitting
535 TODO: this does not use the "Conversion" Lambda, which am not sure
536 who generates this or what it is used for.
538 (EmitLogical): Fix a couple of bugs in AndAlso, OrElse.
540 * Expression.cs: Add support for Coalesce.
541 (BinaryCoreCheck): Move more checking here, instead of the helper
542 routines, will remove them next.
544 * LambdaExpression.cs (Compile): Create the delegate last, so we
545 manage to save the assembly while debugging in case of error
547 2008-01-21 Miguel de Icaza <miguel@novell.com>
549 * Expression.cs (BinaryCoreCheck): Add checking for a few
550 operators here (to avoid doing a second pass, handles AndAlso and
553 (AndAlso, OrElse): Add some code.
555 * BinaryExpression.cs: Instead of using GetValueOrDefault use
556 get_Value, as we already probed for the lack of value.
558 Split out support for And/Or to a separate routine as the code is
559 not very easy to share with the arithmetics code.
561 2008-01-21 Marek Safar <marek.safar@gmail.com>
563 * BinaryExpression.cs: Fixed initobj initialization.
565 2008-01-21 Jb Evain <jbevain@novell.com>
567 * Expression.cs, UnaryExpression.cs, BinaryExpression.cs:
568 Move the IsUnsigned helper from BinaryExpression to Expression,
569 so it can be used in UnaryExpression.
571 2008-01-21 Miguel de Icaza <miguel@novell.com>
573 * Start code generation for nullables, currently this generates
574 incorrect code for things like:
576 Expression<Func<int?, int?, int?>> e2 = (a, b) => a + b;
577 e2.Compile ().Invoke (null, 3))
579 This should return null, but returns something else.
581 * Introduce LINQ_DBG env variable, which generates a linq file in
582 /tmp; It currently does not work as well as it should, as the
583 Func<> parameters do not mwatch the generated method.
587 2008-01-20 Miguel de Icaza <miguel@novell.com>
589 Introduce support for Nullable arguments, no code is generated for
590 these yet, its only tests + node creation behavior at this point.
592 * Expression.cs (BinaryCoreCheck): Do not allow "int?" and "int"
593 as operators, they must both be nullable.
595 NullableTypes in the arguments are transformed into the underlying
596 values when doing the method validation.
598 2008-01-18 Miguel de Icaza <miguel@novell.com>
600 * ParameterExpression.cs: Add emit support.
602 2008-01-18 Jb Evain <jbevain@novell.com>
604 * Expression[Printer|Visitor].cs: implement UnaryPlus, Not, Negate.
606 2008-01-18 Miguel de Icaza <miguel@novell.com>
608 * BinaryExpression.cs: Add support for emitting code for some
609 operators (ported from the Mono C# compiler).
613 2008-01-17 Miguel de Icaza <miguel@novell.com>
615 Beginning of code generation framework for Linq.Expressions.
616 Some code was borrowed by from the C# compiler
618 * Expression_T.cs: Fill in the blanks.
620 * LambdaExpression.cs: Validation of parameters mostly, a tiny bit
623 * ConstantExpression.cs: Mostly done, need to write tests for
624 non-fundamental types and other ValueType initializations.
626 2008-01-17 Jb Evain <jbevain@novell.com>
628 * Expression.cs: implement MakeMemberAccess.
630 2008-01-17 Jb Evain <jbevain@novell.com>
632 * Expression.cs, ExpressionPrinter.cs, BinaryExpression.cs:
633 implement ArrayIndex.
635 2008-01-17 Jb Evain <jbevain@novell.com>
637 * Expression.cs: Use TypeCode for IsInt and IsNumber.
639 2008-01-16 Miguel de Icaza <miguel@novell.com>
641 * Expression.cs: Add support for user-defined operators.
643 Put back various binary operator tests.
645 2008-01-16 Jb Evain <jbevain@novell.com>
647 * Expression.cs, ExpressionPrinter.cs: fix call for static methods.
649 2008-01-15 Miguel de Icaza <miguel@novell.com>
651 * Expression.cs: Do validation on the method parameters and use
652 the return type if provided.
654 2008-01-15 Jb Evain <jbevain@novell.com>
656 * MethodCallExpression.cs, Expression.cs
657 ExpressionPrinter.cs: Implement Call (Expression, ...)
659 2008-01-15 Jb Evain <jbevain@novell.com>
661 * Expression.cs, ConditionalExpressionExpression.cs
662 ExpressionPrinter.cs : implement Expression.Condition.
664 2008-01-15 Jb Evain <jbevain@novell.com>
667 ParameterExpression.cs,
668 ExpressionPrinter.cs: implement Expression.Parameter
670 2008-01-15 Jb Evain <jbevain@novell.com>
672 * ExpressionPrinter.cs (VisitBinaryExpression): simple
673 implementation (probably misses a few cases).
675 2008-01-14 Miguel de Icaza <miguel@novell.com>
677 * Expression.cs: Bring back the (most) of binary operators. Added
678 type checking as well and reorganized the source file by topic
679 instead of alphabetical sorting.
681 2008-01-14 Jb Evain <jbevain@novell.com>
683 * ExpressionPrinter.cs: print ArrayLength.
685 2008-01-14 Jb Evain <jbevain@novell.com>
687 * Expression.cs: TypeAs can't take value types.
688 * ExpressionPrinter.cs: implement TypeAs.
690 2008-01-14 Jb Evain <jbevain@novell.com>
692 * Expression.cs: implement TypeIs.
693 * ExpressionPrinter.cs: implement VisitTypeBinaryExpression.
694 * TypeBinaryExpression.cs: add proper ctor.
696 2008-01-14 Jb Evain <jbevain@novell.com>
698 * Expression.cs, ExpressionPrinter.cs: fix for Quote's type.
700 2008-01-14 Jb Evain <jbevain@novell.com>
702 * BinaryExpression.cs,
703 * Expression.cs: revert part of Miguel's last patch.
704 MakeBinary is expected to call the appropriate factory
705 methods. Whose methods that are responsible for creating
706 the good BinaryExpression, wether they use a custom method
709 2008-01-14 Jb Evain <jbevain@novell.com>
711 * Expression.cs: MakeUnary is expected to call the appropriate
714 2008-01-14 Miguel de Icaza <miguel@novell.com>
716 * Expression.cs (Constant, MakeBinary and consumers of it): Some
717 more fill-up changes.
719 MakeBinary will need much more work to support user-provided
722 2008-01-13 Jb Evain <jbevain@novell.com>
724 * *.cs: fresh implementation.