build: use MOBILE_DYNAMIC instead of MONODROID
[mono.git] / mcs / class / System.Core / System.Runtime.CompilerServices / ExecutionScope.cs
index 0909602636117119c94e7bef5fae9fb7e7a218fa..84458d94a20cbf35f18f66e6a4a7792a2fea490d 100644 (file)
@@ -3,8 +3,9 @@
 //
 // Authors:
 //     Marek Safar  <marek.safar@gmail.com>
+//     Jb Evain  <jbevain@novell.com>
 //
-// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2007 - 2008, Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !FULL_AOT_RUNTIME
+using System;
 using System.Linq.Expressions;
 
-namespace System.Runtime.CompilerServices
-{
-       public class ExecutionScope
-       {
-               public object[] Globals;
-               public object[] Locals;
+namespace System.Runtime.CompilerServices {
+
+#if MOBILE_DYNAMIC
+       [Obsolete ("do not use this type", true)]
+#endif
+       public class ExecutionScope {
+
+               public object [] Globals;
+               public object [] Locals;
                public ExecutionScope Parent;
 
-               [MonoTODO]
-               public Delegate CreateDelegate (int indexLambda)
+#if !MOBILE_DYNAMIC
+               internal CompilationContext context;
+#endif
+               internal int compilation_unit;
+
+#if !MOBILE_DYNAMIC
+               ExecutionScope (CompilationContext context, int compilation_unit)
+               {
+                       this.context = context;
+                       this.compilation_unit = compilation_unit;
+                       this.Globals = context.GetGlobals ();
+               }
+
+               internal ExecutionScope (CompilationContext context)
+                       : this (context, 0)
+               {
+               }
+
+               internal ExecutionScope (CompilationContext context, int compilation_unit, ExecutionScope parent, object [] locals)
+                       : this (context, compilation_unit)
+               {
+                       this.Parent = parent;
+                       this.Locals = locals;
+               }
+#endif
+               public Delegate CreateDelegate (int indexLambda, object [] locals)
+               {
+#if MOBILE_DYNAMIC
+                       throw new NotSupportedException ();
+#else
+                       return context.CreateDelegate (
+                               indexLambda,
+                               new ExecutionScope (context, indexLambda, this, locals));
+#endif
+               }
+
+               public object [] CreateHoistedLocals ()
                {
-                       throw new NotImplementedException();
+#if MOBILE_DYNAMIC
+                       throw new NotSupportedException ();
+#else
+                       return context.CreateHoistedLocals (compilation_unit);
+#endif
                }
 
-               [MonoTODO]
-               public Expression IsolateExpression (Expression expression)
+               public Expression IsolateExpression (Expression expression, object [] locals)
                {
-                       throw new NotImplementedException();
+#if MOBILE_DYNAMIC
+                       throw new NotSupportedException ();
+#else
+                       return context.IsolateExpression (this, locals, expression);
+#endif
                }
        }
 }
+#endif