[IronPython] IronPython 2.6 CodePlex Source Update

merllab at microsoft.com merllab at microsoft.com
Mon Jul 27 19:08:21 CEST 2009


This is an automated email letting you know that sources 
have recently been pushed out.  You can download these newer 
sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/57254.

ADDED SOURCES
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/BinaryExpression.Generated.cs

MODIFIED SOURCES
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/BinaryExpression.Generated.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.Generated.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObject.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallInfo.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/DictionaryGlobalAllocator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/PythonScriptCode.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/GlobalAllocator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/ArrayGlobalAllocator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/SavableGlobalAllocator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/RuntimeScriptCode.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/StaticGlobalAllocator.cs
	$/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs
	$/IronPython/IronPython_Main/Config/Unsigned/App.config
	$/IronPython/IronPython_Main/Config/Signed/App.config
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Reversed.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonType.Calls.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/BindingHelpers.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/PythonExceptions.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonCalls.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Generator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/List.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Interfaces.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/XRange.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs
	$/IronPython/IronPython_Main/Src/IronPython/Runtime/Set.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/TryStatement.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ScopeStatement.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonOperator.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonNameBinder.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonAst.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/GeneratorExpression.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/FunctionDefinition.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/Expression.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ConstantExpression.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/BinaryExpression.cs
	$/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstGenerator.cs
	$/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/CompilerScope.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberAssignment.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/DebugInfoGenerator.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/ILGen.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/BoundConstants.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ElementInit.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/CatchBlock.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberMemberBinding.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberListBinding.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/ContractUtils.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/VariableBinder.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LabelInfo.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Stubs.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/SymbolDocumentGenerator.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Expressions.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.Bindings.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/StackSpiller.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/Action.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/KeyedQueue.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Unary.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/OffsetTrackingILGenerator.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Statements.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/DynamicInstructions.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightLambda.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/Function.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyDictionary.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightLambda.Generated.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/ReadOnlyCollectionBuilder.cs
	$/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/SkipInterpretExpression.cs
	$/IronPython/IronPython_Main/Src/Scripts/generate_calls.py
	$/IronPython/IronPython_Main/Src/Scripts/generate_dynamic_instructions.py
	$/IronPython/IronPython_Main/Src/Tests/test_class.py
	$/IronPython/IronPython_Main/Src/Scripts/generate_ops.py
	$/IronPython/IronPython_Main/Src/Scripts/generate_dynsites.py
	$/IronPython/IronPython_Main/Src/Tests/test_namebinding.py
	$/IronPython/IronPython_Main/Src/Tests/test_superconsole.py

CHECKIN COMMENTS
--------------------------------------------------------------------------------
Changeset Id: 1020357
Date: 7/25/2009 2:43:53 PM

(dinov) Some targetted perf fixes
The changes fall into a few broad categories:
                Reducing code gen / improving one-off code gen performance:
                                This is partially just generating less code when we do our AST transform and reducing the cost of the code we do generate.  There’s some optimizations like using the right-size dynamic nodes to allocate smaller dynamic nodes, avoid / cheapen our creation of block nodes, moving some of our code that we generate into script codes (there’s more to be done here still), using ReadOnlyCollectionBuilder in a couple of spots where it’s an obvious win, avoid generating a return label + return for simple expressions – instead just generate the expression, reduce indirection in creating generator expressions.

                                There’s also a name binding fix which improves performance of methods which contain eval/exec/etc…  along w/ some bug fixes to match CPython’s behavior.  Currently if a method includes import * or something which forces a locals directory we’ll turn var lookups into full runtime lookups.  CPython doesn’t do this so we look for a global where CPython throws a name error.  W/ the fix we can now always lookup in a local variable.

                                Also implemented a simple constant folder that supports ints/longs/doubles for all operators and strings for addition.  If eval code gets 100% constant folded we do no code gen.  

                Runtime improvements:
                                Generators:
                                                Cache the right sized data tuple so we don’t have to fish it out of the potentially larger MutableTuple.  
Move active to a real bool as we hit this flag repeatedly during generation iteration.  
Reduce to check to see if we need CanSetSysExcInfo to just one time through the generator loop.
Make generators non-finalizable.  Instead they allocate a finalizable object and re-cycle it back into a temporary when ...


(Shelveset: TargettedPerfFixesFinal;REDMOND\dinov | SNAP CheckinId: 9009)
--------------------------------------------------------------------------------
Changeset Id: 1018838
Date: 7/24/2009 12:09:33 PM

(dinov) 23555    2              High       Call incorrect __init__ when creating new instances        IronPython\2.6 dinov_cp
23564 an object's __del__ is not called unless its original type had a __del__ 

Currently when we generate the rule for calling a type we burn in a reference to __init__ and __del__ if the type defines it.  But that doesn’t work if the type looks like:

class x(object):
                def __new__(cls, toMake):
                                return object.__new__(toMake)

class subx(x):
                def __init__(self, *args):
                                print ‘init’
                def __del__(self):
                                print ‘del’

x(subx)

In this case we see that x has no init or del method and therefore we create a rule which will never call them.  But then __new__ turns around and returns a subtype of x which should have it’s __init__ method run.  

The fix is to create a 2nd dynamic site which specifically handles calling __new__ and creating the finalization registration code.  This dynamic site will do a type check against the type that’s actually getting created, lookup the appropriate __init__/__del__, and produce the correct rule.  The new custom binder also has pre-compiled rules for the common case to keep the recent optimization of pre-compiled rules for type creation.   We don’t use this site if the type doesn’t override __new__ (as long as the type doesn’t declare __del__ which we won’t optimize to keep things simple).

Also fixes a problem w/ AssemblyResolve event on .NET 4.0 by moving the try/catch to outside of where the method will be JITed



(Shelveset: FixInitDelFinal;REDMOND\dinov | SNAP CheckinId: 8999)



More information about the Ironpython-users mailing list