Browse Source

参考字母哥的CSharp.lua项目,初步集成XLua跟CSharp.lua,生成lua代码成功

tanghai 4 năm trước cách đây
mục cha
commit
2a9a7e508b
100 tập tin đã thay đổi với 8540 bổ sung5930 xóa
  1. 6 0
      .gitignore
  2. 0 1
      Libs/Interpreter/.gitignore
  3. 0 1
      Libs/Interpreter/App/.gitignore
  4. 0 158
      Libs/Interpreter/App/App.vcxproj
  5. 0 27
      Libs/Interpreter/App/App.vcxproj.filters
  6. 0 7
      Libs/Interpreter/App/App.vcxproj.user
  7. 0 11
      Libs/Interpreter/App/Main.cpp
  8. 0 0
      Libs/Interpreter/App/Main.h
  9. 0 39
      Libs/Interpreter/Interpreter.sln
  10. 0 1
      Libs/Interpreter/Interpreter/.gitignore
  11. 0 60
      Libs/Interpreter/Interpreter/Interpreter.cpp
  12. 0 19
      Libs/Interpreter/Interpreter/Interpreter.h
  13. 0 173
      Libs/Interpreter/Interpreter/Interpreter.vcxproj
  14. 0 27
      Libs/Interpreter/Interpreter/Interpreter.vcxproj.filters
  15. 0 4
      Libs/Interpreter/Interpreter/Interpreter.vcxproj.user
  16. 0 347
      Libs/Interpreter/include/mono/cil/opcode.def
  17. 0 119
      Libs/Interpreter/include/mono/jit/jit.h
  18. 0 231
      Libs/Interpreter/include/mono/metadata/appdomain.h
  19. 0 136
      Libs/Interpreter/include/mono/metadata/assembly.h
  20. 0 274
      Libs/Interpreter/include/mono/metadata/attrdefs.h
  21. 0 118
      Libs/Interpreter/include/mono/metadata/blob.h
  22. 0 313
      Libs/Interpreter/include/mono/metadata/class.h
  23. 0 54
      Libs/Interpreter/include/mono/metadata/debug-helpers.h
  24. 0 114
      Libs/Interpreter/include/mono/metadata/debug-mono-symfile.h
  25. 0 23
      Libs/Interpreter/include/mono/metadata/environment.h
  26. 0 178
      Libs/Interpreter/include/mono/metadata/exception.h
  27. 0 97
      Libs/Interpreter/include/mono/metadata/image.h
  28. 0 109
      Libs/Interpreter/include/mono/metadata/loader.h
  29. 0 515
      Libs/Interpreter/include/mono/metadata/metadata.h
  30. 0 38
      Libs/Interpreter/include/mono/metadata/mono-config.h
  31. 0 232
      Libs/Interpreter/include/mono/metadata/mono-debug.h
  32. 0 129
      Libs/Interpreter/include/mono/metadata/mono-gc.h
  33. 0 22
      Libs/Interpreter/include/mono/metadata/object-forward.h
  34. 0 403
      Libs/Interpreter/include/mono/metadata/object.h
  35. 0 81
      Libs/Interpreter/include/mono/metadata/opcodes.h
  36. 0 109
      Libs/Interpreter/include/mono/metadata/profiler-events.h
  37. 0 249
      Libs/Interpreter/include/mono/metadata/profiler.h
  38. 0 174
      Libs/Interpreter/include/mono/metadata/reflection.h
  39. 0 492
      Libs/Interpreter/include/mono/metadata/row-indexes.h
  40. 0 110
      Libs/Interpreter/include/mono/metadata/sgen-bridge.h
  41. 0 67
      Libs/Interpreter/include/mono/metadata/threads.h
  42. 0 45
      Libs/Interpreter/include/mono/metadata/tokentype.h
  43. 0 66
      Libs/Interpreter/include/mono/metadata/verify.h
  44. 0 105
      Libs/Interpreter/include/mono/utils/mono-counters.h
  45. 0 43
      Libs/Interpreter/include/mono/utils/mono-dl-fallback.h
  46. 0 105
      Libs/Interpreter/include/mono/utils/mono-error.h
  47. 0 13
      Libs/Interpreter/include/mono/utils/mono-forward.h
  48. 0 36
      Libs/Interpreter/include/mono/utils/mono-jemalloc.h
  49. 0 31
      Libs/Interpreter/include/mono/utils/mono-logger.h
  50. 0 194
      Libs/Interpreter/include/mono/utils/mono-publib.h
  51. BIN
      Libs/Interpreter/libs/MonoPosixHelper.dll
  52. BIN
      Libs/Interpreter/libs/MonoPosixHelper.lib
  53. BIN
      Libs/Interpreter/libs/MonoPosixHelper.pdb
  54. BIN
      Libs/Interpreter/libs/libmono-static-sgen.lib
  55. BIN
      Libs/Interpreter/libs/mono-2.0-sgen.dll
  56. BIN
      Libs/Interpreter/libs/mono-2.0-sgen.lib
  57. BIN
      Libs/Interpreter/libs/mono-2.0-sgen.pdb
  58. 0 1
      Libs/Interpreter/readme.txt
  59. 0 29
      Unity/Assembly-CSharp.csproj
  60. 8 0
      Unity/Assets/Bundles/Lua.meta
  61. 8 0
      Unity/Assets/Bundles/Lua/CSharpLua.meta
  62. 55 0
      Unity/Assets/Bundles/Lua/CSharpLua/All.lua.txt
  63. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/All.lua.txt.meta
  64. 57 0
      Unity/Assets/Bundles/Lua/CSharpLua/Classloader.lua.txt
  65. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/Classloader.lua.txt.meta
  66. 9 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem.meta
  67. 1159 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Array.lua.txt
  68. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Array.lua.txt.meta
  69. 116 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Boolean.lua.txt
  70. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Boolean.lua.txt.meta
  71. 232 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Char.lua.txt
  72. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Char.lua.txt.meta
  73. 8 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections.meta
  74. 703 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Dictionary.lua.txt
  75. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Dictionary.lua.txt.meta
  76. 167 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/EqualityComparer.lua.txt
  77. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/EqualityComparer.lua.txt.meta
  78. 316 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/HashSet.lua.txt
  79. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/HashSet.lua.txt.meta
  80. 346 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/LinkedList.lua.txt
  81. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/LinkedList.lua.txt.meta
  82. 1282 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Linq.lua.txt
  83. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Linq.lua.txt.meta
  84. 74 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/List.lua.txt
  85. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/List.lua.txt.meta
  86. 54 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Queue.lua.txt
  87. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Queue.lua.txt.meta
  88. 862 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedDictionary.lua.txt
  89. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedDictionary.lua.txt.meta
  90. 25 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedSet.lua.txt
  91. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedSet.lua.txt.meta
  92. 45 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Stack.lua.txt
  93. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Stack.lua.txt.meta
  94. 66 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Console.lua.txt
  95. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Console.lua.txt.meta
  96. 790 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Convert.lua.txt
  97. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Convert.lua.txt.meta
  98. 1579 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Core.lua.txt
  99. 7 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Core.lua.txt.meta
  100. 447 0
      Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/DateTime.lua.txt

+ 6 - 0
.gitignore

@@ -56,3 +56,9 @@ Server/.DS_Store
 /Unity/Unity.Model.csproj
 /Unity/Unity.ModelView.csproj
 /Unity/Unity.ThirdParty.csproj
+/Unity/Assets/Bundles/Lua/ModelView
+/Unity/Assets/Bundles/Lua/Hotfix
+/Unity/Assets/Bundles/Lua/HotfixView
+/Unity/Assets/Bundles/Lua/Model
+/Unity/Assets/Mono/XLua/Gen
+/Unity/Assets/Res/Code

+ 0 - 1
Libs/Interpreter/.gitignore

@@ -1 +0,0 @@
-/x64

+ 0 - 1
Libs/Interpreter/App/.gitignore

@@ -1 +0,0 @@
-/x64

+ 0 - 158
Libs/Interpreter/App/App.vcxproj

@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <VCProjectVersion>16.0</VCProjectVersion>
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{6781b069-a20c-43a2-a83c-1f3d3f3e8cd8}</ProjectGuid>
-    <RootNamespace>App</RootNamespace>
-    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="Shared">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)\include;$(SolutionDir);$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
-    <OutDir>$(SolutionDir)Bin\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Interpreter\Interpreter.vcxproj">
-      <Project>{b8bd0219-aea8-4167-abd7-29d7628803d9}</Project>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="Main.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="Main.cpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 27
Libs/Interpreter/App/App.vcxproj.filters

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="源文件">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="头文件">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
-    </Filter>
-    <Filter Include="资源文件">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="Main.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="Main.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

+ 0 - 7
Libs/Interpreter/App/App.vcxproj.user

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LocalDebuggerCommandArguments>. Test.dll</LocalDebuggerCommandArguments>
-    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
-  </PropertyGroup>
-</Project>

+ 0 - 11
Libs/Interpreter/App/Main.cpp

@@ -1,11 +0,0 @@
-#include "Main.h"
-#include "Interpreter/Interpreter.h"
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
-    interpreter_init(argv[1], argv[2]);
-    std::cout << "1111111111111111111" << std::endl;
-    char name[50];
-    std::cin >> name;
-}

+ 0 - 0
Libs/Interpreter/App/Main.h


+ 0 - 39
Libs/Interpreter/Interpreter.sln

@@ -1,39 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31702.278
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Interpreter", "Interpreter\Interpreter.vcxproj", "{B8BD0219-AEA8-4167-ABD7-29D7628803D9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "App", "App\App.vcxproj", "{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|x64 = Release|x64
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Debug|x64.ActiveCfg = Debug|x64
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Debug|x64.Build.0 = Debug|x64
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Debug|x86.ActiveCfg = Debug|Win32
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Release|x64.ActiveCfg = Release|x64
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Release|x64.Build.0 = Release|x64
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Release|x86.ActiveCfg = Release|Win32
-		{B8BD0219-AEA8-4167-ABD7-29D7628803D9}.Release|x86.Build.0 = Release|Win32
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Debug|x64.ActiveCfg = Debug|x64
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Debug|x64.Build.0 = Debug|x64
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Debug|x86.ActiveCfg = Debug|Win32
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Release|x64.ActiveCfg = Release|x64
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Release|x64.Build.0 = Release|x64
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Release|x86.ActiveCfg = Release|Win32
-		{6781B069-A20C-43A2-A83C-1F3D3F3E8CD8}.Release|x86.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {B5408F2B-2F4D-4830-8D78-3B1DE8FF60F4}
-	EndGlobalSection
-EndGlobal

+ 0 - 1
Libs/Interpreter/Interpreter/.gitignore

@@ -1 +0,0 @@
-/x64

+ 0 - 60
Libs/Interpreter/Interpreter/Interpreter.cpp

@@ -1,60 +0,0 @@
-#include "Interpreter.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <mono/jit/jit.h>
-#include <mono/metadata/environment.h>
-#include <mono/metadata/mono-config.h>
-#include <mono/utils/mono-publib.h>
-#include <mono/utils/mono-logger.h>
-#include <mono/metadata/assembly.h>
-#include <mono/metadata/mono-debug.h>
-#include <mono/metadata/exception.h>
-
-void(*log)(const char* buf, int len);
-
-void log_format(const char* fmt, ...)
-{
-    if (log == 0)
-    {
-        return;
-    }
-
-    char buffer[1024];
-    va_list argptr;
-    va_start(argptr, fmt);
-    int n = vsprintf_s(buffer, fmt, argptr);
-    va_end(argptr);
-    log(buffer, n);
-}
-
-void interpreter_set_log(void(*plog)(const char* buf, int len))
-{
-    log = plog;
-}
-
-void interpreter_log(const char* str)
-{
-    log_format("%s", str);
-}
-
-void interpreter_init(const char* bundleDir, const char* dllName)
-{
-    mono_config_parse(NULL);
-    mono_set_dirs(bundleDir, bundleDir);
-    log_format("1111111111111111111111 %s  %s %d", bundleDir, dllName, strlen(bundleDir));
-    char str[100];
-    memset(str, 0, 100);
-    sprintf_s(str, "%s/%s", bundleDir, dllName);
-    MonoDomain* monoDomain = mono_jit_init("aaaaa");
-    //MonoAssembly* assembly = mono_domain_assembly_open(monoDomain, dllName);
-    //MonoImage* monoImage = mono_assembly_get_image(assembly);
-    //MonoClass* entityClass = mono_class_from_name(monoImage, "ET", "TestEntry");
-    //MonoMethod* processMethod = mono_class_get_method_from_name(entityClass, "Test", 0);
-    //
-    //void* args[2];
-    //args[0] = new int(5);
-    //args[1] = new int(100);
-    //MonoObject* exception = NULL;
-    //MonoObject* result = mono_runtime_invoke(processMethod, nullptr, args, &exception);
-}

+ 0 - 19
Libs/Interpreter/Interpreter/Interpreter.h

@@ -1,19 +0,0 @@
-// Macro to put before functions that need to be exposed to C#
-#ifdef DLL_EXPORTS
-#define INTERPRETER_DLL _declspec(dllexport)
-#else
-#define INTERPRETER_DLL
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-    INTERPRETER_DLL void interpreter_set_log(void(*writelog)(const char* buf, int len));
-
-    INTERPRETER_DLL void interpreter_log(const char* str);
-
-    INTERPRETER_DLL void interpreter_init(const char* bundleDir, const char* dllName);
-
-#ifdef __cplusplus
-}
-#endif

+ 0 - 173
Libs/Interpreter/Interpreter/Interpreter.vcxproj

@@ -1,173 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="Interpreter.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="Interpreter.cpp" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <VCProjectVersion>16.0</VCProjectVersion>
-    <Keyword>Win32Proj</Keyword>
-    <ProjectGuid>{b8bd0219-aea8-4167-abd7-29d7628803d9}</ProjectGuid>
-    <RootNamespace>CSharpInterpreter</RootNamespace>
-    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
-    <ProjectName>Interpreter</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <PlatformToolset>v142</PlatformToolset>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="Shared">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <LibraryPath>E:\ET\Libs\CSharpInterpreter\libs;$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(SolutionDir)\Include;$(SolutionDir);$(IncludePath)</IncludePath>
-    <LibraryPath>$(SolutionDir)\Libs;$(LibraryPath)</LibraryPath>
-    <OutDir>$(SolutionDir)Bin\</OutDir>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;_DEBUG;CSHARPINTERPRETER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableUAC>false</EnableUAC>
-      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>WIN32;NDEBUG;CSHARPINTERPRETER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableUAC>false</EnableUAC>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>_DEBUG;DLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <PrecompiledHeaderFile>
-      </PrecompiledHeaderFile>
-      <PrecompiledHeaderOutputFile />
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableUAC>false</EnableUAC>
-      <AdditionalDependencies>mono-2.0-sgen.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <SDLCheck>true</SDLCheck>
-      <PreprocessorDefinitions>NDEBUG;CSHARPINTERPRETER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ConformanceMode>true</ConformanceMode>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableUAC>false</EnableUAC>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 27
Libs/Interpreter/Interpreter/Interpreter.vcxproj.filters

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="源文件">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="头文件">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
-    </Filter>
-    <Filter Include="资源文件">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="Interpreter.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="Interpreter.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

+ 0 - 4
Libs/Interpreter/Interpreter/Interpreter.vcxproj.user

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup />
-</Project>

+ 0 - 347
Libs/Interpreter/include/mono/cil/opcode.def

@@ -1,347 +0,0 @@
-/* GENERATED FILE, DO NOT EDIT. Edit cil-opcodes.xml instead and run "make opcode.def" to regenerate. */
-OPDEF(CEE_NOP, "nop", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x00, NEXT)
-OPDEF(CEE_BREAK, "break", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x01, ERROR)
-OPDEF(CEE_LDARG_0, "ldarg.0", Pop0, Push1, InlineNone, 0, 1, 0xFF, 0x02, NEXT)
-OPDEF(CEE_LDARG_1, "ldarg.1", Pop0, Push1, InlineNone, 1, 1, 0xFF, 0x03, NEXT)
-OPDEF(CEE_LDARG_2, "ldarg.2", Pop0, Push1, InlineNone, 2, 1, 0xFF, 0x04, NEXT)
-OPDEF(CEE_LDARG_3, "ldarg.3", Pop0, Push1, InlineNone, 3, 1, 0xFF, 0x05, NEXT)
-OPDEF(CEE_LDLOC_0, "ldloc.0", Pop0, Push1, InlineNone, 0, 1, 0xFF, 0x06, NEXT)
-OPDEF(CEE_LDLOC_1, "ldloc.1", Pop0, Push1, InlineNone, 1, 1, 0xFF, 0x07, NEXT)
-OPDEF(CEE_LDLOC_2, "ldloc.2", Pop0, Push1, InlineNone, 2, 1, 0xFF, 0x08, NEXT)
-OPDEF(CEE_LDLOC_3, "ldloc.3", Pop0, Push1, InlineNone, 3, 1, 0xFF, 0x09, NEXT)
-OPDEF(CEE_STLOC_0, "stloc.0", Pop1, Push0, InlineNone, 0, 1, 0xFF, 0x0A, NEXT)
-OPDEF(CEE_STLOC_1, "stloc.1", Pop1, Push0, InlineNone, 1, 1, 0xFF, 0x0B, NEXT)
-OPDEF(CEE_STLOC_2, "stloc.2", Pop1, Push0, InlineNone, 2, 1, 0xFF, 0x0C, NEXT)
-OPDEF(CEE_STLOC_3, "stloc.3", Pop1, Push0, InlineNone, 3, 1, 0xFF, 0x0D, NEXT)
-OPDEF(CEE_LDARG_S, "ldarg.s", Pop0, Push1, ShortInlineVar, 0, 1, 0xFF, 0x0E, NEXT)
-OPDEF(CEE_LDARGA_S, "ldarga.s", Pop0, PushI, ShortInlineVar, 0, 1, 0xFF, 0x0F, NEXT)
-OPDEF(CEE_STARG_S, "starg.s", Pop1, Push0, ShortInlineVar, 0, 1, 0xFF, 0x10, NEXT)
-OPDEF(CEE_LDLOC_S, "ldloc.s", Pop0, Push1, ShortInlineVar, 0, 1, 0xFF, 0x11, NEXT)
-OPDEF(CEE_LDLOCA_S, "ldloca.s", Pop0, PushI, ShortInlineVar, 0, 1, 0xFF, 0x12, NEXT)
-OPDEF(CEE_STLOC_S, "stloc.s", Pop1, Push0, ShortInlineVar, 0, 1, 0xFF, 0x13, NEXT)
-OPDEF(CEE_LDNULL, "ldnull", Pop0, PushRef, InlineNone, 0, 1, 0xFF, 0x14, NEXT)
-OPDEF(CEE_LDC_I4_M1, "ldc.i4.m1", Pop0, PushI, InlineNone, -1, 1, 0xFF, 0x15, NEXT)
-OPDEF(CEE_LDC_I4_0, "ldc.i4.0", Pop0, PushI, InlineNone, 0, 1, 0xFF, 0x16, NEXT)
-OPDEF(CEE_LDC_I4_1, "ldc.i4.1", Pop0, PushI, InlineNone, 1, 1, 0xFF, 0x17, NEXT)
-OPDEF(CEE_LDC_I4_2, "ldc.i4.2", Pop0, PushI, InlineNone, 2, 1, 0xFF, 0x18, NEXT)
-OPDEF(CEE_LDC_I4_3, "ldc.i4.3", Pop0, PushI, InlineNone, 3, 1, 0xFF, 0x19, NEXT)
-OPDEF(CEE_LDC_I4_4, "ldc.i4.4", Pop0, PushI, InlineNone, 4, 1, 0xFF, 0x1A, NEXT)
-OPDEF(CEE_LDC_I4_5, "ldc.i4.5", Pop0, PushI, InlineNone, 5, 1, 0xFF, 0x1B, NEXT)
-OPDEF(CEE_LDC_I4_6, "ldc.i4.6", Pop0, PushI, InlineNone, 6, 1, 0xFF, 0x1C, NEXT)
-OPDEF(CEE_LDC_I4_7, "ldc.i4.7", Pop0, PushI, InlineNone, 7, 1, 0xFF, 0x1D, NEXT)
-OPDEF(CEE_LDC_I4_8, "ldc.i4.8", Pop0, PushI, InlineNone, 8, 1, 0xFF, 0x1E, NEXT)
-OPDEF(CEE_LDC_I4_S, "ldc.i4.s", Pop0, PushI, ShortInlineI, 0, 1, 0xFF, 0x1F, NEXT)
-OPDEF(CEE_LDC_I4, "ldc.i4", Pop0, PushI, InlineI, 0, 1, 0xFF, 0x20, NEXT)
-OPDEF(CEE_LDC_I8, "ldc.i8", Pop0, PushI8, InlineI8, 0, 1, 0xFF, 0x21, NEXT)
-OPDEF(CEE_LDC_R4, "ldc.r4", Pop0, PushR4, ShortInlineR, 0, 1, 0xFF, 0x22, NEXT)
-OPDEF(CEE_LDC_R8, "ldc.r8", Pop0, PushR8, InlineR, 0, 1, 0xFF, 0x23, NEXT)
-OPDEF(CEE_UNUSED99, "unused99", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x24, NEXT)
-OPDEF(CEE_DUP, "dup", Pop1, Push1+Push1, InlineNone, 0, 1, 0xFF, 0x25, NEXT)
-OPDEF(CEE_POP, "pop", Pop1, Push0, InlineNone, 0, 1, 0xFF, 0x26, NEXT)
-OPDEF(CEE_JMP, "jmp", Pop0, Push0, InlineMethod, 0, 1, 0xFF, 0x27, CALL)
-OPDEF(CEE_CALL, "call", VarPop, VarPush, InlineMethod, 0, 1, 0xFF, 0x28, CALL)
-OPDEF(CEE_CALLI, "calli", VarPop, VarPush, InlineSig, 0, 1, 0xFF, 0x29, CALL)
-OPDEF(CEE_RET, "ret", VarPop, Push0, InlineNone, 0, 1, 0xFF, 0x2A, RETURN)
-OPDEF(CEE_BR_S, "br.s", Pop0, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2B, BRANCH)
-OPDEF(CEE_BRFALSE_S, "brfalse.s", PopI, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2C, COND_BRANCH)
-OPDEF(CEE_BRTRUE_S, "brtrue.s", PopI, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2D, COND_BRANCH)
-OPDEF(CEE_BEQ_S, "beq.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2E, COND_BRANCH)
-OPDEF(CEE_BGE_S, "bge.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x2F, COND_BRANCH)
-OPDEF(CEE_BGT_S, "bgt.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x30, COND_BRANCH)
-OPDEF(CEE_BLE_S, "ble.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x31, COND_BRANCH)
-OPDEF(CEE_BLT_S, "blt.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x32, COND_BRANCH)
-OPDEF(CEE_BNE_UN_S, "bne.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x33, COND_BRANCH)
-OPDEF(CEE_BGE_UN_S, "bge.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x34, COND_BRANCH)
-OPDEF(CEE_BGT_UN_S, "bgt.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x35, COND_BRANCH)
-OPDEF(CEE_BLE_UN_S, "ble.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x36, COND_BRANCH)
-OPDEF(CEE_BLT_UN_S, "blt.un.s", Pop1+Pop1, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0x37, COND_BRANCH)
-OPDEF(CEE_BR, "br", Pop0, Push0, InlineBrTarget, 0, 1, 0xFF, 0x38, BRANCH)
-OPDEF(CEE_BRFALSE, "brfalse", PopI, Push0, InlineBrTarget, 0, 1, 0xFF, 0x39, COND_BRANCH)
-OPDEF(CEE_BRTRUE, "brtrue", PopI, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3A, COND_BRANCH)
-OPDEF(CEE_BEQ, "beq", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3B, COND_BRANCH)
-OPDEF(CEE_BGE, "bge", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3C, COND_BRANCH)
-OPDEF(CEE_BGT, "bgt", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3D, COND_BRANCH)
-OPDEF(CEE_BLE, "ble", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3E, COND_BRANCH)
-OPDEF(CEE_BLT, "blt", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x3F, COND_BRANCH)
-OPDEF(CEE_BNE_UN, "bne.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x40, COND_BRANCH)
-OPDEF(CEE_BGE_UN, "bge.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x41, COND_BRANCH)
-OPDEF(CEE_BGT_UN, "bgt.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x42, COND_BRANCH)
-OPDEF(CEE_BLE_UN, "ble.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x43, COND_BRANCH)
-OPDEF(CEE_BLT_UN, "blt.un", Pop1+Pop1, Push0, InlineBrTarget, 0, 1, 0xFF, 0x44, COND_BRANCH)
-OPDEF(CEE_SWITCH, "switch", PopI, Push0, InlineSwitch, 0, 1, 0xFF, 0x45, COND_BRANCH)
-OPDEF(CEE_LDIND_I1, "ldind.i1", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x46, NEXT)
-OPDEF(CEE_LDIND_U1, "ldind.u1", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x47, NEXT)
-OPDEF(CEE_LDIND_I2, "ldind.i2", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x48, NEXT)
-OPDEF(CEE_LDIND_U2, "ldind.u2", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x49, NEXT)
-OPDEF(CEE_LDIND_I4, "ldind.i4", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4A, NEXT)
-OPDEF(CEE_LDIND_U4, "ldind.u4", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4B, NEXT)
-OPDEF(CEE_LDIND_I8, "ldind.i8", PopI, PushI8, InlineNone, 0, 1, 0xFF, 0x4C, NEXT)
-OPDEF(CEE_LDIND_I, "ldind.i", PopI, PushI, InlineNone, 0, 1, 0xFF, 0x4D, NEXT)
-OPDEF(CEE_LDIND_R4, "ldind.r4", PopI, PushR4, InlineNone, 0, 1, 0xFF, 0x4E, NEXT)
-OPDEF(CEE_LDIND_R8, "ldind.r8", PopI, PushR8, InlineNone, 0, 1, 0xFF, 0x4F, NEXT)
-OPDEF(CEE_LDIND_REF, "ldind.ref", PopI, PushRef, InlineNone, 0, 1, 0xFF, 0x50, NEXT)
-OPDEF(CEE_STIND_REF, "stind.ref", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x51, NEXT)
-OPDEF(CEE_STIND_I1, "stind.i1", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x52, NEXT)
-OPDEF(CEE_STIND_I2, "stind.i2", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x53, NEXT)
-OPDEF(CEE_STIND_I4, "stind.i4", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x54, NEXT)
-OPDEF(CEE_STIND_I8, "stind.i8", PopI+PopI8, Push0, InlineNone, 0, 1, 0xFF, 0x55, NEXT)
-OPDEF(CEE_STIND_R4, "stind.r4", PopI+PopR4, Push0, InlineNone, 0, 1, 0xFF, 0x56, NEXT)
-OPDEF(CEE_STIND_R8, "stind.r8", PopI+PopR8, Push0, InlineNone, 0, 1, 0xFF, 0x57, NEXT)
-OPDEF(CEE_ADD, "add", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x58, NEXT)
-OPDEF(CEE_SUB, "sub", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x59, NEXT)
-OPDEF(CEE_MUL, "mul", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5A, NEXT)
-OPDEF(CEE_DIV, "div", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5B, NEXT)
-OPDEF(CEE_DIV_UN, "div.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5C, NEXT)
-OPDEF(CEE_REM, "rem", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5D, NEXT)
-OPDEF(CEE_REM_UN, "rem.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5E, NEXT)
-OPDEF(CEE_AND, "and", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x5F, NEXT)
-OPDEF(CEE_OR, "or", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x60, NEXT)
-OPDEF(CEE_XOR, "xor", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x61, NEXT)
-OPDEF(CEE_SHL, "shl", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x62, NEXT)
-OPDEF(CEE_SHR, "shr", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x63, NEXT)
-OPDEF(CEE_SHR_UN, "shr.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x64, NEXT)
-OPDEF(CEE_NEG, "neg", Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x65, NEXT)
-OPDEF(CEE_NOT, "not", Pop1, Push1, InlineNone, 0, 1, 0xFF, 0x66, NEXT)
-OPDEF(CEE_CONV_I1, "conv.i1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x67, NEXT)
-OPDEF(CEE_CONV_I2, "conv.i2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x68, NEXT)
-OPDEF(CEE_CONV_I4, "conv.i4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x69, NEXT)
-OPDEF(CEE_CONV_I8, "conv.i8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x6A, NEXT)
-OPDEF(CEE_CONV_R4, "conv.r4", Pop1, PushR4, InlineNone, 0, 1, 0xFF, 0x6B, NEXT)
-OPDEF(CEE_CONV_R8, "conv.r8", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0x6C, NEXT)
-OPDEF(CEE_CONV_U4, "conv.u4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x6D, NEXT)
-OPDEF(CEE_CONV_U8, "conv.u8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x6E, NEXT)
-OPDEF(CEE_CALLVIRT, "callvirt", VarPop, VarPush, InlineMethod, 0, 1, 0xFF, 0x6F, CALL)
-OPDEF(CEE_CPOBJ, "cpobj", PopI+PopI, Push0, InlineType, 0, 1, 0xFF, 0x70, NEXT)
-OPDEF(CEE_LDOBJ, "ldobj", PopI, Push1, InlineType, 0, 1, 0xFF, 0x71, NEXT)
-OPDEF(CEE_LDSTR, "ldstr", Pop0, PushRef, InlineString, 0, 1, 0xFF, 0x72, NEXT)
-OPDEF(CEE_NEWOBJ, "newobj", VarPop, PushRef, InlineMethod, 0, 1, 0xFF, 0x73, CALL)
-OPDEF(CEE_CASTCLASS, "castclass", PopRef, PushRef, InlineType, 0, 1, 0xFF, 0x74, NEXT)
-OPDEF(CEE_ISINST, "isinst", PopRef, PushI, InlineType, 0, 1, 0xFF, 0x75, NEXT)
-OPDEF(CEE_CONV_R_UN, "conv.r.un", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0x76, NEXT)
-OPDEF(CEE_UNUSED58, "unused58", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x77, NEXT)
-OPDEF(CEE_UNUSED1, "unused1", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0x78, NEXT)
-OPDEF(CEE_UNBOX, "unbox", PopRef, PushI, InlineType, 0, 1, 0xFF, 0x79, NEXT)
-OPDEF(CEE_THROW, "throw", PopRef, Push0, InlineNone, 0, 1, 0xFF, 0x7A, ERROR)
-OPDEF(CEE_LDFLD, "ldfld", PopRef, Push1, InlineField, 0, 1, 0xFF, 0x7B, NEXT)
-OPDEF(CEE_LDFLDA, "ldflda", PopRef, PushI, InlineField, 0, 1, 0xFF, 0x7C, NEXT)
-OPDEF(CEE_STFLD, "stfld", PopRef+Pop1, Push0, InlineField, 0, 1, 0xFF, 0x7D, NEXT)
-OPDEF(CEE_LDSFLD, "ldsfld", Pop0, Push1, InlineField, 0, 1, 0xFF, 0x7E, NEXT)
-OPDEF(CEE_LDSFLDA, "ldsflda", Pop0, PushI, InlineField, 0, 1, 0xFF, 0x7F, NEXT)
-OPDEF(CEE_STSFLD, "stsfld", Pop1, Push0, InlineField, 0, 1, 0xFF, 0x80, NEXT)
-OPDEF(CEE_STOBJ, "stobj", PopI+Pop1, Push0, InlineType, 0, 1, 0xFF, 0x81, NEXT)
-OPDEF(CEE_CONV_OVF_I1_UN, "conv.ovf.i1.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x82, NEXT)
-OPDEF(CEE_CONV_OVF_I2_UN, "conv.ovf.i2.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x83, NEXT)
-OPDEF(CEE_CONV_OVF_I4_UN, "conv.ovf.i4.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x84, NEXT)
-OPDEF(CEE_CONV_OVF_I8_UN, "conv.ovf.i8.un", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x85, NEXT)
-OPDEF(CEE_CONV_OVF_U1_UN, "conv.ovf.u1.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x86, NEXT)
-OPDEF(CEE_CONV_OVF_U2_UN, "conv.ovf.u2.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x87, NEXT)
-OPDEF(CEE_CONV_OVF_U4_UN, "conv.ovf.u4.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x88, NEXT)
-OPDEF(CEE_CONV_OVF_U8_UN, "conv.ovf.u8.un", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0x89, NEXT)
-OPDEF(CEE_CONV_OVF_I_UN, "conv.ovf.i.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x8A, NEXT)
-OPDEF(CEE_CONV_OVF_U_UN, "conv.ovf.u.un", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0x8B, NEXT)
-OPDEF(CEE_BOX, "box", Pop1, PushRef, InlineType, 0, 1, 0xFF, 0x8C, NEXT)
-OPDEF(CEE_NEWARR, "newarr", PopI, PushRef, InlineType, 0, 1, 0xFF, 0x8D, NEXT)
-OPDEF(CEE_LDLEN, "ldlen", PopRef, PushI, InlineNone, 0, 1, 0xFF, 0x8E, NEXT)
-OPDEF(CEE_LDELEMA, "ldelema", PopRef+PopI, PushI, InlineType, 0, 1, 0xFF, 0x8F, NEXT)
-OPDEF(CEE_LDELEM_I1, "ldelem.i1", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x90, NEXT)
-OPDEF(CEE_LDELEM_U1, "ldelem.u1", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x91, NEXT)
-OPDEF(CEE_LDELEM_I2, "ldelem.i2", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x92, NEXT)
-OPDEF(CEE_LDELEM_U2, "ldelem.u2", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x93, NEXT)
-OPDEF(CEE_LDELEM_I4, "ldelem.i4", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x94, NEXT)
-OPDEF(CEE_LDELEM_U4, "ldelem.u4", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x95, NEXT)
-OPDEF(CEE_LDELEM_I8, "ldelem.i8", PopRef+PopI, PushI8, InlineNone, 0, 1, 0xFF, 0x96, NEXT)
-OPDEF(CEE_LDELEM_I, "ldelem.i", PopRef+PopI, PushI, InlineNone, 0, 1, 0xFF, 0x97, NEXT)
-OPDEF(CEE_LDELEM_R4, "ldelem.r4", PopRef+PopI, PushR4, InlineNone, 0, 1, 0xFF, 0x98, NEXT)
-OPDEF(CEE_LDELEM_R8, "ldelem.r8", PopRef+PopI, PushR8, InlineNone, 0, 1, 0xFF, 0x99, NEXT)
-OPDEF(CEE_LDELEM_REF, "ldelem.ref", PopRef+PopI, PushRef, InlineNone, 0, 1, 0xFF, 0x9A, NEXT)
-OPDEF(CEE_STELEM_I, "stelem.i", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9B, NEXT)
-OPDEF(CEE_STELEM_I1, "stelem.i1", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9C, NEXT)
-OPDEF(CEE_STELEM_I2, "stelem.i2", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9D, NEXT)
-OPDEF(CEE_STELEM_I4, "stelem.i4", PopRef+PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0x9E, NEXT)
-OPDEF(CEE_STELEM_I8, "stelem.i8", PopRef+PopI+PopI8, Push0, InlineNone, 0, 1, 0xFF, 0x9F, NEXT)
-OPDEF(CEE_STELEM_R4, "stelem.r4", PopRef+PopI+PopR4, Push0, InlineNone, 0, 1, 0xFF, 0xA0, NEXT)
-OPDEF(CEE_STELEM_R8, "stelem.r8", PopRef+PopI+PopR8, Push0, InlineNone, 0, 1, 0xFF, 0xA1, NEXT)
-OPDEF(CEE_STELEM_REF, "stelem.ref", PopRef+PopI+PopRef, Push0, InlineNone, 0, 1, 0xFF, 0xA2, NEXT)
-OPDEF(CEE_LDELEM, "ldelem", PopRef+PopI, Push1, InlineType, 0, 1, 0xFF, 0xA3, NEXT)
-OPDEF(CEE_STELEM, "stelem", PopRef+PopI+Pop1, Push0, InlineType, 0, 1, 0xFF, 0xA4, NEXT)
-OPDEF(CEE_UNBOX_ANY, "unbox.any", PopRef, Push1, InlineType, 0, 1, 0xFF, 0xA5, NEXT)
-OPDEF(CEE_UNUSED5, "unused5", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA6, NEXT)
-OPDEF(CEE_UNUSED6, "unused6", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA7, NEXT)
-OPDEF(CEE_UNUSED7, "unused7", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA8, NEXT)
-OPDEF(CEE_UNUSED8, "unused8", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xA9, NEXT)
-OPDEF(CEE_UNUSED9, "unused9", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAA, NEXT)
-OPDEF(CEE_UNUSED10, "unused10", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAB, NEXT)
-OPDEF(CEE_UNUSED11, "unused11", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAC, NEXT)
-OPDEF(CEE_UNUSED12, "unused12", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAD, NEXT)
-OPDEF(CEE_UNUSED13, "unused13", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAE, NEXT)
-OPDEF(CEE_UNUSED14, "unused14", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xAF, NEXT)
-OPDEF(CEE_UNUSED15, "unused15", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB0, NEXT)
-OPDEF(CEE_UNUSED16, "unused16", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB1, NEXT)
-OPDEF(CEE_UNUSED17, "unused17", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xB2, NEXT)
-OPDEF(CEE_CONV_OVF_I1, "conv.ovf.i1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB3, NEXT)
-OPDEF(CEE_CONV_OVF_U1, "conv.ovf.u1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB4, NEXT)
-OPDEF(CEE_CONV_OVF_I2, "conv.ovf.i2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB5, NEXT)
-OPDEF(CEE_CONV_OVF_U2, "conv.ovf.u2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB6, NEXT)
-OPDEF(CEE_CONV_OVF_I4, "conv.ovf.i4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB7, NEXT)
-OPDEF(CEE_CONV_OVF_U4, "conv.ovf.u4", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xB8, NEXT)
-OPDEF(CEE_CONV_OVF_I8, "conv.ovf.i8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0xB9, NEXT)
-OPDEF(CEE_CONV_OVF_U8, "conv.ovf.u8", Pop1, PushI8, InlineNone, 0, 1, 0xFF, 0xBA, NEXT)
-OPDEF(CEE_UNUSED50, "unused50", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBB, NEXT)
-OPDEF(CEE_UNUSED18, "unused18", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBC, NEXT)
-OPDEF(CEE_UNUSED19, "unused19", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBD, NEXT)
-OPDEF(CEE_UNUSED20, "unused20", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBE, NEXT)
-OPDEF(CEE_UNUSED21, "unused21", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xBF, NEXT)
-OPDEF(CEE_UNUSED22, "unused22", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC0, NEXT)
-OPDEF(CEE_UNUSED23, "unused23", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC1, NEXT)
-OPDEF(CEE_REFANYVAL, "refanyval", Pop1, PushI, InlineType, 0, 1, 0xFF, 0xC2, NEXT)
-OPDEF(CEE_CKFINITE, "ckfinite", Pop1, PushR8, InlineNone, 0, 1, 0xFF, 0xC3, NEXT)
-OPDEF(CEE_UNUSED24, "unused24", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC4, NEXT)
-OPDEF(CEE_UNUSED25, "unused25", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC5, NEXT)
-OPDEF(CEE_MKREFANY, "mkrefany", PopI, Push1, InlineType, 0, 1, 0xFF, 0xC6, NEXT)
-OPDEF(CEE_UNUSED59, "unused59", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC7, NEXT)
-OPDEF(CEE_UNUSED60, "unused60", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC8, NEXT)
-OPDEF(CEE_UNUSED61, "unused61", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xC9, NEXT)
-OPDEF(CEE_UNUSED62, "unused62", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCA, NEXT)
-OPDEF(CEE_UNUSED63, "unused63", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCB, NEXT)
-OPDEF(CEE_UNUSED64, "unused64", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCC, NEXT)
-OPDEF(CEE_UNUSED65, "unused65", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCD, NEXT)
-OPDEF(CEE_UNUSED66, "unused66", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCE, NEXT)
-OPDEF(CEE_UNUSED67, "unused67", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xCF, NEXT)
-OPDEF(CEE_LDTOKEN, "ldtoken", Pop0, PushI, InlineTok, 0, 1, 0xFF, 0xD0, NEXT)
-OPDEF(CEE_CONV_U2, "conv.u2", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD1, NEXT)
-OPDEF(CEE_CONV_U1, "conv.u1", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD2, NEXT)
-OPDEF(CEE_CONV_I, "conv.i", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD3, NEXT)
-OPDEF(CEE_CONV_OVF_I, "conv.ovf.i", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD4, NEXT)
-OPDEF(CEE_CONV_OVF_U, "conv.ovf.u", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xD5, NEXT)
-OPDEF(CEE_ADD_OVF, "add.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD6, NEXT)
-OPDEF(CEE_ADD_OVF_UN, "add.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD7, NEXT)
-OPDEF(CEE_MUL_OVF, "mul.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD8, NEXT)
-OPDEF(CEE_MUL_OVF_UN, "mul.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xD9, NEXT)
-OPDEF(CEE_SUB_OVF, "sub.ovf", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xDA, NEXT)
-OPDEF(CEE_SUB_OVF_UN, "sub.ovf.un", Pop1+Pop1, Push1, InlineNone, 0, 1, 0xFF, 0xDB, NEXT)
-OPDEF(CEE_ENDFINALLY, "endfinally", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xDC, RETURN)
-OPDEF(CEE_LEAVE, "leave", Pop0, Push0, InlineBrTarget, 0, 1, 0xFF, 0xDD, BRANCH)
-OPDEF(CEE_LEAVE_S, "leave.s", Pop0, Push0, ShortInlineBrTarget, 0, 1, 0xFF, 0xDE, BRANCH)
-OPDEF(CEE_STIND_I, "stind.i", PopI+PopI, Push0, InlineNone, 0, 1, 0xFF, 0xDF, NEXT)
-OPDEF(CEE_CONV_U, "conv.u", Pop1, PushI, InlineNone, 0, 1, 0xFF, 0xE0, NEXT)
-OPDEF(CEE_UNUSED26, "unused26", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE1, NEXT)
-OPDEF(CEE_UNUSED27, "unused27", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE2, NEXT)
-OPDEF(CEE_UNUSED28, "unused28", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE3, NEXT)
-OPDEF(CEE_UNUSED29, "unused29", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE4, NEXT)
-OPDEF(CEE_UNUSED30, "unused30", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE5, NEXT)
-OPDEF(CEE_UNUSED31, "unused31", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE6, NEXT)
-OPDEF(CEE_UNUSED32, "unused32", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE7, NEXT)
-OPDEF(CEE_UNUSED33, "unused33", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE8, NEXT)
-OPDEF(CEE_UNUSED34, "unused34", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xE9, NEXT)
-OPDEF(CEE_UNUSED35, "unused35", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEA, NEXT)
-OPDEF(CEE_UNUSED36, "unused36", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEB, NEXT)
-OPDEF(CEE_UNUSED37, "unused37", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEC, NEXT)
-OPDEF(CEE_UNUSED38, "unused38", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xED, NEXT)
-OPDEF(CEE_UNUSED39, "unused39", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEE, NEXT)
-OPDEF(CEE_UNUSED40, "unused40", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xEF, NEXT)
-OPDEF(CEE_UNUSED41, "unused41", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF0, NEXT)
-OPDEF(CEE_UNUSED42, "unused42", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF1, NEXT)
-OPDEF(CEE_UNUSED43, "unused43", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF2, NEXT)
-OPDEF(CEE_UNUSED44, "unused44", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF3, NEXT)
-OPDEF(CEE_UNUSED45, "unused45", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF4, NEXT)
-OPDEF(CEE_UNUSED46, "unused46", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF5, NEXT)
-OPDEF(CEE_UNUSED47, "unused47", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF6, NEXT)
-OPDEF(CEE_UNUSED48, "unused48", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF7, NEXT)
-OPDEF(CEE_PREFIX7, "prefix7", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF8, META)
-OPDEF(CEE_PREFIX6, "prefix6", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xF9, META)
-OPDEF(CEE_PREFIX5, "prefix5", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFA, META)
-OPDEF(CEE_PREFIX4, "prefix4", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFB, META)
-OPDEF(CEE_PREFIX3, "prefix3", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFC, META)
-OPDEF(CEE_PREFIX2, "prefix2", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFD, META)
-OPDEF(CEE_PREFIX1, "prefix1", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFE, META)
-OPDEF(CEE_PREFIXREF, "prefixref", Pop0, Push0, InlineNone, 0, 1, 0xFF, 0xFF, META)
-OPDEF(CEE_ARGLIST, "arglist", Pop0, PushI, InlineNone, 0, 2, 0xFE, 0x00, NEXT)
-OPDEF(CEE_CEQ, "ceq", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x01, NEXT)
-OPDEF(CEE_CGT, "cgt", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x02, NEXT)
-OPDEF(CEE_CGT_UN, "cgt.un", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x03, NEXT)
-OPDEF(CEE_CLT, "clt", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x04, NEXT)
-OPDEF(CEE_CLT_UN, "clt.un", Pop1+Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x05, NEXT)
-OPDEF(CEE_LDFTN, "ldftn", Pop0, PushI, InlineMethod, 0, 2, 0xFE, 0x06, NEXT)
-OPDEF(CEE_LDVIRTFTN, "ldvirtftn", PopRef, PushI, InlineMethod, 0, 2, 0xFE, 0x07, NEXT)
-OPDEF(CEE_UNUSED56, "unused56", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x08, NEXT)
-OPDEF(CEE_LDARG, "ldarg", Pop0, Push1, InlineVar, 0, 2, 0xFE, 0x09, NEXT)
-OPDEF(CEE_LDARGA, "ldarga", Pop0, PushI, InlineVar, 0, 2, 0xFE, 0x0A, NEXT)
-OPDEF(CEE_STARG, "starg", Pop1, Push0, InlineVar, 0, 2, 0xFE, 0x0B, NEXT)
-OPDEF(CEE_LDLOC, "ldloc", Pop0, Push1, InlineVar, 0, 2, 0xFE, 0x0C, NEXT)
-OPDEF(CEE_LDLOCA, "ldloca", Pop0, PushI, InlineVar, 0, 2, 0xFE, 0x0D, NEXT)
-OPDEF(CEE_STLOC, "stloc", Pop1, Push0, InlineVar, 0, 2, 0xFE, 0x0E, NEXT)
-OPDEF(CEE_LOCALLOC, "localloc", PopI, PushI, InlineNone, 0, 2, 0xFE, 0x0F, NEXT)
-OPDEF(CEE_UNUSED57, "unused57", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x10, NEXT)
-OPDEF(CEE_ENDFILTER, "endfilter", PopI, Push0, InlineNone, 0, 2, 0xFE, 0x11, RETURN)
-OPDEF(CEE_UNALIGNED_, "unaligned.", Pop0, Push0, ShortInlineI, 0, 2, 0xFE, 0x12, META)
-OPDEF(CEE_VOLATILE_, "volatile.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x13, META)
-OPDEF(CEE_TAIL_, "tail.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x14, META)
-OPDEF(CEE_INITOBJ, "initobj", PopI, Push0, InlineType, 0, 2, 0xFE, 0x15, NEXT)
-OPDEF(CEE_CONSTRAINED_, "constrained.", Pop0, Push0, InlineType, 0, 2, 0xFE, 0x16, META)
-OPDEF(CEE_CPBLK, "cpblk", PopI+PopI+PopI, Push0, InlineNone, 0, 2, 0xFE, 0x17, NEXT)
-OPDEF(CEE_INITBLK, "initblk", PopI+PopI+PopI, Push0, InlineNone, 0, 2, 0xFE, 0x18, NEXT)
-OPDEF(CEE_NO_, "no.", Pop0, Push0, ShortInlineI, 0, 2, 0xFE, 0x19, NEXT)
-OPDEF(CEE_RETHROW, "rethrow", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1A, ERROR)
-OPDEF(CEE_UNUSED, "unused", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1B, NEXT)
-OPDEF(CEE_SIZEOF, "sizeof", Pop0, PushI, InlineType, 0, 2, 0xFE, 0x1C, NEXT)
-OPDEF(CEE_REFANYTYPE, "refanytype", Pop1, PushI, InlineNone, 0, 2, 0xFE, 0x1D, NEXT)
-OPDEF(CEE_READONLY_, "readonly.", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1E, META)
-OPDEF(CEE_UNUSED53, "unused53", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x1F, NEXT)
-OPDEF(CEE_UNUSED54, "unused54", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x20, NEXT)
-OPDEF(CEE_UNUSED55, "unused55", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x21, NEXT)
-OPDEF(CEE_UNUSED70, "unused70", Pop0, Push0, InlineNone, 0, 2, 0xFE, 0x22, NEXT)
-OPDEF(CEE_ILLEGAL, "illegal", Pop0, Push0, InlineNone, 0, 2, 0x00, 0x00, META)
-OPDEF(CEE_ENDMAC, "endmac", Pop0, Push0, InlineNone, 0, 2, 0x00, 0x00, META)
-OPDEF(CEE_MONO_ICALL, "mono_icall", VarPop, VarPush, InlineI, 0, 2, 0xF0, 0x00, NEXT)
-OPDEF(CEE_MONO_OBJADDR, "mono_objaddr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x01, NEXT)
-OPDEF(CEE_MONO_LDPTR, "mono_ldptr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x02, NEXT)
-OPDEF(CEE_MONO_VTADDR, "mono_vtaddr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x03, NEXT)
-OPDEF(CEE_MONO_NEWOBJ, "mono_newobj", Pop0, PushRef, InlineType, 0, 2, 0xF0, 0x04, NEXT)
-OPDEF(CEE_MONO_RETOBJ, "mono_retobj", PopI, Push0, InlineType, 0, 2, 0xF0, 0x05, RETURN)
-OPDEF(CEE_MONO_LDNATIVEOBJ, "mono_ldnativeobj", PopI, Push1, InlineType, 0, 2, 0xF0, 0x06, RETURN)
-OPDEF(CEE_MONO_CISINST, "mono_cisinst", PopRef, Push1, InlineType, 0, 2, 0xF0, 0x07, NEXT)
-OPDEF(CEE_MONO_CCASTCLASS, "mono_ccastclass", PopRef, Push1, InlineType, 0, 2, 0xF0, 0x08, NEXT)
-OPDEF(CEE_MONO_SAVE_LMF, "mono_save_lmf", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x09, NEXT)
-OPDEF(CEE_MONO_RESTORE_LMF, "mono_restore_lmf", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x0A, NEXT)
-OPDEF(CEE_MONO_CLASSCONST, "mono_classconst", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0B, NEXT)
-OPDEF(CEE_MONO_NOT_TAKEN, "mono_not_taken", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x0C, NEXT)
-OPDEF(CEE_MONO_TLS, "mono_tls", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0D, NEXT)
-OPDEF(CEE_MONO_ICALL_ADDR, "mono_icall_addr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x0E, NEXT)
-OPDEF(CEE_MONO_DYN_CALL, "mono_dyn_call", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x0F, NEXT)
-OPDEF(CEE_MONO_MEMORY_BARRIER, "mono_memory_barrier", Pop0, Push0, InlineI, 0, 2, 0xF0, 0x10, NEXT)
-OPDEF(CEE_UNUSED71, "unused71", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x11, NEXT)
-OPDEF(CEE_UNUSED72, "unused72", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x12, NEXT)
-OPDEF(CEE_MONO_JIT_ICALL_ADDR, "mono_jit_icall_addr", Pop0, PushI, InlineI, 0, 2, 0xF0, 0x13, NEXT)
-OPDEF(CEE_MONO_LDPTR_INT_REQ_FLAG, "mono_ldptr_int_req_flag", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x14, NEXT)
-OPDEF(CEE_MONO_LDPTR_CARD_TABLE, "mono_ldptr_card_table", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x15, NEXT)
-OPDEF(CEE_MONO_LDPTR_NURSERY_START, "mono_ldptr_nursery_start", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x16, NEXT)
-OPDEF(CEE_MONO_LDPTR_NURSERY_BITS, "mono_ldptr_nursery_bits", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x17, NEXT)
-OPDEF(CEE_MONO_CALLI_EXTRA_ARG, "mono_calli_extra_arg", VarPop, VarPush, InlineSig, 0, 2, 0xF0, 0x18, CALL)
-OPDEF(CEE_MONO_LDDOMAIN, "mono_lddomain", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x19, NEXT)
-OPDEF(CEE_MONO_ATOMIC_STORE_I4, "mono_atomic_store_i4", PopI+PopI, Push0, InlineI, 0, 2, 0xF0, 0x1A, NEXT)
-OPDEF(CEE_MONO_SAVE_LAST_ERROR, "mono_save_last_error", Pop0, Push0, InlineNone, 0, 2, 0xF0, 0x1B, NEXT)
-OPDEF(CEE_MONO_GET_RGCTX_ARG, "mono_get_rgctx_arg", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x1C, NEXT)
-OPDEF(CEE_MONO_LDPTR_PROFILER_ALLOCATION_COUNT, "mono_ldptr_profiler_allocation_count", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x1D, NEXT)
-OPDEF(CEE_MONO_LD_DELEGATE_METHOD_PTR, "mono_ld_delegate_method_ptr", Pop1, PushI, InlineNone, 0, 2, 0xF0, 0x1E, NEXT)
-OPDEF(CEE_MONO_RETHROW, "mono_rethrow", PopRef, Push0, InlineNone, 0, 2, 0xF0, 0x1F, ERROR)
-OPDEF(CEE_MONO_GET_SP, "mono_get_sp", Pop0, PushI, InlineNone, 0, 2, 0xF0, 0x20, NEXT)
-#ifndef OPALIAS
-#define _MONO_CIL_OPALIAS_DEFINED_
-#define OPALIAS(a,s,r)
-#endif
-
-OPALIAS(CEE_BRNULL,     "brnull",    CEE_BRFALSE)
-OPALIAS(CEE_BRNULL_S,   "brnull.s",  CEE_BRFALSE_S)
-OPALIAS(CEE_BRZERO,     "brzero",    CEE_BRFALSE)
-OPALIAS(CEE_BRZERO_S,   "brzero.s",  CEE_BRFALSE_S)
-OPALIAS(CEE_BRINST,     "brinst",    CEE_BRTRUE)
-OPALIAS(CEE_BRINST_S,   "brinst.s",  CEE_BRTRUE_S)
-OPALIAS(CEE_LDIND_U8,   "ldind.u8",  CEE_LDIND_I8)
-OPALIAS(CEE_LDELEM_U8,  "ldelem.u8", CEE_LDELEM_I8)
-OPALIAS(CEE_LDX_I4_MIX, "ldc.i4.M1", CEE_LDC_I4_M1)
-OPALIAS(CEE_ENDFAULT,   "endfault",  CEE_ENDFINALLY)
-
-#ifdef _MONO_CIL_OPALIAS_DEFINED_
-#undef OPALIAS
-#undef _MONO_CIL_OPALIAS_DEFINED_
-#endif

+ 0 - 119
Libs/Interpreter/include/mono/jit/jit.h

@@ -1,119 +0,0 @@
-/**
- * \file
- * Author:
- *   Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001, 2002, 2003 Ximian, Inc.
- */
-
-#ifndef _MONO_JIT_JIT_H_
-#define _MONO_JIT_JIT_H_
-
-#include <mono/metadata/appdomain.h>
-
-MONO_BEGIN_DECLS
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * 
-mono_jit_init              (const char *file);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * 
-mono_jit_init_version      (const char *root_domain_name, const char *runtime_version);
-
-MONO_API MonoDomain * 
-mono_jit_init_version_for_test_only      (const char *root_domain_name, const char *runtime_version);
-
-MONO_API int
-mono_jit_exec              (MonoDomain *domain, MonoAssembly *assembly, 
-			    int argc, char *argv[]);
-MONO_API void        
-mono_jit_cleanup           (MonoDomain *domain);
-
-MONO_API mono_bool
-mono_jit_set_trace_options (const char* options);
-
-MONO_API void
-mono_set_signal_chaining   (mono_bool chain_signals);
-
-MONO_API void
-mono_set_crash_chaining   (mono_bool chain_signals);
-
-/**
- * This function is deprecated, use mono_jit_set_aot_mode instead.
- */
-MONO_API void
-mono_jit_set_aot_only      (mono_bool aot_only);
-
-/**
- * Allows control over our AOT (Ahead-of-time) compilation mode.
- */
-typedef enum {
-	/* Disables AOT mode */
-	MONO_AOT_MODE_NONE,
-	/* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
-	MONO_AOT_MODE_NORMAL,
-	/* Enables hybrid AOT mode, JIT can still be used for wrappers */
-	MONO_AOT_MODE_HYBRID,
-	/* Enables full AOT mode, JIT is disabled and not allowed,
-	 * equivalent to mono_jit_set_aot_only (true) */
-	MONO_AOT_MODE_FULL,
-	/* Same as full, but use only llvm compiled code */
-	MONO_AOT_MODE_LLVMONLY,
-	/* Uses Interpreter, JIT is disabled and not allowed,
-	 * equivalent to "--full-aot --interpreter" */
-	MONO_AOT_MODE_INTERP,
-	/* Same as INTERP, but use only llvm compiled code */
-	MONO_AOT_MODE_INTERP_LLVMONLY,
-	/* Use only llvm compiled code, fall back to the interpeter */
-	MONO_AOT_MODE_LLVMONLY_INTERP,
-	/* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */
-	MONO_AOT_MODE_LAST = 1000,
-} MonoAotMode;
-
-MONO_API void
-mono_jit_set_aot_mode      (MonoAotMode mode);
-
-/*
- * Returns whether the runtime was invoked for the purpose of AOT-compiling an
- * assembly, i.e. no managed code will run.
- */
-MONO_API mono_bool
-mono_jit_aot_compiling (void);
-
-/* Allow embedders to decide wherther to actually obey breakpoint instructions
- * in specific methods (works for both break IL instructions and Debugger.Break ()
- * method calls).
- */
-typedef enum {
-	/* the default is to always obey the breakpoint */
-	MONO_BREAK_POLICY_ALWAYS,
-	/* a nop is inserted instead of a breakpoint */
-	MONO_BREAK_POLICY_NEVER,
-	/* the breakpoint is executed only if the program has ben started under
-	 * the debugger (that is if a debugger was attached at the time the method
-	 * was compiled).
-	 */
-	MONO_BREAK_POLICY_ON_DBG
-} MonoBreakPolicy;
-
-typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
-MONO_API void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
-
-MONO_API void
-mono_jit_parse_options     (int argc, char * argv[]);
-
-MONO_API char*       mono_get_runtime_build_info    (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_set_use_llvm (mono_bool use_llvm);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_aot_register_module (void **aot_info);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoDomain* mono_jit_thread_attach (MonoDomain *domain);
-
-
-MONO_END_DECLS
-
-#endif
-

+ 0 - 231
Libs/Interpreter/include/mono/metadata/appdomain.h

@@ -1,231 +0,0 @@
-/**
- * \file
- * AppDomain functions
- *
- * Author:
- *	Dietmar Maurer (dietmar@ximian.com)
- *
- * (C) 2001 Ximian, Inc.
- */
-
-#ifndef _MONO_METADATA_APPDOMAIN_H_
-#define _MONO_METADATA_APPDOMAIN_H_
-
-#include <mono/utils/mono-publib.h>
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/reflection.h>
-
-MONO_BEGIN_DECLS
-
-typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
-				   void* func);
-typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
-
-typedef struct _MonoAppDomain MonoAppDomain;
-
-typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
-
-MONO_API MonoDomain*
-mono_init                  (const char *filename);
-
-MONO_API MonoDomain *
-mono_init_from_assembly    (const char *domain_name, const char *filename);
-
-MONO_API MonoDomain *
-mono_init_version          (const char *domain_name, const char *version);
-
-MONO_API MonoDomain*
-mono_get_root_domain       (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_init          (MonoDomain *domain, MonoThreadStartCB start_cb,
-			    MonoThreadAttachCB attach_cb);
-
-MONO_API void
-mono_runtime_cleanup       (MonoDomain *domain);
-
-MONO_API void
-mono_install_runtime_cleanup (MonoDomainFunc func);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_quit (void);
-
-MONO_API void
-mono_runtime_set_shutting_down (void);
-
-MONO_API mono_bool
-mono_runtime_is_shutting_down (void);
-
-MONO_API const char*
-mono_check_corlib_version (void);
-
-MONO_API MonoDomain *
-mono_domain_create         (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_domain_create_appdomain (char *friendly_name, char *configuration_file);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_set_config (MonoDomain *domain, const char *base_dir, const char *config_file_name);
-
-MONO_API MonoDomain *
-mono_domain_get            (void);
-
-MONO_API MonoDomain *
-mono_domain_get_by_id      (int32_t domainid);
-
-MONO_API int32_t
-mono_domain_get_id         (MonoDomain *domain);
-
-MONO_API const char *
-mono_domain_get_friendly_name (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_domain_set            (MonoDomain *domain, mono_bool force);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_set_internal   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_unload (MonoDomain *domain);
-
-MONO_API void
-mono_domain_try_unload (MonoDomain *domain, MonoObject **exc);
-
-MONO_API mono_bool
-mono_domain_is_unloading   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_domain_from_appdomain (MonoAppDomain *appdomain);
-
-MONO_API void
-mono_domain_foreach        (MonoDomainFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *
-mono_domain_assembly_open  (MonoDomain *domain, const char *name);
-
-MONO_API mono_bool
-mono_domain_finalize       (MonoDomain *domain, uint32_t timeout);
-
-MONO_API void
-mono_domain_free           (MonoDomain *domain, mono_bool force);
-
-MONO_API mono_bool
-mono_domain_has_type_resolve (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *
-mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
-
-MONO_API mono_bool
-mono_domain_owns_vtable_slot (MonoDomain *domain, void* vtable_slot);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_context_init 				   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_context_set				   (MonoAppContext *new_context);
-
-MONO_API MonoAppContext * 
-mono_context_get				   (void);
-
-MONO_API int32_t
-mono_context_get_id         (MonoAppContext *context);
-
-MONO_API int32_t
-mono_context_get_domain_id  (MonoAppContext *context);
-
-MONO_API MonoJitInfo *
-mono_jit_info_table_find   (MonoDomain *domain, void* addr);
-
-/* MonoJitInfo accessors */
-
-MONO_API void*
-mono_jit_info_get_code_start (MonoJitInfo* ji);
-
-MONO_API int
-mono_jit_info_get_code_size (MonoJitInfo* ji);
-
-MONO_API MonoMethod*
-mono_jit_info_get_method (MonoJitInfo* ji);
-
-
-MONO_API MonoImage*
-mono_get_corlib            (void);
-
-MONO_API MonoClass*
-mono_get_object_class      (void);
-
-MONO_API MonoClass*
-mono_get_byte_class        (void);
-
-MONO_API MonoClass*
-mono_get_void_class        (void);
-
-MONO_API MonoClass*
-mono_get_boolean_class     (void);
-
-MONO_API MonoClass*
-mono_get_sbyte_class       (void);
-
-MONO_API MonoClass*
-mono_get_int16_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint16_class      (void);
-
-MONO_API MonoClass*
-mono_get_int32_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint32_class      (void);
-
-MONO_API MonoClass*
-mono_get_intptr_class         (void);
-
-MONO_API MonoClass*
-mono_get_uintptr_class        (void);
-
-MONO_API MonoClass*
-mono_get_int64_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint64_class      (void);
-
-MONO_API MonoClass*
-mono_get_single_class      (void);
-
-MONO_API MonoClass*
-mono_get_double_class      (void);
-
-MONO_API MonoClass*
-mono_get_char_class        (void);
-
-MONO_API MonoClass*
-mono_get_string_class      (void);
-
-MONO_API MonoClass*
-mono_get_enum_class        (void);
-
-MONO_API MonoClass*
-mono_get_array_class       (void);
-
-MONO_API MonoClass*
-mono_get_thread_class       (void);
-
-MONO_API MonoClass*
-mono_get_exception_class    (void);
-
-MONO_API void
-mono_security_enable_core_clr (void);
-
-typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
-
-MONO_API void
-mono_security_set_core_clr_platform_callback (MonoCoreClrPlatformCB callback);
-
-MONO_END_DECLS
-
-#endif /* _MONO_METADATA_APPDOMAIN_H_ */
-

+ 0 - 136
Libs/Interpreter/include/mono/metadata/assembly.h

@@ -1,136 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONONET_METADATA_ASSEMBLY_H_ 
-#define _MONONET_METADATA_ASSEMBLY_H_
-
-#include <mono/utils/mono-error.h>
-#include <mono/metadata/image.h>
-
-MONO_BEGIN_DECLS
-
-MONO_API void          mono_assemblies_init     (void);
-MONO_API void          mono_assemblies_cleanup  (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly *mono_assembly_open       (const char *filename,
-				       	MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly *mono_assembly_open_full (const char *filename,
-				       	MonoImageOpenStatus *status,
-					mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load       (MonoAssemblyName *aname, 
-                                       	const char       *basedir, 
-				     	MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname,
-                                       	const char       *basedir, 
-				     	MonoImageOpenStatus *status,
-					mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_from  (MonoImage *image, const char *fname,
-					MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_from_full  (MonoImage *image, const char *fname,
-					MonoImageOpenStatus *status,
-					mono_bool refonly);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_loaded     (MonoAssemblyName *aname);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, mono_bool refonly);
-MONO_API void          mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
-MONO_API void          mono_assembly_load_reference (MonoImage *image, int index);
-MONO_API void          mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
-MONO_API void          mono_assembly_close      (MonoAssembly *assembly);
-MONO_API void          mono_assembly_setrootdir (const char *root_dir);
-MONO_API MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
-MONO_API char         *mono_native_getrootdir (void);
-MONO_API void	       mono_assembly_foreach    (MonoFunc func, void* user_data);
-MONO_API void          mono_assembly_set_main   (MonoAssembly *assembly);
-MONO_API MonoAssembly *mono_assembly_get_main   (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_assembly_get_image  (MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssemblyName *mono_assembly_get_name (MonoAssembly *assembly);
-MONO_API mono_bool      mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
-MONO_API mono_bool      mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
-MONO_API char*         mono_stringify_assembly_name (MonoAssemblyName *aname);
-
-/* Installs a function which is called each time a new assembly is loaded. */
-typedef void  (*MonoAssemblyLoadFunc)         (MonoAssembly *assembly, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data);
-
-/* 
- * Installs a new function which is used to search the list of loaded 
- * assemblies for a given assembly name.
- */
-typedef MonoAssembly *(*MonoAssemblySearchFunc)         (MonoAssemblyName *aname, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void 	      mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
-
-/*
- * Installs a new search function which is used as a last resort when loading 
- * an assembly fails. This could invoke AssemblyResolve events.
- */
-MONO_API MONO_RT_EXTERNAL_ONLY
-void
-mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void
-mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-
-/* Installs a function which is called before a new assembly is loaded
- * The hook are invoked from last hooked to first. If any of them returns
- * a non-null value, that will be the value returned in mono_assembly_load */
-typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
-						   char **assemblies_path,
-						   void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_assembly_invoke_load_hook (MonoAssembly *ass);
-
-MONO_API MonoAssemblyName* mono_assembly_name_new             (const char *name);
-MONO_API const char*       mono_assembly_name_get_name        (MonoAssemblyName *aname);
-MONO_API const char*       mono_assembly_name_get_culture     (MonoAssemblyName *aname);
-MONO_API uint16_t          mono_assembly_name_get_version     (MonoAssemblyName *aname,
-						      uint16_t *minor, uint16_t *build, uint16_t *revision);
-MONO_API mono_byte*        mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_assembly_name_free   (MonoAssemblyName *aname);
-
-typedef struct {
-	const char *name;
-	const unsigned char *data;
-	unsigned int size;
-} MonoBundledAssembly;
-
-MONO_API void          mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
-MONO_API void          mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
-MONO_API void          mono_register_symfile_for_assembly (const char* assembly_name, const mono_byte *raw_contents, int size);
-MONO_API void	      mono_register_machine_config (const char *config_xml);
-
-MONO_API void          mono_set_rootdir (void);
-MONO_API void          mono_set_dirs (const char *assembly_dir, const char *config_dir);
-MONO_API void          mono_set_assemblies_path (const char* path);
-MONO_END_DECLS
-
-#endif
-

+ 0 - 274
Libs/Interpreter/include/mono/metadata/attrdefs.h

@@ -1,274 +0,0 @@
-/**
- * \file
- * This file contains the various definitions for constants
- * found on the metadata tables
- *
- * Author:
- *   Miguel de Icaza (miguel@ximian.com)
- *   Paolo Molaro (lupus@ximian.com)
- *
- * (C) 2001 Ximian, Inc.
- * (C) 2006 Novell, Inc.
- *
- * From the ECMA documentation
- */
- 
-#ifndef _MONO_METADATA_ATTRDEFS_H_
-#define	_MONO_METADATA_ATTRDEFS_H_
-
-/*
- * 23.1.1  Values for AssemblyHashAlgorithm 
- */
-enum {
-	MONO_ASSEMBLY_HASH_NONE,
-	MONO_ASSEMBLY_HASH_MD5  = 0x8003,
-	MONO_ASSEMBLY_HASH_SHA1 = 0x8004
-};
-
-/*
- * 23.1.2 AssemblyRefs
- */
-enum {
-	MONO_ASSEMBLYREF_FULL_PUBLIC_KEY = 0x0001,
-	MONO_ASSEMBLYREF_RETARGETABLE    = 0x0100,
-	MONO_ASSEMBLYREF_JIT_TRACKING    = 0x8000,
-	MONO_ASSEMBLYREF_NO_JIT_OPT      = 0x4000
-};
-
-/*
- * 23.1.4 Flags for Event.EventAttributes
- */
-enum {
-	MONO_EVENT_SPECIALNAME   = 0x0200,
-	MONO_EVENT_RTSPECIALNAME = 0x0400
-};
-
-/*
- * Field Attributes (23.1.5).
- */
-enum {
-	MONO_FIELD_ATTR_FIELD_ACCESS_MASK     = 0x0007,
-	MONO_FIELD_ATTR_COMPILER_CONTROLLED   = 0x0000,
-	MONO_FIELD_ATTR_PRIVATE               = 0x0001,
-	MONO_FIELD_ATTR_FAM_AND_ASSEM         = 0x0002,
-	MONO_FIELD_ATTR_ASSEMBLY              = 0x0003,
-	MONO_FIELD_ATTR_FAMILY                = 0x0004,
-	MONO_FIELD_ATTR_FAM_OR_ASSEM          = 0x0005,
-	MONO_FIELD_ATTR_PUBLIC                = 0x0006,
-
-	MONO_FIELD_ATTR_STATIC                = 0x0010,
-	MONO_FIELD_ATTR_INIT_ONLY             = 0x0020,
-	MONO_FIELD_ATTR_LITERAL               = 0x0040,
-	MONO_FIELD_ATTR_NOT_SERIALIZED        = 0x0080,
-	MONO_FIELD_ATTR_SPECIAL_NAME          = 0x0200,
-	MONO_FIELD_ATTR_PINVOKE_IMPL          = 0x2000,
-
-/* For runtime use only */
-	MONO_FIELD_ATTR_RESERVED_MASK         = 0x9500,
-	MONO_FIELD_ATTR_RT_SPECIAL_NAME       = 0x0400,
-	MONO_FIELD_ATTR_HAS_MARSHAL           = 0x1000,
-	MONO_FIELD_ATTR_HAS_DEFAULT           = 0x8000,
-	MONO_FIELD_ATTR_HAS_RVA               = 0x0100
-};
-
-/*
- * 23.1.6 Flags for FileAttributes
- */
-enum {
-	MONO_FILE_HAS_METADATA      = 0,
-	MONO_FILE_HAS_NO_METADATA   = 1
-};
-
-/*
- * 23.1.7 Flags for generic parameters
- */
-enum {
-	MONO_GEN_PARAM_VARIANCE_MASK    = 0x0003,
-	MONO_GEN_PARAM_NON_VARIANT      = 0x0000,
-	MONO_GEN_PARAM_VARIANT          = 0x0001,
-	MONO_GEN_PARAM_COVARIANT        = 0x0002,
-	MONO_GEN_PARAM_CONSTRAINT_MASK  = 0x001c,
-	MONO_GEN_PARAM_CONSTRAINT_CLASS = 0x0004,
-	MONO_GEN_PARAM_CONSTRAINT_VTYPE = 0x0008,
-	MONO_GEN_PARAM_CONSTRAINT_DCTOR = 0x0010
-};
-
-/*
- * 23.1.8 Flags for ImplMap [PInvokeAttributes]
- */
-enum {
-	MONO_PINVOKE_NO_MANGLE           = 0x0001,
-	MONO_PINVOKE_CHAR_SET_MASK       = 0x0006,
-	MONO_PINVOKE_CHAR_SET_NOT_SPEC   = 0x0000,
-	MONO_PINVOKE_CHAR_SET_ANSI       = 0x0002,
-	MONO_PINVOKE_CHAR_SET_UNICODE    = 0x0004,
-	MONO_PINVOKE_CHAR_SET_AUTO       = 0x0006,
-	MONO_PINVOKE_BEST_FIT_ENABLED    = 0x0010,
-	MONO_PINVOKE_BEST_FIT_DISABLED   = 0x0020,
-	MONO_PINVOKE_BEST_FIT_MASK       = 0x0030,
-	MONO_PINVOKE_SUPPORTS_LAST_ERROR = 0x0040,
-	MONO_PINVOKE_CALL_CONV_MASK      = 0x0700,
-	MONO_PINVOKE_CALL_CONV_WINAPI    = 0x0100,
-	MONO_PINVOKE_CALL_CONV_CDECL     = 0x0200,
-	MONO_PINVOKE_CALL_CONV_STDCALL   = 0x0300,
-	MONO_PINVOKE_CALL_CONV_THISCALL  = 0x0400,
-	MONO_PINVOKE_CALL_CONV_FASTCALL  = 0x0500,
-	MONO_PINVOKE_THROW_ON_UNMAPPABLE_ENABLED    = 0x1000,
-	MONO_PINVOKE_THROW_ON_UNMAPPABLE_DISABLED   = 0x2000,
-	MONO_PINVOKE_THROW_ON_UNMAPPABLE_MASK       = 0x3000,
-	MONO_PINVOKE_CALL_CONV_GENERIC     = 0x0010,
-	MONO_PINVOKE_CALL_CONV_GENERICINST = 0x000a
-};
-
-/*
- * 23.1.9 Flags for ManifestResource
- */
-enum {
-	MONO_MANIFEST_RESOURCE_VISIBILITY_MASK    = 0x00000007,
-	MONO_MANIFEST_RESOURCE_PUBLIC             = 0x00000001,
-	MONO_MANIFEST_RESOURCE_PRIVATE            = 0x00000002
-};
-
-/*
- * Method Attributes (23.1.10)
- */
-enum {
-	MONO_METHOD_ATTR_ACCESS_MASK               = 0x0007,
-	MONO_METHOD_ATTR_COMPILER_CONTROLLED       = 0x0000,
-	MONO_METHOD_ATTR_PRIVATE                   = 0x0001,
-	MONO_METHOD_ATTR_FAM_AND_ASSEM             = 0x0002,
-	MONO_METHOD_ATTR_ASSEM                     = 0x0003,
-	MONO_METHOD_ATTR_FAMILY                    = 0x0004,
-	MONO_METHOD_ATTR_FAM_OR_ASSEM              = 0x0005,
-	MONO_METHOD_ATTR_PUBLIC                    = 0x0006,
-
-	MONO_METHOD_ATTR_STATIC                    = 0x0010,
-	MONO_METHOD_ATTR_FINAL                     = 0x0020,
-	MONO_METHOD_ATTR_VIRTUAL                   = 0x0040,
-	MONO_METHOD_ATTR_HIDE_BY_SIG               = 0x0080,
-
-	MONO_METHOD_ATTR_VTABLE_LAYOUT_MASK        = 0x0100,
-	MONO_METHOD_ATTR_REUSE_SLOT                = 0x0000,
-	MONO_METHOD_ATTR_NEW_SLOT                  = 0x0100,
-	MONO_METHOD_ATTR_STRICT                    = 0x0200,
-	MONO_METHOD_ATTR_ABSTRACT                  = 0x0400,
-
-	MONO_METHOD_ATTR_SPECIAL_NAME              = 0x0800,
-
-	MONO_METHOD_ATTR_PINVOKE_IMPL              = 0x2000,
-	MONO_METHOD_ATTR_UNMANAGED_EXPORT          = 0x0008,
-
-/*
- * For runtime use only
- */
-	MONO_METHOD_ATTR_RESERVED_MASK             = 0xd000,
-	MONO_METHOD_ATTR_RT_SPECIAL_NAME           = 0x1000,
-	MONO_METHOD_ATTR_HAS_SECURITY              = 0x4000,
-	MONO_METHOD_ATTR_REQUIRE_SEC_OBJECT        = 0x8000
-};
-
-/*
- * Method Impl Attributes (23.1.11)
- */
-enum {
-	MONO_METHOD_IMPL_ATTR_CODE_TYPE_MASK       = 0x0003,
-	MONO_METHOD_IMPL_ATTR_IL                   = 0x0000,
-	MONO_METHOD_IMPL_ATTR_NATIVE               = 0x0001,
-	MONO_METHOD_IMPL_ATTR_OPTIL                = 0x0002,
-	MONO_METHOD_IMPL_ATTR_RUNTIME              = 0x0003,
-
-	MONO_METHOD_IMPL_ATTR_MANAGED_MASK         = 0x0004,
-	MONO_METHOD_IMPL_ATTR_UNMANAGED            = 0x0004,
-	MONO_METHOD_IMPL_ATTR_MANAGED              = 0x0000,
-
-	MONO_METHOD_IMPL_ATTR_FORWARD_REF          = 0x0010,
-	MONO_METHOD_IMPL_ATTR_PRESERVE_SIG         = 0x0080,
-	MONO_METHOD_IMPL_ATTR_INTERNAL_CALL        = 0x1000,
-	MONO_METHOD_IMPL_ATTR_SYNCHRONIZED         = 0x0020,
-	MONO_METHOD_IMPL_ATTR_NOINLINING           = 0x0008,
-	MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION       = 0x0040,	
-	MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL  = 0xffff
-};
-
-/*
- * Method Semantics ([MethodSemanticAttributes]) 23.1.12,
- */
-enum {
-	MONO_METHOD_SEMANTIC_SETTER    = 0x0001,
-	MONO_METHOD_SEMANTIC_GETTER    = 0x0002,
-	MONO_METHOD_SEMANTIC_OTHER     = 0x0004,
-	MONO_METHOD_SEMANTIC_ADD_ON    = 0x0008,
-	MONO_METHOD_SEMANTIC_REMOVE_ON = 0x0010,
-	MONO_METHOD_SEMANTIC_FIRE      = 0x0020
-};
-
-/*
- * Flags for Params (23.1.13)
- */
-enum {
-	MONO_PARAM_ATTR_IN                 = 0x0001,
-	MONO_PARAM_ATTR_OUT                = 0x0002,
-	MONO_PARAM_ATTR_OPTIONAL           = 0x0010,
-	MONO_PARAM_ATTR_RESERVED_MASK      = 0xf000,
-	MONO_PARAM_ATTR_HAS_DEFAULT        = 0x1000,
-	MONO_PARAM_ATTR_HAS_MARSHAL        = 0x2000,
-	MONO_PARAM_ATTR_UNUSED             = 0xcfe0
-};
-
-/*
- * 23.1.14 PropertyAttributes
- */
-enum {
-	MONO_PROPERTY_ATTR_SPECIAL_NAME    = 0x0200,
-	MONO_PROPERTY_ATTR_RESERVED_MASK   = 0xf400,
-	MONO_PROPERTY_ATTR_RT_SPECIAL_NAME = 0x0400,
-	MONO_PROPERTY_ATTR_HAS_DEFAULT     = 0x1000,
-	MONO_PROPERTY_ATTR_UNUSED          = 0xe9ff
-};
-
-/*
- * Type Attributes (23.1.15).
- */
-enum {
-	MONO_TYPE_ATTR_VISIBILITY_MASK       = 0x00000007,
-	MONO_TYPE_ATTR_NOT_PUBLIC            = 0x00000000,
-	MONO_TYPE_ATTR_PUBLIC                = 0x00000001,
-	MONO_TYPE_ATTR_NESTED_PUBLIC         = 0x00000002,
-	MONO_TYPE_ATTR_NESTED_PRIVATE        = 0x00000003,
-	MONO_TYPE_ATTR_NESTED_FAMILY         = 0x00000004,
-	MONO_TYPE_ATTR_NESTED_ASSEMBLY       = 0x00000005,
-	MONO_TYPE_ATTR_NESTED_FAM_AND_ASSEM  = 0x00000006,
-	MONO_TYPE_ATTR_NESTED_FAM_OR_ASSEM   = 0x00000007,
-
-	MONO_TYPE_ATTR_LAYOUT_MASK           = 0x00000018,
-	MONO_TYPE_ATTR_AUTO_LAYOUT           = 0x00000000,
-	MONO_TYPE_ATTR_SEQUENTIAL_LAYOUT     = 0x00000008,
-	MONO_TYPE_ATTR_EXPLICIT_LAYOUT       = 0x00000010,
-
-	MONO_TYPE_ATTR_CLASS_SEMANTIC_MASK   = 0x00000020,
-	MONO_TYPE_ATTR_CLASS                 = 0x00000000,
-	MONO_TYPE_ATTR_INTERFACE             = 0x00000020,
-
-	MONO_TYPE_ATTR_ABSTRACT              = 0x00000080,
-	MONO_TYPE_ATTR_SEALED                = 0x00000100,
-	MONO_TYPE_ATTR_SPECIAL_NAME          = 0x00000400,
-
-	MONO_TYPE_ATTR_IMPORT                = 0x00001000,
-	MONO_TYPE_ATTR_SERIALIZABLE          = 0x00002000,
-
-	MONO_TYPE_ATTR_STRING_FORMAT_MASK    = 0x00030000,
-	MONO_TYPE_ATTR_ANSI_CLASS            = 0x00000000,
-	MONO_TYPE_ATTR_UNICODE_CLASS         = 0x00010000,
-	MONO_TYPE_ATTR_AUTO_CLASS            = 0x00020000,
-	MONO_TYPE_ATTR_CUSTOM_CLASS          = 0x00030000,
-	MONO_TYPE_ATTR_CUSTOM_MASK           = 0x00c00000,
-
-	MONO_TYPE_ATTR_BEFORE_FIELD_INIT     = 0x00100000,
-	MONO_TYPE_ATTR_FORWARDER             = 0x00200000,
-
-	MONO_TYPE_ATTR_RESERVED_MASK         = 0x00040800,
-	MONO_TYPE_ATTR_RT_SPECIAL_NAME       = 0x00000800,
-	MONO_TYPE_ATTR_HAS_SECURITY          = 0x00040000
-};
-
-#endif

+ 0 - 118
Libs/Interpreter/include/mono/metadata/blob.h

@@ -1,118 +0,0 @@
-/**
- * \file
- * Definitions used to pull information out of the Blob
- *
- */
-#ifndef _MONO_METADATA_BLOB_H_
-#define _MONO_METADATA_BLOB_H_
-
-/*
- * Encoding for type signatures used in the Metadata
- */
-typedef enum {
-	MONO_TYPE_END        = 0x00,       /* End of List */
-	MONO_TYPE_VOID       = 0x01,
-	MONO_TYPE_BOOLEAN    = 0x02,
-	MONO_TYPE_CHAR       = 0x03,
-	MONO_TYPE_I1         = 0x04,
-	MONO_TYPE_U1         = 0x05,
-	MONO_TYPE_I2         = 0x06,
-	MONO_TYPE_U2         = 0x07,
-	MONO_TYPE_I4         = 0x08,
-	MONO_TYPE_U4         = 0x09,
-	MONO_TYPE_I8         = 0x0a,
-	MONO_TYPE_U8         = 0x0b,
-	MONO_TYPE_R4         = 0x0c,
-	MONO_TYPE_R8         = 0x0d,
-	MONO_TYPE_STRING     = 0x0e,
-	MONO_TYPE_PTR        = 0x0f,       /* arg: <type> token */
-	MONO_TYPE_BYREF      = 0x10,       /* arg: <type> token */
-	MONO_TYPE_VALUETYPE  = 0x11,       /* arg: <type> token */
-	MONO_TYPE_CLASS      = 0x12,       /* arg: <type> token */
-	MONO_TYPE_VAR	     = 0x13,	   /* number */
-	MONO_TYPE_ARRAY      = 0x14,       /* type, rank, boundsCount, bound1, loCount, lo1 */
-	MONO_TYPE_GENERICINST= 0x15,	   /* <type> <type-arg-count> <type-1> \x{2026} <type-n> */
-	MONO_TYPE_TYPEDBYREF = 0x16,
-	MONO_TYPE_I          = 0x18,
-	MONO_TYPE_U          = 0x19,
-	MONO_TYPE_FNPTR      = 0x1b,	      /* arg: full method signature */
-	MONO_TYPE_OBJECT     = 0x1c,
-	MONO_TYPE_SZARRAY    = 0x1d,       /* 0-based one-dim-array */
-	MONO_TYPE_MVAR	     = 0x1e,       /* number */
-	MONO_TYPE_CMOD_REQD  = 0x1f,       /* arg: typedef or typeref token */
-	MONO_TYPE_CMOD_OPT   = 0x20,       /* optional arg: typedef or typref token */
-	MONO_TYPE_INTERNAL   = 0x21,       /* CLR internal type */
-
-	MONO_TYPE_MODIFIER   = 0x40,       /* Or with the following types */
-	MONO_TYPE_SENTINEL   = 0x41,       /* Sentinel for varargs method signature */
-	MONO_TYPE_PINNED     = 0x45,       /* Local var that points to pinned object */
-
-	MONO_TYPE_ENUM       = 0x55        /* an enumeration */
-} MonoTypeEnum;
-
-typedef enum {
-	MONO_TABLE_MODULE,
-	MONO_TABLE_TYPEREF,
-	MONO_TABLE_TYPEDEF,
-	MONO_TABLE_FIELD_POINTER,
-	MONO_TABLE_FIELD,
-	MONO_TABLE_METHOD_POINTER,
-	MONO_TABLE_METHOD,
-	MONO_TABLE_PARAM_POINTER,
-	MONO_TABLE_PARAM,
-	MONO_TABLE_INTERFACEIMPL,
-	MONO_TABLE_MEMBERREF, /* 0xa */
-	MONO_TABLE_CONSTANT,
-	MONO_TABLE_CUSTOMATTRIBUTE,
-	MONO_TABLE_FIELDMARSHAL,
-	MONO_TABLE_DECLSECURITY,
-	MONO_TABLE_CLASSLAYOUT,
-	MONO_TABLE_FIELDLAYOUT, /* 0x10 */
-	MONO_TABLE_STANDALONESIG,
-	MONO_TABLE_EVENTMAP,
-	MONO_TABLE_EVENT_POINTER,
-	MONO_TABLE_EVENT,
-	MONO_TABLE_PROPERTYMAP,
-	MONO_TABLE_PROPERTY_POINTER,
-	MONO_TABLE_PROPERTY,
-	MONO_TABLE_METHODSEMANTICS,
-	MONO_TABLE_METHODIMPL,
-	MONO_TABLE_MODULEREF, /* 0x1a */
-	MONO_TABLE_TYPESPEC,
-	MONO_TABLE_IMPLMAP,
-	MONO_TABLE_FIELDRVA,
-	MONO_TABLE_UNUSED6,
-	MONO_TABLE_UNUSED7,
-	MONO_TABLE_ASSEMBLY, /* 0x20 */
-	MONO_TABLE_ASSEMBLYPROCESSOR,
-	MONO_TABLE_ASSEMBLYOS,
-	MONO_TABLE_ASSEMBLYREF,
-	MONO_TABLE_ASSEMBLYREFPROCESSOR,
-	MONO_TABLE_ASSEMBLYREFOS,
-	MONO_TABLE_FILE,
-	MONO_TABLE_EXPORTEDTYPE,
-	MONO_TABLE_MANIFESTRESOURCE,
-	MONO_TABLE_NESTEDCLASS,
-	MONO_TABLE_GENERICPARAM, /* 0x2a */
-	MONO_TABLE_METHODSPEC,
-	MONO_TABLE_GENERICPARAMCONSTRAINT,
-	MONO_TABLE_UNUSED8,
-	MONO_TABLE_UNUSED9,
-	MONO_TABLE_UNUSED10,
-	/* Portable PDB tables */
-	MONO_TABLE_DOCUMENT, /* 0x30 */
-	MONO_TABLE_METHODBODY,
-	MONO_TABLE_LOCALSCOPE,
-	MONO_TABLE_LOCALVARIABLE,
-	MONO_TABLE_LOCALCONSTANT,
-	MONO_TABLE_IMPORTSCOPE,
-	MONO_TABLE_STATEMACHINEMETHOD,
-	MONO_TABLE_CUSTOMDEBUGINFORMATION
-
-#define MONO_TABLE_LAST MONO_TABLE_CUSTOMDEBUGINFORMATION
-#define MONO_TABLE_NUM (MONO_TABLE_LAST + 1)
-
-} MonoMetaTableEnum;
-
-#endif
-

+ 0 - 313
Libs/Interpreter/include/mono/metadata/class.h

@@ -1,313 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONO_CLI_CLASS_H_
-#define _MONO_CLI_CLASS_H_
-
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/loader.h>
-#include <mono/utils/mono-error.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct MonoVTable MonoVTable;
-
-typedef struct _MonoClassField MonoClassField;
-typedef struct _MonoProperty MonoProperty;
-typedef struct _MonoEvent MonoEvent;
-
-typedef enum {
-	MONO_TYPE_NAME_FORMAT_IL,
-	MONO_TYPE_NAME_FORMAT_REFLECTION,
-	MONO_TYPE_NAME_FORMAT_FULL_NAME,
-	MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
-} MonoTypeNameFormat;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_get             (MonoImage *image, uint32_t type_token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_get_full        (MonoImage *image, uint32_t type_token, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_init            (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoVTable *
-mono_class_vtable          (MonoDomain *domain, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_name       (MonoImage *image, const char* name_space, const char *name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_name_case  (MonoImage *image, const char* name_space, const char *name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int param_count, int flags);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_typeref    (MonoImage *image, uint32_t type_token);
-
-MONO_API MonoClass *
-mono_class_from_typeref_checked (MonoImage *image, uint32_t type_token, MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethod*
-mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethod *
-mono_get_inflated_method (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField*
-mono_field_from_token      (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_bounded_array_class_get (MonoClass *element_class, uint32_t rank, mono_bool bounded);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_array_class_get       (MonoClass *element_class, uint32_t rank);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_ptr_class_get         (MonoType *type);
-
-MONO_API MonoClassField *
-mono_class_get_field       (MonoClass *klass, uint32_t field_token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField *
-mono_class_get_field_from_name (MonoClass *klass, const char *name);
-
-MONO_API uint32_t
-mono_class_get_field_token (MonoClassField *field);
-
-MONO_API uint32_t
-mono_class_get_event_token (MonoEvent *event);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoProperty *
-mono_class_get_property_from_name (MonoClass *klass, const char *name);
-
-MONO_API uint32_t
-mono_class_get_property_token (MonoProperty *prop);
-
-MONO_API int32_t
-mono_array_element_size    (MonoClass *ac);
-
-MONO_API int32_t
-mono_class_instance_size   (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_array_element_size (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_data_size       (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_value_size      (MonoClass *klass, uint32_t *align);
-
-MONO_API int32_t
-mono_class_min_align       (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_mono_type  (MonoType *type);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc, 
-						   mono_bool check_interfaces);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void*
-mono_ldtoken               (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context);
-
-MONO_API char *
-mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
-
-MONO_API char*         
-mono_type_get_name         (MonoType *type);
-
-MONO_API MonoType*
-mono_type_get_underlying_type (MonoType *type);
-
-/* MonoClass accessors */
-MONO_API MonoImage*
-mono_class_get_image         (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass*
-mono_class_get_element_class (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_valuetype      (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_enum          (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_enum_basetype    (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass*
-mono_class_get_parent        (MonoClass *klass);
-
-MONO_API MonoClass*
-mono_class_get_nesting_type  (MonoClass *klass);
-
-MONO_API int
-mono_class_get_rank          (MonoClass *klass);
-
-MONO_API uint32_t
-mono_class_get_flags         (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-const char*
-mono_class_get_name          (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-const char*
-mono_class_get_namespace     (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_get_type          (MonoClass *klass);
-
-MONO_API uint32_t
-mono_class_get_type_token    (MonoClass *klass);
-
-MONO_API MonoType*
-mono_class_get_byref_type    (MonoClass *klass);
-
-MONO_API int
-mono_class_num_fields        (MonoClass *klass);
-
-MONO_API int
-mono_class_num_methods       (MonoClass *klass);
-
-MONO_API int
-mono_class_num_properties    (MonoClass *klass);
-
-MONO_API int
-mono_class_num_events        (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField*
-mono_class_get_fields        (MonoClass* klass, void **iter);
-
-MONO_API MonoMethod*
-mono_class_get_methods       (MonoClass* klass, void **iter);
-
-MONO_API MonoProperty*
-mono_class_get_properties    (MonoClass* klass, void **iter);
-
-MONO_API MonoEvent*
-mono_class_get_events        (MonoClass* klass, void **iter);
-
-MONO_API MonoClass*
-mono_class_get_interfaces    (MonoClass* klass, void **iter);
-
-MONO_API MonoClass*
-mono_class_get_nested_types  (MonoClass* klass, void **iter);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_delegate       (MonoClass* klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_implements_interface (MonoClass* klass, MonoClass* iface);
-
-/* MonoClassField accessors */
-MONO_API const char*
-mono_field_get_name   (MonoClassField *field);
-
-MONO_API MonoType*
-mono_field_get_type   (MonoClassField *field);
-
-MONO_API MonoClass*
-mono_field_get_parent (MonoClassField *field);
-
-MONO_API uint32_t
-mono_field_get_flags  (MonoClassField *field);
-
-MONO_API uint32_t
-mono_field_get_offset  (MonoClassField *field);
-
-MONO_API const char *
-mono_field_get_data  (MonoClassField *field);
-
-/* MonoProperty acessors */
-MONO_API const char*
-mono_property_get_name       (MonoProperty *prop);
-
-MONO_API MonoMethod*
-mono_property_get_set_method (MonoProperty *prop);
-
-MONO_API MonoMethod*
-mono_property_get_get_method (MonoProperty *prop);
-
-MONO_API MonoClass*
-mono_property_get_parent     (MonoProperty *prop);
-
-MONO_API uint32_t
-mono_property_get_flags      (MonoProperty *prop);
-
-/* MonoEvent accessors */
-MONO_API const char*
-mono_event_get_name          (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_add_method    (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_remove_method (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_remove_method (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_raise_method  (MonoEvent *event);
-
-MONO_API MonoClass*
-mono_event_get_parent        (MonoEvent *event);
-
-MONO_API uint32_t
-mono_event_get_flags         (MonoEvent *event);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_count);
-
-MONO_API char *
-mono_class_name_from_token (MonoImage *image, uint32_t type_token);
-
-MONO_API mono_bool
-mono_method_can_access_field (MonoMethod *method, MonoClassField *field);
-
-MONO_API mono_bool
-mono_method_can_access_method (MonoMethod *method, MonoMethod *called);
-
-MONO_API mono_bool
-mono_class_is_nullable (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_class_get_nullable_param (MonoClass *klass);
-
-MONO_END_DECLS
-
-#endif /* _MONO_CLI_CLASS_H_ */

+ 0 - 54
Libs/Interpreter/include/mono/metadata/debug-helpers.h

@@ -1,54 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_DEBUG_HELPERS_H__
-#define __MONO_DEBUG_HELPERS_H__
-
-#include <mono/metadata/class.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct MonoDisHelper MonoDisHelper;
-
-typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, uint32_t ip_offset);
-typedef char* (*MonoDisTokener)  (MonoDisHelper *dh, MonoMethod *method, uint32_t token);
-
-struct MonoDisHelper {
-	const char *newline;
-	const char *label_format;
-	const char *label_target;
-	MonoDisIndenter indenter;
-	MonoDisTokener  tokener;
-	void* user_data;
-};
-
-MONO_API char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp);
-MONO_API char* mono_disasm_code     (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end);
-
-typedef struct MonoMethodDesc MonoMethodDesc;
-
-MONO_API char*           mono_type_full_name (MonoType *type);
-
-MONO_API char*           mono_signature_get_desc (MonoMethodSignature *sig, mono_bool include_namespace);
-
-MONO_API char*           mono_context_get_desc (MonoGenericContext *context);
-
-MONO_API MonoMethodDesc* mono_method_desc_new (const char *name, mono_bool include_namespace);
-MONO_API MonoMethodDesc* mono_method_desc_from_method (MonoMethod *method);
-MONO_API void            mono_method_desc_free (MonoMethodDesc *desc);
-MONO_API mono_bool       mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method);
-MONO_API mono_bool       mono_method_desc_is_full (MonoMethodDesc *desc);
-MONO_API mono_bool       mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method);
-MONO_API MonoMethod*     mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
-MONO_API MonoMethod*     mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
-
-MONO_API char*           mono_method_full_name (MonoMethod *method, mono_bool signature);
-MONO_API char*           mono_method_get_reflection_name (MonoMethod *method);
-
-MONO_API char*           mono_field_full_name (MonoClassField *field);
-
-MONO_END_DECLS
-
-#endif /* __MONO_DEBUG_HELPERS_H__ */
-

+ 0 - 114
Libs/Interpreter/include/mono/metadata/debug-mono-symfile.h

@@ -1,114 +0,0 @@
-/**
- * \file
- * This header is only installed for use by the debugger:
- * the structures and the API declared here are not supported.
- * Copyright 2012 Xamarin Inc (http://www.xamarin.com)
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-#ifndef __MONO_DEBUG_MONO_SYMFILE_H__
-#define __MONO_DEBUG_MONO_SYMFILE_H__
-
-#include <glib.h>
-#include <mono/metadata/class.h>
-#include <mono/metadata/reflection.h>
-#include <mono/metadata/mono-debug.h>
-#include <mono/metadata/debug-internals.h>
-
-typedef struct MonoSymbolFileOffsetTable	MonoSymbolFileOffsetTable;
-typedef struct MonoSymbolFileLineNumberEntry	MonoSymbolFileLineNumberEntry;
-typedef struct MonoSymbolFileMethodAddress	MonoSymbolFileMethodAddress;
-typedef struct MonoSymbolFileDynamicTable	MonoSymbolFileDynamicTable;
-typedef struct MonoSymbolFileSourceEntry	MonoSymbolFileSourceEntry;
-typedef struct MonoSymbolFileMethodEntry	MonoSymbolFileMethodEntry;
-
-/* Keep in sync with OffsetTable in mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs */
-struct MonoSymbolFileOffsetTable {
-	uint32_t _total_file_size;
-	uint32_t _data_section_offset;
-	uint32_t _data_section_size;
-	uint32_t _compile_unit_count;
-	uint32_t _compile_unit_table_offset;
-	uint32_t _compile_unit_table_size;
-	uint32_t _source_count;
-	uint32_t _source_table_offset;
-	uint32_t _source_table_size;
-	uint32_t _method_count;
-	uint32_t _method_table_offset;
-	uint32_t _method_table_size;
-	uint32_t _type_count;
-	uint32_t _anonymous_scope_count;
-	uint32_t _anonymous_scope_table_offset;
-	uint32_t _anonymous_scope_table_size;
-	uint32_t _line_number_table_line_base;
-	uint32_t _line_number_table_line_range;
-	uint32_t _line_number_table_opcode_base;
-	uint32_t _is_aspx_source;
-};
-
-struct MonoSymbolFileSourceEntry {
-	uint32_t _index;
-	uint32_t _data_offset;
-};
-
-struct MonoSymbolFileMethodEntry {
-	uint32_t _token;
-	uint32_t _data_offset;
-	uint32_t _line_number_table;
-};
-
-struct MonoSymbolFileMethodAddress {
-	uint32_t size;
-	const uint8_t *start_address;
-	const uint8_t *end_address;
-	const uint8_t *method_start_address;
-	const uint8_t *method_end_address;
-	const uint8_t *wrapper_address;
-	uint32_t has_this;
-	uint32_t num_params;
-	uint32_t variable_table_offset;
-	uint32_t type_table_offset;
-	uint32_t num_line_numbers;
-	uint32_t line_number_offset;
-	uint8_t data [MONO_ZERO_LEN_ARRAY];
-};
-
-#define MONO_SYMBOL_FILE_MAJOR_VERSION		50
-#define MONO_SYMBOL_FILE_MINOR_VERSION		0
-#define MONO_SYMBOL_FILE_MAGIC			0x45e82623fd7fa614ULL
-
-MONO_BEGIN_DECLS
-
-MONO_API MonoSymbolFile *
-mono_debug_open_mono_symbols       (MonoDebugHandle          *handle,
-				    const uint8_t            *raw_contents,
-				    int                       size,
-				    mono_bool                 in_the_debugger);
-
-MONO_API void
-mono_debug_close_mono_symbol_file  (MonoSymbolFile           *symfile);
-
-MONO_API mono_bool
-mono_debug_symfile_is_loaded       (MonoSymbolFile           *symfile);
-
-MONO_API MonoDebugSourceLocation *
-mono_debug_symfile_lookup_location (MonoDebugMethodInfo      *minfo,
-				    uint32_t                  offset);
-
-MONO_API void
-mono_debug_symfile_free_location   (MonoDebugSourceLocation  *location);
-
-MONO_API MonoDebugMethodInfo *
-mono_debug_symfile_lookup_method   (MonoDebugHandle          *handle,
-				    MonoMethod               *method);
-
-MONO_API MonoDebugLocalsInfo*
-mono_debug_symfile_lookup_locals (MonoDebugMethodInfo *minfo);
-
-void
-mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points);
-
-MONO_END_DECLS
-
-#endif /* __MONO_SYMFILE_H__ */
-

+ 0 - 23
Libs/Interpreter/include/mono/metadata/environment.h

@@ -1,23 +0,0 @@
-/**
- * \file
- * System.Environment support internal calls
- *
- * Author:
- *	Dick Porter (dick@ximian.com)
- *
- * (C) 2002 Ximian, Inc
- */
-
-#ifndef _MONO_METADATA_ENVIRONMENT_H_
-#define _MONO_METADATA_ENVIRONMENT_H_
-
-#include <mono/utils/mono-publib.h>
-
-MONO_BEGIN_DECLS
-
-MONO_API int32_t mono_environment_exitcode_get (void);
-MONO_API void mono_environment_exitcode_set (int32_t value);
-
-MONO_END_DECLS
-
-#endif /* _MONO_METADATA_ENVIRONMENT_H_ */

+ 0 - 178
Libs/Interpreter/include/mono/metadata/exception.h

@@ -1,178 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONO_METADATA_EXCEPTION_H_
-#define _MONO_METADATA_EXCEPTION_H_
-
-#include <mono/metadata/object-forward.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/image.h>
-
-MONO_BEGIN_DECLS
-
-MONO_API MonoException *
-mono_exception_from_name               (MonoImage *image, 
-					const char* name_space, 
-					const char *name);
-
-MONO_API MonoException *
-mono_exception_from_token              (MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
-				      const char *name, MonoString *a1, MonoString *a2);
-
-MONO_API MonoException *
-mono_exception_from_name_msg	       (MonoImage *image, const char *name_space,
-					const char *name, const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_exception_from_token_two_strings (MonoImage *image, uint32_t token,
-						   MonoString *a1, MonoString *a2);
-
-MONO_API MonoException *
-mono_exception_from_name_domain        (MonoDomain *domain, MonoImage *image, 
-					const char* name_space, 
-					const char *name);
-
-MONO_API MonoException *
-mono_get_exception_divide_by_zero      (void);
-
-MONO_API MonoException *
-mono_get_exception_security            (void);
-
-MONO_API MonoException *
-mono_get_exception_arithmetic          (void);
-
-MONO_API MonoException *
-mono_get_exception_overflow            (void);
-
-MONO_API MonoException *
-mono_get_exception_null_reference      (void);
-
-MONO_API MonoException *
-mono_get_exception_execution_engine    (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_thread_abort        (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_thread_state        (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_thread_interrupted  (void);
-
-MONO_API MonoException *
-mono_get_exception_serialization       (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_invalid_cast        (void);
-
-MONO_API MonoException *
-mono_get_exception_invalid_operation (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_index_out_of_range  (void);
-
-MONO_API MonoException *
-mono_get_exception_array_type_mismatch (void);
-
-MONO_API MonoException *
-mono_get_exception_type_load           (MonoString *class_name, char *assembly_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_missing_method      (const char *class_name, const char *member_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_missing_field       (const char *class_name, const char *member_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_not_implemented     (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_not_supported       (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoException*
-mono_get_exception_argument_null       (const char *arg);
-
-MONO_API MonoException *
-mono_get_exception_argument            (const char *arg, const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_argument_out_of_range (const char *arg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_io                    (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_file_not_found        (MonoString *fname);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_file_not_found2       (const char *msg, MonoString *fname);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_type_initialization (const char *type_name, MonoException *inner);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_synchronization_lock (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_cannot_unload_appdomain (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_appdomain_unloaded (void);
-
-MONO_API MonoException *
-mono_get_exception_bad_image_format (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname);
-
-MONO_API MonoException *
-mono_get_exception_stack_overflow (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_out_of_memory (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_field_access (void);
-
-MONO_API MonoException *
-mono_get_exception_method_access (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception);
-
-/* Installs a function which is called when the runtime encounters an unhandled exception.
- * This hook isn't expected to return.
- * If no hook has been installed, the runtime will print a message before aborting.
- */
-typedef void  (*MonoUnhandledExceptionFunc)         (MonoObject *exc, void *user_data);
-MONO_API void mono_install_unhandled_exception_hook (MonoUnhandledExceptionFunc func, void *user_data);
-void          mono_invoke_unhandled_exception_hook  (MonoObject *exc);
-
-MONO_END_DECLS
-
-#endif /* _MONO_METADATA_EXCEPTION_H_ */

+ 0 - 97
Libs/Interpreter/include/mono/metadata/image.h

@@ -1,97 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONONET_METADATA_IMAGE_H_ 
-#define _MONONET_METADATA_IMAGE_H_
-
-#include <stdio.h>
-#include <mono/utils/mono-publib.h>
-#include <mono/utils/mono-error.h>
-#include <mono/metadata/object-forward.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct _MonoAssembly MonoAssembly;
-typedef struct _MonoAssemblyName MonoAssemblyName;
-typedef struct _MonoTableInfo MonoTableInfo;
-
-typedef enum {
-	MONO_IMAGE_OK,
-	MONO_IMAGE_ERROR_ERRNO,
-	MONO_IMAGE_MISSING_ASSEMBLYREF,
-	MONO_IMAGE_IMAGE_INVALID
-} MonoImageOpenStatus;
-
-MONO_API void          mono_images_init    (void);
-MONO_API void          mono_images_cleanup (void);
-
-MONO_API MonoImage    *mono_image_open     (const char *fname,
-				   MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_open_full (const char *fname,
-				   MonoImageOpenStatus *status, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_pe_file_open     (const char *fname,
-				     MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data (char *data, uint32_t data_len, mono_bool need_copy,
-                                         MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data_full (char *data, uint32_t data_len, mono_bool need_copy,
-                                         MonoImageOpenStatus *status, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data_with_name (char *data, uint32_t data_len, mono_bool need_copy,
-                                                   MonoImageOpenStatus *status, mono_bool refonly, const char *name);
-MONO_API void          mono_image_fixup_vtable (MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded   (const char *name);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_full   (const char *name, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_by_guid (const char *guid);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_by_guid_full (const char *guid, mono_bool refonly);
-MONO_API void          mono_image_init     (MonoImage *image);
-MONO_API void          mono_image_close    (MonoImage *image);
-MONO_API void          mono_image_addref   (MonoImage *image);
-MONO_API const char   *mono_image_strerror (MonoImageOpenStatus status);
-
-MONO_API int           mono_image_ensure_section     (MonoImage *image,
-					     const char *section);
-MONO_API int           mono_image_ensure_section_idx (MonoImage *image,
-					     int section);
-
-MONO_API uint32_t       mono_image_get_entry_point    (MonoImage *image);
-MONO_API const char   *mono_image_get_resource       (MonoImage *image, uint32_t offset, uint32_t *size);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_image_load_file_for_image (MonoImage *image, int fileidx);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_image_load_module (MonoImage *image, int idx);
-
-MONO_API const char*   mono_image_get_name       (MonoImage *image);
-MONO_API const char*   mono_image_get_filename   (MonoImage *image);
-MONO_API const char *  mono_image_get_guid       (MonoImage *image);
-MONO_API MonoAssembly* mono_image_get_assembly   (MonoImage *image);
-MONO_API mono_bool     mono_image_is_dynamic     (MonoImage *image);
-MONO_API char*         mono_image_rva_map        (MonoImage *image, uint32_t rva);
-
-MONO_API const MonoTableInfo *mono_image_get_table_info (MonoImage *image, int table_id);
-MONO_API int                  mono_image_get_table_rows (MonoImage *image, int table_id);
-MONO_API int                  mono_table_info_get_rows  (const MonoTableInfo *table);
-
-/* This actually returns a MonoPEResourceDataEntry *, but declaring it
- * causes an include file loop.
- */
-MONO_API void*      mono_image_lookup_resource (MonoImage *image, uint32_t res_id,
-					  uint32_t lang_id, mono_unichar2 *name);
-
-MONO_API const char*   mono_image_get_public_key  (MonoImage *image, uint32_t *size);
-MONO_API const char*   mono_image_get_strong_name (MonoImage *image, uint32_t *size);
-MONO_API uint32_t       mono_image_strong_name_position (MonoImage *image, uint32_t *size);
-MONO_API void          mono_image_add_to_name_cache (MonoImage *image, 
-			const char *nspace, const char *name, uint32_t idx);
-MONO_API mono_bool     mono_image_has_authenticode_entry (MonoImage *image);
-
-MONO_END_DECLS
-
-#endif

+ 0 - 109
Libs/Interpreter/include/mono/metadata/loader.h

@@ -1,109 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONO_METADATA_LOADER_H_
-#define _MONO_METADATA_LOADER_H_ 1
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/image.h>
-#include <mono/utils/mono-error.h>
-
-MONO_BEGIN_DECLS
-
-typedef mono_bool (*MonoStackWalk)     (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method             (MonoImage *image, uint32_t token, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method_full        (MonoImage *image, uint32_t token, MonoClass *klass,
-			     MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method_constrained (MonoImage *image, uint32_t token, MonoClass *constrained_class,
-			     MonoGenericContext *context, MonoMethod **cil_method);
-
-MONO_API void               
-mono_free_method           (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_get_signature_full (MonoMethod *method, MonoImage *image, uint32_t token,
-				MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_get_signature  (MonoMethod *method, MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_signature      (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader*
-mono_method_get_header     (MonoMethod *method);
-
-MONO_API const char*
-mono_method_get_name       (MonoMethod *method);
-
-MONO_API MonoClass*
-mono_method_get_class      (MonoMethod *method);
-
-MONO_API uint32_t
-mono_method_get_token      (MonoMethod *method);
-
-MONO_API uint32_t
-mono_method_get_flags      (MonoMethod *method, uint32_t *iflags);
-
-MONO_API uint32_t
-mono_method_get_index      (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_add_internal_call     (const char *name, const void* method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_dangerous_add_raw_internal_call (const char *name, const void* method);
-
-MONO_API void*
-mono_lookup_internal_call (MonoMethod *method);
-
-MONO_API const char*
-mono_lookup_icall_symbol (MonoMethod *m);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg);
-
-MONO_API void
-mono_method_get_param_names (MonoMethod *method, const char **names);
-
-MONO_API uint32_t
-mono_method_get_param_token (MonoMethod *method, int idx);
-
-MONO_API void
-mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs);
-
-MONO_API mono_bool
-mono_method_has_marshal_info (MonoMethod *method);
-
-MONO_API MonoMethod*
-mono_method_get_last_managed  (void);
-
-MONO_API void
-mono_stack_walk         (MonoStackWalk func, void* user_data);
-
-/* Use this if the IL offset is not needed: it's faster */
-MONO_API void
-mono_stack_walk_no_il   (MonoStackWalk func, void* user_data);
-
-typedef mono_bool (*MonoStackWalkAsyncSafe)     (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void* data);
-MONO_API void
-mono_stack_walk_async_safe   (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data);
-
-MONO_API MonoMethodHeader*
-mono_method_get_header_checked (MonoMethod *method, MonoError *error);
-
-MONO_END_DECLS
-
-#endif
-

+ 0 - 515
Libs/Interpreter/include/mono/metadata/metadata.h

@@ -1,515 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_METADATA_H__
-#define __MONO_METADATA_H__
-
-#include <mono/utils/mono-publib.h>
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/blob.h>
-#include <mono/metadata/row-indexes.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/object-forward.h>
-
-MONO_BEGIN_DECLS
-
-#define MONO_TYPE_ISSTRUCT(t) mono_type_is_struct (t)
-#define MONO_TYPE_IS_VOID(t) mono_type_is_void (t)
-#define MONO_TYPE_IS_POINTER(t) mono_type_is_pointer (t)
-#define MONO_TYPE_IS_REFERENCE(t) mono_type_is_reference (t)
-
-#define MONO_CLASS_IS_INTERFACE(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_INTERFACE) || mono_type_is_generic_parameter (mono_class_get_type (c)))
-
-#define MONO_CLASS_IS_IMPORT(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_IMPORT))
-
-typedef enum {
-	MONO_EXCEPTION_CLAUSE_NONE,
-	MONO_EXCEPTION_CLAUSE_FILTER,
-	MONO_EXCEPTION_CLAUSE_FINALLY,
-	MONO_EXCEPTION_CLAUSE_FAULT = 4
-} MonoExceptionEnum;
-
-typedef enum {
-	MONO_CALL_DEFAULT,
-	MONO_CALL_C,
-	MONO_CALL_STDCALL,
-	MONO_CALL_THISCALL,
-	MONO_CALL_FASTCALL,
-	MONO_CALL_VARARG
-} MonoCallConvention;
-
-/* ECMA lamespec: the old spec had more info... */
-typedef enum {
-	MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */
-	MONO_NATIVE_I1 = 0x03,
-	MONO_NATIVE_U1 = 0x04,
-	MONO_NATIVE_I2 = 0x05,
-	MONO_NATIVE_U2 = 0x06,
-	MONO_NATIVE_I4 = 0x07,
-	MONO_NATIVE_U4 = 0x08,
-	MONO_NATIVE_I8 = 0x09,
-	MONO_NATIVE_U8 = 0x0a,
-	MONO_NATIVE_R4 = 0x0b,
-	MONO_NATIVE_R8 = 0x0c,
-	MONO_NATIVE_CURRENCY = 0x0f,
-	MONO_NATIVE_BSTR = 0x13, /* prefixed length, Unicode */
-	MONO_NATIVE_LPSTR = 0x14, /* ANSI, null terminated */
-	MONO_NATIVE_LPWSTR = 0x15, /* UNICODE, null terminated */
-	MONO_NATIVE_LPTSTR = 0x16, /* plattform dep., null terminated */
-	MONO_NATIVE_BYVALTSTR = 0x17,
-	MONO_NATIVE_IUNKNOWN = 0x19,
-	MONO_NATIVE_IDISPATCH = 0x1a,
-	MONO_NATIVE_STRUCT = 0x1b,
-	MONO_NATIVE_INTERFACE = 0x1c,
-	MONO_NATIVE_SAFEARRAY = 0x1d,
-	MONO_NATIVE_BYVALARRAY = 0x1e,
-	MONO_NATIVE_INT   = 0x1f,
-	MONO_NATIVE_UINT  = 0x20,
-	MONO_NATIVE_VBBYREFSTR  = 0x22,
-	MONO_NATIVE_ANSIBSTR  = 0x23,  /* prefixed length, ANSI */
-	MONO_NATIVE_TBSTR  = 0x24, /* prefixed length, plattform dep. */
-	MONO_NATIVE_VARIANTBOOL  = 0x25,
-	MONO_NATIVE_FUNC  = 0x26,
-	MONO_NATIVE_ASANY = 0x28,
-	MONO_NATIVE_LPARRAY = 0x2a,
-	MONO_NATIVE_LPSTRUCT = 0x2b,
-	MONO_NATIVE_CUSTOM = 0x2c,
-	MONO_NATIVE_ERROR = 0x2d,
-	// TODO: MONO_NATIVE_IINSPECTABLE = 0x2e
-	// TODO: MONO_NATIVE_HSTRING = 0x2f
-	MONO_NATIVE_UTF8STR = 0x30,
-	MONO_NATIVE_MAX = 0x50 /* no info */
-} MonoMarshalNative;
-
-/* Used only in context of SafeArray */
-typedef enum {
-	MONO_VARIANT_EMPTY = 0x00,
-	MONO_VARIANT_NULL = 0x01,
-	MONO_VARIANT_I2 = 0x02,
-	MONO_VARIANT_I4 = 0x03,
-	MONO_VARIANT_R4 = 0x04,
-	MONO_VARIANT_R8 = 0x05,
-	MONO_VARIANT_CY = 0x06,
-	MONO_VARIANT_DATE = 0x07,
-	MONO_VARIANT_BSTR = 0x08,
-	MONO_VARIANT_DISPATCH = 0x09,
-	MONO_VARIANT_ERROR = 0x0a,
-	MONO_VARIANT_BOOL = 0x0b,
-	MONO_VARIANT_VARIANT = 0x0c,
-	MONO_VARIANT_UNKNOWN = 0x0d,
-	MONO_VARIANT_DECIMAL = 0x0e,
-	MONO_VARIANT_I1 = 0x10,
-	MONO_VARIANT_UI1 = 0x11,
-	MONO_VARIANT_UI2 = 0x12,
-	MONO_VARIANT_UI4 = 0x13,
-	MONO_VARIANT_I8 = 0x14,
-	MONO_VARIANT_UI8 = 0x15,
-	MONO_VARIANT_INT = 0x16,
-	MONO_VARIANT_UINT = 0x17,
-	MONO_VARIANT_VOID = 0x18,
-	MONO_VARIANT_HRESULT = 0x19,
-	MONO_VARIANT_PTR = 0x1a,
-	MONO_VARIANT_SAFEARRAY = 0x1b,
-	MONO_VARIANT_CARRAY = 0x1c,
-	MONO_VARIANT_USERDEFINED = 0x1d,
-	MONO_VARIANT_LPSTR = 0x1e,
-	MONO_VARIANT_LPWSTR = 0x1f,
-	MONO_VARIANT_RECORD = 0x24,
-	MONO_VARIANT_FILETIME = 0x40,
-	MONO_VARIANT_BLOB = 0x41,
-	MONO_VARIANT_STREAM = 0x42,
-	MONO_VARIANT_STORAGE = 0x43,
-	MONO_VARIANT_STREAMED_OBJECT = 0x44,
-	MONO_VARIANT_STORED_OBJECT = 0x45,
-	MONO_VARIANT_BLOB_OBJECT = 0x46,
-	MONO_VARIANT_CF = 0x47,
-	MONO_VARIANT_CLSID = 0x48,
-	MONO_VARIANT_VECTOR = 0x1000,
-	MONO_VARIANT_ARRAY = 0x2000,
-	MONO_VARIANT_BYREF = 0x4000
-} MonoMarshalVariant;
-
-typedef enum {
-	MONO_MARSHAL_CONV_NONE,
-	MONO_MARSHAL_CONV_BOOL_VARIANTBOOL,
-	MONO_MARSHAL_CONV_BOOL_I4,
-	MONO_MARSHAL_CONV_STR_BSTR,
-	MONO_MARSHAL_CONV_STR_LPSTR,
-	MONO_MARSHAL_CONV_LPSTR_STR,
-	MONO_MARSHAL_CONV_LPTSTR_STR,
-	MONO_MARSHAL_CONV_STR_LPWSTR,
-	MONO_MARSHAL_CONV_LPWSTR_STR,
-	MONO_MARSHAL_CONV_STR_LPTSTR,
-	MONO_MARSHAL_CONV_STR_ANSIBSTR,
-	MONO_MARSHAL_CONV_STR_TBSTR,
-	MONO_MARSHAL_CONV_STR_BYVALSTR,
-	MONO_MARSHAL_CONV_STR_BYVALWSTR,
-	MONO_MARSHAL_CONV_SB_LPSTR,
-	MONO_MARSHAL_CONV_SB_LPTSTR,
-	MONO_MARSHAL_CONV_SB_LPWSTR,
-	MONO_MARSHAL_CONV_LPSTR_SB,
-	MONO_MARSHAL_CONV_LPTSTR_SB,
-	MONO_MARSHAL_CONV_LPWSTR_SB,
-	MONO_MARSHAL_CONV_ARRAY_BYVALARRAY,
-	MONO_MARSHAL_CONV_ARRAY_BYVALCHARARRAY,
-	MONO_MARSHAL_CONV_ARRAY_SAVEARRAY,
-	MONO_MARSHAL_CONV_ARRAY_LPARRAY,
-	MONO_MARSHAL_FREE_LPARRAY,
-	MONO_MARSHAL_CONV_OBJECT_INTERFACE,
-	MONO_MARSHAL_CONV_OBJECT_IDISPATCH,
-	MONO_MARSHAL_CONV_OBJECT_IUNKNOWN,
-	MONO_MARSHAL_CONV_OBJECT_STRUCT,
-	MONO_MARSHAL_CONV_DEL_FTN,
-	MONO_MARSHAL_CONV_FTN_DEL,
-	MONO_MARSHAL_FREE_ARRAY,
-	MONO_MARSHAL_CONV_BSTR_STR,
-	MONO_MARSHAL_CONV_SAFEHANDLE,
-	MONO_MARSHAL_CONV_HANDLEREF,
-	MONO_MARSHAL_CONV_STR_UTF8STR,
-	MONO_MARSHAL_CONV_SB_UTF8STR,
-	MONO_MARSHAL_CONV_UTF8STR_STR,
-	MONO_MARSHAL_CONV_UTF8STR_SB,
-	MONO_MARSHAL_CONV_FIXED_BUFFER
-} MonoMarshalConv;
-
-#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
-
-typedef struct {
-	MonoMarshalNative native;
-	union {
-		struct {
-			MonoMarshalNative elem_type;
-			int32_t num_elem; /* -1 if not set */
-			int16_t param_num; /* -1 if not set */
-			int16_t elem_mult; /* -1 if not set */
-		} array_data;
-		struct {
-			char *custom_name;
-			char *cookie;
-			MonoImage *image;
-		} custom_data;
-		struct {
-			MonoMarshalVariant elem_type;
-			int32_t num_elem;
-		} safearray_data;
-	} data;
-} MonoMarshalSpec;
-
-MONO_API void         mono_metadata_init (void);
-
-MONO_API void         mono_metadata_decode_row (const MonoTableInfo   *t,
-				       int                    idx,
-				       uint32_t               *res,
-				       int                    res_size);
-
-MONO_API uint32_t      mono_metadata_decode_row_col (const MonoTableInfo *t, 
-					   int            idx, 
-					   unsigned int          col);
-
-/*
- * This macro is used to extract the size of the table encoded in
- * the size_bitfield of MonoTableInfo.
- */
-#define mono_metadata_table_size(bitfield,table) ((((bitfield) >> ((table)*2)) & 0x3) + 1)
-#define mono_metadata_table_count(bitfield) ((bitfield) >> 24)
-
-MONO_API int mono_metadata_compute_size (MonoImage   *meta,
-                                int             tableindex,
-                                uint32_t        *result_bitfield);
-
-/*
- *
- */
-MONO_API const char    *mono_metadata_locate        (MonoImage *meta, int table, int idx);
-MONO_API const char    *mono_metadata_locate_token  (MonoImage *meta, uint32_t token);
-					   
-MONO_API const char    *mono_metadata_string_heap   (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_blob_heap     (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_user_string   (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_guid_heap     (MonoImage *meta, uint32_t table_index);
-
-MONO_API uint32_t mono_metadata_typedef_from_field  (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_typedef_from_method (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_nested_in_typedef   (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_nesting_typedef     (MonoImage *meta, uint32_t table_index, uint32_t start_index);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass** mono_metadata_interfaces_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *count);
-
-MONO_API uint32_t     mono_metadata_events_from_typedef     (MonoImage *meta, uint32_t table_index, unsigned int *end_idx);
-MONO_API uint32_t     mono_metadata_methods_from_event      (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_properties_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_methods_from_property   (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_packing_from_typedef    (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size);
-MONO_API const char* mono_metadata_get_marshal_info        (MonoImage *meta, uint32_t idx, mono_bool is_field);
-MONO_API uint32_t     mono_metadata_custom_attrs_from_index (MonoImage *meta, uint32_t cattr_index);
-
-MONO_API MonoMarshalSpec *mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr);
-
-MONO_API void mono_metadata_free_marshal_spec (MonoMarshalSpec *spec);
-
-MONO_API uint32_t     mono_metadata_implmap_from_method     (MonoImage *meta, uint32_t method_idx);
-
-MONO_API void        mono_metadata_field_info (MonoImage *meta, 
-				      uint32_t       table_index,
-				      uint32_t      *offset,
-				      uint32_t      *rva,
-				      MonoMarshalSpec **marshal_spec);
-
-MONO_API uint32_t     mono_metadata_get_constant_index (MonoImage *meta, uint32_t token, uint32_t hint);
-
-/*
- * Functions to extract information from the Blobs
- */
-MONO_API uint32_t mono_metadata_decode_value     (const char            *ptr,
-                                        const char           **rptr);
-MONO_API int32_t mono_metadata_decode_signed_value (const char *ptr, const char **rptr);
-
-MONO_API uint32_t mono_metadata_decode_blob_size (const char            *ptr,
-                                        const char           **rptr);
-
-MONO_API void mono_metadata_encode_value (uint32_t value, char *bug, char **endbuf);
-
-#define MONO_OFFSET_IN_CLAUSE(clause,offset) \
-	((clause)->try_offset <= (offset) && (offset) < ((clause)->try_offset + (clause)->try_len))
-#define MONO_OFFSET_IN_HANDLER(clause,offset) \
-	((clause)->handler_offset <= (offset) && (offset) < ((clause)->handler_offset + (clause)->handler_len))
-#define MONO_OFFSET_IN_FILTER(clause,offset) \
-	((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER && (clause)->data.filter_offset <= (offset) && (offset) < ((clause)->handler_offset))
-
-typedef struct {
-	uint32_t flags;
-	uint32_t try_offset;
-	uint32_t try_len;
-	uint32_t handler_offset;
-	uint32_t handler_len;
-	union {
-		uint32_t filter_offset;
-		MonoClass *catch_class;
-	} data;
-} MonoExceptionClause;
-
-typedef struct _MonoType MonoType;
-typedef struct _MonoGenericInst MonoGenericInst;
-typedef struct _MonoGenericClass MonoGenericClass;
-typedef struct _MonoGenericContext MonoGenericContext;
-typedef struct _MonoGenericContainer MonoGenericContainer;
-typedef struct _MonoGenericParam MonoGenericParam;
-typedef struct _MonoArrayType MonoArrayType;
-typedef struct _MonoMethodSignature MonoMethodSignature;
-
-/* FIXME: Keeping this name alive for now, since it is part of the exposed API, even though no entrypoint uses it.  */
-typedef struct invalid_name MonoGenericMethod;
-
-typedef struct {
-	unsigned int required : 1;
-	unsigned int token    : 31;
-} MonoCustomMod;
-
-typedef struct _MonoCustomModContainer {
-	uint8_t count; /* max 64 modifiers follow at the end */
-	MonoImage *image; /* Image containing types in modifiers array */
-	MonoCustomMod modifiers [1]; /* Actual length is count */
-} MonoCustomModContainer;
-
-struct _MonoArrayType {
-	MonoClass *eklass;
-	// Number of dimensions of the array
-	uint8_t rank;
-
-	// Arrays recording known upper and lower index bounds for each dimension
-	uint8_t numsizes;
-	uint8_t numlobounds;
-	int *sizes;
-	int *lobounds;
-};
-
-typedef struct _MonoMethodHeader MonoMethodHeader;
-
-typedef enum {
-	MONO_PARSE_TYPE,
-	MONO_PARSE_MOD_TYPE,
-	MONO_PARSE_LOCAL,
-	MONO_PARSE_PARAM,
-	MONO_PARSE_RET,
-	MONO_PARSE_FIELD
-} MonoParseTypeMode;
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_type_is_byref       (MonoType *type);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_type_get_type       (MonoType *type);
-
-/* For MONO_TYPE_FNPTR */
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_type_get_signature  (MonoType *type);
-
-/* For MONO_TYPE_CLASS, VALUETYPE */
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_type_get_class      (MonoType *type);
-
-MONO_API MonoArrayType*
-mono_type_get_array_type (MonoType *type);
-
-/* For MONO_TYPE_PTR */
-MONO_API MonoType*
-mono_type_get_ptr_type (MonoType *type);
-
-MONO_API MonoClass*
-mono_type_get_modifiers  (MonoType *type, mono_bool *is_required, void **iter);
-
-MONO_API mono_bool mono_type_is_struct    (MonoType *type);
-MONO_API mono_bool mono_type_is_void      (MonoType *type);
-MONO_API mono_bool mono_type_is_pointer   (MonoType *type);
-MONO_API mono_bool mono_type_is_reference (MonoType *type);
-MONO_API mono_bool mono_type_is_generic_parameter (MonoType *type);
-
-MONO_API MonoType*
-mono_signature_get_return_type (MonoMethodSignature *sig);
-
-MONO_API MonoType*
-mono_signature_get_params      (MonoMethodSignature *sig, void **iter);
-
-MONO_API uint32_t
-mono_signature_get_param_count (MonoMethodSignature *sig);
-
-MONO_API uint32_t
-mono_signature_get_call_conv   (MonoMethodSignature *sig);
-
-MONO_API int
-mono_signature_vararg_start    (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_is_instance     (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_explicit_this   (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_param_is_out    (MonoMethodSignature *sig, int param_num);
-
-MONO_API uint32_t     mono_metadata_parse_typedef_or_ref (MonoImage      *m,
-                                                const char      *ptr,
-                                                const char     **rptr);
-MONO_API int            mono_metadata_parse_custom_mod  (MonoImage      *m,
-						MonoCustomMod   *dest,
-						const char      *ptr,
-						const char     **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArrayType *mono_metadata_parse_array       (MonoImage      *m,
-						const char      *ptr,
-						const char     **rptr);
-MONO_API void           mono_metadata_free_array        (MonoArrayType     *array);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType      *mono_metadata_parse_type        (MonoImage      *m,
-						MonoParseTypeMode  mode,
-						short              opt_attrs,
-						const char        *ptr,
-						const char       **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_metadata_parse_param       (MonoImage      *m,
-						const char      *ptr,
-						const char      **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_metadata_parse_field_type  (MonoImage      *m,
-		                                short            field_flags,
-						const char      *ptr,
-						const char      **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_type_create_from_typespec  (MonoImage        *image,
-					        uint32_t           type_spec);
-MONO_API void           mono_metadata_free_type         (MonoType        *type);
-MONO_API int            mono_type_size                  (MonoType        *type, 
-						int             *alignment);
-MONO_API int            mono_type_stack_size            (MonoType        *type, 
-						int             *alignment);
-
-MONO_API mono_bool       mono_type_generic_inst_is_valuetype      (MonoType *type);
-MONO_API mono_bool       mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass);
-
-MONO_API unsigned int          mono_metadata_type_hash         (MonoType *t1);
-MONO_API mono_bool       mono_metadata_type_equal        (MonoType *t1, MonoType *t2);
-
-MONO_API MonoMethodSignature  *mono_metadata_signature_alloc (MonoImage *image, uint32_t nparams);
-
-MONO_API MonoMethodSignature  *mono_metadata_signature_dup (MonoMethodSignature *sig);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodSignature  *mono_metadata_parse_signature (MonoImage *image, 
-						     uint32_t    token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodSignature  *mono_metadata_parse_method_signature (MonoImage            *m,
-                                                            int                    def,
-                                                            const char            *ptr,
-                                                            const char           **rptr);
-MONO_API void                  mono_metadata_free_method_signature  (MonoMethodSignature   *method);
-
-MONO_API mono_bool          mono_metadata_signature_equal (MonoMethodSignature *sig1, 
-						 MonoMethodSignature *sig2);
-
-MONO_API unsigned int             mono_signature_hash (MonoMethodSignature *sig);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodHeader *mono_metadata_parse_mh (MonoImage *m, const char *ptr);
-MONO_API void              mono_metadata_free_mh  (MonoMethodHeader *mh);
-
-/* MonoMethodHeader acccessors */
-MONO_API const unsigned char*
-mono_method_header_get_code (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack);
-
-MONO_API MonoType**
-mono_method_header_get_locals (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals);
-
-MONO_API int
-mono_method_header_get_num_clauses (MonoMethodHeader *header);
-
-MONO_API int
-mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause);
-
-MONO_API uint32_t 
-mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec, 
-			mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv);
-
-/*
- * Makes a token based on a table and an index
- */
-#define mono_metadata_make_token(table,idx) (((table) << 24)| (idx))
-
-/*
- * Returns the table index that this token encodes.
- */
-#define mono_metadata_token_table(token) ((token) >> 24)
-
- /*
- * Returns the index that a token refers to
- */
-#define mono_metadata_token_index(token) ((token) & 0xffffff)
-
-
-#define mono_metadata_token_code(token) ((token) & 0xff000000)
-
-MONO_API uint32_t mono_metadata_token_from_dor (uint32_t dor_index);
-
-MONO_API char *mono_guid_to_string (const uint8_t *guid);
-
-MONO_API char *mono_guid_to_string_minimal (const uint8_t *guid);
-
-MONO_API uint32_t mono_metadata_declsec_from_index (MonoImage *meta, uint32_t idx);
-
-MONO_API uint32_t mono_metadata_translate_token_index (MonoImage *image, int table, uint32_t idx);
-
-MONO_API void    mono_metadata_decode_table_row (MonoImage *image, int table,
-				       int                    idx,
-				       uint32_t               *res,
-				       int                    res_size);
-
-MONO_API uint32_t      mono_metadata_decode_table_row_col (MonoImage *image, int table,
-					   int            idx, 
-					   unsigned int          col);
-
-MONO_END_DECLS
-
-#endif /* __MONO_METADATA_H__ */

+ 0 - 38
Libs/Interpreter/include/mono/metadata/mono-config.h

@@ -1,38 +0,0 @@
-/**
- * \file
- *
- * Author: Paolo Molaro (lupus@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-#ifndef __MONO_METADATA_CONFIG_H__
-#define __MONO_METADATA_CONFIG_H__
-
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/image.h>
-
-MONO_BEGIN_DECLS
-
-MONO_API const char *mono_config_get_os (void);
-MONO_API const char *mono_config_get_cpu (void);
-MONO_API const char *mono_config_get_wordsize (void);
-
-MONO_API const char* mono_get_config_dir (void);
-MONO_API void        mono_set_config_dir (const char *dir);
-
-MONO_API const char* mono_get_machine_config (void);
-
-MONO_API void mono_config_cleanup      (void);
-MONO_API void mono_config_parse        (const char *filename);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_config_for_assembly (MonoImage *assembly);
-MONO_API void mono_config_parse_memory (const char *buffer);
-
-MONO_API const char* mono_config_string_for_assembly_file (const char *filename);
-
-MONO_API void mono_config_set_server_mode (mono_bool server_mode);
-MONO_API mono_bool mono_config_is_server_mode (void);
-
-MONO_END_DECLS
-
-#endif /* __MONO_METADATA_CONFIG_H__ */
-

+ 0 - 232
Libs/Interpreter/include/mono/metadata/mono-debug.h

@@ -1,232 +0,0 @@
-/**
- * \file
- * This header is only installed for use by the debugger:
- * the structures and the API declared here are not supported.
- */
-
-#ifndef __MONO_DEBUG_H__
-#define __MONO_DEBUG_H__
-
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/appdomain.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct _MonoSymbolTable			MonoSymbolTable;
-typedef struct _MonoDebugDataTable		MonoDebugDataTable;
-
-typedef struct _MonoSymbolFile			MonoSymbolFile;
-typedef struct _MonoPPDBFile			MonoPPDBFile;
-
-typedef struct _MonoDebugHandle			MonoDebugHandle;
-
-typedef struct _MonoDebugLineNumberEntry	MonoDebugLineNumberEntry;
-
-typedef struct _MonoDebugVarInfo		MonoDebugVarInfo;
-typedef struct _MonoDebugMethodJitInfo		MonoDebugMethodJitInfo;
-typedef struct _MonoDebugMethodAddress		MonoDebugMethodAddress;
-typedef struct _MonoDebugMethodAddressList	MonoDebugMethodAddressList;
-typedef struct _MonoDebugClassEntry		MonoDebugClassEntry;
-
-typedef struct _MonoDebugMethodInfo		MonoDebugMethodInfo;
-typedef struct _MonoDebugLocalsInfo		MonoDebugLocalsInfo;
-typedef struct _MonoDebugMethodAsyncInfo	MonoDebugMethodAsyncInfo;
-typedef struct _MonoDebugSourceLocation		MonoDebugSourceLocation;
-
-typedef struct _MonoDebugList			MonoDebugList;
-
-typedef enum {
-	MONO_DEBUG_FORMAT_NONE,
-	MONO_DEBUG_FORMAT_MONO,
-	/* Deprecated, the mdb debugger is not longer supported. */
-	MONO_DEBUG_FORMAT_DEBUGGER
-} MonoDebugFormat;
-
-/*
- * NOTE:
- * We intentionally do not use GList here since the debugger needs to know about
- * the layout of the fields.
-*/
-struct _MonoDebugList {
-	MonoDebugList *next;
-	const void* data;
-};
-
-struct _MonoSymbolTable {
-	uint64_t magic;
-	uint32_t version;
-	uint32_t total_size;
-
-	/*
-	 * Corlib and metadata info.
-	 */
-	MonoDebugHandle *corlib;
-	MonoDebugDataTable *global_data_table;
-	MonoDebugList *data_tables;
-
-	/*
-	 * The symbol files.
-	 */
-	MonoDebugList *symbol_files;
-};
-
-struct _MonoDebugHandle {
-	uint32_t index;
-	char *image_file;
-	MonoImage *image;
-	MonoDebugDataTable *type_table;
-	MonoSymbolFile *symfile;
-	MonoPPDBFile *ppdb;
-};
-
-struct _MonoDebugMethodJitInfo {
-	const mono_byte *code_start;
-	uint32_t code_size;
-	uint32_t prologue_end;
-	uint32_t epilogue_begin;
-	const mono_byte *wrapper_addr;
-	uint32_t num_line_numbers;
-	MonoDebugLineNumberEntry *line_numbers;
-	uint32_t has_var_info;
-	uint32_t num_params;
-	MonoDebugVarInfo *this_var;
-	MonoDebugVarInfo *params;
-	uint32_t num_locals;
-	MonoDebugVarInfo *locals;
-	MonoDebugVarInfo *gsharedvt_info_var;
-	MonoDebugVarInfo *gsharedvt_locals_var;
-};
-
-struct _MonoDebugMethodAddressList {
-	uint32_t size;
-	uint32_t count;
-	mono_byte data [MONO_ZERO_LEN_ARRAY];
-};
-
-struct _MonoDebugSourceLocation {
-	char *source_file;
-	uint32_t row, column;
-	uint32_t il_offset;
-};
-
-MONO_API mono_bool mono_debug_enabled (void);
-
-/*
- * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
- * where the variable is actually stored.
- *
- * See relocate_variable() in debug-symfile.c for more info.
- */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS		0xf0000000
-
-/* The variable is in register "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER		0
-
-/* The variable is at offset "offset" from register "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET		0x10000000
-
-/* The variable is in the two registers "offset" and "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS	0x20000000
-
-/* The variable is dead. */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD		0x30000000
-
-/* Same as REGOFFSET, but do an indirection */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR		0x40000000
-
-/* gsharedvt local */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL		0x50000000
-
-/* variable is a vt address */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR		0x60000000
-
-struct _MonoDebugVarInfo {
-	uint32_t index;
-	uint32_t offset;
-	uint32_t size;
-	uint32_t begin_scope;
-	uint32_t end_scope;
-	MonoType *type;
-};
-
-#define MONO_DEBUGGER_MAJOR_VERSION			81
-#define MONO_DEBUGGER_MINOR_VERSION			6
-#define MONO_DEBUGGER_MAGIC				0x7aff65af4253d427ULL
-
-MONO_API void mono_debug_init (MonoDebugFormat format);
-MONO_API void mono_debug_open_image_from_memory (MonoImage *image, const mono_byte *raw_contents, int size);
-MONO_API void mono_debug_cleanup (void);
-
-MONO_API void mono_debug_close_image (MonoImage *image);
-
-MONO_API void mono_debug_domain_unload (MonoDomain *domain);
-MONO_API void mono_debug_domain_create (MonoDomain *domain);
-
-MONO_API MonoDebugMethodAddress *
-mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain);
-
-MONO_API void
-mono_debug_remove_method (MonoMethod *method, MonoDomain *domain);
-
-MONO_API MonoDebugMethodInfo *
-mono_debug_lookup_method (MonoMethod *method);
-
-MONO_API MonoDebugMethodAddressList *
-mono_debug_lookup_method_addresses (MonoMethod *method);
-
-MONO_API MonoDebugMethodJitInfo*
-mono_debug_find_method (MonoMethod *method, MonoDomain *domain);
-
-MONO_API MonoDebugHandle *
-mono_debug_get_handle (MonoImage *image);
-
-MONO_API void
-mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit);
-
-
-MONO_API void
-mono_debug_add_delegate_trampoline (void* code, int size);
-
-MONO_API MonoDebugLocalsInfo*
-mono_debug_lookup_locals (MonoMethod *method);
-
-MonoDebugMethodAsyncInfo*
-mono_debug_lookup_method_async_debug_info (MonoMethod *method);
-
-// The intent here is really MONO_LLVM_INTERNAL but that is not necessarily available.
-MONO_API
-MonoDebugSourceLocation *
-mono_debug_method_lookup_location (MonoDebugMethodInfo *minfo, int il_offset);
-
-/*
- * Line number support.
- */
-
-MONO_API MonoDebugSourceLocation *
-mono_debug_lookup_source_location (MonoMethod *method, uint32_t address, MonoDomain *domain);
-
-MONO_API int32_t
-mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, uint32_t native_offset);
-
-MONO_API void
-mono_debug_free_source_location (MonoDebugSourceLocation *location);
-
-MONO_API char *
-mono_debug_print_stack_frame (MonoMethod *method, uint32_t native_offset, MonoDomain *domain);
-
-/*
- * Mono Debugger support functions
- *
- * These methods are used by the JIT while running inside the Mono Debugger.
- */
-
-MONO_API int             mono_debugger_method_has_breakpoint       (MonoMethod *method);
-MONO_API int             mono_debugger_insert_breakpoint           (const char *method_name, mono_bool include_namespace);
-
-MONO_API void mono_set_is_debugger_attached (mono_bool attached);
-MONO_API mono_bool mono_is_debugger_attached (void);
-
-MONO_END_DECLS
-
-#endif /* __MONO_DEBUG_H__ */

+ 0 - 129
Libs/Interpreter/include/mono/metadata/mono-gc.h

@@ -1,129 +0,0 @@
-/**
- * \file
- * GC related public interface
- *
- */
-#ifndef __METADATA_MONO_GC_H__
-#define __METADATA_MONO_GC_H__
-
-#include <mono/metadata/object.h>
-
-MONO_BEGIN_DECLS
-
-typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data);
-
-/**
- * This enum is used by the profiler API when reporting root registration.
- */
-typedef enum {
-	/**
-	 * Roots external to Mono. Embedders may only use this value.
-	 */
-	MONO_ROOT_SOURCE_EXTERNAL = 0,
-	/**
-	 * Thread call stack.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_STACK = 1,
-	/**
-	 * Roots in the finalizer queue. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
-	/**
-	 * Managed \c static variables.
-	 *
-	 * The \c key parameter is a \c MonoVTable pointer.
-	 */
-	MONO_ROOT_SOURCE_STATIC = 3,
-	/**
-	 * Managed \c static variables with \c ThreadStaticAttribute.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_THREAD_STATIC = 4,
-	/**
-	 * Managed \c static variables with \c ContextStaticAttribute.
-	 *
-	 * The \c key parameter is a \c MonoAppContext pointer.
-	 */
-	MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
-	/**
-	 * \c GCHandle structures.
-	 */
-	MONO_ROOT_SOURCE_GC_HANDLE = 6,
-	/**
-	 * Roots in the just-in-time compiler.
-	 */
-	MONO_ROOT_SOURCE_JIT = 7,
-	/**
-	 * Roots in the threading subsystem.
-	 *
-	 * The \c key parameter, if not \c NULL, is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_THREADING = 8,
-	/**
-	 * Roots in application domains.
-	 *
-	 * The \c key parameter, if not \c NULL, is a \c MonoDomain pointer.
-	 */
-	MONO_ROOT_SOURCE_DOMAIN = 9,
-	/**
-	 * Roots in reflection code.
-	 *
-	 * The \c key parameter, if not \c NULL, is a \c MonoVTable pointer.
-	 */
-	MONO_ROOT_SOURCE_REFLECTION = 10,
-	/**
-	 * Roots from P/Invoke or other marshaling infrastructure.
-	 */
-	MONO_ROOT_SOURCE_MARSHAL = 11,
-	/**
-	 * Roots in the thread pool data structures.
-	 */
-	MONO_ROOT_SOURCE_THREAD_POOL = 12,
-	/**
-	 * Roots in the debugger agent.
-	 */
-	MONO_ROOT_SOURCE_DEBUGGER = 13,
-	/**
-	 * Roots in the runtime handle stack. This is a pseudo-root.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_HANDLE = 14,
-	/**
-	 * Roots in the ephemeron arrays. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_EPHEMERON = 15,
-	/**
-	 * Roots in the toggleref arrays. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_TOGGLEREF = 16,
-} MonoGCRootSource;
-
-typedef enum {
-	MONO_GC_HANDLE_TYPE_MIN = 0,
-	MONO_GC_HANDLE_WEAK = MONO_GC_HANDLE_TYPE_MIN,
-	MONO_GC_HANDLE_WEAK_TRACK_RESURRECTION,
-	MONO_GC_HANDLE_NORMAL,
-	MONO_GC_HANDLE_PINNED,
-	MONO_GC_HANDLE_TYPE_MAX,
-} MonoGCHandleType;
-
-MONO_API void   mono_gc_collect         (int generation);
-MONO_API int    mono_gc_max_generation  (void);
-MONO_API int    mono_gc_get_generation  (MonoObject *object);
-MONO_API int    mono_gc_collection_count (int generation);
-MONO_API int64_t mono_gc_get_used_size   (void);
-MONO_API int64_t mono_gc_get_heap_size   (void);
-MONO_API MonoBoolean mono_gc_pending_finalizers (void);
-MONO_API void     mono_gc_finalize_notify    (void);
-MONO_API int    mono_gc_invoke_finalizers (void);
-/* heap walking is only valid in the pre-stop-world event callback */
-MONO_API int    mono_gc_walk_heap        (int flags, MonoGCReferences callback, void *data);
-
-MONO_END_DECLS
-
-#endif /* __METADATA_MONO_GC_H__ */
-

+ 0 - 22
Libs/Interpreter/include/mono/metadata/object-forward.h

@@ -1,22 +0,0 @@
-/**
- * \file
- *
- * Forward declarations of opaque types, and typedefs thereof.
- *
- */
-
-#ifndef __MONO_OBJECT_FORWARD_H__
-#define __MONO_OBJECT_FORWARD_H__
-
-#include <mono/utils/mono-publib.h>
-
-typedef struct _MonoClass MonoClass;
-typedef struct _MonoImage MonoImage;
-typedef struct _MonoMethod MonoMethod;
-
-typedef struct _MonoObject MONO_RT_MANAGED_ATTR MonoObject;
-typedef struct _MonoException MONO_RT_MANAGED_ATTR MonoException;
-typedef struct _MonoReflectionAssembly MONO_RT_MANAGED_ATTR MonoReflectionAssembly;
-typedef struct _MonoReflectionTypeBuilder MONO_RT_MANAGED_ATTR MonoReflectionTypeBuilder;
-
-#endif /* __MONO_OBJECT_FORWARD_H__ */

+ 0 - 403
Libs/Interpreter/include/mono/metadata/object.h

@@ -1,403 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONO_CLI_OBJECT_H_
-#define _MONO_CLI_OBJECT_H_
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/object-forward.h>
-#include <mono/metadata/class.h>
-#include <mono/utils/mono-error.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct _MonoString MONO_RT_MANAGED_ATTR MonoString;
-typedef struct _MonoArray MONO_RT_MANAGED_ATTR MonoArray;
-typedef struct _MonoReflectionMethod MONO_RT_MANAGED_ATTR MonoReflectionMethod;
-typedef struct _MonoReflectionModule MONO_RT_MANAGED_ATTR MonoReflectionModule;
-typedef struct _MonoReflectionField MONO_RT_MANAGED_ATTR MonoReflectionField;
-typedef struct _MonoReflectionProperty MONO_RT_MANAGED_ATTR MonoReflectionProperty;
-typedef struct _MonoReflectionEvent MONO_RT_MANAGED_ATTR MonoReflectionEvent;
-typedef struct _MonoReflectionType MONO_RT_MANAGED_ATTR MonoReflectionType;
-typedef struct _MonoDelegate MONO_RT_MANAGED_ATTR MonoDelegate;
-typedef struct _MonoThreadsSync MonoThreadsSync;
-#ifdef ENABLE_NETCORE
-typedef struct _MonoInternalThread MONO_RT_MANAGED_ATTR MonoThread;
-#else
-typedef struct _MonoThread MONO_RT_MANAGED_ATTR MonoThread;
-#endif
-typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
-typedef struct _MonoDynamicImage MonoDynamicImage;
-typedef struct _MonoReflectionMethodBody MONO_RT_MANAGED_ATTR MonoReflectionMethodBody;
-typedef struct _MonoAppContext MONO_RT_MANAGED_ATTR MonoAppContext;
-
-struct _MonoObject {
-	MonoVTable *vtable;
-	MonoThreadsSync *synchronisation;
-};
-
-typedef MonoObject* (*MonoInvokeFunc)	     (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error);
-typedef void*    (*MonoCompileFunc)	     (MonoMethod *method);
-typedef void	    (*MonoMainThreadFunc)    (void* user_data);
-
-#define MONO_OBJECT_SETREF(obj,fieldname,value) do {	\
-		mono_gc_wbarrier_set_field ((MonoObject*)(obj), &((obj)->fieldname), (MonoObject*)value);	\
-		/*(obj)->fieldname = (value);*/	\
-	} while (0)
-
-/* This should be used if 's' can reside on the heap */
-#define MONO_STRUCT_SETREF(s,field,value) do { \
-        mono_gc_wbarrier_generic_store (&((s)->field), (MonoObject*)(value)); \
-    } while (0)
-
-#define mono_array_addr(array,type,index) ((type*)mono_array_addr_with_size ((array), sizeof (type), (index)))
-#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) ) 
-#define mono_array_set(array,type,index,value)	\
-	do {	\
-		type *__p = (type *) mono_array_addr ((array), type, (index));	\
-		*__p = (value);	\
-	} while (0)
-#define mono_array_setref(array,index,value)	\
-	do {	\
-		void **__p = (void **) mono_array_addr ((array), void*, (index));	\
-		mono_gc_wbarrier_set_arrayref ((array), __p, (MonoObject*)(value));	\
-		/* *__p = (value);*/	\
-	} while (0)
-#define mono_array_memcpy_refs(dest,destidx,src,srcidx,count)	\
-	do {	\
-		void **__p = (void **) mono_array_addr ((dest), void*, (destidx));	\
-		void **__s = mono_array_addr ((src), void*, (srcidx));	\
-		mono_gc_wbarrier_arrayref_copy (__p, __s, (count));	\
-	} while (0)
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *mono_string_chars  (MonoString *s);
-MONO_API MONO_RT_EXTERNAL_ONLY int            mono_string_length (MonoString *s);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_new		    (MonoDomain *domain, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_specific    (MonoVTable *vtable);
-
-/* can be used for classes without finalizer in non-profiling mode */
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_fast	    (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_alloc_specific (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_from_token  (MonoDomain *domain, MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_new		    (MonoDomain *domain, MonoClass *eclass, uintptr_t n);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_new_full	    (MonoDomain *domain, MonoClass *array_class,
-			     uintptr_t *lengths, intptr_t *lower_bounds);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray *
-mono_array_new_specific	    (MonoVTable *vtable, uintptr_t n);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_clone	    (MonoArray *array);
-
-MONO_API MONO_RT_EXTERNAL_ONLY char*
-mono_array_addr_with_size   (MonoArray *array, int size, uintptr_t idx);
-
-MONO_API MONO_RT_EXTERNAL_ONLY uintptr_t
-mono_array_length           (MonoArray *array);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_empty	      (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_empty_wrapper   (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_utf16	    (MonoDomain *domain, const mono_unichar2 *text, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_size	    (MonoDomain *domain, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_ldstr		    (MonoDomain *domain, MonoImage *image, uint32_t str_index);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_is_interned	    (MonoString *str);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_intern	    (MonoString *str);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new		    (MonoDomain *domain, const char *text);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_new_wrapper	    (const char *text);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_len	    (MonoDomain *domain, const char *text, unsigned int length);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_utf32	    (MonoDomain *domain, const mono_unichar4 *text, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-char *
-mono_string_to_utf8	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY char *
-mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *
-mono_string_to_utf16	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar4 *
-mono_string_to_utf32	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString *
-mono_string_from_utf16	    (/*const*/ mono_unichar2 *data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString *
-mono_string_from_utf32	    (/*const*/ mono_unichar4 *data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_string_equal           (MonoString *s1, MonoString *s2);
-
-MONO_API MONO_RT_EXTERNAL_ONLY unsigned int
-mono_string_hash            (MonoString *s);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_object_hash            (MonoObject* obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString *
-mono_object_to_string (MonoObject *obj, MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_value_box		    (MonoDomain *domain, MonoClass *klass, void* val);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_value_copy             (void* dest, /*const*/ void* src, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_value_copy_array       (MonoArray *dest, int dest_idx, void* src, int count);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable*
-mono_object_get_vtable      (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*
-mono_object_get_domain      (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_object_get_class       (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_object_unbox	    (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_clone	    (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_isinst	    (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_isinst_mbyref   (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_monitor_try_enter       (MonoObject *obj, uint32_t ms);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_monitor_enter           (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_monitor_enter_v4        (MonoObject *obj, char *lock_taken);
-
-MONO_API MONO_RT_EXTERNAL_ONLY unsigned int
-mono_object_get_size         (MonoObject *o);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_monitor_exit            (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_raise_exception	    (MonoException *ex);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_runtime_set_pending_exception (MonoException *exc, mono_bool overwrite);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_reraise_exception	    (MonoException *ex);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_object_init    (MonoObject *this_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_class_init	    (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*
-mono_vtable_domain          (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_vtable_class           (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_invoke	    (MonoMethod *method, void *obj, void **params,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_invoke    (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_begin_invoke (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_end_invoke (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_delegate_invoke (MonoObject *delegate, void **params,
-			      MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_invoke_array   (MonoMethod *method, void *obj, MonoArray *params,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_method_get_unmanaged_thunk (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*
-mono_runtime_get_main_args  (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_exec_managed_code (MonoDomain *domain,
-				MonoMainThreadFunc main_func,
-				void* main_args);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_run_main	    (MonoMethod *method, int argc, char* argv[], 
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_exec_main	    (MonoMethod *method, MonoArray *args,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_set_main_args  (int argc, char* argv[]);
-
-/* The following functions won't be available with mono was configured with remoting disabled. */
-/*#ifndef DISABLE_REMOTING */
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_store_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg);
-
-/* #endif */
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_unhandled_exception    (MonoObject *exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_print_unhandled_exception (MonoObject *exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void*
-mono_compile_method	   (MonoMethod *method);
-
-/* accessors for fields and properties */
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
-
-/* GC handles support
- *
- * A handle can be created to refer to a managed object and either prevent it
- * from being garbage collected or moved or to be able to know if it has been 
- * collected or not (weak references).
- * mono_gchandle_new () is used to prevent an object from being garbage collected
- * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to
- * prevent the object from being moved (this should be avoided as much as possible 
- * and this should be used only for shorts periods of time or performance will suffer).
- * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should
- * usually be false (see the GC docs for more details).
- * mono_gchandle_get_target () can be used to get the object referenced by both kinds
- * of handle: for a weakref handle, if an object has been collected, it will return NULL.
- */
-MONO_API MONO_RT_EXTERNAL_ONLY uint32_t     mono_gchandle_new         (MonoObject *obj, mono_bool pinned);
-MONO_API MONO_RT_EXTERNAL_ONLY uint32_t     mono_gchandle_new_weakref (MonoObject *obj, mono_bool track_resurrection);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*  mono_gchandle_get_target  (uint32_t gchandle);
-MONO_API MONO_RT_EXTERNAL_ONLY void         mono_gchandle_free        (uint32_t gchandle);
-
-/* Reference queue support
- *
- * A reference queue is used to get notifications of when objects are collected.
- * Call mono_gc_reference_queue_new to create a new queue and pass the callback that
- * will be invoked when registered objects are collected.
- * Call mono_gc_reference_queue_add to register a pair of objects and data within a queue.
- * The callback will be triggered once an object is both unreachable and finalized.
- */
-
-typedef void (*mono_reference_queue_callback) (void *user_data);
-typedef struct _MonoReferenceQueue MonoReferenceQueue;
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoReferenceQueue* mono_gc_reference_queue_new (mono_reference_queue_callback callback);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_reference_queue_free (MonoReferenceQueue *queue);
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool mono_gc_reference_queue_add (MonoReferenceQueue *queue, MonoObject *obj, void *user_data);
-
-/* GC write barriers support */
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_field     (MonoObject *obj, void* field_ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_arrayref  (MonoArray *arr, void* slot_ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_arrayref_copy (void* dest_ptr, /*const*/ void* src_ptr, int count);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store_atomic (void *ptr, MonoObject *value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_nostore (void* ptr);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_value_copy    (void* dest, /*const*/ void* src, int count, MonoClass *klass);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_object_copy   (MonoObject* obj, MonoObject *src);
-
-MONO_END_DECLS
-
-#endif

+ 0 - 81
Libs/Interpreter/include/mono/metadata/opcodes.h

@@ -1,81 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_METADATA_OPCODES_H__
-#define __MONO_METADATA_OPCODES_H__
-
-/*
- * opcodes.h: CIL instruction information
- *
- * Author:
- *   Paolo Molaro (lupus@ximian.com)
- *
- * (C) 2002 Ximian, Inc.
- */
-
-#include <mono/utils/mono-publib.h>
-
-MONO_BEGIN_DECLS
-
-#define MONO_CUSTOM_PREFIX 0xf0
-
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
-	MONO_ ## a,
-
-typedef enum MonoOpcodeEnum {
-	MonoOpcodeEnum_Invalid = -1,
-#include "mono/cil/opcode.def"
-	MONO_CEE_LAST
-} MonoOpcodeEnum;
-
-#undef OPDEF
-
-enum {
-	MONO_FLOW_NEXT,
-	MONO_FLOW_BRANCH,
-	MONO_FLOW_COND_BRANCH,
-	MONO_FLOW_ERROR,
-	MONO_FLOW_CALL,
-	MONO_FLOW_RETURN,
-	MONO_FLOW_META
-};
-
-enum {
-	MonoInlineNone          = 0,
-	MonoInlineType          = 1,
-	MonoInlineField         = 2,
-	MonoInlineMethod        = 3,
-	MonoInlineTok           = 4,
-	MonoInlineString        = 5,
-	MonoInlineSig           = 6,
-	MonoInlineVar           = 7,
-	MonoShortInlineVar      = 8,
-	MonoInlineBrTarget      = 9,
-	MonoShortInlineBrTarget = 10,
-	MonoInlineSwitch        = 11,
-	MonoInlineR             = 12,
-	MonoShortInlineR        = 13,
-	MonoInlineI             = 14,
-	MonoShortInlineI        = 15,
-	MonoInlineI8            = 16,
-};
-
-typedef struct {
-	unsigned char argument;
-	unsigned char flow_type;
-	unsigned short opval;
-} MonoOpcode;
-
-MONO_API_DATA const MonoOpcode mono_opcodes [];
-
-MONO_API const char*
-mono_opcode_name (int opcode);
-
-MONO_API MonoOpcodeEnum
-mono_opcode_value (const mono_byte **ip, const mono_byte *end);
-
-MONO_END_DECLS
-
-#endif /* __MONO_METADATA_OPCODES_H__ */
-

+ 0 - 109
Libs/Interpreter/include/mono/metadata/profiler-events.h

@@ -1,109 +0,0 @@
-/*
- * Licensed to the .NET Foundation under one or more agreements.
- * The .NET Foundation licenses this file to you under the MIT license.
- * See the LICENSE file in the project root for more information.
- */
-
-/*
- * To #include this file, #define the following macros first:
- *
- * MONO_PROFILER_EVENT_0(name, type)
- * MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name)
- * MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name)
- * MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name)
- * MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name)
- * MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name)
- *
- * To add new callbacks to the API, simply add a line in this file and use
- * MONO_PROFILER_RAISE to raise the event wherever.
- *
- * If you need more arguments then the current macros provide, add another
- * macro and update all areas where the macros are used. Remember that this is
- * a public header and not all users will be defining the newly added macro. So
- * to prevent errors in existing code, you must add something like this at the
- * beginning of this file:
- *
- * #ifndef MONO_PROFILER_EVENT_6
- * #define MONO_PROFILER_EVENT_6(...) # Do nothing.
- * #endif
- */
-
-#ifndef MONO_PROFILER_EVENT_5
-#define MONO_PROFILER_EVENT_5(...)
-#endif
-
-MONO_PROFILER_EVENT_0(runtime_initialized, RuntimeInitialized)
-MONO_PROFILER_EVENT_0(runtime_shutdown_begin, RuntimeShutdownBegin)
-MONO_PROFILER_EVENT_0(runtime_shutdown_end, RuntimeShutdownEnd)
-
-MONO_PROFILER_EVENT_1(context_loaded, ContextLoaded, MonoAppContext *, context)
-MONO_PROFILER_EVENT_1(context_unloaded, ContextUnloaded, MonoAppContext *, context)
-
-MONO_PROFILER_EVENT_1(domain_loading, DomainLoading, MonoDomain *, domain)
-MONO_PROFILER_EVENT_1(domain_loaded, DomainLoaded, MonoDomain *, domain)
-MONO_PROFILER_EVENT_1(domain_unloading, DomainUnloading, MonoDomain *, domain)
-MONO_PROFILER_EVENT_1(domain_unloaded, DomainUnloaded, MonoDomain *, domain)
-MONO_PROFILER_EVENT_2(domain_name, DomainName, MonoDomain *, domain, const char *, name)
-
-MONO_PROFILER_EVENT_1(jit_begin, JitBegin, MonoMethod *, method)
-MONO_PROFILER_EVENT_1(jit_failed, JitFailed, MonoMethod *, method)
-MONO_PROFILER_EVENT_2(jit_done, JitDone, MonoMethod *, method, MonoJitInfo *, jinfo)
-MONO_PROFILER_EVENT_2(jit_chunk_created, JitChunkCreated, const mono_byte *, chunk, uintptr_t, size)
-MONO_PROFILER_EVENT_1(jit_chunk_destroyed, JitChunkDestroyed, const mono_byte *, chunk)
-MONO_PROFILER_EVENT_4(jit_code_buffer, JitCodeBuffer, const mono_byte *, buffer, uint64_t, size, MonoProfilerCodeBufferType, type, const void *, data)
-
-MONO_PROFILER_EVENT_1(class_loading, ClassLoading, MonoClass *, klass)
-MONO_PROFILER_EVENT_1(class_failed, ClassFailed, MonoClass *, klass)
-MONO_PROFILER_EVENT_1(class_loaded, ClassLoaded, MonoClass *, klass)
-
-MONO_PROFILER_EVENT_1(vtable_loading, VTableLoading, MonoVTable *, vtable)
-MONO_PROFILER_EVENT_1(vtable_failed, VTableFailed, MonoVTable *, vtable)
-MONO_PROFILER_EVENT_1(vtable_loaded, VTableLoaded, MonoVTable *, vtable)
-
-MONO_PROFILER_EVENT_1(image_loading, ModuleLoading, MonoImage *, image)
-MONO_PROFILER_EVENT_1(image_failed, ModuleFailed, MonoImage *, image)
-MONO_PROFILER_EVENT_1(image_loaded, ModuleLoaded, MonoImage *, image)
-MONO_PROFILER_EVENT_1(image_unloading, ModuleUnloading, MonoImage *, image)
-MONO_PROFILER_EVENT_1(image_unloaded, ModuleUnloaded, MonoImage *, image)
-
-MONO_PROFILER_EVENT_1(assembly_loading, AssemblyLoading, MonoAssembly *, assembly)
-MONO_PROFILER_EVENT_1(assembly_loaded, AssemblyLLoaded, MonoAssembly *, assembly)
-MONO_PROFILER_EVENT_1(assembly_unloading, AssemblyLUnloading, MonoAssembly *, assembly)
-MONO_PROFILER_EVENT_1(assembly_unloaded, AssemblyLUnloaded, MonoAssembly *, assembly)
-
-MONO_PROFILER_EVENT_2(method_enter, MethodEnter, MonoMethod *, method, MonoProfilerCallContext *, context)
-MONO_PROFILER_EVENT_2(method_leave, MethodLeave, MonoMethod *, method, MonoProfilerCallContext *, context)
-MONO_PROFILER_EVENT_2(method_tail_call, MethodTailCall, MonoMethod *, method, MonoMethod *, target)
-MONO_PROFILER_EVENT_2(method_exception_leave, MethodExceptionLeave, MonoMethod *, method, MonoObject *, exception)
-MONO_PROFILER_EVENT_1(method_free, MethodFree, MonoMethod *, method)
-MONO_PROFILER_EVENT_1(method_begin_invoke, MethodBeginInvoke, MonoMethod *, method)
-MONO_PROFILER_EVENT_1(method_end_invoke, MethodEndInvoke, MonoMethod *, method)
-
-MONO_PROFILER_EVENT_1(exception_throw, ExceptionThrow, MonoObject *, exception)
-MONO_PROFILER_EVENT_4(exception_clause, ExceptionClause, MonoMethod *, method, uint32_t, index, MonoExceptionEnum, type, MonoObject *, exception)
-
-MONO_PROFILER_EVENT_3(gc_event, GCEvent2, MonoProfilerGCEvent, event, uint32_t, generation, mono_bool, is_serial)
-MONO_PROFILER_EVENT_1(gc_allocation, GCAllocation, MonoObject *, object)
-MONO_PROFILER_EVENT_2(gc_moves, GCMoves, MonoObject *const *, objects, uint64_t, count)
-MONO_PROFILER_EVENT_1(gc_resize, GCResize, uintptr_t, size)
-MONO_PROFILER_EVENT_3(gc_handle_created, GCHandleCreated, uint32_t, handle, MonoGCHandleType, type, MonoObject *, object)
-MONO_PROFILER_EVENT_2(gc_handle_deleted, GCHandleDeleted, uint32_t, handle, MonoGCHandleType, type)
-MONO_PROFILER_EVENT_0(gc_finalizing, GCFinalizing)
-MONO_PROFILER_EVENT_0(gc_finalized, GCFinalized)
-MONO_PROFILER_EVENT_1(gc_finalizing_object, GCFinalizingObject, MonoObject *, object)
-MONO_PROFILER_EVENT_1(gc_finalized_object, GCFinalizedObject, MonoObject *, object)
-MONO_PROFILER_EVENT_5(gc_root_register, RootRegister, const mono_byte *, start, uintptr_t, size, MonoGCRootSource, source, const void *, key, const char *, name)
-MONO_PROFILER_EVENT_1(gc_root_unregister, RootUnregister, const mono_byte *, start)
-MONO_PROFILER_EVENT_3(gc_roots, GCRoots, uint64_t, count, const mono_byte *const *, addresses, MonoObject *const *, objects)
-
-MONO_PROFILER_EVENT_1(monitor_contention, MonitorContention, MonoObject *, object)
-MONO_PROFILER_EVENT_1(monitor_failed, MonitorFailed, MonoObject *, object)
-MONO_PROFILER_EVENT_1(monitor_acquired, MonitorAcquired, MonoObject *, object)
-
-MONO_PROFILER_EVENT_1(thread_started, ThreadStarted, uintptr_t, tid)
-MONO_PROFILER_EVENT_1(thread_stopping, ThreadStopping, uintptr_t, tid)
-MONO_PROFILER_EVENT_1(thread_stopped, ThreadStopped, uintptr_t, tid)
-MONO_PROFILER_EVENT_1(thread_exited, ThreadExited, uintptr_t, tid)
-MONO_PROFILER_EVENT_2(thread_name, ThreadName, uintptr_t, tid, const char *, name)
-
-MONO_PROFILER_EVENT_2(sample_hit, SampleHit, const mono_byte *, ip, const void *, context)

+ 0 - 249
Libs/Interpreter/include/mono/metadata/profiler.h

@@ -1,249 +0,0 @@
-/*
- * Licensed to the .NET Foundation under one or more agreements.
- * The .NET Foundation licenses this file to you under the MIT license.
- * See the LICENSE file in the project root for more information.
- */
-
-#ifndef __MONO_PROFILER_H__
-#define __MONO_PROFILER_H__
-
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/metadata/object.h>
-
-MONO_BEGIN_DECLS
-
-/**
- * This value will be incremented whenever breaking changes to the profiler API
- * are made. This macro is intended for use in profiler modules that wish to
- * support older versions of the profiler API.
- *
- * Version 2:
- * - Major overhaul of the profiler API.
- * Version 3:
- * - Added mono_profiler_enable_clauses (). This must now be called to enable
- *   raising exception_clause events.
- * - The exception argument to exception_clause events can now be NULL for
- *   finally clauses invoked in the non-exceptional case.
- * - The type argument to exception_clause events will now correctly indicate
- *   that the catch portion of the clause is being executed in the case of
- *   try-filter-catch clauses.
- * - Removed the iomap_report event.
- * - Removed the old gc_event event and renamed gc_event2 to gc_event.
- */
-#define MONO_PROFILER_API_VERSION 3
-
-typedef struct _MonoProfiler MonoProfiler;
-typedef struct _MonoProfilerDesc *MonoProfilerHandle;
-
-typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof);
-
-MONO_API void mono_profiler_load (const char *desc);
-MONO_API MonoProfilerHandle mono_profiler_create (MonoProfiler *prof);
-MONO_API void mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb);
-
-typedef struct {
-	MonoMethod *method;
-	uint32_t il_offset;
-	uint32_t counter;
-	const char *file_name;
-	uint32_t line;
-	uint32_t column;
-} MonoProfilerCoverageData;
-
-typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method);
-typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProfilerCoverageData *data);
-
-MONO_API mono_bool mono_profiler_enable_coverage (void);
-MONO_API void mono_profiler_set_coverage_filter_callback (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb);
-MONO_API mono_bool mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
-
-typedef enum {
-	/**
-	 * Do not perform sampling. Will make the sampling thread sleep until the
-	 * sampling mode is changed to one of the below modes.
-	 */
-	MONO_PROFILER_SAMPLE_MODE_NONE = 0,
-	/**
-	 * Try to base sampling frequency on process activity. Falls back to
-	 * MONO_PROFILER_SAMPLE_MODE_REAL if such a clock is not available.
-	 */
-	MONO_PROFILER_SAMPLE_MODE_PROCESS = 1,
-	/**
-	 * Base sampling frequency on wall clock time. Uses a monotonic clock when
-	 * available (all major platforms).
-	 */
-	MONO_PROFILER_SAMPLE_MODE_REAL = 2,
-} MonoProfilerSampleMode;
-
-MONO_API mono_bool mono_profiler_enable_sampling (MonoProfilerHandle handle);
-MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq);
-MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq);
-
-MONO_API mono_bool mono_profiler_enable_allocations (void);
-MONO_API mono_bool mono_profiler_enable_clauses (void);
-
-typedef struct _MonoProfilerCallContext MonoProfilerCallContext;
-
-typedef enum {
-	/**
-	 * Do not instrument calls.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0,
-	/**
-	 * Instrument method entries.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1,
-	/**
-	 * Also capture a call context for method entries.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2,
-	/**
-	 * Instrument method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3,
-	/**
-	 * Also capture a call context for method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4,
-	/**
-	 * Instrument method exits as a result of a tail call.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5,
-	/**
-	 * Instrument exceptional method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6,
-} MonoProfilerCallInstrumentationFlags;
-
-typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method);
-
-MONO_API void mono_profiler_set_call_instrumentation_filter_callback (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb);
-MONO_API mono_bool mono_profiler_enable_call_context_introspection (void);
-MONO_API void *mono_profiler_call_context_get_this (MonoProfilerCallContext *context);
-MONO_API void *mono_profiler_call_context_get_argument (MonoProfilerCallContext *context, uint32_t position);
-MONO_API void *mono_profiler_call_context_get_local (MonoProfilerCallContext *context, uint32_t position);
-MONO_API void *mono_profiler_call_context_get_result (MonoProfilerCallContext *context);
-MONO_API void mono_profiler_call_context_free_buffer (void *buffer);
-
-typedef enum {
-	/**
-	 * The \c data parameter is a \c MonoMethod pointer.
-	 */
-	MONO_PROFILER_CODE_BUFFER_METHOD = 0,
-	/**
-	 * \deprecated No longer used.
-	 */
-	MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE = 1,
-	/**
-	 * The \c data parameter is a \c MonoMethod pointer.
-	 */
-	MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE = 2,
-	MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE = 3,
-	MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE = 4,
-	/**
-	 * The \c data parameter is a C string.
-	 */
-	MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE = 5,
-	MONO_PROFILER_CODE_BUFFER_HELPER = 6,
-	/**
-	 * \deprecated No longer used.
-	 */
-	MONO_PROFILER_CODE_BUFFER_MONITOR = 7,
-	MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE = 8,
-	MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
-} MonoProfilerCodeBufferType;
-
-typedef enum {
-	MONO_GC_EVENT_PRE_STOP_WORLD = 6,
-	/**
-	 * When this event arrives, the GC and suspend locks are acquired.
-	 */
-	MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
-	MONO_GC_EVENT_POST_STOP_WORLD = 7,
-	MONO_GC_EVENT_START = 0,
-	MONO_GC_EVENT_END = 5,
-	MONO_GC_EVENT_PRE_START_WORLD = 8,
-	/**
-	 * When this event arrives, the GC and suspend locks are released.
-	 */
-	MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,
-	MONO_GC_EVENT_POST_START_WORLD = 9,
-} MonoProfilerGCEvent;
-
-/*
- * The macros below will generate the majority of the callback API. Refer to
- * mono/metadata/profiler-events.h for a list of callbacks. They are expanded
- * like so:
- *
- * typedef void (*MonoProfilerRuntimeInitializedCallback (MonoProfiler *prof);
- * MONO_API void mono_profiler_set_runtime_initialized_callback (MonoProfiler *prof, MonoProfilerRuntimeInitializedCallback cb);
- *
- * typedef void (*MonoProfilerRuntimeShutdownCallback (MonoProfiler *prof);
- * MONO_API void mono_profiler_set_runtime_shutdown_callback (MonoProfiler *prof, MonoProfilerRuntimeShutdownCallback cb);
- *
- * typedef void (*MonoProfilerContextLoadedCallback (MonoProfiler *prof);
- * MONO_API void mono_profiler_set_context_loaded_callback (MonoProfiler *prof, MonoProfilerContextLoadedCallback cb);
- *
- * typedef void (*MonoProfilerContextUnloadedCallback (MonoProfiler *prof);
- * MONO_API void mono_profiler_set_context_unloaded_callback (MonoProfiler *prof, MonoProfilerContextUnloadedCallback cb);
- *
- * Etc.
- *
- * To remove a callback, pass NULL instead of a valid function pointer.
- * Callbacks can be changed at any point, but note that doing so is inherently
- * racy with respect to threads that aren't suspended, i.e. you may still see a
- * call from another thread right after you change a callback.
- *
- * These functions are async safe.
- */
-
-#define _MONO_PROFILER_EVENT(type, ...) \
-	typedef void (*MonoProfiler ## type ## Callback) (__VA_ARGS__);
-#define MONO_PROFILER_EVENT_0(name, type) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof)
-#define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name)
-#define MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name)
-#define MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name)
-#define MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name, arg4_type arg4_name)
-#define MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name) \
-		_MONO_PROFILER_EVENT(type, MonoProfiler *prof, arg1_type arg1_name, arg2_type arg2_name, arg3_type arg3_name, arg4_type arg4_name, arg5_type arg5_name)
-#include <mono/metadata/profiler-events.h>
-#undef MONO_PROFILER_EVENT_0
-#undef MONO_PROFILER_EVENT_1
-#undef MONO_PROFILER_EVENT_2
-#undef MONO_PROFILER_EVENT_3
-#undef MONO_PROFILER_EVENT_4
-#undef MONO_PROFILER_EVENT_5
-#undef _MONO_PROFILER_EVENT
-
-#define _MONO_PROFILER_EVENT(name, type) \
-	MONO_API void mono_profiler_set_ ## name ## _callback (MonoProfilerHandle handle, MonoProfiler ## type ## Callback cb);
-#define MONO_PROFILER_EVENT_0(name, type) \
-	_MONO_PROFILER_EVENT(name, type)
-#define MONO_PROFILER_EVENT_1(name, type, arg1_type, arg1_name) \
-	_MONO_PROFILER_EVENT(name, type)
-#define MONO_PROFILER_EVENT_2(name, type, arg1_type, arg1_name, arg2_type, arg2_name) \
-	_MONO_PROFILER_EVENT(name, type)
-#define MONO_PROFILER_EVENT_3(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name) \
-	_MONO_PROFILER_EVENT(name, type)
-#define MONO_PROFILER_EVENT_4(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name) \
-	_MONO_PROFILER_EVENT(name, type)
-#define MONO_PROFILER_EVENT_5(name, type, arg1_type, arg1_name, arg2_type, arg2_name, arg3_type, arg3_name, arg4_type, arg4_name, arg5_type, arg5_name) \
-	_MONO_PROFILER_EVENT(name, type)
-#include <mono/metadata/profiler-events.h>
-#undef MONO_PROFILER_EVENT_0
-#undef MONO_PROFILER_EVENT_1
-#undef MONO_PROFILER_EVENT_2
-#undef MONO_PROFILER_EVENT_3
-#undef MONO_PROFILER_EVENT_4
-#undef MONO_PROFILER_EVENT_5
-#undef _MONO_PROFILER_EVENT
-
-MONO_END_DECLS
-
-#endif // __MONO_PROFILER_H__

+ 0 - 174
Libs/Interpreter/include/mono/metadata/reflection.h

@@ -1,174 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __METADATA_REFLECTION_H__
-#define __METADATA_REFLECTION_H__
-
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/object.h>
-
-MONO_BEGIN_DECLS
-
-typedef struct MonoTypeNameParse MonoTypeNameParse;
-
-typedef struct {
-	MonoMethod *ctor;
-	uint32_t     data_size;
-	const mono_byte* data;
-} MonoCustomAttrEntry;
-
-typedef struct {
-	int num_attrs;
-	int cached;
-	MonoImage *image;
-	MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
-} MonoCustomAttrInfo;
-
-#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs))
-
-/* 
- * Information which isn't in the MonoMethod structure is stored here for
- * dynamic methods.
- */
-typedef struct {
-	char **param_names;
-	MonoMarshalSpec **param_marshall;
-	MonoCustomAttrInfo **param_cattr;
-	uint8_t** param_defaults;
-	uint32_t *param_default_types;
-	char *dllentry, *dll;
-} MonoReflectionMethodAux;
-
-typedef enum {
-	ResolveTokenError_OutOfRange,
-	ResolveTokenError_BadTable,
-	ResolveTokenError_Other
-} MonoResolveTokenError;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-int           mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType*     mono_reflection_get_type   (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve);
-MONO_API void          mono_reflection_free_type_info (MonoTypeNameParse *info);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType*     mono_reflection_type_from_name (char *name, MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-uint32_t      mono_reflection_get_token (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionAssembly* mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionModule*   mono_module_get_object   (MonoDomain *domain, MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionModule*   mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_index);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionType*     mono_type_get_object     (MonoDomain *domain, MonoType *type);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionMethod*   mono_method_get_object   (MonoDomain *domain, MonoMethod *method, MonoClass *refclass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionField*    mono_field_get_object    (MonoDomain *domain, MonoClass *klass, MonoClassField *field);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionProperty* mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *property);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionEvent*    mono_event_get_object    (MonoDomain *domain, MonoClass *klass, MonoEvent *event);
-/* note: this one is slightly different: we keep the whole array of params in the cache */
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray* mono_param_get_objects  (MonoDomain *domain, MonoMethod *method);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionMethodBody* mono_method_body_get_object (MonoDomain *domain, MonoMethod *method);
-
-MONO_API MonoObject *mono_get_dbnull_object (MonoDomain *domain);
-
-MONO_API MonoArray*  mono_reflection_get_custom_attrs_by_type (MonoObject *obj, MonoClass *attr_klass, MonoError *error);
-MONO_API MonoArray*  mono_reflection_get_custom_attrs (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_reflection_get_custom_attrs_data (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_reflection_get_custom_attrs_info (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_index    (MonoImage *image, uint32_t idx);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_method   (MonoMethod *method);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_class    (MonoClass *klass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_assembly (MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_property (MonoClass *klass, MonoProperty *property);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_event    (MonoClass *klass, MonoEvent *event);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_field    (MonoClass *klass, MonoClassField *field);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_param    (MonoMethod *method, uint32_t param);
-MONO_API mono_bool           mono_custom_attrs_has_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject*         mono_custom_attrs_get_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
-MONO_API void                mono_custom_attrs_free          (MonoCustomAttrInfo *ainfo);
-
-
-#define MONO_DECLSEC_ACTION_MIN		0x1
-#define MONO_DECLSEC_ACTION_MAX		0x12
-
-enum {
-	MONO_DECLSEC_FLAG_REQUEST 			= 0x00000001,
-	MONO_DECLSEC_FLAG_DEMAND			= 0x00000002,
-	MONO_DECLSEC_FLAG_ASSERT			= 0x00000004,
-	MONO_DECLSEC_FLAG_DENY				= 0x00000008,
-	MONO_DECLSEC_FLAG_PERMITONLY			= 0x00000010,
-	MONO_DECLSEC_FLAG_LINKDEMAND			= 0x00000020,
-	MONO_DECLSEC_FLAG_INHERITANCEDEMAND		= 0x00000040,
-	MONO_DECLSEC_FLAG_REQUEST_MINIMUM		= 0x00000080,
-	MONO_DECLSEC_FLAG_REQUEST_OPTIONAL		= 0x00000100,
-	MONO_DECLSEC_FLAG_REQUEST_REFUSE		= 0x00000200,
-	MONO_DECLSEC_FLAG_PREJIT_GRANT			= 0x00000400,
-	MONO_DECLSEC_FLAG_PREJIT_DENY			= 0x00000800,
-	MONO_DECLSEC_FLAG_NONCAS_DEMAND			= 0x00001000,
-	MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND		= 0x00002000,
-	MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND	= 0x00004000,
-	MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE		= 0x00008000,
-	MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE	= 0x00010000,
-	MONO_DECLSEC_FLAG_DEMAND_CHOICE			= 0x00020000
-};
-
-MONO_API uint32_t mono_declsec_flags_from_method (MonoMethod *method);
-MONO_API uint32_t mono_declsec_flags_from_class (MonoClass *klass);
-MONO_API uint32_t mono_declsec_flags_from_assembly (MonoAssembly *assembly);
-
-/* this structure MUST be kept in synch with RuntimeDeclSecurityEntry
- * located in /mcs/class/corlib/System.Security/SecurityFrame.cs */
-typedef struct {
-	char *blob;				/* pointer to metadata blob */
-	uint32_t size;				/* size of the metadata blob */
-	uint32_t index;
-} MonoDeclSecurityEntry;
-
-typedef struct {
-	MonoDeclSecurityEntry demand;
-	MonoDeclSecurityEntry noncasdemand;
-	MonoDeclSecurityEntry demandchoice;
-} MonoDeclSecurityActions;
-
-MONO_API MonoBoolean mono_declsec_get_demands (MonoMethod *callee, MonoDeclSecurityActions* demands);
-MONO_API MonoBoolean mono_declsec_get_linkdemands (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod);
-MONO_API MonoBoolean mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions* demands);
-MONO_API MonoBoolean mono_declsec_get_inheritdemands_method (MonoMethod *callee, MonoDeclSecurityActions* demands);
-
-MONO_API MonoBoolean mono_declsec_get_method_action (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry);
-MONO_API MonoBoolean mono_declsec_get_class_action (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry);
-MONO_API MonoBoolean mono_declsec_get_assembly_action (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType* mono_reflection_type_get_type (MonoReflectionType *reftype);
-
-MONO_API MonoAssembly* mono_reflection_assembly_get_assembly (MonoReflectionAssembly *refassembly);
-
-MONO_END_DECLS
-
-#endif /* __METADATA_REFLECTION_H__ */

+ 0 - 492
Libs/Interpreter/include/mono/metadata/row-indexes.h

@@ -1,492 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_METADATA_ROW_INDEXES_H__
-#define __MONO_METADATA_ROW_INDEXES_H__
-
-/*
- * The last entry in the enum is used to give the number
- * of columns in the row.
- */
-
-enum {
-	MONO_ASSEMBLY_HASH_ALG,
-	MONO_ASSEMBLY_MAJOR_VERSION,
-	MONO_ASSEMBLY_MINOR_VERSION,
-	MONO_ASSEMBLY_BUILD_NUMBER,
-	MONO_ASSEMBLY_REV_NUMBER,
-	MONO_ASSEMBLY_FLAGS,
-	MONO_ASSEMBLY_PUBLIC_KEY,
-	MONO_ASSEMBLY_NAME,
-	MONO_ASSEMBLY_CULTURE,
-	MONO_ASSEMBLY_SIZE
-};
-
-enum {
-	MONO_ASSEMBLYOS_PLATFORM,
-	MONO_ASSEMBLYOS_MAJOR_VERSION,
-	MONO_ASSEMBLYOS_MINOR_VERSION,
-	MONO_ASSEMBLYOS_SIZE
-};
-
-enum {
-	MONO_ASSEMBLY_PROCESSOR,
-	MONO_ASSEMBLY_PROCESSOR_SIZE
-};
-
-enum {
-	MONO_ASSEMBLYREF_MAJOR_VERSION,
-	MONO_ASSEMBLYREF_MINOR_VERSION,
-	MONO_ASSEMBLYREF_BUILD_NUMBER,
-	MONO_ASSEMBLYREF_REV_NUMBER,
-	MONO_ASSEMBLYREF_FLAGS,
-	MONO_ASSEMBLYREF_PUBLIC_KEY,
-	MONO_ASSEMBLYREF_NAME,
-	MONO_ASSEMBLYREF_CULTURE,
-	MONO_ASSEMBLYREF_HASH_VALUE,
-	MONO_ASSEMBLYREF_SIZE
-};
-
-enum {
-	MONO_ASSEMBLYREFOS_PLATFORM,
-	MONO_ASSEMBLYREFOS_MAJOR_VERSION,
-	MONO_ASSEMBLYREFOS_MINOR_VERSION,
-	MONO_ASSEMBLYREFOS_ASSEMBLYREF,
-	MONO_ASSEMBLYREFOS_SIZE
-};
-
-enum {
-	MONO_ASSEMBLYREFPROC_PROCESSOR,
-	MONO_ASSEMBLYREFPROC_ASSEMBLYREF,
-	MONO_ASSEMBLYREFPROC_SIZE
-};
-
-enum {
-	MONO_CLASS_LAYOUT_PACKING_SIZE,
-	MONO_CLASS_LAYOUT_CLASS_SIZE,
-	MONO_CLASS_LAYOUT_PARENT,
-	MONO_CLASS_LAYOUT_SIZE
-};
-
-enum {
-	MONO_CONSTANT_TYPE,
-	MONO_CONSTANT_PADDING,
-	MONO_CONSTANT_PARENT,
-	MONO_CONSTANT_VALUE,
-	MONO_CONSTANT_SIZE
-};
-
-enum {
-	MONO_CUSTOM_ATTR_PARENT,
-	MONO_CUSTOM_ATTR_TYPE,
-	MONO_CUSTOM_ATTR_VALUE,
-	MONO_CUSTOM_ATTR_SIZE
-};
-
-enum {
-	MONO_DECL_SECURITY_ACTION,
-	MONO_DECL_SECURITY_PARENT,
-	MONO_DECL_SECURITY_PERMISSIONSET,
-	MONO_DECL_SECURITY_SIZE
-};
-
-enum {
-	MONO_EVENT_MAP_PARENT,
-	MONO_EVENT_MAP_EVENTLIST,
-	MONO_EVENT_MAP_SIZE
-};
-
-enum {
-	MONO_EVENT_FLAGS,
-	MONO_EVENT_NAME,
-	MONO_EVENT_TYPE,
-	MONO_EVENT_SIZE
-};
-
-enum {
-	MONO_EVENT_POINTER_EVENT,
-	MONO_EVENT_POINTER_SIZE
-};
-
-enum {
-	MONO_EXP_TYPE_FLAGS,
-	MONO_EXP_TYPE_TYPEDEF,
-	MONO_EXP_TYPE_NAME,
-	MONO_EXP_TYPE_NAMESPACE,
-	MONO_EXP_TYPE_IMPLEMENTATION,
-	MONO_EXP_TYPE_SIZE
-};
-
-enum {
-	MONO_FIELD_FLAGS,
-	MONO_FIELD_NAME,
-	MONO_FIELD_SIGNATURE,
-	MONO_FIELD_SIZE
-};
-
-enum {
-	MONO_FIELD_LAYOUT_OFFSET,
-	MONO_FIELD_LAYOUT_FIELD,
-	MONO_FIELD_LAYOUT_SIZE
-};
-
-enum {
-	MONO_FIELD_MARSHAL_PARENT,
-	MONO_FIELD_MARSHAL_NATIVE_TYPE,
-	MONO_FIELD_MARSHAL_SIZE
-};
-
-enum {
-	MONO_FIELD_POINTER_FIELD,
-	MONO_FIELD_POINTER_SIZE
-};
-
-enum {
-	MONO_FIELD_RVA_RVA,
-	MONO_FIELD_RVA_FIELD,
-	MONO_FIELD_RVA_SIZE
-};
-
-enum {
-	MONO_FILE_FLAGS,
-	MONO_FILE_NAME,
-	MONO_FILE_HASH_VALUE,
-	MONO_FILE_SIZE
-};
-
-enum {
-	MONO_IMPLMAP_FLAGS,
-	MONO_IMPLMAP_MEMBER,
-	MONO_IMPLMAP_NAME,
-	MONO_IMPLMAP_SCOPE,
-	MONO_IMPLMAP_SIZE
-};
-
-enum {
-	MONO_INTERFACEIMPL_CLASS,
-	MONO_INTERFACEIMPL_INTERFACE,
-	MONO_INTERFACEIMPL_SIZE
-};
-
-enum {
-	MONO_MANIFEST_OFFSET,
-	MONO_MANIFEST_FLAGS,
-	MONO_MANIFEST_NAME,
-	MONO_MANIFEST_IMPLEMENTATION,
-	MONO_MANIFEST_SIZE
-};
-
-enum {
-	MONO_MEMBERREF_CLASS,
-	MONO_MEMBERREF_NAME,
-	MONO_MEMBERREF_SIGNATURE,
-	MONO_MEMBERREF_SIZE
-};
-
-enum {
-	MONO_METHOD_RVA,
-	MONO_METHOD_IMPLFLAGS,
-	MONO_METHOD_FLAGS,
-	MONO_METHOD_NAME,
-	MONO_METHOD_SIGNATURE,
-	MONO_METHOD_PARAMLIST,
-	MONO_METHOD_SIZE
-};
-
-enum {
-	MONO_METHODIMPL_CLASS,
-	MONO_METHODIMPL_BODY,
-	MONO_METHODIMPL_DECLARATION,
-	MONO_METHODIMPL_SIZE
-};
-
-enum {
-	MONO_METHOD_POINTER_METHOD,
-	MONO_METHOD_POINTER_SIZE
-};
-
-enum {
-	MONO_METHOD_SEMA_SEMANTICS,
-	MONO_METHOD_SEMA_METHOD,
-	MONO_METHOD_SEMA_ASSOCIATION,
-	MONO_METHOD_SEMA_SIZE
-};
-
-enum {
-	MONO_MODULE_GENERATION,
-	MONO_MODULE_NAME,
-	MONO_MODULE_MVID,
-	MONO_MODULE_ENC,
-	MONO_MODULE_ENCBASE,
-	MONO_MODULE_SIZE
-};
-
-enum {
-	MONO_MODULEREF_NAME,
-	MONO_MODULEREF_SIZE
-};
-
-enum {
-	MONO_NESTED_CLASS_NESTED,
-	MONO_NESTED_CLASS_ENCLOSING,
-	MONO_NESTED_CLASS_SIZE
-};
-
-enum {
-	MONO_PARAM_FLAGS,
-	MONO_PARAM_SEQUENCE,
-	MONO_PARAM_NAME,
-	MONO_PARAM_SIZE
-};
-
-enum {
-	MONO_PARAM_POINTER_PARAM,
-	MONO_PARAM_POINTER_SIZE
-};
-
-enum {
-	MONO_PROPERTY_FLAGS,
-	MONO_PROPERTY_NAME,
-	MONO_PROPERTY_TYPE,
-	MONO_PROPERTY_SIZE
-};
-
-enum {
-	MONO_PROPERTY_POINTER_PROPERTY,
-	MONO_PROPERTY_POINTER_SIZE
-};
-
-enum {
-	MONO_PROPERTY_MAP_PARENT,
-	MONO_PROPERTY_MAP_PROPERTY_LIST,
-	MONO_PROPERTY_MAP_SIZE
-};
-
-enum {
-	MONO_STAND_ALONE_SIGNATURE,
-	MONO_STAND_ALONE_SIGNATURE_SIZE
-};
-
-enum {
-	MONO_TYPEDEF_FLAGS,
-	MONO_TYPEDEF_NAME,
-	MONO_TYPEDEF_NAMESPACE,
-	MONO_TYPEDEF_EXTENDS,
-	MONO_TYPEDEF_FIELD_LIST,
-	MONO_TYPEDEF_METHOD_LIST,
-	MONO_TYPEDEF_SIZE
-};
-
-enum {
-	MONO_TYPEREF_SCOPE,
-	MONO_TYPEREF_NAME,
-	MONO_TYPEREF_NAMESPACE,
-	MONO_TYPEREF_SIZE
-};
-
-enum {
-	MONO_TYPESPEC_SIGNATURE,
-	MONO_TYPESPEC_SIZE
-};
-
-enum {
-	MONO_GENERICPARAM_NUMBER,
-	MONO_GENERICPARAM_FLAGS,
-	MONO_GENERICPARAM_OWNER,
-	MONO_GENERICPARAM_NAME,
-	
-	MONO_GENERICPARAM_SIZE
-};
-
-enum {
-	MONO_METHODSPEC_METHOD,
-	MONO_METHODSPEC_SIGNATURE,
-	MONO_METHODSPEC_SIZE
-};
-
-enum {
-	MONO_GENPARCONSTRAINT_GENERICPAR,
-	MONO_GENPARCONSTRAINT_CONSTRAINT,
-	MONO_GENPARCONSTRAINT_SIZE
-};
-
-enum {
-	MONO_DOCUMENT_NAME,
-	MONO_DOCUMENT_HASHALG,
-	MONO_DOCUMENT_HASH,
-	MONO_DOCUMENT_LANGUAGE,
-	MONO_DOCUMENT_SIZE
-};
-
-enum {
-	MONO_METHODBODY_DOCUMENT,
-	MONO_METHODBODY_SEQ_POINTS,
-	MONO_METHODBODY_SIZE
-};
-
-enum {
-	MONO_LOCALSCOPE_METHOD,
-	MONO_LOCALSCOPE_IMPORTSCOPE,
-	MONO_LOCALSCOPE_VARIABLELIST,
-	MONO_LOCALSCOPE_CONSTANTLIST,
-	MONO_LOCALSCOPE_STARTOFFSET,
-	MONO_LOCALSCOPE_LENGTH,
-	MONO_LOCALSCOPE_SIZE
-};
-
-enum {
-	MONO_LOCALVARIABLE_ATTRIBUTES,
-	MONO_LOCALVARIABLE_INDEX,
-	MONO_LOCALVARIABLE_NAME,
-	MONO_LOCALVARIABLE_SIZE
-};
-
-enum {
-	MONO_CUSTOMDEBUGINFORMATION_PARENT,
-	MONO_CUSTOMDEBUGINFORMATION_KIND,
-	MONO_CUSTOMDEBUGINFORMATION_VALUE,
-	MONO_CUSTOMDEBUGINFORMATION_SIZE
-};
-
-/*
- * Coded Tokens
- * The _BITS entry is for the bits used in the token.
- * The _MASK entry is for mask the index out.
- */
-
-enum {
-	MONO_TYPEDEFORREF_TYPEDEF,
-	MONO_TYPEDEFORREF_TYPEREF,
-	MONO_TYPEDEFORREF_TYPESPEC,
-	MONO_TYPEDEFORREF_BITS = 2,
-	MONO_TYPEDEFORREF_MASK = 3
-};
-
-enum {
-	MONO_HASCONSTANT_FIEDDEF,
-	MONO_HASCONSTANT_PARAM,
-	MONO_HASCONSTANT_PROPERTY,
-	MONO_HASCONSTANT_BITS = 2,
-	MONO_HASCONSTANT_MASK = 3
-};
-
-enum {
-	MONO_CUSTOM_ATTR_METHODDEF,
-	MONO_CUSTOM_ATTR_FIELDDEF,
-	MONO_CUSTOM_ATTR_TYPEREF,
-	MONO_CUSTOM_ATTR_TYPEDEF,
-	MONO_CUSTOM_ATTR_PARAMDEF,
-	MONO_CUSTOM_ATTR_INTERFACE,
-	MONO_CUSTOM_ATTR_MEMBERREF,
-	MONO_CUSTOM_ATTR_MODULE,
-	MONO_CUSTOM_ATTR_PERMISSION,
-	MONO_CUSTOM_ATTR_PROPERTY,
-	MONO_CUSTOM_ATTR_EVENT,
-	MONO_CUSTOM_ATTR_SIGNATURE,
-	MONO_CUSTOM_ATTR_MODULEREF,
-	MONO_CUSTOM_ATTR_TYPESPEC,
-	MONO_CUSTOM_ATTR_ASSEMBLY,
-	MONO_CUSTOM_ATTR_ASSEMBLYREF,
-	MONO_CUSTOM_ATTR_FILE,
-	MONO_CUSTOM_ATTR_EXP_TYPE,
-	MONO_CUSTOM_ATTR_MANIFEST,
-	MONO_CUSTOM_ATTR_GENERICPAR,
-	MONO_CUSTOM_ATTR_GENERICPARAMCONSTRAINT,
-	MONO_CUSTOM_ATTR_BITS = 5,
-	MONO_CUSTOM_ATTR_MASK = 0x1F
-};
-
-enum {
-	MONO_HAS_FIELD_MARSHAL_FIELDSREF,
-	MONO_HAS_FIELD_MARSHAL_PARAMDEF,
-	MONO_HAS_FIELD_MARSHAL_BITS = 1,
-	MONO_HAS_FIELD_MARSHAL_MASK = 1
-};
-
-enum {
-	MONO_HAS_DECL_SECURITY_TYPEDEF,
-	MONO_HAS_DECL_SECURITY_METHODDEF,
-	MONO_HAS_DECL_SECURITY_ASSEMBLY,
-	MONO_HAS_DECL_SECURITY_BITS = 2,
-	MONO_HAS_DECL_SECURITY_MASK = 3
-};
-
-enum {
-	MONO_MEMBERREF_PARENT_TYPEDEF, /* not used */
-	MONO_MEMBERREF_PARENT_TYPEREF,
-	MONO_MEMBERREF_PARENT_MODULEREF,
-	MONO_MEMBERREF_PARENT_METHODDEF,
-	MONO_MEMBERREF_PARENT_TYPESPEC,
-	MONO_MEMBERREF_PARENT_BITS = 3,
-	MONO_MEMBERREF_PARENT_MASK = 7
-};
-
-enum {
-	MONO_HAS_SEMANTICS_EVENT,
-	MONO_HAS_SEMANTICS_PROPERTY,
-	MONO_HAS_SEMANTICS_BITS = 1,
-	MONO_HAS_SEMANTICS_MASK = 1
-};
-
-enum {
-	MONO_METHODDEFORREF_METHODDEF,
-	MONO_METHODDEFORREF_METHODREF,
-	MONO_METHODDEFORREF_BITS = 1,
-	MONO_METHODDEFORREF_MASK = 1
-};
-
-enum {
-	MONO_MEMBERFORWD_FIELDDEF,
-	MONO_MEMBERFORWD_METHODDEF,
-	MONO_MEMBERFORWD_BITS = 1,
-	MONO_MEMBERFORWD_MASK = 1
-};
-
-enum {
-	MONO_IMPLEMENTATION_FILE,
-	MONO_IMPLEMENTATION_ASSEMBLYREF,
-	MONO_IMPLEMENTATION_EXP_TYPE,
-	MONO_IMPLEMENTATION_BITS = 2,
-	MONO_IMPLEMENTATION_MASK = 3
-};
-
-enum {
-	MONO_CUSTOM_ATTR_TYPE_TYPEREF, /* not used */
-	MONO_CUSTOM_ATTR_TYPE_TYPEDEF, /* not used */
-	MONO_CUSTOM_ATTR_TYPE_METHODDEF,
-	MONO_CUSTOM_ATTR_TYPE_MEMBERREF,
-	MONO_CUSTOM_ATTR_TYPE_STRING, /* not used */
-	MONO_CUSTOM_ATTR_TYPE_BITS = 3,
-	MONO_CUSTOM_ATTR_TYPE_MASK = 7
-};
-
-enum {
-	MONO_RESOLUTION_SCOPE_MODULE,
-	MONO_RESOLUTION_SCOPE_MODULEREF,
-	MONO_RESOLUTION_SCOPE_ASSEMBLYREF,
-	MONO_RESOLUTION_SCOPE_TYPEREF,
-	MONO_RESOLUTION_SCOPE_BITS = 2,
-	MONO_RESOLUTION_SCOPE_MASK = 3
-};
-
-/* Kept for compatibility since this is a public header file */
-enum {
-	MONO_RESOLTION_SCOPE_MODULE,
-	MONO_RESOLTION_SCOPE_MODULEREF,
-	MONO_RESOLTION_SCOPE_ASSEMBLYREF,
-	MONO_RESOLTION_SCOPE_TYPEREF,
-	MONO_RESOLTION_SCOPE_BITS = 2,
-	MONO_RESOLTION_SCOPE_MASK = 3
-};
-
-enum {
-	MONO_TYPEORMETHOD_TYPE,
-	MONO_TYPEORMETHOD_METHOD,
-	MONO_TYPEORMETHOD_BITS = 1,
-	MONO_TYPEORMETHOD_MASK = 1
-};
-
-#endif /* __MONO_METADATA_ROW_INDEXES_H__ */
-
-

+ 0 - 110
Libs/Interpreter/include/mono/metadata/sgen-bridge.h

@@ -1,110 +0,0 @@
-/**
- * \file
- * Copyright 2011 Novell, Inc.
- * 
- * Licensed under the MIT license. See LICENSE file in the project root for full license information.
- */
-
-/*
- * The bridge is a mechanism for SGen to let clients override the death of some
- * unreachable objects.  We use it in monodroid to do garbage collection across
- * the Mono and Java heaps.
- *
- * The client (Monodroid) can designate some objects as "bridged", which means
- * that they participate in the bridge processing step once SGen considers them
- * unreachable, i.e., dead.  Bridged objects must be registered for
- * finalization.
- *
- * When SGen is done marking, it puts together a list of all dead bridged
- * objects.  This is passed to the bridge processor, which does an analysis to
- * simplify the graph: It replaces strongly-connected components with single
- * nodes, and may remove nodes corresponding to components which do not contain
- * bridged objects.
- *
- * The output of the SCC analysis is passed to the client's `cross_references()`
- * callback.  This consists of 2 arrays, an array of SCCs (MonoGCBridgeSCC),
- * and an array of "xrefs" (edges between SCCs, MonoGCBridgeXRef).  Edges are
- * encoded as pairs of "API indices", ie indexes in the SCC array.  The client
- * is expected to set the `is_alive` flag on those strongly connected components
- * that it wishes to be kept alive.
- *
- * In monodroid each bridged object has a corresponding Java mirror object.  In
- * the bridge callback it reifies the Mono object graph in the Java heap so that
- * the full, combined object graph is now instantiated on the Java side.  Then
- * it triggers a Java GC, waits for it to finish, and checks which of the Java
- * mirror objects are still alive.  For those it sets the `is_alive` flag and
- * returns from the callback.
- *
- * The SCC analysis is done while the world is stopped, but the callback is made
- * with the world running again.  Weak links to bridged objects and other
- * objects reachable from them are kept until the callback returns, at which
- * point all links to bridged objects that don't have `is_alive` set are nulled.
- * Note that weak links to non-bridged objects reachable from bridged objects
- * are not nulled.  This might be considered a bug.
- *
- * There are three different implementations of the bridge processor, each of
- * which implements 8 callbacks (see SgenBridgeProcessor).  The implementations
- * differ in the algorithm they use to compute the "simplified" SCC graph.
- */
-
-#ifndef _MONO_SGEN_BRIDGE_H_
-#define _MONO_SGEN_BRIDGE_H_
-
-#include <mono/utils/mono-publib.h>
-
-MONO_BEGIN_DECLS
-
-enum {
-	SGEN_BRIDGE_VERSION = 5
-};
-	
-typedef enum {
-	/* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List<object>*/
-	GC_BRIDGE_TRANSPARENT_CLASS,
-	/* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
-	GC_BRIDGE_OPAQUE_CLASS,
-	/* Instances of this class should be bridged and have their dependency computed. */
-	GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
-	/* Instances of this class should be bridged but no dependencies should not be calculated. */
-	GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
-} MonoGCBridgeObjectKind;
-
-typedef struct {
-	mono_bool is_alive;	/* to be set by the cross reference callback */
-	int num_objs;
-	MonoObject *objs [MONO_ZERO_LEN_ARRAY];
-} MonoGCBridgeSCC;
-
-typedef struct {
-	int src_scc_index;
-	int dst_scc_index;
-} MonoGCBridgeXRef;
-
-typedef struct {
-	int bridge_version;
-	/*
-	 * Tells the runtime which classes to even consider when looking for
-	 * bridged objects.  If subclasses are to be considered as well, the
-	 * subclass check must be done in the callback.
-	 */
-	MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass);
-	/*
-	 * This is only called on objects for whose classes
-	 * `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
-	 */
-	mono_bool (*is_bridge_object) (MonoObject *object);
-	void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
-} MonoGCBridgeCallbacks;
-
-/*
- * Note: This may be called at any time, but cannot be called concurrently
- * with (during and on a separate thread from) sgen init. Callers are
- * responsible for enforcing this.
- */
-MONO_API void mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks);
-
-MONO_API void mono_gc_wait_for_bridge_processing (void);
-
-MONO_END_DECLS
-
-#endif

+ 0 - 67
Libs/Interpreter/include/mono/metadata/threads.h

@@ -1,67 +0,0 @@
-/**
- * \file
- * Threading API
- *
- * Author:
- *	Dick Porter (dick@ximian.com)
- *	Patrik Torstensson (patrik.torstensson@labs2.com)
- *
- * (C) 2001 Ximian, Inc
- */
-
-#ifndef _MONO_METADATA_THREADS_H_
-#define _MONO_METADATA_THREADS_H_
-
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
-
-MONO_BEGIN_DECLS
-
-/* This callback should return TRUE if the runtime must wait for the thread, FALSE otherwise */
-typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread);
-
-MONO_API void mono_thread_init (MonoThreadStartCB start_cb,
-			      MonoThreadAttachCB attach_cb);
-MONO_API void mono_thread_cleanup (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void mono_thread_manage(void);
-
-MONO_API MonoThread *mono_thread_current (void);
-
-MONO_API void        mono_thread_set_main (MonoThread *thread);
-MONO_API MonoThread *mono_thread_get_main (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_thread_stop (MonoThread *thread);
-
-MONO_API void mono_thread_new_init (intptr_t tid, void* stack_start,
-				  void* func);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_thread_create (MonoDomain *domain, void* func, void* arg);
-
-MONO_API MonoThread *mono_thread_attach (MonoDomain *domain);
-MONO_API void mono_thread_detach (MonoThread *thread);
-MONO_API void mono_thread_exit (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_threads_attach_tools_thread (void);
-
-MONO_API char   *mono_thread_get_name_utf8 (MonoThread *thread);
-MONO_API int32_t mono_thread_get_managed_id (MonoThread *thread);
-
-MONO_API void     mono_thread_set_manage_callback (MonoThread *thread, MonoThreadManageCallback func);
-
-MONO_API void mono_threads_set_default_stacksize (uint32_t stacksize);
-MONO_API uint32_t mono_threads_get_default_stacksize (void);
-
-MONO_API void mono_threads_request_thread_dump (void);
-
-MONO_API mono_bool mono_thread_is_foreign (MonoThread *thread);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_thread_detach_if_exiting (void);
-
-MONO_END_DECLS
-
-#endif /* _MONO_METADATA_THREADS_H_ */

+ 0 - 45
Libs/Interpreter/include/mono/metadata/tokentype.h

@@ -1,45 +0,0 @@
-/**
- * \file
- */
-
-#ifndef _MONO_METADATA_TOKENTYPE_H_
-#define _MONO_METADATA_TOKENTYPE_H_
-
-/*
- * These tokens match the table ID except for the last
- * three (string, name and base type which are special)
- */
- 
-typedef enum {
-	MONO_TOKEN_MODULE            = 0x00000000,
-	MONO_TOKEN_TYPE_REF          = 0x01000000,
-	MONO_TOKEN_TYPE_DEF          = 0x02000000,
-	MONO_TOKEN_FIELD_DEF         = 0x04000000,
-	MONO_TOKEN_METHOD_DEF        = 0x06000000, 
-	MONO_TOKEN_PARAM_DEF         = 0x08000000,
-	MONO_TOKEN_INTERFACE_IMPL    = 0x09000000,
-	MONO_TOKEN_MEMBER_REF        = 0x0a000000,
-	MONO_TOKEN_CUSTOM_ATTRIBUTE  = 0x0c000000,
-	MONO_TOKEN_PERMISSION        = 0x0e000000,
-	MONO_TOKEN_SIGNATURE         = 0x11000000,
-	MONO_TOKEN_EVENT             = 0x14000000,
-	MONO_TOKEN_PROPERTY          = 0x17000000,
-	MONO_TOKEN_MODULE_REF        = 0x1a000000,
-	MONO_TOKEN_TYPE_SPEC         = 0x1b000000,
-	MONO_TOKEN_ASSEMBLY          = 0x20000000,
-	MONO_TOKEN_ASSEMBLY_REF      = 0x23000000,
-	MONO_TOKEN_FILE              = 0x26000000,
-	MONO_TOKEN_EXPORTED_TYPE     = 0x27000000,
-	MONO_TOKEN_MANIFEST_RESOURCE = 0x28000000,
-	MONO_TOKEN_GENERIC_PARAM     = 0x2a000000,
-	MONO_TOKEN_METHOD_SPEC       = 0x2b000000,
-
-	/*
-	 * These do not match metadata tables directly
-	 */
-	MONO_TOKEN_STRING            = 0x70000000,
-	MONO_TOKEN_NAME              = 0x71000000,
-	MONO_TOKEN_BASE_TYPE         = 0x72000000
-} MonoTokenType;
-
-#endif /* _MONO_METADATA_TOKENTYPE_H_ */

+ 0 - 66
Libs/Interpreter/include/mono/metadata/verify.h

@@ -1,66 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_METADATA_VERIFY_H__
-#define __MONO_METADATA_VERIFY_H__
-
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/loader.h>
-#include <glib.h> /* GSList dep */
-
-MONO_BEGIN_DECLS
-
-typedef enum {
-	MONO_VERIFY_OK,
-	MONO_VERIFY_ERROR,
-	MONO_VERIFY_WARNING,
-	MONO_VERIFY_CLS = 4,
-	MONO_VERIFY_ALL = 7,
-
-	/* Status signaling code that is not verifiable.*/
-	MONO_VERIFY_NOT_VERIFIABLE = 8,
-
-	/*OR it with other flags*/
-	
-	/* Abort the verification if the code is not verifiable.
-	 * The standard behavior is to abort if the code is not valid.
-	 * */
-	MONO_VERIFY_FAIL_FAST = 16,
-
-
-	/* Perform less verification of the code. This flag should be used
-	 * if one wants the verifier to be more compatible to the MS runtime.
-	 * Mind that this is not to be more compatible with MS peverify, but
-	 * with the runtime itself, that has a less strict verifier.
-	 */
-	MONO_VERIFY_NON_STRICT = 32,
-
-	/*Skip all visibility related checks*/
-	MONO_VERIFY_SKIP_VISIBILITY = 64,
-
-	/*Skip all visibility related checks*/
-	MONO_VERIFY_REPORT_ALL_ERRORS = 128
-
-} MonoVerifyStatus;
-
-typedef struct {
-	char            *message;
-	MonoVerifyStatus status;
-} MonoVerifyInfo;
-
-typedef struct {
-	MonoVerifyInfo info;
-	int8_t exception_type; /*should be one of MONO_EXCEPTION_* */
-} MonoVerifyInfoExtended;
-
-
-MONO_API GSList* mono_method_verify       (MonoMethod *method, int level);
-MONO_API void    mono_free_verify_list    (GSList *list);
-MONO_API char*   mono_verify_corlib       (void);
-
-MONO_END_DECLS
-
-#endif  /* __MONO_METADATA_VERIFY_H__ */
-

+ 0 - 105
Libs/Interpreter/include/mono/utils/mono-counters.h

@@ -1,105 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_COUNTERS_H__
-#define __MONO_COUNTERS_H__
-
-#include <stdio.h>
-#include <mono/utils/mono-publib.h>
-
-enum {
-	/* Counter type, bits 0-7. */
-	MONO_COUNTER_INT,    /* 32 bit int */
-	MONO_COUNTER_UINT,    /* 32 bit uint */
-	MONO_COUNTER_WORD,   /* pointer-sized int */
-	MONO_COUNTER_LONG,   /* 64 bit int */
-	MONO_COUNTER_ULONG,   /* 64 bit uint */
-	MONO_COUNTER_DOUBLE,
-	MONO_COUNTER_STRING, /* char* */
-	MONO_COUNTER_TIME_INTERVAL, /* 64 bits signed int holding usecs. */
-	MONO_COUNTER_TYPE_MASK = 0xf,
-	MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */
-	MONO_COUNTER_SECTION_MASK = 0x00ffff00,
-	/* Sections, bits 8-23 (16 bits) */
-	MONO_COUNTER_JIT      = 1 << 8,
-	MONO_COUNTER_GC       = 1 << 9,
-	MONO_COUNTER_METADATA = 1 << 10,
-	MONO_COUNTER_GENERICS = 1 << 11,
-	MONO_COUNTER_SECURITY = 1 << 12,
-	MONO_COUNTER_RUNTIME  = 1 << 13,
-	MONO_COUNTER_SYSTEM   = 1 << 14,
-	MONO_COUNTER_PERFCOUNTERS = 1 << 15,
-	MONO_COUNTER_PROFILER = 1 << 16,
-	MONO_COUNTER_INTERP   = 1 << 17,
-	MONO_COUNTER_TIERED   = 1 << 18,
-	MONO_COUNTER_LAST_SECTION,
-
-	/* Unit, bits 24-27 (4 bits) */
-	MONO_COUNTER_UNIT_SHIFT = 24,
-	MONO_COUNTER_UNIT_MASK = 0xFu << MONO_COUNTER_UNIT_SHIFT,
-	MONO_COUNTER_RAW        = 0 << 24,  /* Raw value */
-	MONO_COUNTER_BYTES      = 1 << 24, /* Quantity of bytes. RSS, active heap, etc */
-	MONO_COUNTER_TIME       = 2 << 24,  /* Time interval in 100ns units. Minor pause, JIT compilation*/
-	MONO_COUNTER_COUNT      = 3 << 24, /*  Number of things (threads, queued jobs) or Number of events triggered (Major collections, Compiled methods).*/
-	MONO_COUNTER_PERCENTAGE = 4 << 24, /* [0-1] Fraction Percentage of something. Load average. */
-
-	/* Monotonicity, bits 28-31 (4 bits) */
-	MONO_COUNTER_VARIANCE_SHIFT = 28,
-	MONO_COUNTER_VARIANCE_MASK = 0xFu << MONO_COUNTER_VARIANCE_SHIFT,
-	MONO_COUNTER_MONOTONIC      = 1 << 28, /* This counter value always increase/decreases over time. Reported by --stat. */
-	MONO_COUNTER_CONSTANT       = 1 << 29, /* Fixed value. Used by configuration data. */
-	MONO_COUNTER_VARIABLE       = 1 << 30, /* This counter value can be anything on each sampling. Only interesting when sampling. */
-};
-
-typedef struct _MonoCounter MonoCounter;
-
-MONO_API void mono_counters_enable (int section_mask);
-MONO_API void mono_counters_init (void);
-
-/* 
- * register addr as the address of a counter of type type.
- * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
- * the function should return the value and take no arguments.
- */
-MONO_API void mono_counters_register (const char* descr, int type, void *addr);
-MONO_API void mono_counters_register_with_size (const char *name, int type, void *addr, int size);
-
-typedef void (*MonoCounterRegisterCallback) (MonoCounter*);
-MONO_API void mono_counters_on_register (MonoCounterRegisterCallback callback);
-
-/* 
- * Create a readable dump of the counters for section_mask sections (ORed section values)
- */
-MONO_API void mono_counters_dump (int section_mask, FILE *outfile);
-
-MONO_API void mono_counters_cleanup (void);
-
-typedef mono_bool (*CountersEnumCallback) (MonoCounter *counter, void *user_data);
-
-MONO_API void mono_counters_foreach (CountersEnumCallback cb, void *user_data);
-
-MONO_API int mono_counters_sample (MonoCounter *counter, void *buffer, int buffer_size);
-
-MONO_API const char* mono_counter_get_name (MonoCounter *name);
-MONO_API int mono_counter_get_type (MonoCounter *counter);
-MONO_API int mono_counter_get_section (MonoCounter *counter);
-MONO_API int mono_counter_get_unit (MonoCounter *counter);
-MONO_API int mono_counter_get_variance (MonoCounter *counter);
-MONO_API size_t mono_counter_get_size (MonoCounter *counter);
-
-typedef enum {
-	MONO_RESOURCE_JIT_CODE, /* bytes */
-	MONO_RESOURCE_METADATA, /* bytes */
-	MONO_RESOURCE_GC_HEAP,  /* bytes */
-	MONO_RESOURCE_COUNT /* non-ABI value */
-} MonoResourceType;
-
-typedef void (*MonoResourceCallback) (int resource_type, uintptr_t value, int is_soft);
-
-MONO_API int  mono_runtime_resource_limit        (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit);
-MONO_API void mono_runtime_resource_set_callback (MonoResourceCallback callback);
-MONO_API void mono_runtime_resource_check_limit  (int resource_type, uintptr_t value);
-
-#endif /* __MONO_COUNTERS_H__ */
-

+ 0 - 43
Libs/Interpreter/include/mono/utils/mono-dl-fallback.h

@@ -1,43 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_UTILS_DL_FALLBACK_H__
-#define __MONO_UTILS_DL_FALLBACK_H__
-
-#include <mono/utils/mono-publib.h>
-
-MONO_BEGIN_DECLS
-
-enum {
-	MONO_DL_EAGER  = 0,
-	MONO_DL_LAZY   = 1,
-	// If MONO_DL_LOCAL is set, it will trump MONO_DL_GLOBAL.
-	MONO_DL_LOCAL  = 2,
-	// MONO_DL_MASK is unused internally and no longer a full mask on netcore, given the introduction of MONO_DL_GLOBAL. Avoid.
-	MONO_DL_MASK   = 3,
-	// Only applicable when building Mono in netcore mode.
-	MONO_DL_GLOBAL = 4
-};
-
-/*
- * This is the dynamic loader fallback API
- */
-typedef struct MonoDlFallbackHandler MonoDlFallbackHandler;
-
-/*
- * The "err" variable contents must be allocated using g_malloc or g_strdup
- */
-typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data);
-typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data);
-typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data);
-
-MONO_API MonoDlFallbackHandler *mono_dl_fallback_register (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func,
-						  MonoDlFallbackClose close_func, void *user_data);
-
-MONO_API void                   mono_dl_fallback_unregister (MonoDlFallbackHandler *handler);
-
-MONO_END_DECLS
-
-#endif /* __MONO_UTILS_DL_FALLBACK_H__ */
-

+ 0 - 105
Libs/Interpreter/include/mono/utils/mono-error.h

@@ -1,105 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_ERROR_H__
-#define __MONO_ERROR_H__
-
-#include <mono/utils/mono-publib.h>
-
-enum {
-	/*
-	The supplied strings were dup'd by means of calling mono_error_dup_strings.
-	*/
-	MONO_ERROR_FREE_STRINGS = 0x0001,
-
-	/*
-	Something happened while processing the error and the resulting message is incomplete.
-	*/
-	MONO_ERROR_INCOMPLETE = 0x0002,
-	/*
-	This MonoError is heap allocated in a mempool
-        */
-	MONO_ERROR_MEMPOOL_BOXED = 0x0004
-};
-
-enum {
-	MONO_ERROR_NONE = 0,
-	MONO_ERROR_MISSING_METHOD = 1,
-	MONO_ERROR_MISSING_FIELD = 2,
-	MONO_ERROR_TYPE_LOAD = 3,
-	MONO_ERROR_FILE_NOT_FOUND = 4,
-	MONO_ERROR_BAD_IMAGE = 5,
-	MONO_ERROR_OUT_OF_MEMORY = 6,
-	MONO_ERROR_ARGUMENT = 7,
-	MONO_ERROR_ARGUMENT_NULL = 11,
-	MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14,
-	MONO_ERROR_NOT_VERIFIABLE = 8,
-	MONO_ERROR_INVALID_PROGRAM = 12,
-	MONO_ERROR_MEMBER_ACCESS = 13,
-
-	/*
-	 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
-	 * You must pass the exception name otherwise prepare_exception will fail with internal execution. 
-	 */
-	MONO_ERROR_GENERIC = 9,
-	/* This one encapsulates a managed exception instance */
-	MONO_ERROR_EXCEPTION_INSTANCE = 10,
-
-	/* Not a valid error code - indicates that the error was cleaned up and reused */
-	MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
-};
-
-#ifdef _MSC_VER
-__pragma(warning (push))
-__pragma(warning (disable:4201))
-#endif
-
-/*Keep in sync with MonoErrorInternal*/
-typedef union _MonoError {
-	// Merge two uint16 into one uint32 so it can be initialized
-	// with one instruction instead of two.
-	uint32_t init;
-	struct {
-		uint16_t error_code;
-		uint16_t private_flags; /*DON'T TOUCH */
-		void *hidden_1 [12]; /*DON'T TOUCH */
-	};
-} MonoErrorExternal;
-
-#ifdef _MSC_VER
-__pragma(warning (pop))
-#endif
-
-#ifdef MONO_INSIDE_RUNTIME
-typedef union _MonoErrorInternal MonoError;
-#else
-typedef MonoErrorExternal MonoError;
-#endif
-
-/* Mempool-allocated MonoError.*/
-typedef struct _MonoErrorBoxed MonoErrorBoxed;
-
-MONO_BEGIN_DECLS
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_error_init (MonoError *error);
-
-MONO_API void
-mono_error_init_flags (MonoError *error, unsigned short flags);
-
-MONO_API void
-mono_error_cleanup (MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_error_ok (MonoError *error);
-
-MONO_API unsigned short
-mono_error_get_error_code (MonoError *error);
-
-MONO_API const char*
-mono_error_get_message (MonoError *error);
-
-MONO_END_DECLS
-
-#endif

+ 0 - 13
Libs/Interpreter/include/mono/utils/mono-forward.h

@@ -1,13 +0,0 @@
-/**
- * \file
- *
- * (C) 2018 Microsoft, Inc.
- *
- */
-#ifndef _MONO_UTILS_FORWARD_
-#define _MONO_UTILS_FORWARD_
-
-typedef struct _MonoDomain MonoDomain;
-typedef struct _MonoJitInfo MonoJitInfo;
-
-#endif

+ 0 - 36
Libs/Interpreter/include/mono/utils/mono-jemalloc.h

@@ -1,36 +0,0 @@
-/**
- * \file
- *
- * Header for jemalloc registration code
- */
-
-#ifndef __MONO_JEMALLOC_H__
-#define __MONO_JEMALLOC_H__
-
-#if defined(MONO_JEMALLOC_ENABLED)
-
-#include <jemalloc/jemalloc.h>
-
-/* Jemalloc can be configured in three ways.
- * 1. You can use it with library loading hacks at run-time
- * 2. You can use it as a global malloc replacement
- * 3. You can use it with a prefix. If you use it with a prefix, you have to explicitly name the malloc function.
- *
- * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je. 
- * This mapping is captured below in the header, in the spirit of "no magic constants".
- *
- * The place that configures jemalloc and sets this prefix is in the Makefile in
- * mono/jemalloc/Makefile.am 
- *
- */
-#define MONO_JEMALLOC_MALLOC mono_jemalloc
-#define MONO_JEMALLOC_REALLOC mono_jerealloc
-#define MONO_JEMALLOC_FREE mono_jefree
-#define MONO_JEMALLOC_CALLOC mono_jecalloc
-
-void mono_init_jemalloc (void);
-
-#endif
-
-#endif
-

+ 0 - 31
Libs/Interpreter/include/mono/utils/mono-logger.h

@@ -1,31 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_LOGGER_H__
-#define __MONO_LOGGER_H__
-
-#include <mono/utils/mono-publib.h>
-MONO_BEGIN_DECLS
-
-MONO_API void 
-mono_trace_set_level_string (const char *value);
-
-MONO_API void 
-mono_trace_set_mask_string (const char *value);
-
-typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout);
-typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data);
-
-MONO_API void
-mono_trace_set_log_handler (MonoLogCallback callback, void *user_data);
-
-MONO_API void
-mono_trace_set_print_handler (MonoPrintCallback callback);
-
-MONO_API void
-mono_trace_set_printerr_handler (MonoPrintCallback callback);
-
-MONO_END_DECLS
-
-#endif /* __MONO_LOGGER_H__ */

+ 0 - 194
Libs/Interpreter/include/mono/utils/mono-publib.h

@@ -1,194 +0,0 @@
-/**
- * \file
- */
-
-#ifndef __MONO_PUBLIB_H__
-#define __MONO_PUBLIB_H__
-
-/* 
- * Minimal general purpose header for use in public mono header files.
- * We can't include config.h, so we use compiler-specific preprocessor
- * directives where needed.
- */
-
-#ifdef  __cplusplus
-#define MONO_BEGIN_DECLS  extern "C" {
-#define MONO_END_DECLS    }
-#else
-#define MONO_BEGIN_DECLS /* nothing */
-#define MONO_END_DECLS   /* nothing */
-#endif
-
-MONO_BEGIN_DECLS
-
-/* VS 2010 and later have stdint.h */
-#if defined(_MSC_VER)
-
-#if _MSC_VER < 1600
-
-typedef __int8			int8_t;
-typedef unsigned __int8		uint8_t;
-typedef __int16			int16_t;
-typedef unsigned __int16	uint16_t;
-typedef __int32			int32_t;
-typedef unsigned __int32	uint32_t;
-typedef __int64			int64_t;
-typedef unsigned __int64	uint64_t;
-
-#else
-
-#include <stdint.h>
-
-#endif
-
-#define MONO_API_EXPORT __declspec(dllexport)
-#define MONO_API_IMPORT __declspec(dllimport)
-
-#else
-
-#include <stdint.h>
-
-#if defined (__clang__) || defined (__GNUC__)
-#define MONO_API_EXPORT __attribute__ ((__visibility__ ("default")))
-#else
-#define MONO_API_EXPORT
-#endif
-#define MONO_API_IMPORT
-
-#endif /* end of compiler-specific stuff */
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-#define MONO_EXTERN_C extern "C"
-#else
-#define MONO_EXTERN_C /* nothing */
-#endif
-
-#if defined(MONO_DLL_EXPORT)
-	#define MONO_API_NO_EXTERN_C MONO_API_EXPORT
-#elif defined(MONO_DLL_IMPORT)
-	#define MONO_API_NO_EXTERN_C MONO_API_IMPORT
-#else
-	#define MONO_API_NO_EXTERN_C /* nothing  */
-#endif
-
-#define MONO_API MONO_EXTERN_C MONO_API_NO_EXTERN_C
-
-// extern "C" extern int c; // warning: duplicate 'extern' declaration specifier [-Wduplicate-decl-specifier]
-//
-// Therefore, remove extern on functions as always meaningless/redundant,
-// and provide MONO_API_DATA for data, that always has one and only one extern.
-#ifdef __cplusplus
-#define MONO_API_DATA MONO_API
-#else
-#define MONO_API_DATA extern MONO_API
-#endif
-
-typedef int32_t		mono_bool;
-typedef uint8_t		mono_byte;
-typedef mono_byte       MonoBoolean;
-#ifdef _WIN32
-MONO_END_DECLS
-#include <wchar.h>
-typedef wchar_t 	mono_unichar2;
-MONO_BEGIN_DECLS
-#else
-typedef uint16_t	mono_unichar2;
-#endif
-typedef uint32_t	mono_unichar4;
-
-typedef void	(*MonoFunc)	(void* data, void* user_data);
-typedef void	(*MonoHFunc)	(void* key, void* value, void* user_data);
-
-MONO_API void mono_free (void *);
-
-#define MONO_ALLOCATOR_VTABLE_VERSION 1
-
-typedef struct {
-	int version;
-	void *(*malloc)      (size_t size);
-	void *(*realloc)     (void *mem, size_t count);
-	void (*free)        (void *mem);
-	void *(*calloc)      (size_t count, size_t size);
-} MonoAllocatorVTable;
-
-MONO_API mono_bool
-mono_set_allocator_vtable (MonoAllocatorVTable* vtable);
-
-
-#define MONO_CONST_RETURN const
-
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
-#if defined (MONO_INSIDE_RUNTIME)
-
-#if defined (__CENTRINEL__)
-/* Centrinel is an analyzer that warns about raw pointer to managed objects
- * inside Mono.
- */
-#define MONO_RT_MANAGED_ATTR __CENTRINEL_MANAGED_ATTR
-#define MONO_RT_CENTRINEL_SUPPRESS __CENTRINEL_SUPPRESS_ATTR(1)
-#else
-#define MONO_RT_MANAGED_ATTR
-#define MONO_RT_CENTRINEL_SUPPRESS
-#endif
-
-#if defined (__clang__) || defined (__GNUC__)
-// attribute(deprecated(message)) was introduced in gcc 4.5.
-// attribute(deprecated))         was introduced in gcc 4.0.
-// Compare: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Function-Attributes.html
-//          https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Function-Attributes.html
-//          https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html
-#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define MONO_RT_EXTERNAL_ONLY \
-	__attribute__ ((__deprecated__ ("The mono runtime must not call this function."))) \
-	MONO_RT_CENTRINEL_SUPPRESS
-#elif __GNUC__ >= 4
-#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__deprecated__)) MONO_RT_CENTRINEL_SUPPRESS
-#else
-#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
-#endif
-
-#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
-// Pragmas for controlling diagnostics appear to be from gcc 4.2.
-// This is used in place of configure gcc -Werror=deprecated-declarations:
-// 1. To be portable across build systems.
-// 2. configure is very sensitive to compiler flags; they break autoconf's probes.
-// Though #2 can be mitigated by being late in configure.
-#pragma GCC diagnostic error "-Wdeprecated-declarations"
-#endif
-
-#else
-#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
-#endif // clang or gcc
-
-#else
-#define MONO_RT_EXTERNAL_ONLY
-#define MONO_RT_MANAGED_ATTR
-#endif /* MONO_INSIDE_RUNTIME */
-
-#if defined (__clang__) || defined (__GNUC__)
-#define _MONO_DEPRECATED __attribute__ ((__deprecated__))
-#elif defined (_MSC_VER)
-#define _MONO_DEPRECATED __declspec (deprecated)
-#else
-#define _MONO_DEPRECATED
-#endif
-
-#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED
-
-MONO_END_DECLS
-
-#endif /* __MONO_PUBLIB_H__ */

BIN
Libs/Interpreter/libs/MonoPosixHelper.dll


BIN
Libs/Interpreter/libs/MonoPosixHelper.lib


BIN
Libs/Interpreter/libs/MonoPosixHelper.pdb


BIN
Libs/Interpreter/libs/libmono-static-sgen.lib


BIN
Libs/Interpreter/libs/mono-2.0-sgen.dll


BIN
Libs/Interpreter/libs/mono-2.0-sgen.lib


BIN
Libs/Interpreter/libs/mono-2.0-sgen.pdb


+ 0 - 1
Libs/Interpreter/readme.txt

@@ -1 +0,0 @@
-mono lib版本6.12.0.122  64bit

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 29
Unity/Assembly-CSharp.csproj


+ 8 - 0
Unity/Assets/Bundles/Lua.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 11b03dccb20627e46bb7598f84842774
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/Bundles/Lua/CSharpLua.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 985185dc54ce47e44ba64742666b94cc
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 55 - 0
Unity/Assets/Bundles/Lua/CSharpLua/All.lua.txt

@@ -0,0 +1,55 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+return function(dir, conf)
+  dir = (dir and #dir > 0) and (dir .. ".CoreSystem.") or "CoreSystem."
+  local require = require
+  local load = function(module) return require(dir .. module) end
+    
+  load("Core")(conf)
+  load("Interfaces")
+  load("Exception")
+  load("Number")
+  load("Char")
+  load("String")
+  load("Boolean")
+  load("Delegate")
+  load("Enum")
+  load("TimeSpan")
+  load("DateTime")
+  load("Collections.EqualityComparer")
+  load("Array")
+  load("Type")
+  load("Collections.List")
+  load("Collections.Dictionary")
+  load("Collections.Queue")
+  load("Collections.Stack")
+  load("Collections.HashSet")
+  load("Collections.LinkedList")
+  load("Collections.SortedDictionary")
+  load("Collections.Linq")
+  load("Convert")
+  load("Math")
+  load("Random")
+  load("Text.StringBuilder")
+  load("Console")
+  load("IO.File")
+  load("Reflection.Assembly")
+  load("Threading.Timer")
+  load("Threading.Thread")
+  load("Threading.Task")
+  load("Utilities")
+end

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/All.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 22ab2ac367c78fb439af88f4e4d2eb59
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 57 - 0
Unity/Assets/Bundles/Lua/CSharpLua/Classloader.lua.txt

@@ -0,0 +1,57 @@
+local typeof = typeof
+local isInstanceOfType = typeof(CS.System.Type).IsInstanceOfType
+
+local function isFromCSharp(T)
+  if T then
+    return T.__name ~= nil or T.UnderlyingSystemType ~= nil
+  end
+
+  return false
+end
+
+local function isUserdataType(obj, T)
+  if isFromCSharp(T) then
+    return isInstanceOfType(typeof(T), obj)
+  end
+  return false
+end
+
+local config = {
+  customTypeCheck = function (T)
+    if isFromCSharp(T) then
+      return isUserdataType
+    end
+  end,
+
+  customTypeof = function (T)
+    if isFromCSharp(T) then
+      return typeof(T)
+    end
+    return nil
+  end,
+
+}
+
+
+if jit then
+  -- luajit table.move may causes a crash in a version, do not confirm whether the current version is fixed
+  table.move = function(a1, f, e, t, a2)
+    if a2 == nil then a2 = a1 end
+    if t > f then
+      t = e - f + t
+      while e >= f do
+        a2[t] = a1[e]
+        t = t - 1
+        e = e - 1
+      end
+    else
+      while f <= e do
+        a2[t] = a1[f]
+        t = t + 1
+        f = f + 1
+      end
+    end
+  end
+end
+
+require("CSharpLua.All")("CSharpLua", config)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/Classloader.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d7c49a49165212a4bad0da5f82c8d240
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: csharplua_lua.unity3d
+  assetBundleVariant: 

+ 9 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem.meta

@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 2138a9006de9313498422cd95a8c4124
+folderAsset: yes
+timeCreated: 1526899278
+licenseType: Free
+DefaultImporter:
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1159 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Array.lua.txt

@@ -0,0 +1,1159 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local div = System.div
+local trueFn = System.trueFn
+local falseFn = System.falseFn
+local lengthFn = System.lengthFn
+
+local InvalidOperationException = System.InvalidOperationException
+local NullReferenceException = System.NullReferenceException
+local ArgumentException = System.ArgumentException
+local ArgumentNullException = System.ArgumentNullException
+local ArgumentOutOfRangeException = System.ArgumentOutOfRangeException
+local IndexOutOfRangeException = System.IndexOutOfRangeException
+local NotSupportedException = System.NotSupportedException
+local EqualityComparer = System.EqualityComparer
+local Comparer_1 = System.Comparer_1
+local IEnumerator_1 = System.IEnumerator_1
+
+local assert = assert
+local select = select
+local getmetatable = getmetatable
+local setmetatable = setmetatable
+local type = type
+local table = table
+local tinsert = table.insert
+local tremove = table.remove
+local tmove = table.move
+local tsort = table.sort
+local pack = table.pack
+local unpack = table.unpack
+local error = error
+local coroutine = coroutine
+local ccreate = coroutine.create
+local cresume = coroutine.resume
+local cyield = coroutine.yield
+
+local null = {}
+local arrayEnumerator
+local arrayFromTable
+
+local versions = setmetatable({}, { __mode = "k" })
+System.versions = versions
+
+local function throwFailedVersion()
+  throw(InvalidOperationException("Collection was modified; enumeration operation may not execute."))
+end
+
+local function checkIndex(t, index) 
+  if index < 0 or index >= #t then
+    throw(ArgumentOutOfRangeException("index"))
+  end
+end
+
+local function checkIndexAndCount(t, index, count)
+  if t == nil then throw(ArgumentNullException("array")) end
+  if index < 0 or count < 0 or index + count > #t then
+    throw(ArgumentOutOfRangeException("index or count"))
+  end
+end
+
+local function wrap(v)
+  if v == nil then 
+    return null 
+  end
+  return v
+end
+
+local function unWrap(v)
+  if v == null then 
+    return nil 
+  end
+  return v
+end
+
+local function ipairs(t)
+  local version = versions[t]
+  return function (t, i)
+    if version ~= versions[t] then
+      throwFailedVersion()
+    end
+    local v = t[i]
+    if v ~= nil then
+      if v == null then
+        v = nil
+      end
+      return i + 1, v
+    end
+  end, t, 1
+end
+
+local function eachFn(en)
+  if en:MoveNext() then
+    return true, en:getCurrent()
+  end
+  return nil
+end
+
+local function each(t)
+  if t == nil then throw(NullReferenceException(), 1) end
+  local getEnumerator = t.GetEnumerator
+  if getEnumerator == arrayEnumerator then
+    return ipairs(t)
+  end
+  local en = getEnumerator(t)
+  return eachFn, en
+end
+
+function System.isArrayLike(t)
+  return type(t) == "table" and t.GetEnumerator == arrayEnumerator
+end
+
+function System.isEnumerableLike(t)
+  return type(t) == "table" and t.GetEnumerator ~= nil
+end
+
+function System.toLuaTable(array)
+  local t = {}
+  for i = 1, #array do
+    local item = array[i]
+    if item ~= null then
+      t[i] = item
+    end
+  end   
+  return t
+end
+
+System.null = null
+System.Void = null
+System.each = each
+System.ipairs = ipairs
+System.throwFailedVersion = throwFailedVersion
+
+System.wrap = wrap
+System.unWrap = unWrap
+System.checkIndex = checkIndex
+System.checkIndexAndCount = checkIndexAndCount
+
+local Array
+local emptys = {}
+
+local function get(t, index)
+  local v = t[index + 1]
+  if v == nil then
+    throw(ArgumentOutOfRangeException("index"))
+  end
+  if v ~= null then 
+    return v
+  end
+  return nil
+end
+
+local function set(t, index, v)
+  index = index + 1
+  if t[index] == nil then
+    throw(ArgumentOutOfRangeException("index"))
+  end
+  t[index] = v == nil and null or v
+  versions[t] = (versions[t] or 0) + 1
+end
+
+local function add(t, v)
+  local n = #t
+  t[n + 1] = v == nil and null or v
+  versions[t] = (versions[t] or 0) + 1
+  return n
+end
+
+local function addRange(t, collection)
+  if collection == nil then throw(ArgumentNullException("collection")) end
+  local count = #t + 1
+  if collection.GetEnumerator == arrayEnumerator then
+    tmove(collection, 1, #collection, count, t)
+  else
+    for _, v in each(collection) do
+      t[count] = v == nil and null or v
+      count = count + 1
+    end
+  end
+  versions[t] = (versions[t] or 0) + 1
+end
+
+local function unset()
+  throw(NotSupportedException("Collection is read-only."))
+end
+
+local function fill(t, f, e, v)
+  while f <= e do
+    t[f] = v
+    f = f + 1
+  end
+end
+
+local function buildArray(T, len, t)
+  if t == nil then 
+    t = {}
+    if len > 0 then
+      local genericT = T.__genericT__
+      local default = genericT:default()
+      if default == nil then
+        fill(t, 1, len, null)
+      elseif type(default) ~= "table" then
+        fill(t, 1, len, default)
+      else
+        for i = 1, len do
+          t[i] = genericT:default()
+        end
+      end
+    end
+  else
+    if len > 0 then
+      local default = T.__genericT__:default()
+      if default == nil then
+        for i = 1, len do
+          if t[i] == nil then
+            t[i] = null
+          end
+        end
+      end
+    end
+  end
+  return setmetatable(t, T)
+end
+
+local function indexOf(t, v, startIndex, count)
+  if t == nil then throw(ArgumentNullException("array")) end
+  local len = #t
+  if not startIndex then
+    startIndex, count = 0, len
+  elseif not count then
+    if startIndex < 0 or startIndex > len then
+      throw(ArgumentOutOfRangeException("startIndex"))
+    end
+    count = len - startIndex
+  else
+    if startIndex < 0 or startIndex > len then
+      throw(ArgumentOutOfRangeException("startIndex"))
+    end
+    if count < 0 or count > len - startIndex then
+      throw(ArgumentOutOfRangeException("count"))
+    end
+  end
+  local comparer = EqualityComparer(t.__genericT__).getDefault()
+  local equals = comparer.EqualsOf
+  for i = startIndex + 1, startIndex + count do
+    local item = t[i]
+    if item == null then item = nil end
+    if equals(comparer, item, v) then
+      return i - 1
+    end
+  end
+  return -1
+end
+
+local function findIndex(t, startIndex, count, match)
+  if t == nil then throw(ArgumentNullException("array")) end
+  local len = #t
+  if not count then
+    startIndex, count, match = 0, len, startIndex
+  elseif not match then
+    if startIndex < 0 or startIndex > len then
+      throw(ArgumentOutOfRangeException("startIndex"))
+    end
+    count, match = len - startIndex, count
+  else
+    if startIndex < 0 or startIndex > len then
+      throw(ArgumentOutOfRangeException("startIndex"))
+    end
+    if count < 0 or count > len - startIndex then
+      throw(ArgumentOutOfRangeException("count"))
+    end
+  end
+  if match == nil then throw(ArgumentNullException("match")) end
+  local endIndex = startIndex + count
+  for i = startIndex + 1, endIndex  do
+    local item = t[i]
+    if item == null then item = nil end
+    if match(item) then
+      return i - 1
+    end
+  end
+  return -1
+end
+
+local function copy(sourceArray, sourceIndex, destinationArray, destinationIndex, length, reliable)
+  if not reliable then
+    checkIndexAndCount(sourceArray, sourceIndex, length)
+    checkIndexAndCount(destinationArray, destinationIndex, length)
+  end
+  tmove(sourceArray, sourceIndex + 1, sourceIndex + length, destinationIndex + 1, destinationArray)
+end
+
+local function removeRange(t, index, count)
+  local n = #t
+  if count < 0 or index > n - count then
+    throw(ArgumentOutOfRangeException("index or count"))
+  end
+  if count > 0 then
+    if index + count < n then
+      tmove(t, index + count + 1, n, index + 1)
+    end
+    fill(t, n - count + 1, n, nil)
+    versions[t] = (versions[t] or 0) + 1
+  end
+end
+
+local function findAll(t, match)
+  if t == nil then throw(ArgumentNullException("array")) end
+  if match == nil then throw(ArgumentNullException("match")) end
+  local list = {}
+  local count = 1
+  for i = 1, #t do
+    local item = t[i]
+    if (item == null and match(nil)) or match(item) then
+      list[count] = item
+      count = count + 1
+    end
+  end
+  return list
+end
+
+local function getComp(t, comparer)
+  local compare
+  if comparer then
+    if type(comparer) == "function" then
+      compare = comparer
+    else
+      local Compare = comparer.Compare
+      if Compare then
+        compare = function (x, y) return Compare(comparer, x, y) end
+      else
+        compare = comparer
+      end
+    end
+  else
+    comparer = Comparer_1(t.__genericT__).getDefault()
+    local Compare = comparer.Compare
+    compare = function (x, y) return Compare(comparer, x, y) end
+  end
+  return function(x, y) 
+    if x == null then x = nil end
+    if y == null then y = nil end
+    return compare(x, y) < 0
+  end
+end
+
+local function sort(t, comparer)
+  if #t > 1 then
+    tsort(t, getComp(t, comparer))
+    versions[t] = (versions[t] or 0) + 1
+  end
+end
+
+local ArrayEnumerator = define("System.ArrayEnumerator", function (T)
+  return {
+    base = { IEnumerator_1(T) }
+  }
+end, {
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  Reset = function (this)
+    this.index = 1
+    this.current = nil
+  end,
+  MoveNext = function (this)
+    local t = this.list
+    if this.version ~= versions[t] then
+      throwFailedVersion()
+    end
+    local index = this.index
+    local v = t[index]
+    if v ~= nil then
+      if v == null then
+        this.current = nil
+      else
+        this.current = v
+      end
+      this.index = index + 1
+      return true
+    end
+    this.current = nil
+    return false
+  end
+})
+
+arrayEnumerator = function (t, T)
+  if not T then T = t.__genericT__ end
+  return setmetatable({ list = t, index = 1, version = versions[t], currnet = T:default() }, ArrayEnumerator(T))
+end
+
+local ArrayReverseEnumerator = define("System.ArrayReverseEnumerator", function (T)
+  return {
+    base = { IEnumerator_1(T) }
+  }
+end, {
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  Reset = function (this)
+    this.index = #this.list
+    this.current = nil
+  end,
+  MoveNext = function (this)
+    local t = this.list
+    if this.version ~= versions[t] then
+      throwFailedVersion()
+    end
+    local index = this.index
+    local v = t[index]
+    if v ~= nil then
+      if v == null then
+        this.current = nil
+      else
+        this.current = v
+      end
+      this.index = index - 1
+      return true
+    end
+    this.current = nil
+    return false
+  end
+})
+
+local function reverseEnumerator(t)
+  local T = t.__genericT__
+  return setmetatable({ list = t, index = #t, version = versions[t], currnet = T:default() }, ArrayReverseEnumerator(T))
+end
+
+local function checkArrayIndex(index1, index2)
+  if index2 then
+    throw(ArgumentException("Indices length does not match the array rank."))
+  elseif type(index1) == "table" then
+    if #index1 ~= 1 then
+      throw(ArgumentException("Indices length does not match the array rank."))
+    else
+      index1 = index1[1]
+    end
+  end
+  return index1
+end
+
+Array = {
+  version = 0,
+  new = buildArray,
+  set = set,
+  get = get,
+  ctorList = function (t, ...)
+    local len = select("#", ...)
+    if len == 0 then return end
+    local collection = ...
+    if type(collection) == "number" then return end
+    addRange(t, collection)
+  end,
+  add = add,
+  addObj = function (this, item)
+    if not System.is(item, this.__genericT__) then
+      throw(ArgumentException())
+    end
+    return add(this, item)
+  end,
+  addRange = addRange,
+  AsReadOnly = function (t)
+    return System.ReadOnlyCollection(t.__genericT__)(t)
+  end,
+  clear = function (t)
+    local size = #t
+    if size > 0 then
+      for i = 1, size do
+        t[i] = nil
+      end
+      versions[t] = (versions[t] or 0) + 1
+    end
+  end,
+  findAll = function (t, match)
+    return setmetatable(findAll(t, match), System.List(t.__genericT__))
+  end,
+  first = function (t)
+    if #t == 0 then throw(InvalidOperationException()) end
+    local v = t[1]
+    if v ~= null then
+      return v
+    end
+    return nil
+  end,
+  insert = function (t, index, v)
+    if index < 0 or index > #t then
+      throw(ArgumentOutOfRangeException("index"))
+    end
+    tinsert(t, index + 1, v == nil and null or v)
+    versions[t] = (versions[t] or 0) + 1
+  end,
+  insertRange = function (t, index, collection) 
+    if collection == nil then throw(ArgumentNullException("collection")) end
+    local len = #t
+    if index < 0 or index > len then
+      throw(ArgumentOutOfRangeException("index"))
+    end
+    if t.GetEnumerator == arrayEnumerator then
+      local count = #collection
+      if count > 0 then
+        if index < len then
+          tmove(t, index + 1, len, index + 1 + count, t)
+        end
+        if t == collection then
+          tmove(t, 1, index, index + 1, t)
+          tmove(t, index + 1 + count, count * 2, index * 2 + 1, t)
+        else
+          tmove(collection, 1, count, index + 1, t)
+        end
+      end
+    else
+      for _, v in each(collection) do
+        index = index + 1
+        tinsert(t, index, v == nil and null or v)
+      end
+    end
+    versions[t] = (versions[t] or 0) + 1
+  end,
+  last = function (t)
+    local n = #t
+    if n == 0 then throw(InvalidOperationException()) end
+    local v = t[n]
+    if v ~= null then
+      return v
+    end
+    return nil
+  end,
+  popFirst = function (t)
+    if #t == 0 then throw(InvalidOperationException()) end
+    local v = t[1]
+    tremove(t, 1)
+    versions[t] = (versions[t] or 0) + 1
+    if v ~= null then
+      return v
+    end
+    return nil
+  end,
+  popLast = function (t)
+    local n = #t
+    if n == 0 then throw(InvalidOperationException()) end
+    local v = t[n]
+    t[n] = nil
+    if v ~= null then
+      return v
+    end
+    return nil
+  end,
+  removeRange = removeRange,
+  remove = function (t, v)
+    local index = indexOf(t, v)
+    if index >= 0 then
+      tremove(t, index + 1)
+      versions[t] = (versions[t] or 0) + 1
+      return true
+    end
+    return false
+  end,
+  removeAll = function (t, match)
+    if match == nil then throw(ArgumentNullException("match")) end
+    local size = #t
+    local freeIndex = 1
+    while freeIndex <= size do
+      local item = t[freeIndex]
+      if item == null then  item = nil end
+      if match(item) then
+        break
+      end
+      freeIndex = freeIndex + 1 
+    end
+    if freeIndex > size then return 0 end
+  
+    local current = freeIndex + 1
+    while current <= size do 
+      while current <= size do
+        local item = t[current]
+        if item == null then item = nil end
+        if not match(item) then
+          break
+        end
+        current = current + 1 
+      end
+      if current <= size then
+        t[freeIndex] = t[current]
+        freeIndex = freeIndex + 1
+        current = current + 1
+      end
+    end
+    freeIndex = freeIndex -1
+    local count = size - freeIndex
+    removeRange(t, freeIndex, count)
+    return count
+  end,
+  removeAt = function (t, index)
+    local v = tremove(t, index + 1)
+    if v == nil then
+      throw(ArgumentOutOfRangeException("index"))
+    end
+    versions[t] = (versions[t] or 0) + 1
+  end,
+  getRange = function (t, index, count)
+    if count < 0 or index > #t - count then
+      throw(ArgumentOutOfRangeException("index or count"))
+    end
+    local list = {}
+    tmove(t, index + 1, index + count, 1, list)
+    return setmetatable(list, System.List(t.__genericT__))
+  end,
+  reverseEnumerator = reverseEnumerator,
+  getCount = lengthFn,
+  getSyncRoot = System.identityFn,
+  getLongLength = lengthFn,
+  getLength = lengthFn,
+  getIsSynchronized = falseFn,
+  getIsReadOnly = falseFn,
+  getIsFixedSize = trueFn,
+  getRank = System.oneFn,
+  Add = unset,
+  Clear = unset,
+  Insert = unset,
+  Remove = unset,
+  RemoveAt = unset,
+  BinarySearch = function (t, ...)
+    if t == nil then throw(ArgumentNullException("array")) end
+    local len = #t
+    local index, count, v, comparer
+    local n = select("#", ...)
+    if n == 1 or n == 2 then
+      index, count, v, comparer = 0, len, ...
+    else
+      index, count, v, comparer = ...
+    end
+    checkIndexAndCount(t, index, count)
+    local compare
+    if comparer == nil then
+      comparer = Comparer_1(t.__genericT__).getDefault()
+      compare = comparer.Compare 
+    else
+      compare = comparer.Compare
+    end
+    local lo = index
+    local hi = index + count - 1
+    while lo <= hi do
+      local i = lo + div(hi - lo, 2)
+      local item = t[i + 1]
+      if item == null then item = nil end
+      local order = compare(comparer, item, v);
+      if order == 0 then return i end
+      if order < 0 then
+        lo = i + 1
+      else
+        hi = i - 1
+      end
+    end
+    return -1
+  end,
+  ClearArray = function (t, index, length)
+    if t == nil then throw(ArgumentNullException("array")) end
+    if index < 0 or length < 0 or index + length > #t then
+      throw(IndexOutOfRangeException())
+    end
+    local default = t.__genericT__:default()
+    if default == nil then default = null end
+    fill(t, index + 1, index + length, default)
+  end,
+  Contains = function (t, v)
+    return indexOf(t, v) ~= -1
+  end,
+  Copy = function (t, ...)
+    local len = select("#", ...)     
+    if len == 2 then
+      local array, length = ...
+      copy(t, 0, array, 0, length)
+    else 
+      copy(t, ...)
+    end
+  end,
+  CreateInstance = function (elementType, length)
+    return buildArray(Array(elementType[1]), length)
+  end,
+  Empty = function (T)
+    local t = emptys[T]
+    if t == nil then
+      t = Array(T)()
+      emptys[T] = t
+    end
+    return t
+  end,
+  Exists = function (t, match)
+    return findIndex(t, match) ~= -1
+  end,
+  Fill = function (t, value, startIndex, count)
+    if t == nil then throw(ArgumentNullException("array")) end
+    local len = #t
+    if not startIndex then
+      startIndex, count = 0, len
+    else
+      if startIndex < 0 or startIndex > len then
+        throw(ArgumentOutOfRangeException("startIndex"))
+      end
+      if count < 0 or count > len - startIndex then
+        throw(ArgumentOutOfRangeException("count"))
+      end
+    end
+    fill(t, startIndex + 1, startIndex + count, value)
+  end,
+  Find = function (t, match)
+    if t == nil then throw(ArgumentNullException("array")) end
+    if match == nil then throw(ArgumentNullException("match")) end
+    for i = 1, #t do
+      local item = t[i]
+      if item == null then item = nil end
+      if match(item) then
+        return item
+      end
+    end
+    return t.__genericT__:default()
+  end,
+  FindAll = function (t, match)
+    return setmetatable(findAll(t, match), Array(t.__genericT__))
+  end,
+  FindIndex = findIndex,
+  FindLast = function (t, match)
+    if t == nil then throw(ArgumentNullException("array")) end
+    if match == nil then throw(ArgumentNullException("match")) end
+    for i = #t, 1, -1 do
+      local item = t[i]
+      if item == null then item = nil end
+      if match(item) then
+        return item
+      end
+    end
+    return t.__genericT__:default()
+  end,
+  FindLastIndex = function (t, startIndex, count, match)
+    if t == nil then throw(ArgumentNullException("array")) end
+    local len = #t
+    if not count then
+      startIndex, count, match = len - 1, len, startIndex
+    elseif not match then
+      count, match = startIndex + 1, count
+    end
+    if match == nil then throw(ArgumentNullException("match")) end
+    if count < 0 or startIndex - count + 1 < 0 then
+      throw(ArgumentOutOfRangeException("count"))
+    end
+    local endIndex = startIndex - count + 1
+    for i = startIndex + 1, endIndex + 1, -1 do
+      local item = t[i]
+      if item == null then
+        item = nil
+      end
+      if match(item) then
+        return i - 1
+      end
+    end
+    return -1
+  end,
+  ForEach = function (t, action)
+    if action == nil then throw(ArgumentNullException("action")) end
+    for i = 1, #t do
+      local item = t[i]
+      if item == null then item = nil end
+      action(item)
+    end
+  end,
+  IndexOf = indexOf,
+  LastIndexOf = function (t, value, startIndex, count)
+    if t == nil then throw(ArgumentNullException("array")) end
+    local len = #t
+    if not startIndex then
+      startIndex, count = len - 1, len
+    elseif not count then
+      count = len == 0 and 0 or (startIndex + 1)
+    end
+    if len == 0 then
+      if startIndex ~= -1 and startIndex ~= 0 then
+        throw(ArgumentOutOfRangeException("startIndex"))
+      end
+      if count ~= 0 then
+        throw(ArgumentOutOfRangeException("count"))
+      end
+    end
+    if startIndex < 0 or startIndex >= len then
+      throw(ArgumentOutOfRangeException("startIndex"))
+    end
+    if count < 0 or startIndex - count + 1 < 0 then
+      throw(ArgumentOutOfRangeException("count"))
+    end
+    local comparer = EqualityComparer(t.__genericT__).getDefault()
+    local equals = comparer.EqualsOf
+    local endIndex = startIndex - count + 1
+    for i = startIndex + 1, endIndex + 1, -1 do
+      local item = t[i]
+      if item == null then item = nil end
+      if equals(comparer, item, value) then
+        return i - 1
+      end
+    end
+    return -1
+  end,
+  Resize = function (t, newSize, T)
+    if newSize < 0 then throw(ArgumentOutOfRangeException("newSize")) end
+    if t == nil then
+      return buildArray(Array(T), newSize)
+    end
+    local len = #t
+    if len > newSize then
+      fill(t, newSize + 1, len, nil)
+    elseif len < newSize then
+      local default = t.__genericT__:default()
+      if default == nil then default = null end
+      fill(t, len + 1, newSize, default)
+    end
+    return t
+  end,
+  Reverse = function (t, index, count)
+    if not index then
+      index = 0
+      count = #t
+    else
+      if count < 0 or index > #t - count then
+        throw(ArgumentOutOfRangeException("index or count"))
+      end
+    end
+    local i, j = index + 1, index + count
+    while i <= j do
+      t[i], t[j] = t[j], t[i]
+      i = i + 1
+      j = j - 1
+    end
+    versions[t] = (versions[t] or 0) + 1
+  end,
+  Sort = function (t, ...)
+    if t == nil then throw(ArgumentNullException("array")) end
+    local len = select("#", ...)
+    if len == 0 then
+      sort(t)
+    elseif len == 1 then
+      local comparer = ...
+      sort(t, comparer)
+    else
+      local index, count, comparer = ...
+      if count > 1 then
+        local comp = getComp(t, comparer)
+        if index == 0 and count == #t then
+          tsort(t, comp)
+        else
+          checkIndexAndCount(t, index, count)
+          local arr = {}
+          tmove(t, index + 1, index + count, 1, arr)
+          tsort(arr, comp)
+          tmove(arr, 1, count, index + 1, t)
+        end
+        versions[t] = (versions[t] or 0) + 1
+      end
+    end
+  end,
+  toArray = function (t)
+    local array = {}    
+    if t.GetEnumerator == arrayEnumerator then
+      tmove(t, 1, #t, 1, array)
+    else
+      local count = 1
+      for _, v in each(t) do
+        array[count] = v == nil and null or v
+        count = count + 1
+      end
+    end
+    return arrayFromTable(array, t.__genericT__)
+  end,
+  TrueForAll = function (t, match)
+    if t == nil then throw(ArgumentNullException("array")) end
+    if match == nil then throw(ArgumentNullException("match")) end
+    for i = 1, #t do
+      local item = t[i]
+      if item == null then item = nil end
+      if not match(item) then
+        return false
+      end
+    end
+    return true
+  end,
+  Clone = function (this)
+    local t = setmetatable({}, getmetatable(this))
+    tmove(this, 1, #this, 1, t)
+    return t
+  end,
+  CopyTo = function (this, array, index)
+    local n = #this
+    checkIndexAndCount(array, index, n)
+    local T = this.__genericT__
+    if T.class == "S" then
+      local default = T:default()
+      if type(default) == "table" then
+        for i = 1, n do
+          array[i + index] = this[i]:__clone__()
+        end
+        return
+      end
+    end
+    tmove(this, 1, n, index + 1, array)
+  end,
+  GetEnumerator = arrayEnumerator,
+  GetLength = function (this, dimension)
+    if dimension ~= 0 then throw(IndexOutOfRangeException()) end
+    return #this
+  end,
+  GetLowerBound = function (this, dimension)
+    if dimension ~= 0 then throw(IndexOutOfRangeException()) end
+    return 0
+  end,
+  GetUpperBound = function (this, dimension)
+    if dimension ~= 0 then throw(IndexOutOfRangeException()) end
+    return #this - 1
+  end,
+  GetValue = function (this, index1, index2)
+    if index1 == nil then throw(ArgumentNullException("indices")) end
+    return get(this, checkArrayIndex(index1, index2))
+  end,
+  SetValue = function (this, value, index1, index2)
+    if index1 == nil then throw(ArgumentNullException("indices")) end
+    set(this, checkArrayIndex(index1, index2), System.castWithNullable(this.__genericT__, value))
+  end,
+  Clone = function (this)
+    local array = {}
+    tmove(this, 1, #this, 1, array)
+    return arrayFromTable(array, this.__genericT__)
+  end
+}
+
+function Array.__call(T, ...)
+  return buildArray(T, select("#", ...), { ... })
+end
+
+function System.arrayFromList(t)
+  return setmetatable(t, Array(t.__genericT__))
+end
+
+arrayFromTable = function (t, T, readOnly)
+  assert(T)
+  local array = setmetatable(t, Array(T))
+  if readOnly then
+    array.set = unset
+  end
+  return array
+end
+
+System.arrayFromTable = arrayFromTable
+
+local function getIndex(t, ...)
+  local rank = t.__rank__
+  local id = 0
+  local len = #rank
+  for i = 1, len do
+    id = id * rank[i] + select(i, ...)
+  end
+  return id, len
+end
+
+local function checkMultiArrayIndex(t, index1, ...)
+  if index1 == nil then throw(ArgumentNullException("indices")) end
+  local rank = t.__rank__
+  local len = #rank
+  if type(index1) == "table" then
+    if #index1 ~= len then
+      throw(ArgumentException("Indices length does not match the array rank."))
+    end
+    local id = 0
+    for i = 1, len do
+      id = id * rank[i] + index1[i]
+    end
+    return id
+  elseif len ~= select("#", ...) + 1 then
+    throw(ArgumentException("Indices length does not match the array rank."))
+  end
+  return getIndex(t, index1, ...)
+end
+
+local MultiArray = { 
+  set = function (this, ...)
+    local index, len = getIndex(this, ...)
+    set(this, index, select(len + 1, ...))
+  end,
+  get = function (this, ...)
+    local index = getIndex(this, ...)
+    return get(this, index)
+  end,
+  getRank = function (this)
+    return #this.__rank__
+  end,
+  GetLength = function (this, dimension)
+    local rank = this.__rank__
+    if dimension < 0 or dimension >= #rank then throw(IndexOutOfRangeException()) end
+    return rank[dimension + 1]
+  end,
+  GetLowerBound = function (this, dimension)
+    local rank = this.__rank__
+    if dimension < 0 or dimension >= #rank then throw(IndexOutOfRangeException()) end
+    return 0
+  end,
+  GetUpperBound = function (this, dimension)
+    local rank = this.__rank__
+    if dimension < 0 or dimension >= #rank then throw(IndexOutOfRangeException()) end
+    return rank[dimension + 1] - 1
+  end,
+  GetValue = function (this, ...)
+    return get(this, checkMultiArrayIndex(this, ...))
+  end,
+  SetValue = function (this, value, ...)
+    set(this, checkMultiArrayIndex(this, ...), System.castWithNullable(this.__genericT__, value))
+  end,
+  Clone = function (this)
+    local array = { __rank__ = this.__rank__ }
+    tmove(this, 1, #this, 1, array)
+    return arrayFromTable(array, this.__genericT__)
+  end
+}
+
+function MultiArray.__call(T, rank, t)
+  local len = 1
+  for i = 1, #rank do
+    len = len * rank[i]
+  end
+  t = buildArray(T, len, t)
+  t.__rank__ = rank
+  return t
+end
+
+System.defArray("System.Array", function(T) 
+  return { 
+    base = { System.ICloneable, System.IList_1(T), System.IReadOnlyList_1(T), System.IList }, 
+    __genericT__ = T
+  }
+end, Array, MultiArray)
+
+local cpool = {}
+local function createCoroutine(f)
+  local c = tremove(cpool)
+  if c == nil then
+    c = ccreate(function (...)
+      f(...)
+      while true do
+        f = nil
+        cpool[#cpool + 1] = c
+        f = cyield(cpool)
+        f(cyield())
+      end
+    end)
+  else
+    cresume(c, f)
+  end
+  return c
+end
+
+System.ccreate = createCoroutine
+System.cpool = cpool
+System.cresume = cresume
+System.yield = cyield
+
+local YieldEnumerable
+YieldEnumerable = define("System.YieldEnumerable", function (T)
+  return {
+    base = { System.IEnumerable_1(T), System.IEnumerator_1(T), System.IDisposable },
+    __genericT__ = T
+  }
+end, {
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  GetEnumerator = function (this)
+    return setmetatable({ f = this.f, args = this.args }, YieldEnumerable(this.__genericT__))
+  end,
+  MoveNext = function (this)
+    local c = this.c
+    if c == false then
+      return false
+    end
+  
+    local ok, v
+    if c == nil then
+      c = createCoroutine(this.f)
+      this.c = c
+      local args = this.args
+      ok, v = cresume(c, unpack(args, 1, args.n))
+      this.args = nil
+    else
+      ok, v = cresume(c)
+    end
+  
+    if ok then
+      if v == cpool then
+        this.c = false
+        this.current = nil
+        return false
+      else
+        this.current = v
+        return true
+      end
+    else
+      error(v)
+    end
+  end
+})
+
+local function yieldIEnumerable(f, T, ...)
+  return setmetatable({ f = f, args = pack(...) }, YieldEnumerable(T))
+end
+
+System.yieldIEnumerable = yieldIEnumerable
+System.yieldIEnumerator = yieldIEnumerable
+
+local ReadOnlyCollection = {
+  __ctor__ = function (this, list)
+    if not list then throw(ArgumentNullException("list")) end
+    this.list = list
+  end,
+  getCount = function (this)
+    return #this.list
+  end,
+  get = function (this, index)
+    return this.list:get(index)
+  end,
+  Contains = function (this, value)
+    return this.list:Contains(value)
+  end,
+  GetEnumerator = function (this)
+    return this.list:GetEnumerator()
+  end,
+  CopyTo = function (this, array, index)
+    this.list:CopyTo(array, index)
+  end,
+  IndexOf = function (this, value)
+    return this.list:IndexOf(value)
+  end,
+  getIsSynchronized = falseFn,
+  getIsReadOnly = trueFn,
+  getIsFixedSize = trueFn,
+}
+
+define("System.ReadOnlyCollection", function (T)
+  return { 
+    base = { System.IList_1(T), System.IList, System.IReadOnlyList_1(T) }, 
+    __genericT__ = T
+  }
+end, ReadOnlyCollection)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Array.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f49715e81fe8f844098c314272ae235e
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 116 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Boolean.lua.txt

@@ -0,0 +1,116 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local throw = System.throw
+local debugsetmetatable = System.debugsetmetatable
+local ArgumentException = System.ArgumentException
+local ArgumentNullException = System.ArgumentNullException
+local FormatException = System.FormatException
+
+local type = type
+local setmetatable = setmetatable
+
+local function compareTo(this, v)
+  if this == v then
+    return 0
+  elseif this == false then
+    return -1     
+  end
+  return 1
+end
+
+local falseString = "False"
+local trueString = "True"
+
+local function parse(s)
+  if s == nil then
+    return nil, 1
+  end
+  local i, j, value = s:find("^[%s%c%z]*(%a+)[%s%c%z]*$")
+  if value then
+    s = value:lower()
+    if s == "true" then
+      return true
+    elseif s == "false" then
+      return false
+    end
+  end
+  return nil, 2
+end
+
+local function toString(this)
+  return this and trueString or falseString
+end
+
+local Boolean = System.defStc("System.Boolean", {
+  default = System.falseFn,
+  GetHashCode = System.identityFn,
+  Equals = System.equals,
+  CompareTo = compareTo,
+  ToString = toString,
+  FalseString = falseString,
+  TrueString = trueString,
+  CompareToObj = function (this, v)
+    if v == nil then return 1 end
+    if type(v) ~= "boolean" then
+      throw(ArgumentException("Arg_MustBeBoolean"))
+    end
+    return compareTo(this, v)
+  end,
+  EqualsObj = function (this, v)
+    if type(v) ~= "boolean" then
+      return false
+    end
+    return this == v
+  end,
+  __concat = function (a, b)
+    if type(a) == "boolean" then
+      return toString(a) .. b
+    else 
+      return a .. toString(b)
+    end
+  end,
+  __tostring = toString,
+  Parse = function (s)
+    local v, err = parse(s)
+    if v == nil then
+      if err == 1 then
+        throw(ArgumentNullException()) 
+      else
+        throw(FormatException())
+      end
+    end
+    return v
+  end,
+  TryParse = function (s)
+    local v = parse(s)
+    if v ~= nil then
+      return true, v
+    end
+    return false, false
+  end,
+  base = function (_, T)
+    return { System.IComparable, System.IConvertible, System.IComparable_1(T), System.IEquatable_1(T) }
+  end
+})
+if debugsetmetatable then
+  debugsetmetatable(false, Boolean)
+end
+
+local ValueType = System.ValueType
+local boolMetaTable = setmetatable({ __index = ValueType, __call = Boolean.default }, ValueType)
+setmetatable(Boolean, boolMetaTable)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Boolean.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: b93ad47703c50434b853d52607d581d4
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 232 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Char.lua.txt

@@ -0,0 +1,232 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local throw = System.throw
+local Int = System.Int
+local ArgumentNullException = System.ArgumentNullException
+local ArgumentOutOfRangeException = System.ArgumentOutOfRangeException
+
+local setmetatable = setmetatable
+local byte = string.byte
+
+local isSeparatorTable = {
+  [32] = true,
+  [160] = true,
+  [0x2028] = true,
+  [0x2029] = true,
+  [0x0020] = true,
+  [0x00A0] = true,
+  [0x1680] = true,
+  [0x180E] = true,
+  [0x202F] = true,
+  [0x205F] = true,
+  [0x3000] = true,
+}
+
+local isSymbolTable = {
+  [36] = true,
+  [43] = true,
+  [60] = true, 
+  [61] = true, 
+  [62] = true, 
+  [94] = true, 
+  [96] = true,
+  [124] = true,
+  [126] = true,
+  [172] = true, 
+  [180] = true,
+  [182] = true,
+  [184] = true,
+  [215] = true,
+  [247] = true,
+}
+
+--https://msdn.microsoft.com/zh-cn/library/t809ektx(v=vs.110).aspx
+local isWhiteSpace = {
+  [0x0020] = true,
+  [0x00A0] = true,
+  [0x1680] = true,
+  [0x202F] = true,
+  [0x205F] = true,
+  [0x3000] = true,
+  [0x2028] = true,
+  [0x2029] = true,
+  [0x0085] = true,
+}
+
+local function get(s, index)
+  if s == nil then throw(ArgumentNullException("s")) end
+  local c = byte(s, index + 1)
+  if not c then throw(ArgumentOutOfRangeException("index")) end
+  return c
+end
+
+local function isDigit(c, index)
+  if index then
+    c = get(c, index)
+  end
+  return (c >= 48 and c <= 57)
+end
+
+-- https://msdn.microsoft.com/zh-cn/library/yyxz6h5w(v=vs.110).aspx
+local function isLetter(c, index)    
+  if index then
+    c = get(c, index) 
+  end
+  if c < 128 then
+    return (c >= 65 and c <= 90) or (c >= 97 and c <= 122)
+  else  
+    return (c >= 0x0400 and c <= 0x042F) 
+      or (c >= 0x03AC and c <= 0x03CE) 
+      or (c == 0x01C5 or c == 0x1FFC) 
+      or (c >= 0x02B0 and c <= 0x02C1) 
+      or (c >= 0x1D2C and c <= 0x1D61) 
+      or (c >= 0x05D0 and c <= 0x05EA)
+      or (c >= 0x0621 and c <= 0x063A)
+      or (c >= 0x4E00 and c <= 0x9FC3) 
+  end
+end
+
+local Char = System.defStc("System.Char", {
+  ToString = string.char,
+  CompareTo = Int.CompareTo,
+  CompareToObj = Int.CompareToObj,
+  Equals = Int.Equals,
+  EqualsObj = Int.EqualsObj,
+  GetHashCode = Int.GetHashCode,
+  default = Int.default,
+  IsControl = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >=0 and c <= 31) or (c >= 127 and c <= 159)
+  end,
+  IsDigit = isDigit,
+  IsLetter = isLetter,
+  IsLetterOrDigit = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return isDigit(c) or isLetter(c)
+  end,
+  IsLower = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >= 97 and c <= 122) or (c >= 945 and c <= 969)
+  end,
+  IsNumber = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >= 48 and c <= 57) or c == 178 or c == 179 or c == 185 or c == 188 or c == 189 or c == 190
+  end,
+  IsPunctuation = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    if c < 256 then
+      return (c >= 0x0021 and c <= 0x0023) 
+        or (c >= 0x0025 and c <= 0x002A) 
+        or (c >= 0x002C and c <= 0x002F) 
+        or (c >= 0x003A and c <= 0x003B) 
+        or (c >= 0x003F and c <= 0x0040)  
+        or (c >= 0x005B and c <= 0x005D)
+        or c == 0x5F or c == 0x7B or c == 0x007D or c == 0x00A1 or c == 0x00AB or c == 0x00AD or c == 0x00B7 or c == 0x00BB or c == 0x00BF
+    end
+    return false
+  end,
+  IsSeparator = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >= 0x2000 and c <= 0x200A) or isSeparatorTable[c] == true
+  end,
+  IsSymbol = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    if c < 256 then
+      return (c >= 162 and c <= 169) or (c >= 174 and c <= 177) or isSymbolTable(c) == true
+    end
+    return false
+  end,
+  IsUpper = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >= 65 and c <= 90) or (c >= 913 and c <= 937)
+  end,
+  IsWhiteSpace = function (c, index)
+    if index then
+      c = get(c, index)
+    end
+    return (c >= 0x2000 and c <= 0x200A) or (c >= 0x0009 and c <= 0x000d) or isWhiteSpace[c] == true
+  end,
+  Parse = function (s)
+    if s == nil then
+      throw(System.ArgumentNullException())
+    end
+    if #s ~= 1 then
+      throw(System.FormatException())
+    end
+    return s:byte()
+  end,
+  TryParse = function (s)
+    if s == nil or #s ~= 1 then
+      return false, 0
+    end 
+    return true, s:byte()
+  end,
+  ToLower = function (c)
+    if (c >= 65 and c <= 90) or (c >= 913 and c <= 937) then
+      return c + 32
+    end
+    return c
+  end,
+  ToUpper = function (c)
+    if (c >= 97 and c <= 122) or (c >= 945 and c <= 969) then
+      return c - 32
+    end
+    return c
+  end,
+  IsHighSurrogate = function (c, index) 
+    if index then
+      c = get(c, index)
+    end
+    return c >= 0xD800 and c <= 0xDBFF
+  end,
+  IsLowSurrogate = function (c, index) 
+    if index then
+      c = get(c, index)
+    end
+    return c >= 0xDC00 and c <= 0xDFFF
+  end,
+  IsSurrogate = function (c, index) 
+    if index then
+      c = get(c, index)
+    end
+    return c >= 0xD800 and c <= 0xDFFF
+  end,
+  base = function (_, T)
+    return { System.IComparable, System.IComparable_1(T), System.IEquatable_1(T) }
+  end
+})
+
+local ValueType = System.ValueType
+local charMetaTable = setmetatable({ __index = ValueType, __call = Char.default }, ValueType)
+setmetatable(Char, charMetaTable)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Char.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 8e446fd3dda4425418c55a3819999236
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6c593174ea67b1c49a59b342c76fe211
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 703 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Dictionary.lua.txt

@@ -0,0 +1,703 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local null = System.null
+local falseFn = System.falseFn
+local each = System.each
+local lengthFn = System.lengthFn
+local versions = System.versions
+local Array = System.Array
+local checkIndexAndCount = System.checkIndexAndCount
+local throwFailedVersion = System.throwFailedVersion
+local ArgumentNullException = System.ArgumentNullException
+local ArgumentException = System.ArgumentException
+local KeyNotFoundException = System.KeyNotFoundException
+local EqualityComparer = System.EqualityComparer
+local NotSupportedException = System.NotSupportedException
+
+local assert = assert
+local pairs = pairs
+local next = next
+local select = select
+local getmetatable = getmetatable
+local setmetatable = setmetatable
+local tconcat = table.concat
+local tremove = table.remove
+local type = type
+
+local counts = setmetatable({}, { __mode = "k" })
+System.counts = counts
+
+local function getCount(this)
+  local t = counts[this]
+  if t then
+    return t[1]
+  end
+  return 0
+end
+
+local function pairsFn(t, i)
+  local count =  counts[t]
+  if count then
+    if count[2] ~= count[3] then
+      throwFailedVersion()
+    end
+  end
+  local k, v = next(t, i)
+  if v == null then
+    return k
+  end
+  return k, v
+end
+
+function System.pairs(t)
+  local count = counts[t]
+  if count then
+    count[3] = count[2]
+  end
+  return pairsFn, t
+end
+
+local KeyValuePairFn
+local KeyValuePair = {
+  __ctor__ = function (this, ...)
+    if select("#", ...) == 0 then
+      this.Key, this.Value = this.__genericTKey__:default(), this.__genericTValue__:default()
+    else
+      this.Key, this.Value = ...
+    end
+  end,
+  Create = function (key, value, TKey, TValue)
+    return setmetatable({ Key = key, Value = value }, KeyValuePairFn(TKey, TValue))
+  end,
+  Deconstruct = function (this)
+    return this.Key, this.Value
+  end,
+  ToString = function (this)
+    local t = { "[" }
+    local count = 2
+    local k, v = this.Key, this.Value
+    if k ~= nil then
+      t[count] = k:ToString()
+      count = count + 1
+    end
+    t[count] = ", "
+    count = count + 1
+    if v ~= nil then
+      t[count] = v:ToString()
+      count = count + 1
+    end
+    t[count] = "]"
+    return tconcat(t)
+  end
+}
+
+KeyValuePairFn = System.defStc("System.Collections.Generic.KeyValuePair", function(TKey, TValue)
+  local cls = {
+    __genericTKey__ = TKey,
+    __genericTValue__ = TValue,
+  }
+  return cls
+end, KeyValuePair)
+System.KeyValuePair = KeyValuePairFn
+
+local function isKeyValuePair(t)
+  return getmetatable(getmetatable(t)) == KeyValuePair
+end
+
+local DictionaryEnumerator = define("System.Collections.Generic.DictionaryEnumerator", {
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  MoveNext = function (this)
+    local t, kind = this.dict, this.kind
+    local count = counts[t]
+    if this.version ~= (count and count[2] or 0) then
+      throwFailedVersion()
+    end
+    local k, v = next(t, this.index)
+    if k ~= nil then
+      if kind then
+        kind.Key = k
+        if v == null then v = nil end
+        kind.Value = v
+      elseif kind == false then
+        if v == null then v = nil end
+        this.current = v
+      else
+        this.current = k
+      end
+      this.index = k
+      return true
+    else
+      if kind then
+        kind.Key, kind.Value = kind.__genericTKey__:default(), kind.__genericTValue__:default()
+      elseif kind == false then
+        this.current = t.__genericTValue__:default()
+      else
+        this.current = t.__genericTKey__:default()
+      end
+      return false
+    end
+  end
+})
+
+local function dictionaryEnumerator(t, kind)
+  local current
+  if not kind then
+    local TKey, TValue = t.__genericTKey__, t.__genericTValue__
+    kind = setmetatable({ Key = TKey:default(), Value = TValue:default() }, t.__genericT__)
+    current = kind
+  elseif kind == 1 then
+    local TKey = t.__genericTKey__
+    current = TKey:default()
+    kind = nil
+  else
+    local TValue = t.__genericTValue__
+    current = TValue:default()
+    kind = false
+  end
+  local count = counts[t]
+  local en = {
+    dict = t,
+    version = count and count[2] or 0,
+    kind = kind,
+    current = current
+  }
+  return setmetatable(en, DictionaryEnumerator)
+end
+
+local DictionaryCollection = define("System.Collections.Generic.DictionaryCollection", function (T)
+    return {
+      base = { System.ICollection_1(T), System.IReadOnlyCollection_1(T), System.ICollection },
+      __genericT__ = T
+    }
+  end, {
+  __ctor__ = function (this, dict, kind)
+    this.dict = dict
+    this.kind = kind
+  end,
+  getCount = function (this)
+    return getCount(this.dict)
+  end,
+  GetEnumerator = function (this)
+    return dictionaryEnumerator(this.dict, this.kind)
+  end
+})
+
+local function add(this, key, value)
+  if key == nil then throw(ArgumentNullException("key")) end
+  if this[key] ~= nil then throw(ArgumentException("key already exists")) end
+  this[key] = value == nil and null or value
+  local t = counts[this]
+  if t then
+    t[1] = t[1] + 1
+    t[2] = t[2] + 1
+  else
+    counts[this] = { 1, 1 }
+  end
+end
+
+local function remove(this, key)
+  if key == nil then throw(ArgumentNullException("key")) end
+  if this[key] ~= nil then
+    this[key] = nil
+    local t = counts[this]
+    t[1] = t[1] - 1
+    t[2] = t[2] + 1
+    return true
+  end
+  return false
+end
+
+local function buildFromDictionary(this, dictionary)
+  if dictionary == nil then throw(ArgumentNullException("dictionary")) end
+  local count = 0
+  for k, v in pairs(dictionary) do
+    this[k] = v
+    count = count + 1
+  end
+  counts[this] = { count, 0 }
+end
+
+local ArrayDictionaryFn
+local function buildHasComparer(this, ...)
+   local Dictionary = ArrayDictionaryFn(this.__genericTKey__, this.__genericTValue__)
+   Dictionary.__ctor__(this, ...)
+   return setmetatable(this, Dictionary)
+end
+
+local Dictionary = {
+  getIsFixedSize = falseFn,
+  getIsReadOnly = falseFn,
+  __ctor__ = function (this, ...) 
+    local n = select("#", ...)
+    if n == 0 then
+    elseif n == 1 then
+      local comparer = ...
+      if comparer == nil or type(comparer) == "number" then  
+      else
+        local equals = comparer.EqualsOf
+        if equals == nil then
+          buildFromDictionary(this, comparer)
+        else
+          buildHasComparer(this, ...)
+        end
+      end
+    else
+      local dictionary, comparer = ...
+      if comparer ~= nil then 
+        buildHasComparer(this, ...)
+      end
+      if type(dictionary) ~= "number" then 
+        buildFromDictionary(this, dictionary)
+      end
+    end
+  end,
+  AddKeyValue = add,
+  Add = function (this, ...)
+    local k, v
+    if select("#", ...) == 1 then
+      local pair = ... 
+      k, v = pair.Key, pair.Value
+    else
+      k, v = ...
+    end
+    add(this, k ,v)
+  end,
+  Clear = function (this)
+    for k, v in pairs(this) do
+      this[k] = nil
+    end
+    counts[this] = nil
+  end,
+  ContainsKey = function (this, key)
+    if key == nil then throw(ArgumentNullException("key")) end
+    return this[key] ~= nil 
+  end,
+  ContainsValue = function (this, value)
+    if value == nil then
+      for _, v in pairs(this) do
+        if v == null then
+          return true
+        end
+      end
+    else
+      local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+      local equals = comparer.EqualsOf
+        for _, v in pairs(this) do
+          if v ~= null then
+            if equals(comparer, value, v ) then
+              return true
+            end
+          end
+      end
+    end
+    return false
+  end,
+  Contains = function (this, pair)
+    local key = pair.Key
+    if key == nil then throw(ArgumentNullException("key")) end
+    local value = this[key]
+    if value ~= nil then
+      if value == null then value = nil end
+      local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+      if comparer:EqualsOf(value, pair.Value) then
+        return true
+      end
+    end
+    return false
+  end,
+  CopyTo = function (this, array, index)
+    local count = getCount(this)
+    checkIndexAndCount(array, index, count)
+    if count > 0 then
+      local KeyValuePair = this.__genericT__
+      index = index + 1
+      for k, v in pairs(this) do
+        if v == null then v = nil end
+        array[index] = setmetatable({ Key = k, Value = v }, KeyValuePair)
+        index = index + 1
+      end
+    end
+  end,
+  RemoveKey = remove,
+  Remove = function (this, key)
+    if isKeyValuePair(key) then
+      local k, v = key.Key, key.Value
+      if k == nil then throw(ArgumentNullException("key")) end
+      local value = this[k]
+      if value ~= nil then
+        if value == null then value = nil end
+        local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+        if comparer:EqualsOf(value, v) then
+          remove(this, k)
+          return true
+        end
+      end
+      return false
+    end
+    return remove(this, key)
+  end,
+  TryGetValue = function (this, key)
+    if key == nil then throw(ArgumentNullException("key")) end
+    local value = this[key]
+    if value == nil then
+      return false, this.__genericTValue__:default()
+    end
+    if value == null then return true end
+    return true, value
+  end,
+  getComparer = function (this)
+    return EqualityComparer(this.__genericTKey__).getDefault()
+  end,
+  getCount = getCount,
+  get = function (this, key)
+    if key == nil then throw(ArgumentNullException("key")) end
+    local value = this[key]
+    if value == nil then throw(KeyNotFoundException()) end
+    if value ~= null then
+      return value
+    end
+    return nil
+  end,
+  set = function (this, key, value)
+    if key == nil then throw(ArgumentNullException("key")) end
+    local t = counts[this]
+    if t then
+      if this[key] == nil then
+        t[1] = t[1] + 1
+      end
+      t[2] = t[2] + 1
+    else
+      counts[this] = { 1, 1 }
+    end
+    this[key] = value == nil and null or value
+  end,
+  GetEnumerator = dictionaryEnumerator,
+  getKeys = function (this)
+    return DictionaryCollection(this.__genericTKey__)(this, 1)
+  end,
+  getValues = function (this)
+    return DictionaryCollection(this.__genericTValue__)(this, 2)
+  end
+}
+
+local ArrayDictionaryEnumerator = define("System.Collections.Generic.ArrayDictionaryEnumerator", function (T)
+  return {
+    base = { System.IEnumerator_1(T) }
+  }
+end, {
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  MoveNext = function (this)
+    local t = this.list
+    if this.version ~= versions[t] then
+      throwFailedVersion()
+    end
+    local index = this.index
+    local pair = t[index]
+    if pair ~= nil then
+      if t.kind then
+        this.current = pair.Value
+      else
+        this.current = pair.Key
+      end
+      this.index = index + 1
+      return true
+    end
+    this.current = nil
+    return false
+  end
+})
+
+local arrayDictionaryEnumerator = function (t, kind, T)
+  return setmetatable({ list = t, kind = kind, index = 1, version = versions[t], currnet = T:default() }, ArrayDictionaryEnumerator(T))
+end
+
+local ArrayDictionaryCollection = define("System.Collections.Generic.ArrayDictionaryCollection", function (T)
+  return {
+    base = { System.ICollection_1(T), System.IReadOnlyCollection_1(T), System.ICollection },
+    __genericT__ = T
+  }
+  end, {
+  __ctor__ = function (this, dict, kind)
+    this.dict = dict
+    this.kind = kind
+  end,
+  getCount = function (this)
+    return getCount(this.dict)
+  end,
+  GetEnumerator = function (this)
+    return arrayDictionaryEnumerator(this.dict, this.kind, this.__genericT__)
+  end
+})
+
+local ArrayDictionary = (function ()
+  local function buildFromDictionary(this, dictionary)
+    if dictionary == nil then throw(ArgumentNullException("dictionary")) end
+    local count = 1
+    local KeyValuePair = this.__genericT__
+    for _, pair in each(dictionary) do
+      local k, v = pair.Key, pair.Value
+      if type(k) == "table" and k.class == 'S' then
+        k = k:__clone__()
+      end
+      this[count] = setmetatable({ Key = k, Value = v }, KeyValuePair)
+      count = count + 1
+    end
+  end 
+  
+  local function add(this, key, value, set)
+    if key == nil then throw(ArgumentNullException("key")) end
+    local len = #this
+    if len > 0 then
+      local comparer = this.comparer
+      local equals = comparer.EqualsOf
+      for i = 1, len do
+        if equals(comparer, this[i].Key, key) then
+          if set then
+            this[i].Value = value
+            return
+          else
+            throw(ArgumentException("key already exists"))
+          end
+        end
+      end
+    end
+    this[len + 1] = setmetatable({ Key = key, Value = value }, this.__genericT__)
+    versions[this] = (versions[this] or 0) + 1
+  end
+  
+  local function remove(this, key)
+    if key == nil then throw(ArgumentNullException("key")) end
+    local len = #this
+    if len > 0 then
+      local comparer = this.comparer
+      local equals = comparer.EqualsOf
+      for i = 1, len do
+        if equals(comparer, this[i].Key, key) then
+          tremove(this, i)
+          versions[this] = (versions[this] or 0) + 1
+          return true
+        end
+      end
+    end
+    return false
+  end
+ 
+  return {
+    getIsFixedSize = falseFn,
+    getIsReadOnly = falseFn,
+    __ctor__ = function (this, ...)
+      local Comparer
+      local n = select("#", ...)
+      if n == 0 then
+      elseif n == 1 then
+        local comparer = ...
+        if comparer == nil or type(comparer) == "number" then  
+        else
+          local equals = comparer.EqualsOf
+          if equals == nil then
+            buildFromDictionary(this, comparer)
+          else
+            Comparer = comparer
+          end
+        end
+      else
+        local dictionary, comparer = ...
+        if type(dictionary) ~= "number" then 
+           buildFromDictionary(this, dictionary)
+        end
+        Comparer = comparer
+      end
+      this.comparer = Comparer or EqualityComparer(this.__genericTKey__).getDefault()
+    end,
+    AddKeyValue = add,
+    Add = function (this, ...)
+      local k, v
+      if select("#", ...) == 1 then
+        local pair = ... 
+        k, v = pair.Key, pair.Value
+      else
+        k, v = ...
+      end
+      add(this, k ,v)
+    end,
+    Clear = Array.clear,
+    ContainsKey = function (this, key)
+      if key == nil then throw(ArgumentNullException("key")) end
+      local len = #this
+      if len > 0 then
+        local comparer = this.comparer
+        local equals = comparer.EqualsOf
+        for i = 1, len do
+          if equals(comparer, this[i].Key, key) then
+            return true
+          end
+        end
+      end
+      return false
+    end,
+    ContainsValue = function (this, value)
+      local len = #this
+      if len > 0 then
+        local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+        local equals = comparer.EqualsOf
+        for i = 1, #this do
+          if equals(comparer, value, this[i].Value) then
+            return true
+          end
+        end
+      end
+      return false
+    end,
+    Contains = function (this, pair)
+      local key = pair.Key
+      if key == nil then throw(ArgumentNullException("key")) end
+      local len = #this
+      if len > 0 then
+        local comparer = this.comparer
+        local equals = comparer.EqualsOf
+        for i = 1, len do
+          local t = this[i]
+          if equals(comparer, t.Key, key) then
+            local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+            if comparer:EqualsOf(t.Value, pair.Value) then
+              return true
+            end 
+          end
+        end
+      end
+      return false
+    end,
+    CopyTo = function (this, array, index)
+      local count = #this
+      checkIndexAndCount(array, index, count)
+      if count > 0 then
+        local KeyValuePair = this.__genericT__
+        index = index + 1
+        for i = 1, count do
+          local t = this[i]
+          array[index] = setmetatable({ Key = t.Key:__clone__(), Value = t.Value }, KeyValuePair)
+          index = index + 1
+        end
+      end
+    end,
+    RemoveKey = remove,
+    Remove = function (this, key)
+      if isKeyValuePair(key) then
+        local len = #this
+        local k, v = key.Key, key.Value
+        for i = 1, #this do
+          local pair = this[i]
+          if pair.Key:EqualsObj(k) then
+            local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+            if comparer:EqualsOf(pair.Value, v) then
+              tremove(this, i)
+              return true
+            end
+          end
+        end
+      end
+      return false
+    end,
+    TryGetValue = function (this, key)
+      if key == nil then throw(ArgumentNullException("key")) end
+      local len = #this
+      if len > 0 then
+        local comparer = this.comparer
+        local equals = comparer.EqualsOf
+        for i = 1, len do
+          local pair = this[i]
+          if equals(comparer, pair.Key, key) then
+            return true, pair.Value
+          end
+        end
+      end
+      return false, this.__genericTValue__:default()
+    end,
+    getComparer = function (this)
+      return this.comparer
+    end,
+    getCount = lengthFn,
+    get = function (this, key)
+      if key == nil then throw(ArgumentNullException("key")) end
+      local len = #this
+      if len > 0 then
+        local comparer = this.comparer
+        local equals = comparer.EqualsOf
+        for i = 1, len do
+          local pair = this[i]
+          if equals(comparer, pair.Key, key) then
+            return pair.Value
+          end
+        end
+      end
+      throw(KeyNotFoundException())
+    end,
+    set = function (this, key, value)
+      add(this, key, value, true)
+    end,
+    GetEnumerator = Array.GetEnumerator,
+    getKeys = function (this)
+      return ArrayDictionaryCollection(this.__genericTKey__)(this)
+    end,
+    getValues = function (this)
+      return ArrayDictionaryCollection(this.__genericTValue__)(this, true)
+    end
+  }
+end)()
+
+ArrayDictionaryFn = define("System.Collections.Generic.ArrayDictionary", function(TKey, TValue) 
+  return { 
+    base = { System.IDictionary_2(TKey, TValue), System.IDictionary, System.IReadOnlyDictionary_2(TKey, TValue) },
+    __genericT__ = KeyValuePairFn(TKey, TValue),
+    __genericTKey__ = TKey,
+    __genericTValue__ = TValue,
+  }
+end, ArrayDictionary)
+
+function System.dictionaryFromTable(t, TKey, TValue)
+  return setmetatable(t, Dictionary(TKey, TValue))
+end
+
+function System.isDictLike(t)
+  return type(t) == "table" and t.GetEnumerator == dictionaryEnumerator
+end
+
+local DictionaryFn = define("System.Collections.Generic.Dictionary", function(TKey, TValue)
+  local array, len
+  if TKey.class == 'S' and type(TKey:default()) == "table" then
+    array = ArrayDictionary
+  else
+    len = getCount
+  end
+  return { 
+    base = { System.IDictionary_2(TKey, TValue), System.IDictionary, System.IReadOnlyDictionary_2(TKey, TValue) },
+    __genericT__ = KeyValuePairFn(TKey, TValue),
+    __genericTKey__ = TKey,
+    __genericTValue__ = TValue,
+    __len = len
+  }, array
+end, Dictionary)
+
+System.Dictionary = DictionaryFn
+
+local Object = System.Object
+System.Hashtable = DictionaryFn(Object, Object)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Dictionary.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: fc265898d8760334d8238733f5a33940
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 167 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/EqualityComparer.lua.txt

@@ -0,0 +1,167 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local equalsObj = System.equalsObj
+local compareObj = System.compareObj
+local ArgumentException = System.ArgumentException
+local ArgumentNullException = System.ArgumentNullException
+
+local type = type
+
+local EqualityComparer
+EqualityComparer = define("System.EqualityComparer", function (T)
+  local equals
+  local Equals = T.Equals
+  if Equals then
+    if T.class == 'S' then
+      equals = Equals 
+    else
+      equals = function (x, y) 
+        return x:Equals(y) 
+      end 
+    end
+  else
+    equals = equalsObj
+  end
+  local function getHashCode(x)
+    if type(x) == "table" then
+      return x:GetHashCode()
+    end
+    return x
+  end
+  local defaultComparer
+  return {
+    __genericT__ = T,
+    base = { System.IEqualityComparer_1(T), System.IEqualityComparer }, 
+    getDefault = function ()
+      local comparer = defaultComparer 
+      if comparer == nil then
+        comparer = EqualityComparer(T)()
+        defaultComparer = comparer
+      end
+      return comparer
+    end,
+    EqualsOf = function (this, x, y)
+      if x ~= nil then
+        if y ~= nil then return equals(x, y) end
+        return false
+      end                 
+      if y ~= nil then return false end
+      return true
+    end,
+    GetHashCodeOf = function (this, obj)
+      if obj == nil then return 0 end
+      return getHashCode(obj)
+    end,
+    GetHashCodeObjOf = function (this, obj)
+      if obj == nil then return 0 end
+      if System.is(obj, T) then return getHashCode(obj) end
+      throw(ArgumentException("Type of argument is not compatible with the generic comparer."))
+      return false
+    end,
+    EqualsObjOf = function (this, x, y)
+      if x == y then return true end
+      if x == nil or y == nil then return false end
+      local is = System.is
+      if is(x, T) and is(y, T) then return equals(x, y) end
+      throw(ArgumentException("Type of argument is not compatible with the generic comparer."))
+      return false
+    end
+  }
+end)
+
+local function compare(this, a, b)
+  return compareObj(a, b)
+end
+
+define("System.Comparer", (function ()
+  local Comparer
+  Comparer = {
+    base = { System.IComparer },
+    static = function (this)
+      local default = Comparer()
+      this.Default = default
+      this.DefaultInvariant = default
+    end,
+    Compare = compare
+  }
+  return Comparer
+end)())
+
+local Comparer, ComparisonComparer
+
+ComparisonComparer = define("System.ComparisonComparer", function (T)
+  return {
+    base = { Comparer(T) },
+    __ctor__ = function (this, comparison)
+      this.comparison = comparison
+    end,
+    Compare = function (this, x, y)
+      return this.comparison(x, y)
+    end
+  }
+end)
+
+Comparer = define("System.Comparer_1", function (T)
+  local Compare
+  local compareTo = T.CompareTo
+  if compareTo then
+    if T.class ~= 'S' then
+      compareTo = function (x, y)
+        return x:CompareTo(y)
+      end
+    end
+    Compare = function (this, x, y)
+      if x ~= nil then
+        if y ~= nil then 
+          return compareTo(x, y) 
+        end
+        return 1
+      end                 
+      if y ~= nil then return -1 end
+      return 0
+    end
+  else
+    Compare = compare
+  end
+
+  local defaultComparer
+  local function getDefault()
+    local comparer = defaultComparer 
+    if comparer == nil then
+      comparer = Comparer(T)()
+      defaultComparer = comparer
+    end
+    return comparer
+  end
+
+  local function Create(comparison)
+    if comparison == nil then throw(ArgumentNullException("comparison")) end
+    return ComparisonComparer(T)(comparison)
+  end
+
+  return {
+    __genericT__ = T,
+    base = { System.IComparer_1(T), System.IComparer }, 
+    getDefault = getDefault,
+    getDefaultInvariant = getDefault,
+    Compare = Compare,
+    Create = Create
+  }
+end)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/EqualityComparer.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c527cf6238609b949b0cec196a4f3101
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 316 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/HashSet.lua.txt

@@ -0,0 +1,316 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local throw = System.throw
+local each = System.each
+local Dictionary = System.Dictionary
+local wrap = System.wrap
+local unWrap = System.unWrap
+local getEnumerator = Dictionary.GetEnumerator 
+local ArgumentNullException = System.ArgumentNullException
+
+local assert = assert
+local pairs = pairs
+local select = select
+
+local counts = System.counts
+
+local function build(this, collection, comparer)
+  if comparer ~= nil then
+    assert(false)
+  end
+  if collection == nil then
+    throw(ArgumentNullException("collection"))
+  end
+  this:UnionWith(collection)
+end
+
+local function checkUniqueAndUnfoundElements(this, other, returnIfUnfound)
+  if #this == 0 then
+    local numElementsInOther = 0
+    for _, item in each(other) do
+      numElementsInOther = numElementsInOther + 1
+      break
+    end
+    return 0, numElementsInOther
+  end
+  local set, uniqueCount, unfoundCount = {}, 0, 0
+  for _, item in each(other) do
+    item = wrap(item)
+      if this[item] ~= nil then
+        if set[item] == nil then
+          set[item] = true
+          uniqueCount = uniqueCount + 1
+        end
+      else
+      unfoundCount = unfoundCount + 1
+      if returnIfUnfound then
+        break
+      end
+    end
+  end
+  return uniqueCount, unfoundCount
+end
+
+local HashSet = {
+  __ctor__ = function (this, ...)
+    local len = select("#", ...)
+    if len == 0 then
+    elseif len == 1 then
+      local collection = ...
+      if collection == nil then return end
+      if collection.getEnumerator ~= nil then
+        build(this, collection, nil)
+      else
+        assert(true)
+      end
+    else 
+      build(this, ...)
+    end
+  end,
+  Clear = Dictionary.Clear,
+  getCount = Dictionary.getCount,
+  getIsReadOnly = System.falseFn,
+  Contains = function (this, item)
+    item = wrap(item)
+    return this[item] ~= nil
+  end,
+  Remove = function (this, item)
+    item = wrap(item)
+    if this[item] then
+      this[item] = nil
+      local t = counts[this]
+      t[1] = t[1] - 1
+      t[2] = t[2] + 1
+      return true
+    end
+    return false
+  end,
+  GetEnumerator = function (this)
+    return getEnumerator(this, 1)
+  end,
+  Add = function (this, v)
+    v = wrap(v)
+    if this[v] == nil then
+      this[v] = true
+      local t = counts[this]
+      if t then
+        t[1] = t[1] + 1
+        t[2] = t[2] + 1
+      else
+        counts[this] = { 1, 1 }
+      end
+      return true
+    end
+    return false
+  end,
+  UnionWith = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local count = 0
+    for _, v in each(collection) do
+      v = wrap(v)
+      if this[v] == nil then
+        this[v] = true
+        count = count + 1
+      end
+    end
+    if count > 0 then
+      local t = counts[this]
+      if t then
+        t[1] = t[1] + count
+        t[2] = t[2] + 1
+      else
+        counts[this] = { count, 1 }  
+      end
+    end
+  end,
+  IntersectWith = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local set = {}
+    for _, v in each(other) do
+      v = wrap(v)
+      if this[v] ~= nil then
+        set[v] = true
+      end
+    end
+    local count = 0
+    for v, _ in pairs(this) do
+      if set[v] == nil then
+        this[v] = nil
+        count = count + 1
+      end
+    end
+    if count > 0 then
+      local t = counts[this]
+      t[1] = t[1] - count
+      t[2] = t[2] + 1
+    end
+  end,
+  ExceptWith = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    if other == this then
+      this:Clear()
+      return
+    end
+    local count = 0
+    for _, v in each(other) do
+      v = wrap(v)
+      if this[v] ~= nil then
+        this[v] = nil
+        count = count + 1
+      end
+    end
+    if count > 0 then
+      local t = counts[this]
+      t[1] = t[1] - count
+      t[2] = t[2] + 1
+    end
+  end,
+  SymmetricExceptWith = function (this, other)
+    if other == nil then throw(ArgumentNullException("other")) end
+    if other == this then
+      this:Clear()
+      return
+    end
+    local set = {}
+    local count = 0
+    local changed = false
+    for _, v in each(other) do
+      v = wrap(v)
+      if this[v] == nil then
+        this[v] = true
+        count = count + 1
+        changed = true
+        set[v] = true
+      elseif set[v] == nil then 
+        this[v] = nil
+        count = count - 1
+        changed = true
+      end
+    end
+    if changed then
+      local t = counts[this]
+      if t then
+        t[1] = t[1] + count
+        t[2] = t[2] + 1
+      else
+        counts[this] = { count, 1 }
+      end
+    end
+  end,
+  IsSubsetOf = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local count = #this
+    if count == 0 then
+      return true
+    end
+    local uniqueCount, unfoundCount = checkUniqueAndUnfoundElements(this, other, false)
+    return uniqueCount == count and unfoundCount >= 0
+  end,
+  IsProperSubsetOf = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local uniqueCount, unfoundCount = checkUniqueAndUnfoundElements(this, other, false)
+    return uniqueCount == #this and unfoundCount > 0
+  end,
+  IsSupersetOf = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    for _, element in each(other) do
+      element = wrap(element)
+      if this[element] == nil then
+        return false
+      end
+    end
+    return true
+  end,
+  IsProperSupersetOf = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local count = #this
+    if count == 0 then
+      return false
+    end
+    local uniqueCount, unfoundCount = checkUniqueAndUnfoundElements(this, other, true)
+    return uniqueCount < count and unfoundCount == 0
+  end,
+  Overlaps = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    if #this == 0 then
+      return false
+    end
+    for _, element in each(other) do
+      element = wrap(element)
+      if this[element] ~= nil then
+        return true
+      end
+    end
+    return false
+  end,
+  SetEquals = function (this, other)
+    if other == nil then
+      throw(ArgumentNullException("other"))
+    end
+    local uniqueCount, unfoundCount = checkUniqueAndUnfoundElements(this, other, true)
+    return uniqueCount == #this and unfoundCount == 0
+  end,
+  RemoveWhere = function (this, match)
+    if match == nil then
+      throw(ArgumentNullException("match"))
+    end
+    local numRemoved = 0
+    for v, _ in pairs(this) do
+      if match(unWrap(v)) then
+        this[v] = nil
+        numRemoved = numRemoved + 1
+      end
+    end
+    if numRemoved > 0 then
+      local t = counts[this]
+      t[1] = t[1] - numRemoved
+      t[2] = t[2] + 1
+    end
+    return numRemoved
+  end,
+  TrimExcess = System.emptyFn
+}
+
+function System.hashSetFromTable(t, T)
+  return setmetatable(t, HashSet(T))
+end
+
+System.HashSet = System.define("System.Collections.Generic.HashSet", function(T) 
+  return { 
+    base = { System.ICollection_1(T), System.ISet_1(T) }, 
+    __genericT__ = T,
+    __genericTKey__ = T,
+    __len = HashSet.getCount
+  }
+end, HashSet)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/HashSet.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4a464aedab59c644b8228aabf54d8a07
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 346 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/LinkedList.lua.txt

@@ -0,0 +1,346 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local each = System.each
+local checkIndexAndCount = System.checkIndexAndCount
+local ArgumentNullException = System.ArgumentNullException
+local InvalidOperationException = System.InvalidOperationException
+local EqualityComparer = System.EqualityComparer
+
+local setmetatable = setmetatable
+local select = select
+
+local LinkedListNode = define("System.Collections.Generic.LinkedListNode", {
+  __ctor__ = function (this, value)
+    this.Value = value
+  end,
+  getNext = function (this)
+    local next = this.next
+    if next == nil or next == this.List.head then
+      return nil
+    end
+    return next
+  end,
+  getPrevious = function (this)
+    local prev = this.prev
+    if prev == nil or this == this.List.head then
+      return nil
+    end
+    return prev
+  end
+})
+System.LinkedListNode = LinkedListNode
+
+local function newLinkedListNode(list, value)
+  return setmetatable({ List = assert(list), Value = value }, LinkedListNode)
+end
+
+local function vaildateNewNode(this, node)
+  if node == nil then
+    throw(ArgumentNullException("node"))
+  end
+  if node.List ~= nil then
+    throw(InvalidOperationException("ExternalLinkedListNode"))
+  end
+end
+
+local function vaildateNode(this, node)
+  if node == nil then
+    throw(ArgumentNullException("node"))
+  end
+  if node.List ~= this then
+    throw(InvalidOperationException("ExternalLinkedListNode"))
+  end
+end
+
+local function insertNodeBefore(this, node, newNode)
+  newNode.next = node
+  newNode.prev = node.prev
+  node.prev.next = newNode
+  node.prev = newNode
+  this.Count = this.Count + 1
+  this.version = this.version + 1
+end
+
+local function insertNodeToEmptyList(this, newNode)
+  newNode.next = newNode
+  newNode.prev = newNode
+  this.head = newNode
+  this.Count = this.Count + 1
+  this.version = this.version + 1
+end
+
+local function invalidate(this)
+  this.List = nil
+  this.next = nil
+  this.prev = nil
+end
+
+local function remvoeNode(this, node)
+  if node.next == node then
+    this.head = nil
+  else
+    node.next.prev = node.prev
+    node.prev.next = node.next
+    if this.head == node then
+      this.head = node.next
+    end
+  end
+  invalidate(node)
+  this.Count = this.Count - 1
+  this.version = this.version + 1
+end
+
+local LinkedListEnumerator = { 
+  __index = false,
+  getCurrent = System.getCurrent, 
+  Dispose = System.emptyFn,
+  MoveNext = function (this)
+    local list = this.list
+    local node = this.node
+    if this.version ~= list.version then
+      System.throwFailedVersion()
+    end
+    if node == nil then
+      return false
+    end
+    this.current = node.Value
+    node = node.next
+    if node == list.head then
+      node = nil
+    end
+    this.node = node
+    return true
+  end
+}
+LinkedListEnumerator.__index = LinkedListEnumerator
+
+local LinkedList = { 
+  Count = 0, 
+  version = 0,
+  __ctor__ = function (this, ...)
+    local len = select("#", ...)
+    if len == 1 then
+      local collection = ...
+      if collection == nil then
+        throw(ArgumentNullException("collection"))
+      end
+      for _, item in each(collection) do
+        this:AddLast(item)
+      end
+    end
+  end,
+  getCount = function (this)
+    return this.Count
+  end,
+  getFirst = function(this)    
+    return this.head
+  end,
+  getLast = function (this)
+    local head = this.head
+    return head ~= nil and head.prev or nil
+  end,
+  AddAfterNode = function (this, node, newNode)
+    vaildateNode(this, node)
+    vaildateNewNode(this, newNode)
+    insertNodeBefore(this, node.next, newNode)
+    newNode.List = this
+  end,
+  AddAfter = function (this, node, value)    
+    vaildateNode(this, node)
+    local result = newLinkedListNode(node.List, value)
+    insertNodeBefore(this, node.next, result)
+    return result
+  end,
+  AddBeforeNode = function (this, node, newNode)
+    vaildateNode(this, node)
+    vaildateNewNode(this, newNode)
+    insertNodeBefore(this, node, newNode)
+    newNode.List = this
+    if node == this.head then
+      this.head = newNode
+    end
+  end,
+  AddBefore = function (this, node, value)
+    vaildateNode(this, node)
+    local result = newLinkedListNode(node.List, value)
+    insertNodeBefore(this, node, result)
+    if node == this.head then
+      this.head = result
+    end
+    return result
+  end,
+  AddFirstNode = function (this, node)
+	  vaildateNewNode(this, node)
+    if this.head == nil then
+      insertNodeToEmptyList(this, node)
+    else
+      insertNodeBefore(this, this.head, node)
+      this.head = node
+    end
+    node.List = this
+  end,
+  AddFirst = function (this, value)
+    local result = newLinkedListNode(this, value)
+    if this.head == nil then
+      insertNodeToEmptyList(this, result)
+    else
+      insertNodeBefore(this, this.head, result)
+      this.head = result
+    end
+    return result
+  end,
+  AddLastNode = function (this, node)
+    vaildateNewNode(this, node)
+    if this.head == nil then
+      insertNodeToEmptyList(this, node)
+    else
+      insertNodeBefore(this, this.head, node)
+    end
+    node.List = this
+  end,
+  AddLast = function (this, value)
+    local result = newLinkedListNode(this, value)
+    if this.head == nil then
+      insertNodeToEmptyList(this, result)
+    else
+      insertNodeBefore(this, this.head, result)
+    end
+    return result
+  end,
+  Clear = function (this)
+    local current = this.head
+    while current ~= nil do
+      local temp = current
+      current = current.next
+      invalidate(temp)
+    end
+    this.head = nil
+    this.Count = 0
+    this.version = this.version + 1
+  end,
+  Contains = function (this, value)
+    return this:Find(value) ~= nil
+  end,
+  CopyTo = function (this, array, index)
+    checkIndexAndCount(array, index, this.Count)
+    local head = this.head
+    local node = head
+    if node then
+      index = index + 1
+      repeat
+        local value = node.Value
+        if value == nil then value = System.null end
+        array[index] = value
+        index = index + 1
+        node = node.next
+      until node == head
+    end
+  end,
+  Find = function (this, value)     
+    local head = this.head
+    local node = head
+    local comparer = EqualityComparer(this.__genericT__).getDefault()
+    local equals = comparer.EqualsOf
+    if node ~= nil then
+      if value ~= nil then
+        repeat
+          if equals(comparer, node.Value, value) then
+            return node
+          end
+          node = node.next
+        until node == head
+      else
+        repeat 
+          if node.Value == nil then
+            return node
+          end
+          node = node.next
+        until node == head
+      end
+    end
+    return nil
+  end,
+  FindLast = function (this, value)
+    local head = this.head
+    if head == nil then return nil end
+    local last = head.prev
+    local node = last
+    local comparer = EqualityComparer(this.__genericT__).getDefault()
+    local equals = comparer.EqualsOf
+    if node ~= nil then
+      if value ~= nil then
+        repeat
+          if equals(comparer, node.Value, value) then
+            return node
+          end
+          node = node.prev
+        until node == last
+      else
+        repeat 
+          if node.Value == nil then
+            return node
+          end
+          node = node.prev
+         until node == last
+      end
+    end
+    return nil
+  end,
+  RemoveNode = function (this, node)
+    vaildateNode(this, node)
+    remvoeNode(this, node)
+  end,
+  Remove = function (this, node)
+    node = this:Find(node)
+    if node ~= nil then
+      remvoeNode(this, node)
+    end
+    return false
+  end,
+  RemoveFirst = function (this)
+    local head = this.head
+    if head == nil then
+      throw(InvalidOperationException("LinkedListEmpty"))
+    end
+    remvoeNode(this, head)
+  end,
+  RemoveLast = function (this)
+    local head = this.head
+    if head == nil then
+      throw(InvalidOperationException("LinkedListEmpty"))
+    end
+    remvoeNode(this, head.prev)
+  end,
+  GetEnumerator = function (this)
+    return setmetatable({ list = this, version = this.version, node = this.head }, LinkedListEnumerator)
+  end
+}
+
+function System.linkedListFromTable(t, T)
+  return setmetatable(t, LinkedList(T))
+end
+
+System.LinkedList = define("System.Collections.Generic.LinkedList", function(T) 
+  return { 
+  base = { System.ICollection_1(T), System.ICollection }, 
+  __genericT__ = T,
+  __len = LinkedList.getCount
+  }
+end, LinkedList)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/LinkedList.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 3970e23ba972aa3409ec86da4f7af85f
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1282 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Linq.lua.txt

@@ -0,0 +1,1282 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local each = System.each
+local identityFn = System.identityFn
+local wrap = System.wrap
+local unWrap = System.unWrap
+local is = System.is
+local cast = System.cast
+local Int32 = System.Int32
+local isArrayLike = System.isArrayLike
+local isDictLike = System.isDictLike
+local Array = System.Array
+local arrayEnumerator = Array.GetEnumerator
+
+local NullReferenceException = System.NullReferenceException
+local ArgumentNullException = System.ArgumentNullException
+local ArgumentOutOfRangeException = System.ArgumentOutOfRangeException
+local InvalidOperationException = System.InvalidOperationException
+local EqualityComparer = System.EqualityComparer
+local Comparer_1 = System.Comparer_1
+local Empty = System.Array.Empty
+
+local IEnumerable_1 = System.IEnumerable_1
+local IEnumerable = System.IEnumerable
+local IEnumerator_1 = System.IEnumerator_1
+local IEnumerator = System.IEnumerator
+
+local assert = assert
+local getmetatable = getmetatable
+local setmetatable = setmetatable
+local select = select
+local pairs = pairs
+local tsort = table.sort
+
+local InternalEnumerable = define("System.Linq.InternalEnumerable", function(T) 
+  return {
+    base = { IEnumerable_1(T) }
+  }
+end)
+
+local function createEnumerable(T, GetEnumerator)
+  assert(T)
+  return setmetatable({ __genericT__ = T, GetEnumerator = GetEnumerator }, InternalEnumerable(T))
+end
+
+local InternalEnumerator = define("System.Linq.InternalEnumerator", function(T) 
+  return {
+    base = { IEnumerator_1(T) }
+  }
+end)
+
+local function createEnumerator(T, source, tryGetNext, init)
+  assert(T)
+  local state = 1
+  local current
+  local en
+  return setmetatable({
+    MoveNext = function()
+      if state == 1 then
+        state = 2
+        if source then
+          en = source:GetEnumerator() 
+        end
+        if init then
+          init(en) 
+        end
+      end
+      if state == 2 then
+        local ok, v = tryGetNext(en)
+        if ok then
+          current = v
+          return true
+        elseif en then
+          local dispose = en.Dispose
+          if dispose then
+            dispose(en)
+          end    
+        end
+       end
+       return false
+    end,
+    getCurrent = function()
+      return current
+    end
+  }, InternalEnumerator(T))
+end
+
+local Enumerable = {}
+define("System.Linq.Enumerable", Enumerable)
+
+function Enumerable.Where(source, predicate)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if predicate == nil then throw(ArgumentNullException("predicate")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function() 
+    local index = -1
+    return createEnumerator(T, source, function(en)
+      while en:MoveNext() do
+        local current = en:getCurrent()
+        index = index + 1
+        if predicate(current, index) then
+          return true, current
+        end
+      end 
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Select(source, selector, T)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if selector == nil then throw(ArgumentNullException("selector")) end
+  return createEnumerable(T, function()
+    local index = -1
+    return createEnumerator(T, source, function(en) 
+      if en:MoveNext() then
+        index = index + 1
+        return true, selector(en:getCurrent(), index)
+      end
+      return false
+    end)
+  end)
+end
+
+local function selectMany(source, collectionSelector, resultSelector, T)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if collectionSelector == nil then throw(ArgumentNullException("collectionSelector")) end
+  if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+  return createEnumerable(T, function() 
+    local element, midEn
+    local index = -1
+    return createEnumerator(T, source, function(en) 
+      while true do
+        if midEn and midEn:MoveNext() then
+          return true, resultSelector(element, midEn:getCurrent())
+        else
+          if not en:MoveNext() then return false end
+          index = index + 1
+          local current = en:getCurrent()
+          midEn = collectionSelector(current, index):GetEnumerator()
+          if midEn == nil then
+            throw(NullReferenceException())
+          end
+          element = current
+        end  
+      end
+    end)
+  end)
+end
+
+local function identityFnOfSelectMany(s, x)
+  return x
+end
+
+function Enumerable.SelectMany(source, ...)
+  local len = select("#", ...)
+  if len == 2 then
+    local collectionSelector, T = ...
+    return selectMany(source, collectionSelector, identityFnOfSelectMany, T)
+  else
+    return selectMany(source, ...)
+  end
+end
+
+function Enumerable.Take(source, count)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    return createEnumerator(T, source, function(en)
+      if count > 0 then
+        if en:MoveNext() then
+          count = count - 1
+          return true, en:getCurrent()
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.TakeWhile(source, predicate)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if predicate == nil then throw(ArgumentNullException("predicate")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    local index = -1
+    return createEnumerator(T, source, function(en)
+      if en:MoveNext() then
+        local current = en:getCurrent()
+        index = index + 1
+        if not predicate(current, index) then
+          return false
+        end
+        return true, current
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Skip(source, count)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    return createEnumerator(T, source, function(en)
+      while count > 0 and en:MoveNext() do count = count - 1 end
+      if count <= 0 then
+        if en:MoveNext() then
+          return true, en:getCurrent() 
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.SkipWhile(source, predicate)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if predicate == nil then throw(ArgumentNullException("predicate")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    local index = -1
+    local isSkipEnd = false
+    return createEnumerator(T, source, function(en)
+      while not isSkipEnd do
+        if en:MoveNext() then
+          local current = en:getCurrent()
+          index = index + 1
+          if not predicate(current, index) then
+            isSkipEnd = true
+            return true, current
+          end     
+        else 
+          return false
+        end
+      end
+      if en:MoveNext() then
+        return true, en:getCurrent()
+      end
+      return false
+    end)
+  end)
+end
+
+local IGrouping = System.defInf("System.Linq.IGrouping_2", function (TKey, TElement)
+  return {
+    base = { IEnumerable_1(TElement) } 
+  }
+end)
+
+local Grouping = define("System.Linq.Grouping", function (TKey, TElement)
+  return {
+    __genericT__ = TElement,
+    base = { IGrouping(TKey, TElement) },
+    GetEnumerator = arrayEnumerator,
+    getKey = function (this)
+      return this.key
+    end,
+    getCount = function (this)
+      return #this
+    end
+  }
+end)
+
+local function getGrouping(this, key)
+  local hashCode = this.comparer:GetHashCodeOf(key)
+  local groupIndex = this.indexs[hashCode]
+  return this.groups[groupIndex]
+end
+
+local Lookup = {
+  __ctor__ = function (this, comparer)
+    this.comparer = comparer or EqualityComparer(this.__genericTKey__).getDefault()
+    this.groups = {}
+    this.indexs = {}
+  end,
+  get = function (this, key)
+    local grouping = getGrouping(this, key)
+    if grouping ~= nil then return grouping end 
+    return Empty(this.__genericTElement__)
+  end,
+  GetCount = function (this)
+    return #this.groups
+  end,
+  Contains = function (this, key)
+    return getGrouping(this, key) ~= nil
+  end,
+  GetEnumerator = function (this)
+    return arrayEnumerator(this.groups, IGrouping)
+  end
+}
+
+local LookupFn = define("System.Linq.Lookup", function(TKey, TElement)
+  local cls = {
+    __genericTKey__ = TKey,
+    __genericTElement__ = TElement,
+  }
+  return cls
+end, Lookup)
+
+local function addToLookup(this, key, value)
+  local hashCode = this.comparer:GetHashCodeOf(key)
+  local groupIndex = this.indexs[hashCode]
+  local group
+  if groupIndex == nil then
+	  groupIndex = #this.groups + 1
+	  this.indexs[hashCode] = groupIndex
+	  group = setmetatable({ key = key }, Grouping(this.__genericTKey__, this.__genericTElement__))
+	  this.groups[groupIndex] = group
+  else
+	  group = this.groups[groupIndex]
+	  assert(group)
+  end
+  group[#group + 1] = wrap(value)
+end
+
+local function createLookup(source, keySelector, elementSelector, comparer, TKey, TElement)
+  local lookup = LookupFn(TKey, TElement)(comparer)
+  for _, item in each(source) do
+    addToLookup(lookup, keySelector(item), elementSelector(item))
+  end
+  return lookup
+end
+
+local function createLookupForJoin(source, keySelector, comparer, TKey, TElement)
+  local lookup = LookupFn(TKey, TElement)(comparer)
+  for _, item in each(source) do
+    local key = keySelector(item)
+    if key ~= nil then
+      addToLookup(lookup, key, item)
+    end
+  end
+  return lookup
+end
+
+function Enumerable.Join(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, TKey, TResult)
+  if outer == nil then throw(ArgumentNullException("outer")) end
+  if inner == nil then throw(ArgumentNullException("inner")) end
+  if outerKeySelector == nil then throw(ArgumentNullException("outerKeySelector")) end
+  if innerKeySelector == nil then throw(ArgumentNullException("innerKeySelector")) end
+  if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+  local lookup = createLookupForJoin(inner, innerKeySelector, comparer, TKey, inner.__genericT__)
+  return createEnumerable(TResult, function ()
+    local item, grouping, index
+    return createEnumerator(TResult, outer, function (en)
+      while true do
+        if grouping ~= nil then
+          index = index + 1
+          if index < #grouping then
+            return true, resultSelector(item, unWrap(grouping[index + 1]))
+          end
+        end
+        if not en:MoveNext() then return false end
+        local current = en:getCurrent()
+        item = current
+        grouping = getGrouping(lookup, outerKeySelector(current))
+        index = -1
+      end
+    end)
+  end)
+end
+
+function Enumerable.GroupJoin(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer, TKey, TResult)
+  if outer == nil then throw(ArgumentNullException("outer")) end
+  if inner == nil then throw(ArgumentNullException("inner")) end
+  if outerKeySelector == nil then throw(ArgumentNullException("outerKeySelector")) end
+  if innerKeySelector == nil then throw(ArgumentNullException("innerKeySelector")) end
+  if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+  local lookup = createLookupForJoin(inner, innerKeySelector, comparer, TKey, inner.__genericT__)
+  return createEnumerable(TResult, function ()
+    return createEnumerator(TResult, outer, function (en)
+      if en:MoveNext() then
+        local item = en:getCurrent()
+        return true, resultSelector(item, lookup:get(outerKeySelector(item)))
+      end
+      return false
+    end)
+  end)
+end
+
+local function ordered(source, compare)
+  local T = source.__genericT__
+  local orderedEnumerable = createEnumerable(T, function()
+    local t = {}
+    local index = 0
+    return createEnumerator(T, source, function() 
+      index = index + 1
+      local v = t[index]
+      if v ~= nil then
+        return true, unWrap(v)
+      end
+      return false
+    end, 
+    function() 
+      local count = 1
+      if isDictLike(source) then
+        for k, v in pairs(source) do
+          t[count] = setmetatable({ Key = k, Value = v }, T)
+          count = count + 1
+        end
+      else
+        for _, v in each(source) do
+          t[count] = wrap(v)
+          count = count + 1
+        end
+      end
+      if count > 1 then
+        tsort(t, function(x, y)
+          return compare(unWrap(x), unWrap(y)) < 0 
+        end)
+      end
+    end)
+  end)
+  orderedEnumerable.source = source
+  orderedEnumerable.compare = compare
+  return orderedEnumerable
+end
+
+local function orderBy(source, keySelector, comparer, TKey, descending)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if comparer == nil then comparer = Comparer_1(TKey).getDefault() end 
+  local keys = {}
+  local function getKey(t) 
+    local k = keys[t]
+    if k == nil then
+      k = keySelector(t)
+      keys[t] = k
+    end
+    return k
+  end
+  local c = comparer.Compare
+  local compare
+  if descending then
+    compare = function(x, y)
+      return -c(comparer, getKey(x), getKey(y))
+    end
+  else
+    compare = function(x, y)
+      return c(comparer, getKey(x), getKey(y))
+    end
+  end
+  return ordered(source, compare)
+end
+
+function Enumerable.OrderBy(source, keySelector, comparer, TKey)
+  return orderBy(source, keySelector, comparer, TKey, false)
+end
+
+function Enumerable.OrderByDescending(source, keySelector, comparer, TKey)
+  return orderBy(source, keySelector, comparer, TKey, true)
+end
+
+local function thenBy(source, keySelector, comparer, TKey, descending)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if comparer == nil then comparer = Comparer_1(TKey).getDefault() end
+  local keys = {}
+  local function getKey(t) 
+    local k = keys[t]
+    if k == nil then
+      k = keySelector(t)
+      keys[t] = k
+    end
+    return k
+  end
+  local c = comparer.Compare
+  local compare
+  local parentSource, parentCompare = source.source, source.compare
+  if descending then
+    compare = function(x, y)
+      local v = parentCompare(x, y)
+      if v ~= 0 then
+        return v
+      else
+        return -c(comparer, getKey(x), getKey(y))
+      end
+    end
+  else
+    compare = function(x, y)
+      local v = parentCompare(x, y)
+      if v ~= 0 then
+        return v
+      else
+        return c(comparer, getKey(x), getKey(y))
+      end
+    end
+  end
+  return ordered(parentSource, compare)
+end
+
+function Enumerable.ThenBy(source, keySelector, comparer, TKey)
+  return thenBy(source, keySelector, comparer, TKey, false)
+end
+
+function Enumerable.ThenByDescending(source, keySelector, comparer, TKey)
+  return thenBy(source, keySelector, comparer, TKey, true)
+end
+
+local function groupBy(source, keySelector, elementSelector, comparer, TKey, TElement)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if elementSelector == nil then throw(ArgumentNullException("elementSelector")) end
+  return createEnumerable(IGrouping, function()
+    return createLookup(source, keySelector, elementSelector, comparer, TKey, TElement):GetEnumerator()
+  end)
+end
+
+function Enumerable.GroupBy(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 2 then
+    local keySelector, TKey = ...
+    return groupBy(source, keySelector, identityFn, nil, TKey, source.__genericT__)
+  elseif len == 3 then
+    local keySelector, comparer, TKey = ...
+    return groupBy(source, keySelector, identityFn, comparer, TKey, source.__genericT__)
+  elseif len == 4 then
+    local keySelector, elementSelector, TKey, TElement = ...
+    return groupBy(source, keySelector, elementSelector, nil, TKey, TElement)
+  else
+    return groupBy(source, ...)
+  end
+end
+
+local function groupBySelect(source, keySelector, elementSelector, resultSelector, comparer, TKey, TElement, TResult)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if elementSelector == nil then throw(ArgumentNullException("elementSelector")) end
+  if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+  return createEnumerable(TResult, function()
+    local lookup = createLookup(source, keySelector, elementSelector, comparer, TKey, TElement)
+    return createEnumerator(TResult, lookup, function(en)
+      if en:MoveNext() then
+        local current = en:getCurrent()
+        return resultSelector(current.key, current)
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.GroupBySelect(source, ...)
+  local len = select("#", ...)
+  if len == 4 then
+    local keySelector, resultSelector, TKey, TResult = ...
+    return groupBySelect(source, keySelector, identityFn, resultSelector, nil, TKey, source.__genericT__, TResult)
+  elseif len == 5 then
+    local keySelector, resultSelector, comparer, TKey, TResult = ...
+    return groupBySelect(source, keySelector, identityFn, resultSelector, comparer, TKey, source.__genericT__, TResult)
+  elseif len == 6 then
+    local keySelector, elementSelector, resultSelector, TKey, TElement, TResult = ...
+    return groupBySelect(source, keySelector, elementSelector, resultSelector, nil, TKey, TElement, TResult)
+  else
+    return groupBySelect(source, ...)
+  end
+end
+
+function Enumerable.Concat(first, second)
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  local T = first.__genericT__
+  return createEnumerable(T, function()
+    local secondEn
+    return createEnumerator(T, first, function(en)
+      if secondEn == nil then
+        if en:MoveNext() then
+          return true, en:getCurrent()
+        end
+        secondEn = second:GetEnumerator()
+      end
+      if secondEn:MoveNext() then
+        return true, secondEn:getCurrent()
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Zip(first, second, resultSelector, TResult) 
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+  return createEnumerable(TResult, function()
+    local e2
+    return createEnumerator(TResult, first, function(e1)
+      if e1:MoveNext() and e2:MoveNext() then
+          return true, resultSelector(e1:getCurrent(), e2:getCurrent())
+      end
+    end, 
+    function()
+      e2 = second:GetEnumerator()
+    end)
+  end)
+end
+
+local function addToSet(set, v, getHashCode, comparer)
+  local hashCode = getHashCode(comparer, v)
+  if set[hashCode] == nil then
+    set[hashCode] = true
+    return true
+  end
+  return false
+end
+
+local function removeFromSet(set, v, getHashCode, comparer)
+  local hashCode = getHashCode(comparer, v)
+  if set[hashCode] ~= nil then
+    set[hashCode] = nil
+    return true
+  end
+  return false
+end
+
+local function getComparer(source, comparer)
+  return comparer or EqualityComparer(source.__genericT__).getDefault()
+end
+
+function Enumerable.Distinct(source, comparer)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    local set = {}
+    comparer = getComparer(source, comparer)
+    local getHashCode = comparer.GetHashCodeOf
+    return createEnumerator(T, source, function(en)
+      while en:MoveNext() do
+        local current = en:getCurrent()
+        if addToSet(set, current, getHashCode, comparer) then
+          return true, current  
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Union(first, second, comparer)
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  local T = first.__genericT__
+  return createEnumerable(T, function()
+    local set = {}
+    comparer = getComparer(first, comparer)
+    local getHashCode = comparer.GetHashCodeOf
+    local secondEn
+    return createEnumerator(T, first, function(en)
+      if secondEn == nil then
+        while en:MoveNext() do
+          local current = en:getCurrent()
+          if addToSet(set, current, getHashCode, comparer) then
+            return true, current  
+          end
+        end
+        secondEn = second:GetEnumerator()
+      end
+      while secondEn:MoveNext() do
+        local current = secondEn:getCurrent()
+        if addToSet(set, current, getHashCode, comparer) then
+          return true, current  
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Intersect(first, second, comparer)
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  local T = first.__genericT__
+  return createEnumerable(T, function()
+    local set = {}
+    comparer = getComparer(first, comparer)
+    local getHashCode = comparer.GetHashCodeOf
+    return createEnumerator(T, first, function(en)
+      while en:MoveNext() do
+        local current = en:getCurrent()
+        if removeFromSet(set, current, getHashCode, comparer) then
+          return true, current
+        end
+      end
+      return false
+    end,
+    function()
+      for _, v in each(second) do
+        addToSet(set, v, getHashCode, comparer)
+      end
+    end)
+  end) 
+end
+
+function Enumerable.Except(first, second, comparer)
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  local T = first.__genericT__
+  return createEnumerable(T, function()
+    local set = {}
+    comparer = getComparer(first, comparer)
+    local getHashCode = comparer.GetHashCodeOf
+    return createEnumerator(T, first, function(en) 
+      while en:MoveNext() do
+        local current = en:getCurrent()
+        if addToSet(set, current, getHashCode, comparer) then
+          return true, current  
+        end
+      end
+      return false
+    end,
+    function()
+      for _, v in each(second) do
+        addToSet(set, v, getHashCode, comparer)
+      end
+    end)
+  end)
+end
+
+function Enumerable.Reverse(source)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local T = source.__genericT__
+  return createEnumerable(T, function()
+    local t = {}    
+    local index
+    return createEnumerator(T, nil, function() 
+      if index > 1 then
+        index = index - 1
+        return true, t[index]
+      end
+      return false
+    end,
+    function()
+      local count = 1
+      for _, v in each(source) do
+        t[count] = v
+        count = count + 1
+      end  
+      index = count
+    end)
+  end)
+end
+
+function Enumerable.SequenceEqual(first, second, comparer)
+  if first == nil then throw(ArgumentNullException("first")) end
+  if second == nil then throw(ArgumentNullException("second")) end
+  comparer = getComparer(first, comparer)
+  local equals = comparer.EqualsOf
+  local e1 = first:GetEnumerator()
+  local e2 = second:GetEnumerator()
+  while e1:MoveNext() do
+    if not(e2:MoveNext() and equals(comparer, e1:getCurrent(), e2:getCurrent())) then
+      return false
+    end
+  end
+  if e2:MoveNext() then
+    return false
+  end
+  return true
+end
+
+Enumerable.ToArray = Array.toArray
+
+function Enumerable.ToList(source)
+  return System.List(source.__genericT__)(source)
+end
+
+local function toDictionary(source, keySelector, elementSelector, comparer, TKey, TValue)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if elementSelector == nil then throw(ArgumentNullException("elementSelector")) end
+  local dict = System.Dictionary(TKey, TValue)(comparer)
+  for _, v in each(source) do
+    dict:Add(keySelector(v), elementSelector(v))
+  end
+  return dict
+end
+
+function Enumerable.ToDictionary(source, ...)
+  local len = select("#", ...)
+  if len == 2 then
+    local keySelector, TKey = ...
+    return toDictionary(source, keySelector, identityFn, nil, TKey, source.__genericT__)
+  elseif len == 3 then
+    local keySelector, comparer, TKey = ...
+    return toDictionary(source, keySelector, identityFn, comparer, TKey, source.__genericT__)
+  elseif len == 4 then
+    local keySelector, elementSelector, TKey, TElement = ...
+    return toDictionary(source, keySelector, elementSelector, nil, TKey, TElement)
+  else
+    return toDictionary(source, ...)
+  end
+end
+
+local function toLookup(source, keySelector, elementSelector, comparer, TKey, TElement )
+  if source == nil then throw(ArgumentNullException("source")) end
+  if keySelector == nil then throw(ArgumentNullException("keySelector")) end
+  if elementSelector == nil then throw(ArgumentNullException("elementSelector")) end
+  return createLookup(source, keySelector, elementSelector, comparer, TKey, TElement)
+end
+
+function Enumerable.ToLookup(source, ...)
+  local len = select("#", ...)
+  if len == 2 then
+    local keySelector, TKey = ...
+    return toLookup(source, keySelector, identityFn, nil, TKey, source.__genericT__)
+  elseif len == 3 then
+    local keySelector, comparer, TKey = ...
+    return toLookup(source, keySelector, identityFn, comparer, TKey, source.__genericT__)
+  elseif len == 4 then
+    local keySelector, elementSelector, TKey, TElement = ...
+    return toLookup(source, keySelector, elementSelector, nil, TKey, TElement)
+  else
+    return toLookup(source, ...)
+  end
+end
+
+function Enumerable.DefaultIfEmpty(source)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local T = source.__genericT__
+  local state 
+  return createEnumerable(T, function()
+    return createEnumerator(T, source, function(en)
+      if not state then
+        if en:MoveNext() then
+          state = 1
+          return true, en:getCurrent()
+        end
+        state = 2
+        return true, T:default()
+      elseif state == 1 then
+        if en:MoveNext() then
+          return true, en:getCurrent()
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.OfType(source, T)
+  if source == nil then throw(ArgumentNullException("source")) end
+  return createEnumerable(T, function()
+    return createEnumerator(T, source, function(en) 
+      while en:MoveNext() do
+        local current = en:getCurrent()
+        if is(current, T) then
+          return true, current
+        end
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Cast(source, T)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if is(source, IEnumerable_1(T)) then return source end
+  return createEnumerable(T, function()
+    return createEnumerator(T, source, function(en) 
+      if en:MoveNext() then
+        return true, cast(T, en:getCurrent())
+      end
+      return false
+    end)
+  end)
+end
+
+local function first(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    if isArrayLike(source) then
+      local count = #source
+      if count > 0 then
+        return true, unWrap(source[1])
+      end
+    else
+      local en = source:GetEnumerator()
+      if en:MoveNext() then 
+        return true, en:getCurrent()
+      end
+    end
+    return false, 0
+  else
+    local predicate = ...
+    if predicate == nil then throw(ArgumentNullException("predicate")) end
+    for _, v in each(source) do
+      if predicate(v) then 
+        return true, v
+      end
+    end
+    return false, 1
+  end
+end
+
+function Enumerable.First(source, ...)
+  local ok, result = first(source, ...)
+  if ok then return result end
+  if result == 0 then
+    throw(InvalidOperationException("NoElements"))
+  end
+  throw(InvalidOperationException("NoMatch"))
+end
+
+function Enumerable.FirstOrDefault(source, ...)
+  local ok, result = first(source, ...)
+  return ok and result or source.__genericT__:default()
+end
+
+local function last(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    if isArrayLike(source) then
+      local count = #source
+      if count > 0 then
+        return true, unWrap(source[count])
+      end
+    else
+      local en = source:GetEnumerator()
+      if en:MoveNext() then 
+        local result
+        repeat
+          result = en:getCurrent()
+        until not en:MoveNext()
+        return true, result
+      end
+    end
+    return false, 0
+  else
+    local predicate = ...
+    if predicate == nil then throw(ArgumentNullException("predicate")) end
+    local result, found
+    for _, v in each(source) do
+      if predicate(v) then
+        result = v
+        found = true
+      end
+    end    
+    if found then return true, result end
+    return false, 1
+  end
+end
+
+function Enumerable.Last(source, ...)
+  local ok, result = last(source, ...)
+  if ok then return result end
+  if result == 0 then
+    throw(InvalidOperationException("NoElements"))
+  end
+  throw(InvalidOperationException("NoMatch"))
+end
+
+function Enumerable.LastOrDefault(source, ...)
+  local ok, result = last(source, ...)
+  return ok and result or source.__genericT__:default()
+end
+
+local function single(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    if isArrayLike(source) then
+      local count = #source
+      if count == 0 then
+        return false, 0
+      elseif count == 1 then
+        return true, unWrap(source[1])
+      end
+    else
+      local en = source:GetEnumerator()
+      if not en:MoveNext() then return false, 0 end
+      local result = en:getCurrent()
+      if not en:MoveNext() then
+        return true, result
+      end
+    end
+    return false, 1
+  else
+    local predicate = ...
+    if predicate == nil then throw(ArgumentNullException("predicate")) end
+    local result, found
+    for _, v in each(source) do
+      if predicate(v) then
+        result = v
+        if found then
+          return false, 1
+        end
+        found = true
+      end
+    end
+    if foun then return true, result end    
+    return false, 0    
+  end
+end
+
+function Enumerable.Single(source, ...)
+  local ok, result = single(source, ...)
+  if ok then return result end
+  if result == 0 then
+    throw(InvalidOperationException("NoElements"))
+  end
+  throw(InvalidOperationException("MoreThanOneMatch"))
+end
+
+function Enumerable.SingleOrDefault(source, ...)
+  local ok, result = single(source, ...)
+  return ok and result or source.__genericT__:default()
+end
+
+local function elementAt(source, index)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if index >= 0 then
+    if isArrayLike(source) then
+      local count = #source
+      if index < count then
+        return true, unWrap(source[index + 1])
+      end
+    else
+      local en = source:GetEnumerator()
+      while true do
+        if not en:MoveNext() then break end
+        if index == 0 then return true, en:getCurrent() end
+        index = index - 1
+      end
+    end
+  end
+  return false
+end
+
+function Enumerable.ElementAt(source, index)
+  local ok, result = elementAt(source, index)
+  if ok then return result end
+  throw(ArgumentOutOfRangeException("index"))
+end
+
+function Enumerable.ElementAtOrDefault(source, index)
+  local ok, result = elementAt(source, index)
+  return ok and result or source.__genericT__:default()
+end
+
+function Enumerable.Range(start, count)
+  if count < 0 then throw(ArgumentOutOfRangeException("count")) end
+  return createEnumerable(Int32, function()
+    local index = -1
+    return createEnumerator(Int32, nil, function()
+      index = index + 1
+      if index < count then
+        return true, start + index  
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Repeat(element, count, T)
+  if count < 0 then throw(ArgumentOutOfRangeException("count")) end
+  return createEnumerable(T, function()
+    local index = -1
+    return createEnumerator(T, nil, function()
+      index = index + 1
+      if index < count then
+        return true, element  
+      end
+      return false
+    end)
+  end)
+end
+
+function Enumerable.Any(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    local en = source:GetEnumerator()
+    return en:MoveNext()
+  else
+    local predicate = ...
+    if predicate == nil then throw(ArgumentNullException("predicate")) end
+    for _, v in each(source) do
+      if predicate(v) then
+        return true
+      end
+    end
+    return false
+  end
+end
+
+function Enumerable.All(source, predicate)
+  if source == nil then throw(ArgumentNullException("source")) end
+  if predicate == nil then throw(ArgumentNullException("predicate")) end
+  for _, v in each(source) do
+    if not predicate(v) then
+      return false
+    end
+  end
+  return true
+end
+
+function Enumerable.Count(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    if isArrayLike(source) then
+      return #source
+    end
+    local count = 0
+    local en = source:GetEnumerator()
+    while en:MoveNext() do 
+      count = count + 1 
+    end
+    return count
+  else
+    local predicate = ...
+    if predicate == nil then throw(ArgumentNullException("predicate")) end
+    local count = 0
+    for _, v in each(source) do
+      if predicate(v) then
+        count = count + 1
+      end
+    end
+    return count
+  end
+end
+
+function Enumerable.Contains(source, value, comparer)
+  if source == nil then throw(ArgumentNullException("source")) end
+  comparer = getComparer(source, comparer)
+  local equals = comparer.EqualsOf
+  for _, v in each(source) do
+    if equals(comparer, v, value) then
+      return true
+    end
+  end
+  return false
+end
+
+function Enumerable.Aggregate(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...);
+  if len == 1 then
+    local func = ...
+    if func == nil then throw(ArgumentNullException("func")) end
+    local e = source:GetEnumerator()
+    if not e:MoveNext() then throw(InvalidOperationException("NoElements")) end
+    local result = e:getCurrent()
+    while e:MoveNext() do
+      result = func(result, e:getCurrent())
+    end
+    return result
+  elseif len == 2 then
+    local seed, func = ...
+    if func == nil then throw(ArgumentNullException("func")) end
+    local result = seed
+    for _, element in each(source) do
+      result = func(result, element)
+    end
+    return result
+  else 
+    local seed, func, resultSelector = ...
+    if func == nil then throw(ArgumentNullException("func")) end
+    if resultSelector == nil then throw(ArgumentNullException("resultSelector")) end
+    local result = seed
+    for _, element in each(source) do
+      result = func(result, element)
+    end
+    return resultSelector(result)
+  end
+end
+
+function Enumerable.Sum(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  if len == 0 then
+    local sum = 0
+    for _, v in each(source) do
+      sum = sum + v
+    end
+    return sum
+  else
+    local selector = ...
+    if selector == nil then throw(ArgumentNullException("selector")) end
+    local sum = 0
+    for _, v in each(source) do
+      sum = sum + selector(v)
+    end
+    return sum
+  end
+end
+
+local function minOrMax(compareFn, source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local len = select("#", ...)
+  local selector, T 
+  if len == 0 then
+    selector, T = identityFn, source.__genericT__
+  else
+    selector, T = ...
+    if selector == nil then throw(ArgumentNullException("selector")) end
+  end
+  local comparer = Comparer_1(T).getDefault()
+  local compare = comparer.Compare
+  local value = T:default()
+  if value == nil then
+    for _, x in each(source) do
+      x = selector(x)
+      if x ~= nil and (value == nil or compareFn(compare, comparer, x, value)) then
+        value = x
+      end 
+    end
+    return value
+  else
+    local hasValue = false
+    for _, x in each(source) do
+      x = selector(x)
+      if hasValue then
+        if compareFn(compare, comparer, x, value) then
+          value = x
+        end
+      else
+        value = x
+        hasValue = true
+      end
+    end
+    if hasValue then return value end
+    throw(InvalidOperationException("NoElements"))
+  end
+end
+
+local function minFn(compare, comparer, x, y)
+  return compare(comparer, x, y) < 0
+end
+
+function Enumerable.Min(source, ...)
+  return minOrMax(minFn, source, ...)
+end
+
+local function maxFn(compare, comparer, x, y)
+  return compare(comparer, x, y) > 0
+end
+
+function Enumerable.Max(source, ...)
+  return minOrMax(maxFn, source, ...)
+end
+
+function Enumerable.Average(source, ...)
+  if source == nil then throw(ArgumentNullException("source")) end
+  local sum, count = 0, 0
+  local len = select("#", ...)
+  if len == 0 then
+    for _, v in each(source) do
+      sum = sum + v
+      count = count + 1
+    end
+  else
+    local selector = ...
+    if selector == nil then throw(ArgumentNullException("selector")) end
+    for _, v in each(source) do
+      sum = sum + selector(v)
+      count = count + 1
+    end
+  end
+  if count > 0 then
+    return sum / count
+  end
+  throw(InvalidOperationException("NoElements"))
+end

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Linq.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 28a4ca77818d8a14fb14c271ed6ec8f5
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 74 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/List.lua.txt

@@ -0,0 +1,74 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local falseFn = System.falseFn
+local lengthFn = System.lengthFn
+local Array = System.Array
+
+local List = {
+  __ctor__ = Array.ctorList,
+  getCapacity = lengthFn,
+  getCount = lengthFn,
+  getIsFixedSize = falseFn,
+  getIsReadOnly = falseFn,
+  get = Array.get,
+  set = Array.set,
+  Add = Array.add,
+  AddObj = Array.addObj,
+  AddRange = Array.addRange,
+  AsReadOnly = Array.AsReadOnly,
+  BinarySearch = Array.BinarySearch,
+  Clear = Array.clear,
+  Contains = Array.Contains,
+  CopyTo = Array.CopyTo,
+  Exists = Array.Exists,
+  Find = Array.Find,
+  FindAll = Array.findAll,
+  FindIndex = Array.FindIndex,
+  FindLast = Array.FindLast,
+  FindLastIndex = Array.FindLastIndex,
+  ForEach = Array.ForEach,
+  GetEnumerator = Array.GetEnumerator,
+  GetRange = Array.getRange,
+  IndexOf = Array.IndexOf,
+  Insert = Array.insert,
+  InsertRange = Array.insertRange,
+  LastIndexOf = Array.LastIndexOf,
+  Remove = Array.remove,
+  RemoveAll = Array.removeAll,
+  RemoveAt = Array.removeAt,
+  RemoveRange = Array.removeRange,
+  Reverse = Array.Reverse,
+  Sort = Array.Sort,
+  TrimExcess = System.emptyFn,
+  ToArray = Array.toArray,
+  TrueForAll = Array.TrueForAll
+}
+
+function System.listFromTable(t, T)
+  return setmetatable(t, List(T))
+end
+
+local ListFn = System.define("System.Collections.Generic.List", function(T) 
+  return { 
+    base = { System.IList_1(T), System.IReadOnlyList_1(T), System.IList }, 
+    __genericT__ = T,
+  }
+end, List)
+
+System.List = ListFn
+System.ArrayList = ListFn(System.Object)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/List.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 62dbdab8504904843ab4788d54179ba3
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 54 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Queue.lua.txt

@@ -0,0 +1,54 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local Array = System.Array
+
+local function tryDequeue(this)
+  if #this == 0 then
+    return false
+  end
+  return true, this:Dequeue()
+end
+
+local Queue = {
+  __ctor__ = Array.ctorList,
+  getCount = Array.getLength,
+  Clear = Array.clear,
+  Contains = Array.Contains,
+  CopyTo = Array.CopyTo,
+  Dequeue = Array.popFirst,
+  Enqueue = Array.add,
+  GetEnumerator = Array.GetEnumerator,
+  Peek = Array.first,
+  ToArray = Array.toArray,
+  TrimExcess = System.emptyFn,
+  TryDequeue = tryDequeue
+}
+
+function System.queueFromTable(t, T)
+  return setmetatable(t, Queue(T))
+end
+
+local QueueFn = System.define("System.Collections.Generic.Queue", function(T) 
+  return {
+    base = { System.IEnumerable_1(T), System.ICollection },
+    __genericT__ = T,
+  }
+end, Queue)
+
+System.Queue = QueueFn
+System.queue = QueueFn(System.Object)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Queue.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 35978418ae8a1d14f9262a5fa89e0574
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 862 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedDictionary.lua.txt

@@ -0,0 +1,862 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+local throw = System.throw
+local null = System.null
+local falseFn = System.falseFn
+local each = System.each
+local lengthFn = System.lengthFn
+local versions = System.versions
+local Array = System.Array
+local checkIndexAndCount = System.checkIndexAndCount
+local throwFailedVersion = System.throwFailedVersion
+local ArgumentNullException = System.ArgumentNullException
+local ArgumentException = System.ArgumentException
+local KeyNotFoundException = System.KeyNotFoundException
+local EqualityComparer = System.EqualityComparer
+local Comparer = System.Comparer_1
+local NotSupportedException = System.NotSupportedException
+
+local assert = assert
+local pairs = pairs
+local next = next
+local select = select
+local getmetatable = getmetatable
+local setmetatable = setmetatable
+local tconcat = table.concat
+local tremove = table.remove
+local type = type
+
+local counts = setmetatable({}, { __mode = "k" })
+System.counts = counts
+
+local function getCount(this)
+    local t = counts[this]
+    if t then
+        return t[1]
+    end
+    return 0
+end
+
+local function pairsFn(t, i)
+    local count = counts[t]
+    if count then
+        if count[2] ~= count[3] then
+            throwFailedVersion()
+        end
+    end
+    local k, v = next(t, i)
+    if v == null then
+        return k
+    end
+    return k, v
+end
+
+function System.pairs(t)
+    local count = counts[t]
+    if count then
+        count[3] = count[2]
+    end
+    return pairsFn, t
+end
+
+local KeyValuePairFn =System.KeyValuePair
+local KeyValuePair = {
+    __ctor__ = function(this, ...)
+        if select("#", ...) == 0 then
+            this.Key, this.Value = this.__genericTKey__:default(), this.__genericTValue__:default()
+        else
+            this.Key, this.Value = ...
+        end
+    end,
+    Create = function(key, value, TKey, TValue)
+        return setmetatable({ Key = key, Value = value }, KeyValuePairFn(TKey, TValue))
+    end,
+    Deconstruct = function(this)
+        return this.Key, this.Value
+    end,
+    ToString = function(this)
+        local t = { "[" }
+        local count = 2
+        local k, v = this.Key, this.Value
+        if k ~= nil then
+            t[count] = k:ToString()
+            count = count + 1
+        end
+        t[count] = ", "
+        count = count + 1
+        if v ~= nil then
+            t[count] = v:ToString()
+            count = count + 1
+        end
+        t[count] = "]"
+        return tconcat(t)
+    end
+}
+
+local function isKeyValuePair(t)
+    return getmetatable(getmetatable(t)) == KeyValuePair
+end
+
+local DictionaryEnumerator = define("System.Collections.Generic.SortedDictionaryEnumerator", {
+    getCurrent = System.getCurrent,
+    Dispose = System.emptyFn,
+    MoveNext = function(this)
+        local t, kind = this.dict, this.kind
+        local count = counts[t]
+        if this.version ~= (count and count[2] or 0) then
+            throwFailedVersion()
+        end
+        if this.currNode then
+            local k, v = this.currNode.k,this.currNode.v
+            if kind then
+                kind.Key = k
+                if v == null then
+                    v = nil
+                end
+                kind.Value = v
+            elseif kind == false then
+                if v == null then
+                    v = nil
+                end
+                this.current = v
+            else
+                this.current = k
+            end
+            this.currNode = this.currNode.next
+            return true
+        else
+            if kind then
+                kind.Key, kind.Value = kind.__genericTKey__:default(), kind.__genericTValue__:default()
+            elseif kind == false then
+                this.current = t.__genericTValue__:default()
+            else
+                this.current = t.__genericTKey__:default()
+            end
+            return false
+        end
+    end
+})
+
+local function dictionaryEnumerator(t, kind)
+    local current
+    if not kind then
+        local TKey, TValue = t.__genericTKey__, t.__genericTValue__
+        kind = setmetatable({ Key = TKey:default(), Value = TValue:default() }, t.__genericT__)
+        current = kind
+    elseif kind == 1 then
+        local TKey = t.__genericTKey__
+        current = TKey:default()
+        kind = nil
+    else
+        local TValue = t.__genericTValue__
+        current = TValue:default()
+        kind = false
+    end
+    local count = counts[t]
+    local en = {
+        dict = t,
+        version = count and count[2] or 0,
+        kind = kind,
+        current = current
+    }
+    local enumerator= setmetatable(en, DictionaryEnumerator)
+    enumerator.currNode = t.first
+    return enumerator
+end
+
+local DictionaryCollection = define("System.Collections.Generic.SortedDictionaryCollection", function(T)
+    return {
+        base = { System.ICollection_1(T), System.IReadOnlyCollection_1(T), System.ICollection },
+        __genericT__ = T
+    }
+end, {
+    __ctor__ = function(this, dict, kind)
+        this.dict = dict
+        this.kind = kind
+    end,
+    getCount = function(this)
+        return getCount(this.dict)
+    end,
+    GetEnumerator = function(this)
+        return dictionaryEnumerator(this.dict, this.kind)
+    end
+}, 1)
+
+local KVNode = define("System.Collections.Generic.SortedDictionaryCollection.KVNode",{
+    __ctor__ = function(this, k, v, ...)
+        this.k = k
+        this.v = v
+        local pre, next = ...
+        this.pre = pre
+        this.next = next
+    end
+})
+
+local function addNodeEmpty(this, key, value)
+    local node = KVNode()(key, value)
+    this.first = node
+end
+local function addNode(this, key, value)
+    local node = KVNode()(key, value)
+    local curr = this.first;
+    if not curr then
+        throw(ArgumentNullException("first"))
+    end
+    while (1) do
+        local k = curr.k
+        local comparer = Comparer(this.__genericTKey__).getDefault()
+        if (comparer:Compare(k,key) > 0) then
+            curr.pre = node
+            node.next = curr
+            break
+        end
+        local nextNode = curr.next;
+        if not nextNode then
+            curr.next = node
+            node.pre = curr
+            break ;
+        end
+        curr = nextNode
+    end
+end
+local function removeNode(this, key)
+    local curr = this.first;
+    if not curr then
+        throw(ArgumentNullException("first"))
+    end
+    while (1) do
+        local k = curr.k
+        local comparer = Comparer(this.__genericTKey__).getDefault()
+        if (comparer:Compare(k,key) == 0) then
+            if curr.pre then
+                curr.pre.next = curr.next;
+            end
+            if curr.next then
+                curr.next.pre = curr.pre;
+            end
+            if curr == this.first and not curr.next then
+                this.first=nil
+            end
+            break
+        end
+        local nextNode = curr.next;
+        if not nextNode then
+            break ;
+        end
+        curr = nextNode
+    end
+
+end
+
+local function clearNodes(this)
+    local curr = this.first;
+    if not curr then
+        return
+    end
+    while (1) do
+        local nextNode = curr.next;
+        if not nextNode then
+            break
+        end
+        curr = nextNode
+    end
+    this.first = nil
+end
+local function add(this, key, value)
+    if key == nil then
+        throw(ArgumentNullException("key"))
+    end
+    if this[key] ~= nil then
+        throw(ArgumentException("key already exists"))
+    end
+    local t = counts[this]
+    if t then
+        t[1] = t[1] + 1
+        t[2] = t[2] + 1
+    else
+       t = { 1, 1 }
+       counts[this] = t
+    end
+    if this.first == nil then
+        addNodeEmpty(this, key, value)
+    else
+        addNode(this, key, value)
+    end
+    this[key] = value == nil and null or value
+end
+
+local function remove(this, key)
+    if key == nil then
+        throw(ArgumentNullException("key"))
+    end
+    if this[key] ~= nil then
+        this[key] = nil
+        removeNode(this, key)
+        local t = counts[this]
+        t[1] = t[1] - 1
+        t[2] = t[2] + 1
+        return true
+    end
+    return false
+end
+local function replace(this, key,value)
+    local node=KVNode()(key,value)
+    local curr = this.first;
+    if not curr then
+        throw(ArgumentNullException("first"))
+    end
+    while (1) do
+        local k = curr.k
+        local comparer = Comparer(this.__genericTKey__).getDefault()
+        if (comparer:Compare(k,key) == 0) then
+            curr.pre.next = node;
+            curr.nect.pre = node;
+            node.pre=curr.pre
+            node.next=curr.next
+            curr = nil;
+            break
+        end
+        local nextNode = curr.next;
+        if not nextNode then
+            break ;
+        end
+        curr = nextNode
+    end
+end
+
+local function buildFromDictionary(this, dictionary)
+    if dictionary == nil then
+        throw(ArgumentNullException("dictionary"))
+    end
+    local count = 0
+    for k, v in pairs(dictionary) do
+
+        if count == 0 then
+            addNodeEmpty(this, k, v)
+        else
+            addNode(this, k, v)
+        end
+
+        this[k] = v
+        count = count + 1
+    end
+    counts[this] = { count, 0 }
+end
+
+local ArrayDictionaryFn
+local function buildHasComparer(this, ...)
+    local Dictionary = ArrayDictionaryFn(this.__genericTKey__, this.__genericTValue__)
+    Dictionary.__ctor__(this, ...)
+    return setmetatable(this, Dictionary)
+end
+
+local Dictionary = {
+    getIsFixedSize = falseFn,
+    getIsReadOnly = falseFn,
+    __ctor__ = function(this, ...)
+        local n = select("#", ...)
+        if n == 0 then
+        elseif n == 1 then
+            local comparer = ...
+            if comparer == nil or type(comparer) == "number" then
+            else
+                local equals = comparer.EqualsOf
+                if equals == nil then
+                    buildFromDictionary(this, comparer)
+                else
+                    buildHasComparer(this, ...)
+                end
+            end
+        else
+            local dictionary, comparer = ...
+            if comparer ~= nil then
+                buildHasComparer(this, ...)
+            end
+            if type(dictionary) ~= "number" then
+                buildFromDictionary(this, dictionary)
+            end
+        end
+    end,
+    AddKeyValue = add,
+    Add = function(this, ...)
+        local k, v
+        if select("#", ...) == 1 then
+            local pair = ...
+            k, v = pair.Key, pair.Value
+        else
+            k, v = ...
+        end
+        add(this, k, v)
+    end,
+    Clear = function(this)
+        for k, v in pairs(this) do
+            clearNodes(this)
+            this[k] = nil
+        end
+        counts[this] = nil
+    end,
+    ContainsKey = function(this, key)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        return this[key] ~= nil
+    end,
+    ContainsValue = function(this, value)
+        if value == nil then
+            for _, v in pairs(this) do
+                if v == null then
+                    return true
+                end
+            end
+        else
+            local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+            local equals = comparer.EqualsOf
+            for _, v in pairs(this) do
+                if v ~= null then
+                    if equals(comparer, value, v) then
+                        return true
+                    end
+                end
+            end
+        end
+        return false
+    end,
+    Contains = function(this, pair)
+        local key = pair.Key
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local value = this[key]
+        if value ~= nil then
+            if value == null then
+                value = nil
+            end
+            local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+            if comparer:EqualsOf(value, pair.Value) then
+                return true
+            end
+        end
+        return false
+    end,
+    CopyTo = function(this, array, index)
+        local count = getCount(this)
+        checkIndexAndCount(array, index, count)
+        if count > 0 then
+            local KeyValuePair = this.__genericT__
+            index = index + 1
+            for k, v in pairs(this) do
+                if v == null then
+                    v = nil
+                end
+                array[index] = setmetatable({ Key = k, Value = v }, KeyValuePair)
+                index = index + 1
+            end
+        end
+    end,
+    RemoveKey = remove,
+    Remove = function(this, key)
+        if isKeyValuePair(key) then
+            local k, v = key.Key, key.Value
+            if k == nil then
+                throw(ArgumentNullException("key"))
+            end
+            local value = this[k]
+            if value ~= nil then
+                if value == null then
+                    value = nil
+                end
+                local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+                if comparer:EqualsOf(value, v) then
+                    remove(this, k)
+                    return true
+                end
+            end
+            return false
+        end
+        return remove(this, key)
+    end,
+    TryGetValue = function(this, key)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local value = this[key]
+        if value == nil then
+            return false, this.__genericTValue__:default()
+        end
+        if value == null then
+            return true
+        end
+        return true, value
+    end,
+    getComparer = function(this)
+        return EqualityComparer(this.__genericTKey__).getDefault()
+    end,
+    getCount = getCount,
+    get = function(this, key)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local value = this[key]
+        if value == nil then
+            throw(KeyNotFoundException())
+        end
+        if value ~= null then
+            return value
+        end
+        return nil
+    end,
+    set = function(this, key, value)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local t = counts[this]
+        if t then
+            if this[key] == nil then
+                t[1] = t[1] + 1
+            end
+            t[2] = t[2] + 1
+        else
+            counts[this] = { 1, 1 }
+        end
+        this[key] = value == nil and null or value
+        replace(this,key,value)
+    end,
+    GetEnumerator = dictionaryEnumerator,
+    getKeys = function(this)
+        return DictionaryCollection(this.__genericTKey__)(this, 1)
+    end,
+    getValues = function(this)
+        return DictionaryCollection(this.__genericTValue__)(this, 2)
+    end
+}
+
+local ArrayDictionaryEnumerator = define("System.Collections.Generic.ArraySortedDictionaryEnumerator", function(T)
+    return {
+        base = { System.IEnumerator_1(T) }
+    }
+end, {
+    getCurrent = System.getCurrent,
+    Dispose = System.emptyFn,
+    MoveNext = function(this)
+        local t = this.list
+        if this.version ~= versions[t] then
+            throwFailedVersion()
+        end
+        local index = this.index
+        local pair = t[index]
+        if pair ~= nil then
+            if t.kind then
+                this.current = pair.Value
+            else
+                this.current = pair.Key
+            end
+            this.index = index + 1
+            return true
+        end
+        this.current = nil
+        return false
+    end
+}, 1)
+
+local arrayDictionaryEnumerator = function(t, kind, T)
+    return setmetatable({ list = t, kind = kind, index = 1, version = versions[t], currnet = T:default() }, ArrayDictionaryEnumerator(T))
+end
+
+local ArrayDictionaryCollection = define("System.Collections.Generic.ArraySortedDictionaryCollection", function(T)
+    return {
+        base = { System.ICollection_1(T), System.IReadOnlyCollection_1(T), System.ICollection },
+        __genericT__ = T
+    }
+end, {
+    __ctor__ = function(this, dict, kind)
+        this.dict = dict
+        this.kind = kind
+    end,
+    getCount = function(this)
+        return getCount(this.dict)
+    end,
+    GetEnumerator = function(this)
+        return arrayDictionaryEnumerator(this.dict, this.kind, this.__genericT__)
+    end
+}, 1)
+
+local ArrayDictionary = (function()
+    local function buildFromDictionary(this, dictionary)
+        if dictionary == nil then
+            throw(ArgumentNullException("dictionary"))
+        end
+        local count = 1
+        local KeyValuePair = this.__genericT__
+        for _, pair in each(dictionary) do
+            local k, v = pair.Key, pair.Value
+            if type(k) == "table" and k.class == 'S' then
+                k = k:__clone__()
+            end
+            this[count] = setmetatable({ Key = k, Value = v }, KeyValuePair)
+            count = count + 1
+        end
+    end
+
+    local function add(this, key, value, set)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local len = #this
+        if len > 0 then
+            local comparer = this.comparer
+            local equals = comparer.EqualsOf
+            for i = 1, len do
+                if equals(comparer, this[i].Key, key) then
+                    if set then
+                        this[i].Value = value
+                        return
+                    else
+                        throw(ArgumentException("key already exists"))
+                    end
+                end
+            end
+        end
+        this[len + 1] = setmetatable({ Key = key, Value = value }, this.__genericT__)
+        versions[this] = (versions[this] or 0) + 1
+    end
+
+    local function remove(this, key)
+        if key == nil then
+            throw(ArgumentNullException("key"))
+        end
+        local len = #this
+        if len > 0 then
+            local comparer = this.comparer
+            local equals = comparer.EqualsOf
+            for i = 1, len do
+                if equals(comparer, this[i].Key, key) then
+                    tremove(this, i)
+                    versions[this] = (versions[this] or 0) + 1
+                    return true
+                end
+            end
+        end
+        return false
+    end
+
+    return {
+        getIsFixedSize = falseFn,
+        getIsReadOnly = falseFn,
+        __ctor__ = function(this, ...)
+            local Comparer
+            local n = select("#", ...)
+            if n == 0 then
+            elseif n == 1 then
+                local comparer = ...
+                if comparer == nil or type(comparer) == "number" then
+                else
+                    local equals = comparer.EqualsOf
+                    if equals == nil then
+                        buildFromDictionary(this, comparer)
+                    else
+                        Comparer = comparer
+                    end
+                end
+            else
+                local dictionary, comparer = ...
+                if type(dictionary) ~= "number" then
+                    buildFromDictionary(this, dictionary)
+                end
+                Comparer = comparer
+            end
+            this.comparer = Comparer or EqualityComparer(this.__genericTKey__).getDefault()
+        end,
+        AddKeyValue = add,
+        Add = function(this, ...)
+            local k, v
+            if select("#", ...) == 1 then
+                local pair = ...
+                k, v = pair.Key, pair.Value
+            else
+                k, v = ...
+            end
+            add(this, k, v)
+        end,
+        Clear = Array.clear,
+        ContainsKey = function(this, key)
+            if key == nil then
+                throw(ArgumentNullException("key"))
+            end
+            local len = #this
+            if len > 0 then
+                local comparer = this.comparer
+                local equals = comparer.EqualsOf
+                for i = 1, len do
+                    if equals(comparer, this[i].Key, key) then
+                        return true
+                    end
+                end
+            end
+            return false
+        end,
+        ContainsValue = function(this, value)
+            local len = #this
+            if len > 0 then
+                local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+                local equals = comparer.EqualsOf
+                for i = 1, #this do
+                    if equals(comparer, value, this[i].Value) then
+                        return true
+                    end
+                end
+            end
+            return false
+        end,
+        Contains = function(this, pair)
+            local key = pair.Key
+            if key == nil then
+                throw(ArgumentNullException("key"))
+            end
+            local len = #this
+            if len > 0 then
+                local comparer = this.comparer
+                local equals = comparer.EqualsOf
+                for i = 1, len do
+                    local t = this[i]
+                    if equals(comparer, t.Key, key) then
+                        local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+                        if comparer:EqualsOf(t.Value, pair.Value) then
+                            return true
+                        end
+                    end
+                end
+            end
+            return false
+        end,
+        CopyTo = function(this, array, index)
+            local count = #this
+            checkIndexAndCount(array, index, count)
+            if count > 0 then
+                local KeyValuePair = this.__genericT__
+                index = index + 1
+                for i = 1, count do
+                    local t = this[i]
+                    array[index] = setmetatable({ Key = t.Key:__clone__(), Value = t.Value }, KeyValuePair)
+                    index = index + 1
+                end
+            end
+        end,
+        RemoveKey = remove,
+        Remove = function(this, key)
+            if isKeyValuePair(key) then
+                local len = #this
+                local k, v = key.Key, key.Value
+                for i = 1, #this do
+                    local pair = this[i]
+                    if pair.Key:EqualsObj(k) then
+                        local comparer = EqualityComparer(this.__genericTValue__).getDefault()
+                        if comparer:EqualsOf(pair.Value, v) then
+                            tremove(this, i)
+                            return true
+                        end
+                    end
+                end
+            end
+            return false
+        end,
+        TryGetValue = function(this, key)
+            if key == nil then
+                throw(ArgumentNullException("key"))
+            end
+            local len = #this
+            if len > 0 then
+                local comparer = this.comparer
+                local equals = comparer.EqualsOf
+                for i = 1, len do
+                    local pair = this[i]
+                    if equals(comparer, pair.Key, key) then
+                        return true, pair.Value
+                    end
+                end
+            end
+            return false, this.__genericTValue__:default()
+        end,
+        getComparer = function(this)
+            return this.comparer
+        end,
+        getCount = lengthFn,
+        get = function(this, key)
+            if key == nil then
+                throw(ArgumentNullException("key"))
+            end
+            local len = #this
+            if len > 0 then
+                local comparer = this.comparer
+                local equals = comparer.EqualsOf
+                for i = 1, len do
+                    local pair = this[i]
+                    if equals(comparer, pair.Key, key) then
+                        return pair.Value
+                    end
+                end
+            end
+            throw(KeyNotFoundException())
+        end,
+        set = function(this, key, value)
+            add(this, key, value, true)
+        end,
+        GetEnumerator = Array.GetEnumerator,
+        getKeys = function(this)
+            return ArrayDictionaryCollection(this.__genericTKey__)(this)
+        end,
+        getValues = function(this)
+            return ArrayDictionaryCollection(this.__genericTValue__)(this, true)
+        end
+    }
+end)()
+
+ArrayDictionaryFn = define("System.Collections.Generic.ArraySortedDictionary", function(TKey, TValue)
+    return {
+        base = { System.IDictionary_2(TKey, TValue), System.IDictionary, System.IReadOnlyDictionary_2(TKey, TValue) },
+        __genericT__ = KeyValuePairFn(TKey, TValue),
+        __genericTKey__ = TKey,
+        __genericTValue__ = TValue,
+    }
+end, ArrayDictionary, 2)
+
+function System.dictionaryFromTable(t, TKey, TValue)
+    return setmetatable(t, Dictionary(TKey, TValue))
+end
+
+function System.isDictLike(t)
+    return type(t) == "table" and t.GetEnumerator == dictionaryEnumerator
+end
+
+local DictionaryFn = define("System.Collections.Generic.SortedDictionary", function(TKey, TValue)
+    local array, len
+    if TKey.class == 'S' and type(TKey:default()) == "table" then
+        array = ArrayDictionary
+    else
+        len = getCount
+    end
+    return {
+        base = { System.IDictionary_2(TKey, TValue), System.IDictionary, System.IReadOnlyDictionary_2(TKey, TValue) },
+        __genericT__ = KeyValuePairFn(TKey, TValue),
+        __genericTKey__ = TKey,
+        __genericTValue__ = TValue,
+        __len = len
+    }, array
+end, Dictionary, 2)
+
+System.SortedDictionary_2 = DictionaryFn

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedDictionary.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 14b118ddd32e1e040bd7a6d1c4f77aed
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedSet.lua.txt

@@ -0,0 +1,25 @@
+--[[
+Copyright YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local define = System.define
+
+local SortedSet = {
+  
+}
+
+
+

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/SortedSet.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: b7006ac7d98fbf0498e4e469f3d334d4
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 45 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Stack.lua.txt

@@ -0,0 +1,45 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local Array = System.Array
+
+local Stack = {
+  __ctor__ = Array.ctorList,
+  getCount = Array.getLength,
+  Clear = Array.clear,
+  Contains = Array.Contains,
+  GetEnumerator = Array.reverseEnumerator,
+  Push = Array.add,
+  Peek = Array.last,
+  Pop = Array.popLast,
+  ToArray = Array.toArray,
+  TrimExcess = System.emptyFn
+}
+
+function System.stackFromTable(t, T)
+  return setmetatable(t, Stack(T))
+end
+
+local StackFn = System.define("System.Collections.Generic.Stack", function(T) 
+  return {
+    base = { System.IEnumerable_1(T), System.ICollection },
+    __genericT__ = T,
+  }
+end, Stack)
+
+System.Stack = StackFn
+System.stack = StackFn(System.Object)

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Collections/Stack.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 24132a7e1d8b7e344a7bf4924f54b84d
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 66 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Console.lua.txt

@@ -0,0 +1,66 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local toString = System.toString
+
+local print = print
+local select = select
+local string = string
+local byte = string.byte
+local char = string.char
+local Format = string.Format
+
+local function getWriteValue(v, ...)
+  if select("#", ...) ~= 0 then
+    return Format(v, ...)
+  end
+  return toString(v)
+end
+
+local Console = System.define("System.Console", {
+  WriteLine = function (v, ...)
+    print(getWriteValue(v, ...))     
+  end,
+  WriteLineChar = function (v)
+    print(char(v))     
+  end
+})
+
+local io = io
+if io then
+  local stdin = io.stdin
+  local stdout = io.stdout
+  local read = stdin.read
+  local write = stdout.write
+
+  function Console.Read()
+    local ch = read(stdin, 1)
+    return byte(ch)
+  end
+
+  function Console.ReadLine()
+     return read(stdin)
+  end
+
+  function Console.Write(v, ...)
+    write(stdout, getWriteValue(v, ...))
+  end
+
+  function Console.WriteChar(v)
+     write(stdout, char(v))
+  end
+end

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Console.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 55d5f3d124f7bd14983c385fb8c4db50
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 790 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Convert.lua.txt

@@ -0,0 +1,790 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local throw = System.throw
+local cast = System.cast
+local as = System.as
+local trunc = System.trunc
+local define = System.define
+local identityFn = System.identityFn
+local IConvertible = System.IConvertible
+local systemToString = System.toString
+
+local OverflowException = System.OverflowException
+local FormatException = System.FormatException
+local ArgumentException = System.ArgumentException
+local ArgumentOutOfRangeException = System.ArgumentOutOfRangeException
+local ArgumentNullException = System.ArgumentNullException
+local InvalidCastException = System.InvalidCastException
+
+local SByte = System.SByte
+local Byte = System.Byte
+local Int16 = System.Int16
+local UInt16 = System.UInt16
+local Int32 = System.Int32
+local UInt32 = System.UInt32
+local Int64 = System.Int64
+local UInt64 = System.UInt64
+local Single = System.Single
+local Double = System.Double
+local Boolean = System.Boolean
+local Char = System.Char
+local DateTime = System.DateTime
+local String = System.String
+local Object = System.Object
+
+local ParseSByte = SByte.Parse
+local ParseByte = Byte.Parse
+local ParseInt16 = Int16.Parse
+local ParseUInt16 = UInt16.Parse
+local ParseInt32 = Int32.Parse
+local ParseUInt32 = UInt32.Parse
+local ParseInt64 = Int64.Parse
+local ParseUInt64 = UInt64.Parse
+
+local ParseSingle = Single.Parse
+local ParseDouble = Double.Parse
+local ParseBoolean = Boolean.Parse
+
+local type = type
+local string = string
+local sbyte = string.byte
+local math = math
+local floor = math.floor
+local tconcat = table.concat
+local getmetatable = getmetatable
+local tonumber = tonumber
+
+local function toBoolean(value)
+  if value == nil then return false end
+  local typename = type(value)
+  if typename == "number" then
+    return value ~= 0
+  elseif typename == "string" then
+    return ParseBoolean(value)  
+  elseif typename == "boolean" then
+    return value
+  else
+    return cast(IConvertible, value):ToBoolean()   
+  end
+end
+
+local function toChar(value)
+  if value == nil then return 0 end
+  local typename = type(value)
+  if typename == "number" then
+    if value ~= floor(value) or value > 9223372036854775807 or value < -9223372036854775808 then
+      throw(InvalidCastException("InvalidCast_FromTo_Char"))
+    end
+    if value < 0 or value > 65535 then 
+      throw(OverflowException("Overflow_Char")) 
+    end
+    return value
+  elseif typename == "string" then
+    if #value ~= 1 then
+      throw(FormatException("Format_NeedSingleChar"))
+    end
+    return sbyte(value)
+  else
+    return cast(IConvertible, value):ToChar()
+  end
+end
+
+local function parseBits(s, p, n)
+  local i, j, v = s:find(p)
+  if not i then
+    throw(FormatException())
+  end
+  v = tonumber(v)
+  for i = j + 1, #s do
+    local ch = sbyte(s, i)
+    local b = ch - 48
+    if b < 0 or b >= n then
+      if not s:find("^%s*$", i) then
+        throw(FormatException())
+      end
+      break
+    end
+    v = v * n + b
+  end
+  return v
+end
+
+local function parseNumberFromBase(value, fromBase, min, max)
+  if fromBase == 2 then
+    value = parseBits(value, "^%s*([01])", fromBase)
+  elseif fromBase == 8 then
+    value = parseBits(value, "^%s*([0-7])", fromBase)
+  elseif fromBase == 16 then
+    local _, _, v = value:find("^%s*(%w+)%s*$")
+    if not v then
+      throw(ArgumentException("String cannot contain a minus sign if the base is not 10."))
+    end
+    local ch = sbyte(v, 2)
+    if ch == 120 or ch == 88 then
+    else
+      v = "0x" .. v
+    end
+    value = tonumber(v)
+    if value == nil then
+      throw(FormatException())
+    end
+  else
+    throw(ArgumentException("fromBase")) 
+  end
+  if max == 127 and value <= 255 then
+    return System.toSByte(value)
+  end
+  if max == 32767 and value <= 65535 then
+    return System.toInt16(value)
+  end
+  if max == 2147483647 and value <= 4294967295 then
+    return System.toInt32(value)
+  end
+  if value < min or value > max then
+    throw(OverflowException())
+  end
+  return value
+end
+
+local function toNumber(value, min, max, parse, objectTo, sign)
+  if value == nil then return 0 end
+  local typename = type(value)
+  if typename == "number" then
+    if sign == false then
+      value = System.ToSingle(value * 1.0)
+    elseif sign == true then
+      value = value * 1.0
+    else
+      local i = value
+      value = trunc(value)
+      if value ~= i then
+        local dif = i - value
+        if value >= 0 then
+          if dif > 0.5 or (dif == 0.5 and value % 2 ~= 0) then
+            value = value + 1  
+          end
+        else
+          if dif < -0.5 or (dif == -0.5 and value % 2 ~= 0) then
+            value = value - 1  
+          end
+        end
+      end
+      if value < min or value > max then
+        throw(OverflowException())
+      end
+    end
+    return value
+  elseif typename == "string" then
+    if sign and sign ~= 10 and type(sign) == "number" then
+      return parseNumberFromBase(value, sign, min, max)
+    end
+    return parse(value) 
+  elseif typename == "boolean" then
+    return value and 1 or 0
+  else
+    return objectTo(value)
+  end
+end
+
+local function objectToSByte(value)
+  return cast(IConvertible, value):ToSByte()
+end
+
+local function toSByte(value, fromBase)
+  return toNumber(value, -128, 127, ParseSByte, objectToSByte, fromBase)
+end
+
+local function objectToByte(value)
+  return cast(IConvertible, value):ToByte()
+end
+
+local function toByte(value, fromBase)
+  return toNumber(value, 0, 255, ParseByte, objectToByte, fromBase) 
+end
+
+local function objectToInt16(value)
+  return cast(IConvertible, value):ToInt16()
+end
+
+local function toInt16(value, fromBase)
+  return toNumber(value, -32768, 32767, ParseInt16, objectToInt16, fromBase) 
+end
+
+local function objectToUInt16(value)
+  return cast(IConvertible, value):ToUInt16()
+end
+
+local function toUInt16(value, fromBase)
+  return toNumber(value, 0, 65535, ParseUInt16, objectToUInt16, fromBase) 
+end
+
+local function objectToInt32(value)
+  return cast(IConvertible, value):ToInt32()
+end
+
+local function toInt32(value, fromBase)
+  return toNumber(value, -2147483648, 2147483647, ParseInt32, objectToInt32, fromBase) 
+end
+
+local function objectToUInt32(value)
+  return cast(IConvertible, value):ToUInt32()
+end
+
+local function toUInt32(value, fromBase)
+  return toNumber(value, 0, 4294967295, ParseUInt32, objectToUInt32, fromBase) 
+end
+
+local function objectToInt64(value)
+  return cast(IConvertible, value):ToInt64()
+end
+
+local function toInt64(value, fromBase)
+  return toNumber(value, -9223372036854775808, 9223372036854775807, ParseInt64, objectToInt64, fromBase) 
+end
+
+local function objectToUInt64(value)
+  return cast(IConvertible, value):ToUInt64()
+end
+
+local function toUInt64(value, fromBase)
+  return toNumber(value, 0, 18446744073709551615.0, ParseUInt64, objectToUInt64, fromBase) 
+end
+
+local function objectToSingle(value)
+  return cast(IConvertible, value):ToSingle()
+end
+
+local function toSingle(value)
+  return toNumber(value, nil, nil, ParseSingle, objectToSingle, false) 
+end
+
+local function objectToDouble(value)
+  return cast(IConvertible, value):ToDouble()
+end
+
+local function toDouble(value)
+  return toNumber(value, nil, nil, ParseDouble, objectToDouble, true) 
+end
+
+local function toDateTime(value)
+  if value == nil then return DateTime.MinValue end
+  if getmetatable(value) == DateTime then return value end
+  if type(value) == "string" then return DateTime.Parse(value) end
+  return cast(IConvertible, value):ToDateTime()
+end
+
+local function toBaseType(ic, targetType)
+  local cls = targetType[1]
+  if cls == Boolean then return ic:ToBoolean() end
+  if cls == Char then return ic:ToChar() end
+  if cls == SByte then return ic:ToSByte() end
+  if cls == Byte then return ic:ToByte() end
+  if cls == Int16 then return ic:ToInt16() end
+  if cls == UInt16 then return ic:ToUInt16() end
+  if cls == Int32 then return ic:ToInt32() end
+  if cls == UInt32 then return ic:ToUInt32() end
+  if cls == Int64 then return ic:ToInt64() end
+  if cls == UInt64 then return ic:ToUInt64() end
+  if cls == Single then return ic:ToSingle() end
+  if cls == Double then return ic:ToDouble() end
+  if cls == DateTime then return ic:ToDateTime() end
+  if cls == String then return ic:ToString() end
+  if cls == Object then return value end
+end
+
+local function defaultToType(value, targetType)
+  if targetType == nil then throw(ArgumentNullException("targetType")) end
+  if value:GetType() == targetType then return value end
+  local v = toBaseType(value, targetType)
+  if v ~= nil then
+    return v
+  end
+  throw(InvalidCastException())
+end
+
+local function changeType(value, conversionType)
+  if conversionType == nil then
+    throw(ArgumentNullException("conversionType"))
+  end
+  if value == nil then
+    if conversionType:getIsValueType() then
+      throw(InvalidCastException("InvalidCast_CannotCastNullToValueType"))
+    end
+    return nil
+  end
+  local ic = as(value, IConvertible)
+  if ic == nil then
+    if value:GetType() == conversionType then
+      return value
+    end
+    throw(InvalidCastException("InvalidCast_IConvertible"))
+  end
+  local v = toBaseType(ic, conversionType)
+  if v ~= nil then
+    return v
+  end
+  return ic.ToType(conversionType)
+end
+
+local function toBits(num, bits)
+  -- returns a table of bits, most significant first.
+  bits = bits or math.max(1, select(2, math.frexp(num)))
+  local t = {} -- will contain the bits        
+  for b = bits, 1, -1 do
+    local i =  num % 2
+    t[b] = i
+    num = System.div(num - i, 2)
+  end
+  if bits == 64 and t[1] == 0 then
+    return tconcat(t, nil, 2, bits)
+  end
+  return tconcat(t)
+end
+
+local function toString(value, toBaseOrProvider, cast)
+  if value == nil then
+    return ""
+  end
+  if toBaseOrProvider then
+    if type(toBaseOrProvider) == "number" then
+      if toBaseOrProvider ~= 10 then
+        if cast and value < 0 then
+          value = cast(value)
+        end
+      end
+      if toBaseOrProvider == 2 then
+        return toBits(value)
+      elseif toBaseOrProvider == 8 then
+        return ("%o"):format(value)
+      elseif toBaseOrProvider == 10 then
+        return value .. ""
+      elseif toBaseOrProvider == 16 then
+        return ("%x"):format(value)
+      else
+        throw(ArgumentException())
+      end
+    end
+  end
+  return systemToString(value)
+end
+
+define("System.Convert", {
+  ToBoolean = toBoolean,
+  ToChar = toChar,
+  ToSByte = toSByte,
+  ToByte = toByte,
+  ToInt16 = toInt16,
+  ToUInt16 = toUInt16,
+  ToInt32 = toInt32,
+  ToUInt32 = toUInt32,
+  ToInt64 = toInt64,
+  ToUInt64 = toUInt64,
+  ToSingle = toSingle,
+  ToDouble = toDouble,
+  ToDateTime = toDateTime,
+  ChangeType = changeType,
+  ToString = toString,
+  ToStringFromChar = string.char
+})
+
+String.ToBoolean = toBoolean
+String.ToChar = toChar
+String.ToSByte = toSByte
+String.ToByte = toByte
+String.ToInt16 = toInt16
+String.ToUInt16 = toUInt16
+String.ToInt32 = toInt32
+String.ToUInt32 = toUInt32
+String.ToInt64 = toInt64
+String.ToUInt64 = toUInt64
+String.ToSingle = identityFn
+String.ToDouble = toDouble
+String.ToDateTime = toDateTime
+String.ToType = defaultToType
+
+local function throwInvalidCastException()
+  throw(InvalidCastException())
+end
+
+local Number = System.Number
+Number.ToBoolean = toBoolean
+Number.ToChar = toChar
+Number.ToSByte = toSByte
+Number.ToByte = toByte
+Number.ToInt16 = toInt16
+Number.ToUInt16 = toUInt16
+Number.ToInt32 = toInt32
+Number.ToUInt32 = toUInt32
+Number.ToInt64 = toInt64
+Number.ToUInt64 = toUInt64
+Number.ToSingle = toSingle
+Number.ToDouble = toDouble
+Number.ToDateTime = throwInvalidCastException
+Number.ToType = defaultToType
+
+Boolean.ToBoolean = identityFn
+Boolean.ToChar = throwInvalidCastException
+Boolean.ToSByte = toSByte
+Boolean.ToByte = toByte
+Boolean.ToInt16 = toInt16
+Boolean.ToUInt16 = toUInt16
+Boolean.ToInt32 = toInt32
+Boolean.ToUInt32 = toUInt32
+Boolean.ToInt64 = toInt64
+Boolean.ToUInt64 = toUInt64
+Boolean.ToSingle = toSingle
+Boolean.ToDouble = toDouble
+Boolean.ToDateTime = throwInvalidCastException
+Boolean.ToType = defaultToType
+
+DateTime.ToBoolean = throwInvalidCastException
+DateTime.ToChar = throwInvalidCastException
+DateTime.ToSByte = throwInvalidCastException
+DateTime.ToByte = throwInvalidCastException
+DateTime.ToInt16 = throwInvalidCastException
+DateTime.ToUInt16 = throwInvalidCastException
+DateTime.ToInt32 = throwInvalidCastException
+DateTime.ToUInt32 = throwInvalidCastException
+DateTime.ToInt64 = throwInvalidCastException
+DateTime.ToUInt64 = throwInvalidCastException
+DateTime.ToSingle = throwInvalidCastException
+DateTime.ToDouble = throwInvalidCastException
+DateTime.ToDateTime = identityFn
+DateTime.ToType = defaultToType
+
+
+-- BitConverter
+local band = System.band
+local bor = System.bor
+local sl = System.sl
+local sr = System.sr
+local div = System.div
+local global = System.global
+local systemToInt16 = System.toInt16
+local systemToInt32 = System.toInt32
+local systemToUInt64 = System.toUInt64
+local arrayFromTable = System.arrayFromTable
+local NotSupportedException = System.NotSupportedException
+
+local assert = assert
+local rawget = rawget
+local unpack = table.unpack
+local schar = string.char
+
+-- https://github.com/ToxicFrog/vstruct/blob/master/io/endianness.lua#L30
+local isLittleEndian = true
+if rawget(global, "jit") then
+  if require("ffi").abi("be") then
+    isLittleEndian = false
+  end
+else 
+  local dump = string.dump
+  if dump and sbyte(dump(System.emptyFn, 7)) == 0x00 then
+    isLittleEndian = false
+  end
+end
+
+local function bytes(t)
+  return arrayFromTable(t, Byte)    
+end
+
+local function checkIndex(value, startIndex, count)
+  if value == nil then throw(ArgumentNullException("value")) end
+  local len = #value
+  if startIndex < 0 or startIndex >= len then
+    throw(ArgumentOutOfRangeException("startIndex"))
+  end
+  if startIndex > len - count then
+    throw(ArgumentException())
+  end
+end
+
+local spack, sunpack, getBytesFromInt64, toInt64
+if System.luaVersion < 5.3 then
+  local struct = rawget(global, "struct")
+  if struct then
+    spack, sunpack = struct.pack, struct.upack
+  end
+  if not spack then
+    spack = function ()
+      throw(NotSupportedException("not found struct"), 1) 
+    end
+    sunpack = spack
+  end
+
+  getBytesFromInt64 = function (value)
+    if value <= -2147483647 or value >= 2147483647 then
+      local s = spack("i8", value)
+      return bytes({
+        sbyte(s, 1),
+        sbyte(s, 2),
+        sbyte(s, 3),
+        sbyte(s, 4),
+        sbyte(s, 5),
+        sbyte(s, 6),
+        sbyte(s, 7),
+        sbyte(s, 8)
+      })
+    end
+    return bytes({
+      band(value, 0xff),
+      band(sr(value, 8), 0xff),
+      band(sr(value, 16), 0xff),
+      band(sr(value, 24), 0xff),
+      0,
+      0,
+      0,
+      0
+    })
+  end
+
+  toInt64 = function (value, startIndex)
+    checkIndex(value, startIndex, 8)
+    if value <= -2147483647 or value >= 2147483647 then
+      throw(System.NotSupportedException()) 
+    end
+    if isLittleEndian then
+      local i = value[startIndex + 1]
+      i = bor(i, sl(value[startIndex + 2], 8))
+      i = bor(i, sl(value[startIndex + 3], 16))
+      i = bor(i, sl(value[startIndex + 4], 24))
+      return i
+    else
+      local i = value[startIndex + 8]
+      i = bor(i, sl(value[startIndex + 7], 8))
+      i = bor(i, sl(value[startIndex + 6], 16))
+      i = bor(i, sl(value[startIndex + 5], 24))
+      return i
+    end
+  end
+else
+  spack, sunpack = string.pack, string.unpack
+  getBytesFromInt64 = function (value)
+    return bytes({
+      band(value, 0xff),
+      band(sr(value, 8), 0xff),
+      band(sr(value, 16), 0xff),
+      band(sr(value, 24), 0xff),
+      band(sr(value, 32), 0xff),
+      band(sr(value, 40), 0xff),
+      band(sr(value, 48), 0xff),
+      band(sr(value, 56), 0xff)
+    })
+  end
+
+  toInt64 = function (value, startIndex)
+    checkIndex(value, startIndex, 8)
+    if isLittleEndian then
+      local i = value[startIndex + 1]
+      i = bor(i, sl(value[startIndex + 2], 8))
+      i = bor(i, sl(value[startIndex + 3], 16))
+      i = bor(i, sl(value[startIndex + 4], 24))
+      i = bor(i, sl(value[startIndex + 5], 32))
+      i = bor(i, sl(value[startIndex + 6], 40))
+      i = bor(i, sl(value[startIndex + 7], 48))
+      i = bor(i, sl(value[startIndex + 8], 56))
+      return i
+    else
+      local i = value[startIndex + 8]
+      i = bor(i, sl(value[startIndex + 7], 8))
+      i = bor(i, sl(value[startIndex + 6], 16))
+      i = bor(i, sl(value[startIndex + 5], 24))
+      i = bor(i, sl(value[startIndex + 4], 32))
+      i = bor(i, sl(value[startIndex + 3], 40))
+      i = bor(i, sl(value[startIndex + 2], 48))
+      i = bor(i, sl(value[startIndex + 1], 56))
+      return i
+    end
+  end
+end
+
+local function getBytesFromBoolean(value)
+  return bytes({ value and 1 or 0 })
+end
+
+local function getBytesFromInt16(value)
+  return bytes({
+    band(value, 0xff),
+    band(sr(value, 8), 0xff),
+  })
+end
+
+local function getBytesFromInt32(value)
+  return bytes({
+    band(value, 0xff),
+    band(sr(value, 8), 0xff),
+    band(sr(value, 16), 0xff),
+    band(sr(value, 24), 0xff)
+  })
+end
+
+local function getBytesFromFloat(value)
+  local s = spack("f", value)
+  return bytes({
+    sbyte(s, 1),
+    sbyte(s, 2),
+    sbyte(s, 3),
+    sbyte(s, 4)
+  })
+end
+
+local function getBytesFromDouble(value)
+  local s = spack("d", value)
+  return bytes({
+    sbyte(s, 1),
+    sbyte(s, 2),
+    sbyte(s, 3),
+    sbyte(s, 4),
+    sbyte(s, 5),
+    sbyte(s, 6),
+    sbyte(s, 7),
+    sbyte(s, 8)
+  })
+end
+
+local function toBoolean(value, startIndex)
+  checkIndex(value, startIndex, 1)
+  return value[startIndex + 1] ~= 0 and true or false
+end
+
+local function toUInt16(value, startIndex)
+  checkIndex(value, startIndex, 2)
+  if isLittleEndian then
+    value = bor(value[startIndex + 1], sl(value[startIndex + 2], 8))
+  else
+    value = bor(sl(value[startIndex + 1], 8), value[startIndex + 2])
+  end
+  return value
+end
+
+local function toInt16(value, startIndex)
+  value = toUInt16(value, startIndex)
+  return systemToInt16(value)
+end
+
+local function toUInt32(value, startIndex)
+  checkIndex(value, startIndex, 4)
+  local i
+  if isLittleEndian then
+    i = value[startIndex + 1]
+    i = bor(i, sl(value[startIndex + 2], 8))
+    i = bor(i, sl(value[startIndex + 3], 16))
+    i = bor(i, sl(value[startIndex + 4], 24))
+  else
+    local i = value[startIndex + 4]
+    i = bor(i, sl(value[startIndex + 3], 8))
+    i = bor(i, sl(value[startIndex + 2], 16))
+    i = bor(i, sl(value[startIndex + 1], 24))
+  end
+  return i
+end
+
+local function toInt32(value, startIndex)
+  value = toUInt32(value, startIndex)
+  return systemToInt32(value)
+end
+
+local function toUInt64(value, startIndex)
+  value = toInt64(value, startIndex)
+  return systemToUInt64(value)
+end
+
+local function toSingle(value, startIndex)
+  checkIndex(value, startIndex, 4)
+  return sunpack("f", schar(unpack(value, startIndex + 1)))
+end
+
+local function toDouble(value, startIndex)
+  checkIndex(value, startIndex, 8)
+  return sunpack("d", schar(unpack(value, startIndex + 1)))
+end
+
+local function getHexValue(i)
+  assert(i >= 0 and i < 16, "i is out of range.")
+  if i < 10 then
+    return i + 48
+  end
+  return i - 10 + 65
+end
+
+local function toString(value, startIndex, length)
+  if value == nil then throw(ArgumentNullException("value")) end
+  local len = #value
+  if not startIndex then
+    startIndex, length = 0, #value
+  elseif not length then
+    length = len - startIndex
+  end
+  if startIndex < 0 or (startIndex >= len and startIndex > 0) then
+    throw(ArgumentOutOfRangeException("startIndex"))
+  end
+  if length < 0 then
+    throw(ArgumentOutOfRangeException("length"))
+  end
+  if startIndex + length > len then
+    throw(ArgumentException())
+  end
+  if length == 0 then
+    return ""
+  end
+  local t = {}
+  local len = 1
+  for i = startIndex + 1, startIndex + length  do
+    local b = value[i]
+    t[len] = getHexValue(div(b, 16))
+    t[len + 1] = getHexValue(b % 16)
+    t[len + 2] = 45
+    len = len + 3
+  end
+  return schar(unpack(t, 1, len - 2))
+end
+
+local function doubleToInt64Bits(value)
+  assert(isLittleEndian, "This method is implemented assuming little endian with an ambiguous spec.")
+  local s = spack("d", value)
+  return (sunpack("i8", s))
+end
+
+local function int64BitsToDouble(value)
+  assert(isLittleEndian, "This method is implemented assuming little endian with an ambiguous spec.")
+  local s = spack("i8", value)
+  return (sunpack("d", s))
+end
+
+define("System.BitConverter", {
+  IsLittleEndian = isLittleEndian,
+  GetBytesFromBoolean = getBytesFromBoolean,
+  GetBytesFromInt16 = getBytesFromInt16,
+  GetBytesFromInt32 = getBytesFromInt32,
+  GetBytesFromInt64 = getBytesFromInt64,
+  GetBytesFromFloat = getBytesFromFloat,
+  GetBytesFromDouble = getBytesFromDouble,
+  ToBoolean = toBoolean,
+  ToChar = toUInt16,
+  ToInt16 = toInt16,
+  ToUInt16 = toUInt16,
+  ToInt32 = toInt32,
+  ToUInt32 = toUInt32,
+  ToInt64 = toInt64,
+  ToUInt64 = toUInt64,
+  ToSingle = toSingle,
+  ToDouble = toDouble,
+  ToString = toString,
+  DoubleToInt64Bits = doubleToInt64Bits,
+  Int64BitsToDouble = int64BitsToDouble
+})

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Convert.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 6c20c4463ceaef949adfe475216089e3
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1579 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Core.lua.txt

@@ -0,0 +1,1579 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local setmetatable = setmetatable
+local getmetatable = getmetatable
+local type = type
+local pairs  = pairs
+local assert = assert
+local table = table
+local tremove = table.remove
+local tconcat = table.concat
+local floor = math.floor
+local ceil = math.ceil
+local error = error
+local select = select
+local xpcall = xpcall
+local rawget = rawget
+local rawset = rawset
+local rawequal = rawequal
+local tostring = tostring
+local string = string
+local sfind = string.find
+local ssub = string.sub
+local debug = debug
+local next = next
+local global = _G
+local prevSystem = rawget(global, "System")
+
+local emptyFn = function() end
+local nilFn = function() return nil end
+local falseFn = function() return false end
+local trueFn = function() return true end
+local identityFn = function(x) return x end
+local lengthFn = function (t) return #t end
+local zeroFn = function() return 0 end
+local oneFn = function() return 1 end
+local equals = function(x, y) return x == y end
+local getCurrent = function(t) return t.current end
+local assembly, metadatas
+local System, Object, ValueType
+
+local function new(cls, ...)
+  local this = setmetatable({}, cls)
+  return this, cls.__ctor__(this, ...)
+end
+
+local function throw(e, lv)
+  if e == nil then e = System.NullReferenceException() end
+  e:traceback(lv)
+  error(e)
+end
+
+local function xpcallErr(e)
+  if e == nil then
+    e = System.Exception("script error")
+    e:traceback()
+  elseif type(e) == "string" then
+    if sfind(e, "attempt to index") then
+      e = System.NullReferenceException(e)
+    elseif sfind(e, "attempt to divide by zero") then  
+      e = System.DivideByZeroException(e)
+    else
+      e = System.Exception(e)
+    end
+    e:traceback()
+  end
+  return e
+end
+
+local function try(try, catch, finally)
+  local ok, status, result = xpcall(try, xpcallErr)
+  if not ok then
+    if catch then
+      if finally then
+        ok, status, result = xpcall(catch, xpcallErr, status)
+      else
+        ok, status, result = true, catch(status)
+      end
+      if ok then
+        if status == 1 then
+          ok = false
+          status = result
+        end
+      end
+    end
+  end
+  if finally then
+    finally()
+  end
+  if not ok then
+    error(status)
+  end
+  return status, result
+end
+
+local function set(className, cls)
+  local scope = global
+  local starIndex = 1
+  while true do
+    local pos = sfind(className, "[%.+]", starIndex) or 0
+    local name = ssub(className, starIndex, pos -1)
+    if pos ~= 0 then
+      local t = rawget(scope, name)
+      if t == nil then
+        if cls then
+          t = {}
+          rawset(scope, name, t)
+        else
+          return nil
+        end
+      end
+      scope = t
+      starIndex = pos + 1
+    else
+      if cls then
+        assert(rawget(scope, name) == nil, className)
+        rawset(scope, name, cls)
+        return cls
+      else
+        return rawget(scope, name)
+      end
+    end
+  end
+end
+
+local function multiKey(t, ...)
+  local n, i, k = select("#", ...), 1
+  while true do
+    k = assert(select(i, ...))
+    if i == n then
+      break
+    end
+    local tk = t[k]
+    if tk == nil then
+      tk = {}
+      t[k] = tk
+    end
+    t = tk
+    i = i + 1
+  end
+  return t, k
+end
+
+local function genericName(name, ...)
+  if name:byte(-2) == 95 then
+    name = ssub(name, 1, -3)
+  end
+  local n = select("#", ...)
+  local t = { name, "`", n, "[" }
+  local count = 5
+  local hascomma
+  for i = 1, n do
+    local cls = select(i, ...)
+    if hascomma then
+      t[count] = ","
+      count = count + 1
+    else
+      hascomma = true
+    end
+    t[count] = cls.__name__
+    count = count + 1
+  end
+  t[count] = "]"
+  return tconcat(t)
+end
+
+local enumMetatable = { class = "E", default = zeroFn, __index = false, interface = false, __call = function (_, v) return v or 0 end }
+enumMetatable.__index = enumMetatable
+
+local interfaceMetatable = { class = "I", default = nilFn, __index = false }
+interfaceMetatable.__index = interfaceMetatable
+
+local ctorMetatable = { __call = function (ctor, ...) return ctor[1](...) end }
+
+local function applyExtends(cls)
+  local extends = cls.base
+  if extends then
+    if type(extends) == "function" then
+      extends = extends(global, cls)
+    end
+    cls.base = nil
+  end
+  return extends
+end
+
+local function applyMetadata(cls)
+  local metadata = cls.__metadata__
+  if metadata then
+    if metadatas then
+      metadatas[#metadatas + 1] = function (global)
+        cls.__metadata__ = metadata(global)
+      end
+    else
+      cls.__metadata__ = metadata(global)
+    end
+  end
+end
+
+local function setBase(cls, kind)
+  local ctor = cls.__ctor__
+  if ctor and type(ctor) == "table" then
+    setmetatable(ctor, ctorMetatable)
+  end
+  local extends = applyExtends(cls)
+  applyMetadata(cls)
+
+  cls.__index = cls 
+  cls.__call = new
+  
+  if kind == "S" then
+    if extends then
+      cls.interface = extends
+    end
+    setmetatable(cls, ValueType)
+  else
+    if extends then
+      local base = extends[1]
+      if not base then error(cls.__name__ .. "'s base is nil") end
+      if base.class == "I" then
+        cls.interface = extends
+        setmetatable(cls, Object)
+      else
+        setmetatable(cls, base)
+        if #extends > 1 then
+          tremove(extends, 1)
+          cls.interface = extends
+        end
+      end
+    else
+      setmetatable(cls, Object)
+    end
+  end
+end
+
+local function staticCtorSetBase(cls)
+  setmetatable(cls, nil)
+  local t = cls[cls]
+  for k, v in pairs(t) do
+    cls[k] = v
+  end
+  cls[cls] = nil
+  local kind = cls.class
+  cls.class = nil
+  setBase(cls, kind)
+  cls:static()
+  cls.static = nil
+end
+
+local staticCtorMetatable = {
+  __index = function(cls, key)
+    staticCtorSetBase(cls)
+    return cls[key]
+  end,
+  __newindex = function(cls, key, value)
+    staticCtorSetBase(cls)
+    cls[key] = value
+  end,
+  __call = function(cls, ...)
+    staticCtorSetBase(cls)
+    return new(cls, ...)
+  end
+}
+
+local function setHasStaticCtor(cls, kind)
+  local name = cls.__name__
+  cls.__name__ = nil
+  local t = {}
+  for k, v in pairs(cls) do
+    t[k] = v
+    cls[k] = nil
+  end
+  cls[cls] = t
+  cls.__name__ = name
+  cls.class = kind
+  cls.__call = new
+  cls.__index = cls
+  setmetatable(cls, staticCtorMetatable)
+end
+
+local function defCore(name, kind, cls, generic)
+  cls = cls or {}
+  cls.__name__ = name
+  cls.__assembly__ = assembly
+  if not generic then
+    set(name, cls)
+  end
+  if kind == "C" or kind == "S" then
+    if cls.static == nil then
+      setBase(cls, kind)
+    else
+      setHasStaticCtor(cls, kind)
+    end
+  elseif kind == "I" then
+    local extends = applyExtends(cls)
+    if extends then 
+      cls.interface = extends 
+    end
+    applyMetadata(cls)
+    setmetatable(cls, interfaceMetatable)
+  elseif kind == "E" then
+    applyMetadata(cls)
+    setmetatable(cls, enumMetatable)
+  else
+    assert(false, kind)
+  end
+  return cls
+end
+
+local function def(name, kind, cls, generic)
+  if type(cls) == "function" then
+    local mt = {}
+    local fn = function(_, ...)
+      local gt, gk = multiKey(mt, ...)
+      local t = gt[gk]
+      if t == nil then
+        local class, super  = cls(...)
+        t = defCore(genericName(name, ...), kind, class or {}, true)
+        if generic then
+          setmetatable(t, super or generic)
+        end
+        gt[gk] = t
+      end
+      return t
+    end
+
+    local base = kind ~= "S" and Object or ValueType
+    local caller = setmetatable({ __call = fn, __index = base }, base)
+    if generic then
+      generic.__index = generic
+      generic.__call = new
+    end
+    return set(name, setmetatable(generic or {}, caller))
+  else
+    return defCore(name, kind, cls, generic)
+  end
+end
+
+local function defCls(name, cls, generic)
+  return def(name, "C", cls, generic)
+end
+
+local function defInf(name, cls)
+  return def(name, "I", cls)
+end
+
+local function defStc(name, cls, generic)
+  return def(name, "S", cls, generic)
+end
+
+local function defEnum(name, cls)
+  return def(name, "E", cls)
+end
+
+local function defArray(name, cls, Array, MultiArray)
+  Array.__index = Array
+  MultiArray.__index =  MultiArray
+  setmetatable(MultiArray, Array)
+
+  local mt = {}
+  local function create(Array, T)
+    local ArrayT = mt[T]
+    if ArrayT == nil then
+      ArrayT = defCore(T.__name__ .. "[]", "C", cls(T), true)
+      setmetatable(ArrayT, Array)
+      mt[T] = ArrayT
+    end
+    return ArrayT
+  end
+
+  local mtMulti = {}
+  local function createMulti(MultiArray, T, dimension)
+    local gt, gk = multiKey(mtMulti, T, dimension)
+    local ArrayT = gt[gk]
+    if ArrayT == nil then
+      local name = T.__name__ .. "[" .. (","):rep(dimension - 1) .. "]"
+      ArrayT = defCore(name, "C", cls(T), true)
+      setmetatable(ArrayT, MultiArray)
+      gt[gk] = ArrayT
+    end
+    return ArrayT
+  end
+
+  return set(name, setmetatable(Array, {
+    __index = Object,
+    __call = function (Array, T, dimension)
+      if not dimension then
+        return create(Array, T)
+      else
+        return createMulti(MultiArray, T, dimension)
+      end
+    end
+  }))
+end
+
+local function trunc(num)
+  return num > 0 and floor(num) or ceil(num)
+end
+
+local function when(f, ...)
+  local ok, r = pcall(f, ...)
+  return ok and r
+end
+
+System = {
+  emptyFn = emptyFn,
+  falseFn = falseFn,
+  trueFn = trueFn,
+  identityFn = identityFn,
+  lengthFn = lengthFn,
+  zeroFn = zeroFn,
+  oneFn = oneFn,
+  equals = equals,
+  getCurrent = getCurrent,
+  try = try,
+  when = when,
+  throw = throw,
+  getClass = set,
+  multiKey = multiKey,
+  define = defCls,
+  defInf = defInf,
+  defStc = defStc,
+  defEnum = defEnum,
+  defArray = defArray,
+  enumMetatable = enumMetatable,
+  trunc = trunc,
+  global = global
+}
+if prevSystem then
+  setmetatable(System, { __index = prevSystem })
+end
+global.System = System
+
+local debugsetmetatable = debug and debug.setmetatable
+System.debugsetmetatable = debugsetmetatable
+
+local _, _, version = sfind(_VERSION, "^Lua (.*)$")
+version = tonumber(version)
+System.luaVersion = version
+
+if version < 5.3 then
+  local bnot, band, bor, xor, sl, sr
+  local bit = rawget(global, "bit")
+  if not bit then
+    local ok, b = pcall(require, "bit")
+    if ok then
+      bit = b
+    end
+  end
+  if bit then
+    bnot, band, bor, xor, sl, sr = bit.bnot, bit.band, bit.bor, bit.bxor, bit.lshift, bit.rshift
+  else
+    local function disable()
+      throw(System.NotSupportedException("bit operation is not enabled."))
+    end
+    bnot, band, bor, xor, sl, sr  = disable, disable, disable, disable, disable, disable
+  end
+
+  System.bnot = bnot
+  System.band = band
+  System.bor = bor
+  System.xor = xor
+  System.sl = sl
+  System.sr = sr
+
+  function System.div(x, y) 
+    if y == 0 then throw(System.DivideByZeroException(), 1) end
+    return trunc(x / y)
+  end
+
+  function System.mod(x, y)
+    if y == 0 then throw(System.DivideByZeroException(), 1) end
+    local v = x % y
+    if v ~= 0 and x * y < 0 then
+      return v - y
+    end
+    return v
+  end
+  
+  function System.modf(x, y)
+    local v = x % y
+    if v ~= 0 and x * y < 0 then
+      return v - y
+    end
+    return v
+  end
+
+  function System.toUInt(v, max, mask, checked)
+    if v >= 0 and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return band(v, mask)
+  end
+
+  function System.ToUInt(v, max, mask, checked)
+    v = trunc(v)
+    if v >= 0 and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    if v < -2147483648 or v > 2147483647 then
+      return 0
+    end
+    return band(v, mask)
+  end
+
+  local function toInt(v, mask, umask)
+    v = band(v, mask)
+    local uv = band(v, umask)
+    if uv ~= v then
+      v = xor(uv - 1, umask)
+      if uv ~= 0 then
+        v = -v
+      end
+    end
+    return v
+  end
+
+  function System.toInt(v, min, max, mask, umask, checked)
+    if v >= min and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return toInt(v, mask, umask)
+  end
+
+  function System.ToInt(v, min, max, mask, umask, checked)
+    v = trunc(v)
+    if v >= min and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    if v < -2147483648 or v > 2147483647 then
+      return 0
+    end
+    return toInt(v, mask, umask)
+  end
+
+  local function toUInt32(v)
+    if v <= -2251799813685248 or v >= 2251799813685248 then  -- 2 ^ 51, Lua BitOp used 51 and 52
+      throw(System.InvalidCastException()) 
+    end
+    v = band(v, 0xffffffff)
+    local uv = band(v, 0x7fffffff)
+    if uv ~= v then
+      return uv + 0x80000000
+    end
+    return v
+  end
+
+  function System.toUInt32(v, checked)
+    if v >= 0 and v <= 4294967295 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return toUInt32(v)
+  end
+
+  function System.ToUInt32(v, checked)
+    v = trunc(v)
+    if v >= 0 and v <= 4294967295 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return toUInt32(v)
+  end
+
+  function System.toInt32(v, checked)
+    if v >= -2147483648 and v <= 2147483647 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    if v <= -2251799813685248 or v >= 2251799813685248 then  -- 2 ^ 51, Lua BitOp used 51 and 52
+      throw(System.InvalidCastException()) 
+    end
+    return band(v, 0xffffffff)
+  end
+
+  function System.toInt64(v, checked) 
+    if v >= -9223372036854775808 and v <= 9223372036854775807 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    throw(System.InvalidCastException()) -- 2 ^ 51, Lua BitOp used 51 and 52
+  end
+
+  function System.toUInt64(v, checked)
+    if v >= 0 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    if v >= -2147483648 then
+      return band(v, 0x7fffffff) + 0xffffffff80000000
+    end
+    throw(System.InvalidCastException()) 
+  end
+
+  function System.ToUInt64(v, checked)
+    v = trunc(v)
+    if v >= 0 and v <= 18446744073709551615 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    if v >= -2147483648 and v <= 2147483647 then
+      v = band(v, 0xffffffff)
+      local uv = band(v, 0x7fffffff)
+      if uv ~= v then
+        return uv + 0xffffffff80000000
+      end
+      return v
+    end
+    throw(System.InvalidCastException()) 
+  end
+
+  if table.pack == nil then
+    table.pack = function(...)
+      return { n = select("#", ...), ... }
+    end
+  end
+
+  if table.unpack == nil then
+    table.unpack = assert(unpack)
+  end
+
+  if table.move == nil then
+    table.move = function(a1, f, e, t, a2)
+      if a2 == nil then a2 = a1 end
+      if t > f then
+        t = e - f + t
+        while e >= f do
+          a2[t] = a1[e]
+          t = t - 1
+          e = e - 1
+        end
+      else
+        while f <= e do
+          a2[t] = a1[f]
+          t = t + 1
+          f = f + 1
+        end
+      end
+    end
+  end
+else
+  load[[
+  local System = System
+  local throw = System.throw
+  local trunc = System.trunc
+  
+  function System.bnot(x) return ~x end 
+  function System.band(x, y) return x & y end
+  function System.bor(x, y) return x | y end
+  function System.xor(x, y) return x ~ y end
+  function System.sl(x, y) return x << y end
+  function System.sr(x, y) return x >> y end
+  function System.div(x, y) if x ~ y < 0 then return -(-x // y) end return x // y end
+
+  function System.mod(x, y)
+    local v = x % y
+    if v ~= 0 and 1.0 * x * y < 0 then
+      return v - y
+    end
+    return v
+  end
+
+  local function toUInt(v, max, mask, checked)  
+    if v >= 0 and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 2) 
+    end
+    return v & mask
+  end
+  System.toUInt = toUInt
+
+  function System.ToUInt(v, max, mask, checked)
+    v = trunc(v)
+    if v >= 0 and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 2) 
+    end
+    if v < -2147483648 or v > 2147483647 then
+      return 0
+    end
+    return v & mask
+  end
+  
+  local function toSingedInt(v, mask, umask)
+    v = v & mask
+    local uv = v & umask
+    if uv ~= v then
+      v = (uv - 1) ~ umask
+      if uv ~= 0 then
+        v = -v
+      end
+    end
+    return v
+  end
+  
+  local function toInt(v, min, max, mask, umask, checked)
+    if v >= min and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 2) 
+    end
+    return toSingedInt(v, mask, umask)
+  end
+  System.toInt = toInt
+  
+  function System.ToInt(v, min, max, mask, umask, checked)
+    v = trunc(v)
+    if v >= min and v <= max then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 2) 
+    end
+    if v < -2147483648 or v > 2147483647 then
+      return 0
+    end
+    return toSingedInt(v, mask, umask)
+  end
+
+  function System.toUInt32(v, checked)
+    return toUInt(v, 4294967295, 0xffffffff, checked)
+  end
+  
+  function System.ToUInt32(v, checked)
+    v = trunc(v)
+    if v >= 0 and v <= 4294967295 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return v & 0xffffffff
+  end
+  
+  function System.toInt32(v, checked)
+    return toInt(v, -2147483648, 2147483647, 0xffffffff, 0x7fffffff, checked)
+  end
+
+  function System.toInt64(v, checked)
+    return toInt(v, -9223372036854775808, 9223372036854775807, 0xffffffffffffffff, 0x7fffffffffffffff, checked)
+  end
+
+  function System.toUInt64(v, checked)
+    if v >= 0 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    return (v & 0x7fffffffffffffff) + 0x8000000000000000
+  end
+
+  function System.ToUInt64(v, checked)
+    v = trunc(v)
+    if v >= 0 and v <= 18446744073709551615 then
+      return v
+    end
+    if checked then
+      throw(System.OverflowException(), 1) 
+    end
+    v = v & 0xffffffffffffffff
+    local uv = v & 0x7fffffffffffffff
+    if uv ~= v then
+      return uv + 0x8000000000000000
+    end
+    return v
+  end
+
+  ]]()
+end
+
+local toUInt = System.toUInt
+local toInt = System.toInt
+local ToUInt = System.ToUInt
+local ToInt = System.ToInt
+
+function System.toByte(v, checked)
+  return toUInt(v, 255, 0xff, checked)
+end
+
+function System.toSByte(v, checked)
+  return toInt(v, -128, 127, 0xff, 0x7f, checked)
+end
+
+function System.toInt16(v, checked)
+  return toInt(v, -32768, 32767, 0xffff, 0x7fff, checked)
+end
+
+function System.toUInt16(v, checked)
+  return toUInt(v, 65535, 0xffff, checked)
+end
+
+function System.ToByte(v, checked)
+  return ToUInt(v, 255, 0xff, checked)
+end
+
+function System.ToSByte(v, checked)
+  return ToInt(v, -128, 127, 0xff, 0x7f, checked)
+end
+
+function System.ToInt16(v, checked)
+  return ToInt(v, -32768, 32767, 0xffff, 0x7fff, checked)
+end
+
+function System.ToUInt16(v, checked)
+  return ToUInt(v, 65535, 0xffff, checked)
+end
+
+function System.ToInt32(v, checked)
+  v = trunc(v)
+  if v >= -2147483648 and v <= 2147483647 then
+    return v
+  end
+  if checked then
+    throw(System.OverflowException(), 1) 
+  end
+  return -2147483648
+end
+
+function System.ToInt64(v, checked)
+  v = trunc(v)
+  if v >= -9223372036854775808 and v <= 9223372036854775807 then
+    return v
+  end
+  if checked then
+    throw(System.OverflowException(), 1) 
+  end
+  return -9223372036854775808
+end
+
+function System.ToSingle(v, checked)
+  if v >= -3.40282347E+38 and v <= 3.40282347E+38 then
+    return v
+  end
+  if checked then
+    throw(System.OverflowException(), 1) 
+  end
+  if v > 0 then
+    return 1 / 0 
+  else
+    return -1 / 0
+  end
+end
+
+function System.using(t, f)
+  local dispose = t and t.Dispose
+  if dispose ~= nil then
+    local ok, status, ret = xpcall(f, xpcallErr, t)   
+    dispose(t)
+    if not ok then
+      error(status)
+    end
+    return status, ret
+  else
+    return f(t)    
+  end
+end
+
+function System.usingX(f, ...)
+  local ok, status, ret = xpcall(f, xpcallErr, ...)
+  for i = 1, select("#", ...) do
+    local t = select(i, ...)
+    if t ~= nil then
+      local dispose = t.Dispose
+      if dispose ~= nil then
+        dispose(t)
+      end
+    end
+  end
+  if not ok then
+    error(status)
+  end
+  return status, ret
+end
+
+function System.apply(t, f)
+  f(t)
+  return t
+end
+
+function System.default(T)
+  return T:default()
+end
+
+function System.property(name)
+  local function g(this)
+    return this[name]
+  end
+  local function s(this, v)
+    this[name] = v
+  end
+  return g, s
+end
+
+function System.new(cls, index, ...)
+  local this = setmetatable({}, cls)
+  return this, cls.__ctor__[index](this, ...)
+end
+
+function System.base(this)
+  return getmetatable(getmetatable(this))
+end
+
+local equalsObj, compareObj, toString
+if debugsetmetatable then
+  equalsObj = function (x, y)
+    if x == y then
+      return true
+    end
+    if x == nil or y == nil then
+      return false
+    end
+    local ix = x.EqualsObj
+    if ix ~= nil then
+      return ix(x, y)
+    end
+    local iy = y.EqualsObj
+    if iy ~= nil then
+      return iy(y, x)
+    end
+    return false
+  end
+
+  compareObj = function (a, b)
+    if a == b then return 0 end
+    if a == nil then return -1 end
+    if b == nil then return 1 end
+    local ia = a.CompareToObj
+    if ia ~= nil then
+      return ia(a, b)
+    end
+    local ib = b.CompareToObj
+    if ib ~= nil then
+      return -ib(b, a)
+    end
+    throw(System.ArgumentException("Argument_ImplementIComparable"))
+  end
+
+  toString = function (t)
+    return t ~= nil and t:ToString() or ""
+  end
+
+  debugsetmetatable(nil, {
+    __concat = function(a, b)
+      if a == nil then
+        if b == nil then
+          return ""
+        else
+          return b
+        end
+      else
+        return a
+      end
+    end,
+    __add = function (a, b)
+      if a == nil then
+        if b == nil or type(b) == "number" then
+          return nil
+        end
+        return b
+      end
+      return nil
+    end,
+    __sub = nilFn,
+    __mul = nilFn,
+    __div = nilFn,
+    __mod = nilFn,
+    __unm = nilFn,
+    __lt = falseFn,
+    __le = falseFn,
+
+    -- lua 5.3
+    __idiv = nilFn,
+    __band = nilFn,
+    __bor = nilFn,
+    __bxor = nilFn,
+    __bnot = nilFn,
+    __shl = nilFn,
+    __shr = nilFn,
+  })
+else
+  equalsObj = function (x, y)
+    if x == y then
+      return true
+    end
+    if x == nil or y == nil then
+      return false
+    end
+    local t = type(x)
+    if t == "table" then
+      local ix = x.EqualsObj
+      if ix ~= nil then
+        return ix(x, y)
+      end
+    elseif t == "number" then
+      return System.Number.EqualsObj(x, y)
+    end
+    t = type(y)
+    if t == "table" then
+      local iy = y.EqualsObj
+      if iy ~= nil then
+        return iy(y, x)
+      end
+    end
+    return false
+  end
+
+  compareObj = function (a, b)
+    if a == b then return 0 end
+    if a == nil then return -1 end
+    if b == nil then return 1 end
+    local t = type(a)
+    if t == "number" then
+      return System.Number.CompareToObj(a, b)
+    elseif t == "boolean" then
+      return System.Boolean.CompareToObj(a, b)
+    else
+      local ia = a.CompareToObj
+      if ia ~= nil then
+        return ia(a, b)
+      end
+    end
+    t = type(b)
+    if t == "number" then
+      return -System.Number.CompareToObj(b, a)
+    elseif t == "boolean" then
+      return -System.Boolean.CompareToObj(a, b)
+    else
+      local ib = b.CompareToObj
+      if ib ~= nil then
+        return -ib(b, a)
+      end
+    end
+    throw(System.ArgumentException("Argument_ImplementIComparable"))
+  end
+
+  toString = function (obj)
+    if obj == nil then return "" end
+    local t = type(obj) 
+    if t == "table" then
+      return obj:ToString()
+    elseif t == "boolean" then
+      return obj and "True" or "False"
+    elseif t == "function" then
+      return "System.Delegate"
+    end
+    return tostring(obj)
+  end
+end
+
+System.equalsObj = equalsObj
+System.compareObj = compareObj
+System.toString = toString
+
+Object = defCls("System.Object", {
+  __call = new,
+  __ctor__ = emptyFn,
+  default = nilFn,
+  class = "C",
+  EqualsObj = equals,
+  ReferenceEquals = rawequal,
+  GetHashCode = identityFn,
+  EqualsStatic = equalsObj,
+  GetType = false,
+  ToString = function(this) return this.__name__ end
+})
+setmetatable(Object, { __call = new })
+
+ValueType = defCls("System.ValueType", {
+  class = "S",
+  default = function(T) 
+    return T()
+  end,
+  __clone__ = function(this)
+    if type(this) == "table" then
+      local cls = getmetatable(this)
+      local t = {}
+      for k, v in pairs(this) do
+        if type(v) == "table" and v.class == "S" then
+          t[k] = v:__clone__()
+        else
+          t[k] = v
+        end
+      end
+      return setmetatable(t, cls)
+    end
+    return this
+  end,
+  __copy__ = function (this, obj)
+    for k, v in pairs(obj) do
+      if type(v) == "table" and v.class == "S" then
+        this[k] = v:__clone__()
+      else
+        this[k] = v
+      end
+    end
+    for k, v in pairs(this) do
+      if v ~= nil and rawget(obj, k) == nil then
+        this[k] = nil
+      end
+    end
+  end,
+  EqualsObj = function (this, obj)
+    if getmetatable(this) ~= getmetatable(obj) then return false end
+    for k, v in pairs(this) do
+      if not equalsObj(v, obj[k]) then
+        return false
+      end
+    end
+    return true
+  end,
+  GetHashCode = function (this)
+    throw(System.NotSupportedException(this.__name__ .. " User-defined struct not support GetHashCode"), 1)
+  end
+})
+
+local AnonymousType
+AnonymousType = defCls("System.AnonymousType", {
+  EqualsObj = function (this, obj)
+    if getmetatable(obj) ~= AnonymousType then return false end
+    for k, v in pairs(this) do
+      if not equalsObj(v, obj[k]) then
+        return false
+      end
+    end
+    return true
+  end
+})
+
+local function anonymousTypeCreate(T, t)
+  return setmetatable(t, T)
+end
+
+local anonymousTypeMetaTable = setmetatable({ __index = Object, __call = anonymousTypeCreate }, Object)
+setmetatable(AnonymousType, anonymousTypeMetaTable)
+
+local pack, unpack = table.pack, table.unpack
+
+local function tupleDeconstruct(t) 
+  return unpack(t, 1, t.n)
+end
+
+local function tupleEquals(t, other)
+  for i = 1, t.n do
+    if not equalsObj(t[i], other[i]) then
+      return false
+    end
+  end
+  return true
+end
+
+local function tupleEqualsObj(t, obj)
+  if getmetatable(obj) ~= getmetatable(t) or t.n ~= obj.n then
+    return false
+  end
+  return tupleEquals(t, obj)
+end
+
+local function tupleCompareTo(t, other)
+  for i = 1, t.n do
+    local v = compareObj(t[i], other[i])
+    if v ~= 0 then
+      return v
+    end
+  end
+  return 0
+end
+
+local function tupleCompareToObj(t, obj)
+  if obj == nil then return 1 end
+  if getmetatable(obj) ~= getmetatable(t) or t.n ~= obj.n then
+    throw(System.ArgumentException())
+  end
+  return tupleCompareTo(t, obj)
+end
+
+local function tupleToString(t)
+  local a = { "(" }
+  local count = 2
+  for i = 1, t.n do
+    if i ~= 1 then
+      a[count] = ", "
+      count = count + 1
+    end
+    local v = t[i]
+    if v ~= nil then
+      a[count] = v:ToString()
+      count = count + 1
+    end
+  end
+  a[count] = ")"
+  return tconcat(a)
+end
+
+local function tupleLength(t)
+  return t.n
+end
+
+local function tupleGet(t, index)
+  if index < 0 or index >= t.n then
+    throw(System.IndexOutOfRangeException())
+  end
+  return t[index + 1]
+end
+
+local function tupleGetRest(t)
+  return t[8]
+end
+
+local function tupleCreate(T, ...)
+  return setmetatable(pack(...), T)
+end
+
+local Tuple = defCls("System.Tuple", {
+  Deconstruct = tupleDeconstruct,
+  ToString = tupleToString,
+  EqualsObj = tupleEqualsObj,
+  CompareToObj = tupleCompareToObj,
+  getLength = tupleLength,
+  get = tupleGet,
+  getRest = tupleGetRest
+})
+local tupleMetaTable = setmetatable({ __index  = Object, __call = tupleCreate }, Object)
+setmetatable(Tuple, tupleMetaTable)
+
+local ValueTuple = defStc("System.ValueTuple", {
+  Deconstruct = tupleDeconstruct,
+  ToString = tupleToString,
+  __eq = tupleEquals,
+  Equals = tupleEquals,
+  EqualsObj = tupleEqualsObj,
+  CompareTo = tupleCompareTo,
+  CompareToObj = tupleCompareToObj,
+  getLength = tupleLength,
+  get = tupleGet,
+  default = function ()
+    throw(System.NotSupportedException("not support default(T) when T is ValueTuple"))
+  end
+})
+local valueTupleMetaTable = setmetatable({ __index  = ValueType, __call = tupleCreate }, ValueType)
+setmetatable(ValueTuple, valueTupleMetaTable)
+
+local function recordEquals(t, other)
+  if getmetatable(t) == getmetatable(other) then
+    for k, v in pairs(t) do
+      if not equalsObj(v, other[k]) then
+        return false
+      end
+    end
+    return true
+  end
+  return false
+end
+
+defCls("System.RecordType", {
+  __eq = recordEquals,
+  __clone__ = function (this)
+    local cls = getmetatable(this)
+    local t = {}
+    for k, v in pairs(this) do
+      t[k] = v
+    end
+    return setmetatable(t, cls)
+  end,
+  Equals = recordEquals,
+  PrintMembers = function (this, builder)
+    local p = pack(this.__members__())
+    local n = p.n
+    for i = 2, n do
+      local k = p[i]
+      local v = this[k]
+      builder:Append(k)
+      builder:Append(" = ")
+      if v ~= nil then
+        builder:Append(toString(v))
+      end
+      if i ~= n then
+        builder:Append(", ")
+      end
+    end
+  end,
+  ToString = function (this)
+    local p = pack(this.__members__())
+    local n = p.n
+    local t = { p[1], "{" }
+    local count = 3
+    for i = 2, n do
+      local k = p[i]
+      local v = this[k]
+      t[count] = k
+      t[count + 1] = "="
+      if v ~= nil then
+        if i ~= n then
+          t[count + 2] = toString(v) .. ','
+        else
+          t[count + 2] = toString(v)
+        end
+      else
+        if i ~= n then
+          t[count + 2] = ','
+        end
+      end
+      if v == nil and i == n then
+        count = count + 2
+      else
+        count = count + 3
+      end
+    end
+    t[count] = "}"
+    return tconcat(t, ' ')
+  end
+})
+
+local Attribute = defCls("System.Attribute")
+defCls("System.FlagsAttribute", { base = { Attribute } })
+
+local Nullable = { 
+  default = nilFn,
+  Value = function (this)
+    if this == nil then
+      throw(System.InvalidOperationException("Nullable object must have a value."))
+    end
+    return this
+  end,
+  EqualsObj = equalsObj,
+  GetHashCode = function (this)
+    if this == nil then
+      return 0
+    end
+    if type(this) == "table" then
+      return this:GetHashCode()
+    end
+    return this
+  end,
+  clone = function (t)
+    if type(t) == "table" then
+      return t:__clone__()
+    end
+    return t
+  end
+}
+
+defStc("System.Nullable", function (T)
+  return { 
+    __genericT__ = T 
+  }
+end, Nullable)
+
+function System.isNullable(T)
+  return getmetatable(T) == Nullable
+end
+
+local Index = defStc("System.Index", {
+  End = -0.0,
+  Start = 0,
+  IsFromEnd = function (this)
+    return 1 / this < 0 
+  end,
+  GetOffset = function (this, length)
+    if 1 / this < 0 then
+      return length + this
+    end
+    return this
+  end,
+  ToString = function (this)
+    return ((1 / this < 0) and '^' or '') .. this
+  end
+})
+setmetatable(Index, { 
+  __call = function (value, fromEnd)
+    if value < 0 then
+      throw(System.ArgumentOutOfRangeException("Non-negative number required."))
+    end
+    if fromEnd then
+      if value == 0 then
+        return -0.0
+      end
+      return -value
+    end
+    return value
+  end
+})
+
+local function pointerAddress(p)
+  local address = p[3]
+  if address == nil then
+    address = ssub(tostring(p), 7)
+    p[3] = address
+  end
+  return address + p[2]
+end
+
+local Pointer
+local function newPointer(t, i)
+  return setmetatable({ t, i }, Pointer)
+end
+
+Pointer = {
+  __index = false,
+  get = function(this)
+    local t, i = this[1], this[2]
+    return t[i]
+  end,
+  set = function(this, value)
+    local t, i = this[1], this[2]
+    t[i] = value
+  end,
+  __add = function(this, count)
+    return newPointer(this[1], this[2] + count)
+  end,
+  __sub = function(this, count)
+    return newPointer(this[1], this[2] - count)
+  end,
+  __lt = function(t1, t2)
+    return pointerAddress(t1) < pointerAddress(t2)
+  end,
+  __le = function(t1, t2)
+    return pointerAddress(t1) <= pointerAddress(t2)
+  end
+}
+Pointer.__index = Pointer
+
+function System.stackalloc(t)
+  return newPointer(t, 1)
+end
+
+local modules, imports = {}, {}
+function System.import(f)
+  imports[#imports + 1] = f
+end
+
+local namespace
+local function defIn(kind, name, f)
+  local namespaceName, isClass = namespace[1], namespace[2]
+  if #namespaceName > 0 then
+    name = namespaceName .. (isClass and "+" or ".") .. name
+  end
+  assert(modules[name] == nil, name)
+  namespace[1], namespace[2] = name, kind == "C" or kind == "S"
+  local t = f(assembly)
+  namespace[1], namespace[2] = namespaceName, isClass
+  modules[isClass and name:gsub("+", ".") or name] = function()
+    return def(name, kind, t)
+  end
+end
+
+namespace = {
+  "",
+  false,
+  __index = false,
+  class = function(name, f) defIn("C", name, f) end,
+  struct = function(name, f) defIn("S", name, f) end,
+  interface = function(name, f) defIn("I", name, f) end,
+  enum = function(name, f) defIn("E", name, f) end,
+  namespace = function(name, f)
+    local namespaceName = namespace[1]
+    name = namespaceName .. "." .. name
+    namespace[1] = name
+    f(namespace)
+    namespace[1] = namespaceName
+  end
+}
+namespace.__index = namespace
+
+function System.namespace(name, f)
+  if not assembly then assembly = setmetatable({}, namespace) end
+  namespace[1] = name
+  f(namespace)
+  namespace[1], namespace[2] = "", false
+end
+
+function System.init(t)
+  local path, files = t.path, t.files
+  if files then
+    path = (path and #path > 0) and (path .. '.') or ""
+    for i = 1, #files do
+      require(path .. files[i])
+    end
+  end
+
+  metadatas = {}
+  local types = t.types
+  if types then
+    local classes = {}
+    for i = 1, #types do
+      local name = types[i]
+      local cls = assert(modules[name], name)()
+      classes[i] = cls
+    end
+    assembly.classes = classes
+  end
+
+  for i = 1, #imports do
+    imports[i](global)
+  end
+
+  local b, e = 1, #metadatas
+  while true do
+    for i = b, e do
+      metadatas[i](global)
+    end
+    local len = #metadatas
+    if len == e then
+      break
+    end
+    b, e = e + 1, len
+  end
+
+  local main = t.Main
+  if main then
+    assembly.entryPoint = main
+    System.entryAssembly = assembly
+  end
+
+  local attributes = t.assembly
+  if attributes then
+    if type(attributes) == "function" then
+      attributes = attributes(global)
+    end
+    for k, v in pairs(attributes) do
+      assembly[k] = v
+    end
+  end
+
+  local current = assembly
+  modules, imports, assembly, metadatas = {}, {}, nil, nil
+  return current
+end
+
+System.config = rawget(global, "CSharpLuaSystemConfig") or {}
+local isSingleFile = rawget(global, "CSharpLuaSingleFile")
+if not isSingleFile then
+  return function (config)
+    if config then
+      System.config = config 
+    end
+  end
+end

+ 7 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/Core.lua.txt.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 45bb7e93b3d083046b18a2ce465d79f9
+TextScriptImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 447 - 0
Unity/Assets/Bundles/Lua/CSharpLua/CoreSystem/DateTime.lua.txt

@@ -0,0 +1,447 @@
+--[[
+Copyright 2017 YANG Huan (sy.yanghuan@gmail.com).
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--]]
+
+local System = System
+local throw = System.throw
+local div = System.div
+local trunc = System.trunc
+
+local TimeSpan = System.TimeSpan
+local compare = TimeSpan.Compare
+local ArgumentOutOfRangeException = System.ArgumentOutOfRangeException
+local ArgumentException = System.ArgumentException
+local ArgumentNullException = System.ArgumentNullException
+local FormatException = System.FormatException
+
+local assert = assert
+local getmetatable = getmetatable
+local select = select
+local sformat = string.format
+local sfind = string.find
+local os = os
+local ostime = os.time
+local osdifftime = os.difftime
+local osdate = os.date
+local tonumber = tonumber
+local math = math
+local floor = math.floor
+local log10 = math.log10
+local modf = math.modf
+
+--http://referencesource.microsoft.com/#mscorlib/system/datetime.cs
+local DateTime
+local minValue
+
+local daysToMonth365 = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
+local daysToMonth366 = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
+
+local function isLeapYear(year) 
+  if year < 1 or year > 9999 then 
+    throw(ArgumentOutOfRangeException("year", "ArgumentOutOfRange_Year"))
+  end
+  return year % 4 == 0 and (year % 100 ~= 0 or year % 400 == 0)
+end
+
+local function dateToTicks(year, month, day) 
+  if year >= 1 and year <= 9999 and month >= 1 and month <= 12 then
+    local days = isLeapYear(year) and daysToMonth366 or daysToMonth365
+    if day >= 1 and day <= days[month + 1] - days[month] then
+      local y = year - 1
+      local n = y * 365 + div(y, 4) - div(y, 100) + div(y, 400) + days[month] + day - 1
+      return n * 864000000000
+    end
+  end
+end
+
+local function timeToTicks(hour, minute, second)
+  if hour >= 0 and hour < 24 and minute >= 0 and minute < 60 and second >=0 and second < 60 then 
+    return (((hour * 60 + minute) * 60) + second) * 10000000
+  end
+  throw(ArgumentOutOfRangeException("ArgumentOutOfRange_BadHourMinuteSecond"))
+end
+
+local function checkTicks(ticks)
+  if ticks < 0 or ticks > 3155378975999999999 then
+    throw(ArgumentOutOfRangeException("ticks", "ArgumentOutOfRange_DateTimeBadTicks"))
+  end
+end
+
+local function checkKind(kind) 
+  if kind and (kind < 0 or kind > 2) then
+    throw(ArgumentOutOfRangeException("kind"))
+  end
+end
+
+local function addTicks(this, value)
+  return DateTime(this.ticks + value, this.kind)
+end
+
+local function addTimeSpan(this, ts)
+  return addTicks(this, ts.ticks)
+end
+
+local function add(this, value, scale)
+  local millis = trunc(value * scale + (value >= 0 and 0.5 or -0.5))
+  return addTicks(this, millis * 10000)
+end
+
+local function subtract(this, v) 
+  if getmetatable(v) == DateTime then
+    return TimeSpan(this.ticks - v.ticks)
+  end
+  return DateTime(this.ticks - v.ticks, this.kind) 
+end
+
+local function getDataPart(ticks, part)
+  local n = div(ticks, 864000000000)
+  local y400 = div(n, 146097)
+  n = n - y400 * 146097
+  local y100 = div(n, 36524)
+  if y100 == 4 then y100 = 3 end
+  n = n - y100 * 36524
+  local y4 = div(n, 1461)
+  n = n - y4 * 1461;
+  local y1 = div(n, 365)
+  if y1 == 4 then y1 = 3 end
+  if part == 0 then
+    return y400 * 400 + y100 * 100 + y4 * 4 + y1 + 1
+  end
+  n = n - y1 * 365
+  if part == 1 then return n + 1 end
+  local leapYear = y1 == 3 and (y4 ~= 24 or y100 == 3)
+  local days = leapYear and daysToMonth366 or daysToMonth365
+  local m = div(n, 32) + 1
+  while n >= days[m + 1] do m = m + 1 end
+  if part == 2 then return m end
+  return n - days[m] + 1
+end
+
+local function getDatePart(ticks)
+  local year, month, day
+  local n = div(ticks, 864000000000)
+  local y400 = div(n, 146097)
+  n = n - y400 * 146097
+  local y100 = div(n, 36524)
+  if y100 == 4 then y100 = 3 end
+  n = n - y100 * 36524
+  local y4 = div(n, 1461)
+  n = n - y4 * 1461
+  local y1 = div(n, 365)
+  if y1 == 4 then y1 = 3 end
+  year = y400 * 400 + y100 * 100 + y4 * 4 + y1 + 1
+  n = n - y1 * 365
+  local leapYear = y1 == 3 and (y4 ~= 24 or y100 == 3)
+  local days = leapYear and daysToMonth366 or daysToMonth365
+  local m = div(n, 32) + 1
+  while n >= days[m + 1] do m = m + 1 end
+  month = m
+  day = n - days[m] + 1
+  return year, month, day
+end
+
+local function daysInMonth(year, month)
+  if month < 1 or month > 12 then
+    throw(ArgumentOutOfRangeException("month"))
+  end
+  local days = isLeapYear(year) and daysToMonth366 or daysToMonth365
+  return days[month + 1] - days[month]
+end
+
+local function addMonths(this, months)
+  if months < -120000 or months > 12000 then
+    throw(ArgumentOutOfRangeException("months"))
+  end
+  local ticks = this.ticks
+  local y, m, d = getDatePart(ticks)
+  local i = m - 1 + months
+  if i >= 0 then
+    m = i % 12 + 1
+    y = y + div(i, 12)
+  else
+    m = 12 + (i + 1) % -12
+    y = y + div(i - 11, 12)
+  end
+  if y < 1 or y > 9999 then
+    throw(ArgumentOutOfRangeException("months")) 
+  end
+  local days = daysInMonth(y, m)
+  if d > days then d = days end
+  return DateTime(dateToTicks(y, m, d) + ticks % 864000000000, this.kind)
+end
+
+local function getTimeZone()
+  local date = osdate("*t")
+  local dst = date.isdst
+  local now = ostime(date)
+  return osdifftime(now, ostime(osdate("!*t", now))) * 10000000, dst and 3600 * 10000000 or 0 
+end
+
+local timeZoneTicks, dstTicks = getTimeZone()
+
+local time = System.config.time or ostime
+System.time = time
+System.currentTimeMillis = function () return trunc(time() * 1000) end
+
+local function now()
+  local seconds = time()
+  local ticks = seconds * 10000000 + timeZoneTicks + dstTicks + 621355968000000000
+  return DateTime(ticks, 2)
+end
+
+local function parse(s)
+  if s == nil then
+    return nil, 1
+  end
+  local i, j, year, month, day, hour, minute, second, milliseconds
+  i, j, year, month, day = sfind(s, "^%s*(%d+)%s*/%s*(%d+)%s*/%s*(%d+)%s*")
+  if i == nil then
+    return nil, 2
+  else
+    year, month, day = tonumber(year), tonumber(month), tonumber(day)
+  end
+  if j < #s then
+    i, j, hour, minute = sfind(s, "^(%d+)%s*:%s*(%d+)", j + 1)
+    if i == nil then
+      return nil, 2
+    else
+      hour, minute = tonumber(hour), tonumber(minute)
+    end
+    local next = j + 1
+    i, j, second = sfind(s, "^:%s*(%d+)", next)
+    if i == nil then
+      if sfind(s, "^%s*$", next) == nil then
+        return nil, 2
+      else
+        second = 0
+        milliseconds = 0
+      end
+    else
+      second = tonumber(second)
+      next = j + 1
+      i, j, milliseconds = sfind(s, "^%.(%d+)%s*$", next)
+      if i == nil then
+        if sfind(s, "^%s*$", next) == nil then
+          return nil, 2
+        else
+          milliseconds = 0
+        end
+      else
+        milliseconds = tonumber(milliseconds)
+        local n = floor(log10(milliseconds) + 1)
+        if n > 3 then
+          if n <= 7 then
+            milliseconds = milliseconds / (10 ^ (n - 3))
+          else
+            local ticks = milliseconds / (10 ^ (n - 7))
+            local _, decimal = modf(ticks)
+            if decimal > 0.5 then
+              ticks = ticks + 1
+            end
+            milliseconds = floor(ticks) / 10000
+          end
+        end
+      end
+    end
+  end
+  if hour == nil then
+    return DateTime(year, month, day)
+  end
+  return DateTime(year, month, day, hour, minute, second, milliseconds)
+end
+
+DateTime = System.defStc("System.DateTime", {
+  ticks = 0,
+  kind = 0,
+  Compare = compare,
+  CompareTo = compare,
+  CompareToObj = function (this, t)
+    if t == nil then return 1 end
+    if getmetatable(t) ~= DateTime then
+      throw(ArgumentException("Arg_MustBeDateTime"))
+    end
+    return compare(this, t)
+  end,
+  Equals = function (t1, t2)
+    return t1.ticks == t2.ticks
+  end,
+  EqualsObj = function (this, t)
+    if getmetatable(t) == DateTime then
+      return this.ticks == t.ticks
+    end
+    return false
+  end,
+  GetHashCode = function (this)
+    return this.ticks
+  end,
+  IsLeapYear = isLeapYear,
+  __ctor__ = function (this, ...)
+    local len = select("#", ...)
+    if len == 0 then
+    elseif len == 1 then
+      local ticks = ...
+      checkTicks(ticks)
+      this.ticks = ticks
+    elseif len == 2 then
+      local ticks, kind = ...
+      checkTicks(ticks)
+      checkKind(kind)
+      this.ticks = ticks
+      this.kind = kind
+    elseif len == 3 then
+      this.ticks = dateToTicks(...)
+    elseif len == 6 then
+      local year, month, day, hour, minute, second = ...
+      this.ticks = dateToTicks(year, month, day) + timeToTicks(hour, minute, second)
+    elseif len == 7 then
+      local year, month, day, hour, minute, second, millisecond = ...
+      this.ticks = dateToTicks(year, month, day) + timeToTicks(hour, minute, second) + millisecond * 10000
+    elseif len == 8 then
+      local year, month, day, hour, minute, second, millisecond, kind = ...
+      checkKind(kind)
+      this.ticks = dateToTicks(year, month, day) + timeToTicks(hour, minute, second) + millisecond * 10000
+      this.kind = kind
+    else
+      assert(false)
+    end
+  end,
+  AddTicks = addTicks,
+  Add = addTimeSpan,
+  AddDays = function (this, days)
+    return add(this, days, 86400000)
+  end,
+  AddHours = function (this, hours)
+    return add(this, hours, 3600000)
+  end,
+  AddMinutes = function (this, minutes) 
+    return add(this, minutes, 60000);
+  end,
+  AddSeconds = function (this, seconds)
+    return add(this, seconds, 1000)
+  end,
+  AddMilliseconds = function (this, milliseconds)
+    return add(this, milliseconds, 1)
+  end,
+  DaysInMonth = daysInMonth,
+  AddMonths = addMonths,
+  AddYears = function (this, years)
+    if years < - 10000 or years > 10000 then
+      throw(ArgumentOutOfRangeException("years")) 
+    end
+    return addMonths(this, years * 12)
+  end,
+  SpecifyKind = function (this, kind)
+    return DateTime(this.ticks, kind)
+  end,
+  Subtract = subtract,
+  getDay = function (this)
+    return getDataPart(this.ticks, 3)
+  end,
+  getDate = function (this)
+    local ticks = this.ticks
+    return DateTime(ticks - ticks % 864000000000, this.kind)
+  end,
+  getDayOfWeek = function (this)
+    return (div(this.ticks, 864000000000) + 1) % 7
+  end,
+  getDayOfYear = function (this)
+    return getDataPart(this.ticks, 1)
+  end,
+  getKind = function (this)
+    return this.kind
+  end,
+  getHour = TimeSpan.getHours,
+  getMinute = TimeSpan.getMinutes,
+  getSecond = TimeSpan.getSeconds,
+  getMillisecond = TimeSpan.getMilliseconds,
+  getMonth = function (this)
+    return getDataPart(this.ticks, 2)
+  end,
+  getYear = function (this)
+    return getDataPart(this.ticks, 0)
+  end,
+  getTimeOfDay = function (this)
+    return TimeSpan(this.ticks % 864000000000)
+  end,
+  getTicks = function (this)
+    return this.ticks
+  end,
+  BaseUtcOffset = TimeSpan(timeZoneTicks),
+  getUtcNow = function ()
+    local seconds = time()
+    local ticks = seconds * 10000000 + 621355968000000000
+    return DateTime(ticks, 1)
+  end,
+  getNow = now,
+  getToday = function ()
+    return now():getDate()
+  end,
+  ToLocalTime = function (this)
+    if this.kind == 2 then 
+      return this
+    end
+    local ticks = this.ticks + timeZoneTicks + dstTicks
+    return DateTime(ticks, 2)
+  end,
+  ToUniversalTime = function (this)
+    if this.kind == 1 then
+      return this
+    end
+    local ticks = this.ticks - timeZoneTicks - dstTicks
+    return DateTime(ticks, 1)
+  end,
+  IsDaylightSavingTime = function(this)
+    return this.kind == 2 and dstTicks > 0
+  end,
+  ToString = function (this)
+    local year, month, day = getDatePart(this.ticks)
+    return sformat("%d/%d/%d %02d:%02d:%02d", year, month, day, this:getHour(), this:getMinute(), this:getSecond())
+  end,
+  Parse = function (s)
+    local v, err = parse(s)
+    if v then
+      return v
+    end
+    if err == 1 then
+      throw(ArgumentNullException())
+    else
+      throw(FormatException())
+    end
+  end,
+  TryParse = function(s)
+    local v = parse(s)
+    if v then
+      return true, v
+    end
+    return false, minValue
+  end,
+  __add = addTimeSpan,
+  __sub = subtract,
+  __eq = TimeSpan.__eq,
+  __lt = TimeSpan.__lt,
+  __le = TimeSpan.__le,
+  base =  function(_, T)
+    return { System.IComparable, System.IComparable_1(T), System.IConvertible, System.IEquatable_1(T), System.IFormattable }
+  end,
+  default = function ()
+    return minValue
+  end,
+  MinValue = false,
+  MaxValue = false
+})
+
+minValue = DateTime(0)
+DateTime.MinValue = minValue
+DateTime.MaxValue = DateTime(3155378975999999999)

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác