[IronPython] Pyc in IronPython 2.6

Dino Viehland dinov at microsoft.com
Tue Aug 18 19:33:57 CEST 2009

Compile on 64-bit?  :)

I have a guess of what the problem is here but I haven't run a test to
Confirm.  I recently ran into a similar issue when I increased the
number of constants we were generating - except for I was just trying
to pre-compile a single file.

If you want to build from source you can modify ToDiskRewriter.cs to add a
new member variable:

private Dictionary<ConstantExpression, Expression> _constantCache;

And then in VisitConstant replace:
                    Expression serialized = exprSerializable.CreateExpression();

                return AstUtils.Convert(
                    Expression.ArrayAccess(_constantPool, AstUtils.Constant(_constants.Count - 1)),

                Expression res;

                if (!_constantCache.TryGetValue(node, out res)) {
                    Expression serialized = exprSerializable.CreateExpression();

                    _constantCache[node] = res = AstUtils.Convert(
                        Expression.ArrayAccess(_constantPool, AstUtils.Constant(_constants.Count - 1)),

                return res;

and then add:

_constantCache = new Dictionary<ConstantExpression, Expression>();

To EnsureConstantPool()

If that doesn't work, or you don't want to build from source, I'll attempt to repro it and see what's going on.

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Glenn Jones
> Sent: Tuesday, August 18, 2009 5:31 AM
> To: users at lists.ironpython.com
> Subject: [IronPython] Pyc in IronPython 2.6
> Hi guys,
> I have just created a ticket
> http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=24362,
> but I was wondering if there was anything obvious that I could do to
> get this working.
> Thanks
> Glenn
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

More information about the Ironpython-users mailing list