Thursday, January 9, 2014

Target 0.0.2: Status 5

The progress of the code is: big refactoring.

The invoke-dynamic like comportament is a big component, and maybe it will not need to be implemented at all, but before wanting to implement it or not, the reasoning is simply that the runtime library has some difficult use-cases of matching C++ code to C# (or vice-versa). The code is improved in handling library concerns and I will work to improve it even further.

In short, the code changes are the following:

Before refactor, this were the variables were tracked by CR compiler to map a C++ code to a C# code:
  private readonly Dictionary<string, CppMethodBodyAttribute> _supportedCppMethods = new Dictionary<string, CppMethodBodyAttribute>();

private readonly Dictionary<string, MetaLinker> _supportedCilMethods = new Dictionary<string, MetaLinker>();
private readonly Dictionary<string, MethodBase> _supportedMethods = new Dictionary<string, MethodBase>();
public readonly Dictionary<Type, Type> MappedTypes = new Dictionary<Type, Type>();
public readonly Dictionary<Type, MapTypeAttribute> TypeAttribute = new Dictionary<Type, MapTypeAttribute>();
public readonly Dictionary<Type, Type> ReverseMappedTypes = new Dictionary<Type, Type>();

private readonly Dictionary<Type, List<CppMethodDefinition>> _crMethods =
            new Dictionary<Type, List<CppMethodDefinition>>();
public readonly Dictionary<string, MethodBase> UsedCppMethods = new Dictionary<string, MethodBase>();
public readonly Dictionary<string, MetaLinker> UsedCilMethods = new Dictionary<string, MetaLinker>();
public readonly Dictionary<Type, Type> UsedTypes = new Dictionary<Type, Type>();
After refactor:
         public readonly Dictionary<Type, Type> MappedTypes = new Dictionary<Type, Type>();

Sadly the today's code (soon it will be fixed) it has a bug that does not include all code (a linker bug). This cleanup also is important as it improves the way the escape analysis works and separate to make variables to contain escape data.

More fixes will come, but this is rewrite was important to improve the library level integration of C++ and C#.

No comments:

Post a Comment