diff options
author | jfrijters <jfrijters> | 2014-07-01 19:09:11 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2014-07-01 19:09:11 +0400 |
commit | 3bfe04144498cb03e1ea1ccecf553dc85bbe70b7 (patch) | |
tree | d5a1a5feb52da66bc251a0b876931187db0c5f68 | |
parent | 3315d085eafe00dcfaae4120bce2b63a39dc07d9 (diff) |
Make Boxer helper class available to runtime.
-rw-r--r-- | ikvmc.8.csproj | 4 | ||||
-rw-r--r-- | ikvmc/Proxy.cs | 191 | ||||
-rw-r--r-- | ikvmc/ikvmc.build | 27 | ||||
-rw-r--r-- | runtime/Boxer.cs | 212 | ||||
-rw-r--r-- | runtime/IKVM.Runtime.8.csproj | 19 | ||||
-rw-r--r-- | runtime/runtime.build | 51 |
6 files changed, 329 insertions, 175 deletions
diff --git a/ikvmc.8.csproj b/ikvmc.8.csproj index 71a657cd..0f5d45bf 100644 --- a/ikvmc.8.csproj +++ b/ikvmc.8.csproj @@ -35,7 +35,7 @@ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> - <DefineConstants>TRACE;DEBUG;STATIC_COMPILER;IKVM_REF_EMIT</DefineConstants> + <DefineConstants>TRACE;DEBUG;STATIC_COMPILER;EMITTERS</DefineConstants> <DocumentationFile> </DocumentationFile> <DebugSymbols>true</DebugSymbols> @@ -91,6 +91,7 @@ <Compile Include="runtime\BigEndianBinaryReader.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="runtime\Boxer.cs" /> <Compile Include="runtime\ByteCode.cs"> <SubType>Code</SubType> </Compile> @@ -123,6 +124,7 @@ <Compile Include="runtime\MemberWrapper.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="runtime\MethodHandleUtil.cs" /> <Compile Include="runtime\profiler.cs"> <SubType>Code</SubType> </Compile> diff --git a/ikvmc/Proxy.cs b/ikvmc/Proxy.cs index 14f87273..4bd2a4fb 100644 --- a/ikvmc/Proxy.cs +++ b/ikvmc/Proxy.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2011 Jeroen Frijters + Copyright (C) 2011-2014 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -23,6 +23,7 @@ */ using System; using System.Collections.Generic; +using IKVM.Attributes; using IKVM.Reflection; using IKVM.Reflection.Emit; using Type = IKVM.Reflection.Type; @@ -143,6 +144,7 @@ namespace IKVM.Internal // Check for duplicates if (!MethodExists(methods, mw)) { + mw.Link(); methods.Add(mw); } } @@ -220,9 +222,20 @@ namespace IKVM.Internal private static void CreateNoFail(CompilerClassLoader loader, TypeWrapper[] interfaces, List<ProxyMethod> methods) { + bool ispublic = true; + Type[] interfaceTypes = new Type[interfaces.Length]; + for (int i = 0; i < interfaceTypes.Length; i++) + { + ispublic &= interfaces[i].IsPublic; + interfaceTypes[i] = interfaces[i].TypeAsBaseType; + } + TypeAttributes attr = TypeAttributes.Class | TypeAttributes.Sealed; + attr |= ispublic ? TypeAttributes.NestedPublic : TypeAttributes.NestedAssembly; DynamicClassLoader factory = (DynamicClassLoader)loader.GetTypeWrapperFactory(); - TypeBuilder tb = factory.DefineProxy(proxyClass, interfaces); + TypeBuilder tb = factory.DefineProxy(TypeNameUtil.GetProxyNestedName(interfaces), attr, proxyClass.TypeAsBaseType, interfaceTypes); AttributeHelper.SetImplementsAttribute(tb, interfaces); + // we apply an InnerClass attribute to avoid the CompiledTypeWrapper heuristics for figuring out the modifiers + AttributeHelper.SetInnerClass(tb, null, ispublic ? Modifiers.Public | Modifiers.Final : Modifiers.Final); CreateConstructor(tb); for (int i = 0; i < methods.Count; i++) { @@ -232,7 +245,7 @@ namespace IKVM.Internal { CreateMethod(loader, tb, method); } - CreateStaticInitializer(tb, methods); + CreateStaticInitializer(tb, methods, loader); } private static void CreateConstructor(TypeBuilder tb) @@ -297,7 +310,7 @@ namespace IKVM.Internal } else if (returnType.IsPrimitive) { - Boxer.EmitUnbox(ilgen, returnType); + Boxer.EmitUnbox(ilgen, returnType, true); } else if (returnType != CoreClasses.java.lang.Object.Wrapper) { @@ -341,9 +354,9 @@ namespace IKVM.Internal ilgen.DoEmit(); } - private static void CreateStaticInitializer(TypeBuilder tb, List<ProxyMethod> methods) + private static void CreateStaticInitializer(TypeBuilder tb, List<ProxyMethod> methods, CompilerClassLoader loader) { - CodeEmitter ilgen = CodeEmitter.Create(ReflectUtil.DefineTypeInitializer(tb)); + CodeEmitter ilgen = CodeEmitter.Create(ReflectUtil.DefineTypeInitializer(tb, loader)); CodeEmitterLocal callerID = ilgen.DeclareLocal(CoreClasses.ikvm.@internal.CallerID.Wrapper.TypeAsSignatureType); TypeBuilder tbCallerID = DynamicTypeWrapper.FinishContext.EmitCreateCallerID(tb, ilgen); ilgen.Emit(OpCodes.Stloc, callerID); @@ -401,7 +414,10 @@ namespace IKVM.Internal Dictionary<string, MethodWrapper> methods = new Dictionary<string, MethodWrapper>(); foreach (MethodWrapper mw in tw.GetMethods()) { - methods.Add(mw.Name + mw.Signature, mw); + if (mw.IsVirtual) + { + methods.Add(mw.Name + mw.Signature, mw); + } } foreach (TypeWrapper iface in tw.Interfaces) { @@ -438,165 +454,4 @@ namespace IKVM.Internal } } } - - static class Boxer - { - private static readonly TypeWrapper javaLangByte; - private static readonly MethodWrapper byteValue; - private static readonly MethodWrapper valueOfByte; - private static readonly TypeWrapper javaLangBoolean; - private static readonly MethodWrapper booleanValue; - private static readonly MethodWrapper valueOfBoolean; - private static readonly TypeWrapper javaLangShort; - private static readonly MethodWrapper shortValue; - private static readonly MethodWrapper valueOfShort; - private static readonly TypeWrapper javaLangCharacter; - private static readonly MethodWrapper charValue; - private static readonly MethodWrapper valueOfCharacter; - private static readonly TypeWrapper javaLangInteger; - private static readonly MethodWrapper intValue; - private static readonly MethodWrapper valueOfInteger; - private static readonly TypeWrapper javaLangFloat; - private static readonly MethodWrapper floatValue; - private static readonly MethodWrapper valueOfFloat; - private static readonly TypeWrapper javaLangLong; - private static readonly MethodWrapper longValue; - private static readonly MethodWrapper valueOfLong; - private static readonly TypeWrapper javaLangDouble; - private static readonly MethodWrapper doubleValue; - private static readonly MethodWrapper valueOfDouble; - - static Boxer() - { - ClassLoaderWrapper bootClassLoader = ClassLoaderWrapper.GetBootstrapClassLoader(); - javaLangByte = bootClassLoader.LoadClassByDottedNameFast("java.lang.Byte"); - byteValue = javaLangByte.GetMethodWrapper("byteValue", "()B", false); - byteValue.Link(); - valueOfByte = javaLangByte.GetMethodWrapper("valueOf", "(B)Ljava.lang.Byte;", false); - valueOfByte.Link(); - javaLangBoolean = bootClassLoader.LoadClassByDottedNameFast("java.lang.Boolean"); - booleanValue = javaLangBoolean.GetMethodWrapper("booleanValue", "()Z", false); - booleanValue.Link(); - valueOfBoolean = javaLangBoolean.GetMethodWrapper("valueOf", "(Z)Ljava.lang.Boolean;", false); - valueOfBoolean.Link(); - javaLangShort = bootClassLoader.LoadClassByDottedNameFast("java.lang.Short"); - shortValue = javaLangShort.GetMethodWrapper("shortValue", "()S", false); - shortValue.Link(); - valueOfShort = javaLangShort.GetMethodWrapper("valueOf", "(S)Ljava.lang.Short;", false); - valueOfShort.Link(); - javaLangCharacter = bootClassLoader.LoadClassByDottedNameFast("java.lang.Character"); - charValue = javaLangCharacter.GetMethodWrapper("charValue", "()C", false); - charValue.Link(); - valueOfCharacter = javaLangCharacter.GetMethodWrapper("valueOf", "(C)Ljava.lang.Character;", false); - valueOfCharacter.Link(); - javaLangInteger = bootClassLoader.LoadClassByDottedNameFast("java.lang.Integer"); - intValue = javaLangInteger.GetMethodWrapper("intValue", "()I", false); - intValue.Link(); - valueOfInteger = javaLangInteger.GetMethodWrapper("valueOf", "(I)Ljava.lang.Integer;", false); - valueOfInteger.Link(); - javaLangFloat = bootClassLoader.LoadClassByDottedNameFast("java.lang.Float"); - floatValue = javaLangFloat.GetMethodWrapper("floatValue", "()F", false); - floatValue.Link(); - valueOfFloat = javaLangFloat.GetMethodWrapper("valueOf", "(F)Ljava.lang.Float;", false); - valueOfFloat.Link(); - javaLangLong = bootClassLoader.LoadClassByDottedNameFast("java.lang.Long"); - longValue = javaLangLong.GetMethodWrapper("longValue", "()J", false); - longValue.Link(); - valueOfLong = javaLangLong.GetMethodWrapper("valueOf", "(J)Ljava.lang.Long;", false); - valueOfLong.Link(); - javaLangDouble = bootClassLoader.LoadClassByDottedNameFast("java.lang.Double"); - doubleValue = javaLangDouble.GetMethodWrapper("doubleValue", "()D", false); - doubleValue.Link(); - valueOfDouble = javaLangDouble.GetMethodWrapper("valueOf", "(D)Ljava.lang.Double;", false); - valueOfDouble.Link(); - } - - internal static void EmitUnbox(CodeEmitter ilgen, TypeWrapper tw) - { - if (tw == PrimitiveTypeWrapper.BYTE) - { - javaLangByte.EmitCheckcast(ilgen); - byteValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.BOOLEAN) - { - javaLangBoolean.EmitCheckcast(ilgen); - booleanValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.SHORT) - { - javaLangShort.EmitCheckcast(ilgen); - shortValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.CHAR) - { - javaLangCharacter.EmitCheckcast(ilgen); - charValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.INT) - { - javaLangInteger.EmitCheckcast(ilgen); - intValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.FLOAT) - { - javaLangFloat.EmitCheckcast(ilgen); - floatValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.LONG) - { - javaLangLong.EmitCheckcast(ilgen); - longValue.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.DOUBLE) - { - javaLangDouble.EmitCheckcast(ilgen); - doubleValue.EmitCall(ilgen); - } - else - { - throw new InvalidOperationException(); - } - } - - internal static void EmitBox(CodeEmitter ilgen, TypeWrapper tw) - { - if (tw == PrimitiveTypeWrapper.BYTE) - { - valueOfByte.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.BOOLEAN) - { - valueOfBoolean.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.SHORT) - { - valueOfShort.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.CHAR) - { - valueOfCharacter.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.INT) - { - valueOfInteger.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.FLOAT) - { - valueOfFloat.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.LONG) - { - valueOfLong.EmitCall(ilgen); - } - else if (tw == PrimitiveTypeWrapper.DOUBLE) - { - valueOfDouble.EmitCall(ilgen); - } - else - { - throw new InvalidOperationException(); - } - } - } } diff --git a/ikvmc/ikvmc.build b/ikvmc/ikvmc.build index af5dcb9c..a77ed836 100644 --- a/ikvmc/ikvmc.build +++ b/ikvmc/ikvmc.build @@ -1,9 +1,32 @@ <?xml version="1.0"?> +<!-- + Copyright (C) 2002-2013 Jeroen Frijters + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jeroen Frijters + jeroen@frijters.net + +--> <project name="ikvmc" default="ikvmc"> <include buildfile="../ikvm.include" /> <target name="ikvmc"> - <property name="defs" value="TRACE;STATIC_COMPILER" /> + <property name="defs" value="TRACE;STATIC_COMPILER;EMITTERS" /> <if test="${property::exists('signed')}"> <property name="defs" value="${defs};${signed}" /> </if> @@ -25,6 +48,7 @@ <include name="../runtime/atomic.cs" /> <include name="../runtime/attributes.cs" /> <include name="../runtime/BigEndianBinaryReader.cs" /> + <include name="../runtime/Boxer.cs" /> <include name="../runtime/ByteCode.cs" /> <include name="../runtime/ClassFile.cs" /> <include name="../runtime/ClassLoaderWrapper.cs" /> @@ -39,6 +63,7 @@ <include name="../runtime/JsrInliner.cs" /> <include name="../runtime/LocalVars.cs" /> <include name="../runtime/MemberWrapper.cs" /> + <include name="../runtime/MethodHandleUtil.cs" /> <include name="../runtime/profiler.cs" /> <include name="../runtime/ReflectUtil.cs" /> <include name="../runtime/RuntimeHelperTypes.cs" /> diff --git a/runtime/Boxer.cs b/runtime/Boxer.cs new file mode 100644 index 00000000..880e015e --- /dev/null +++ b/runtime/Boxer.cs @@ -0,0 +1,212 @@ +/* + Copyright (C) 2011-2014 Jeroen Frijters + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jeroen Frijters + jeroen@frijters.net + +*/ +using System; + +namespace IKVM.Internal +{ + static class Boxer + { + private static readonly TypeWrapper javaLangByte; + private static readonly MethodWrapper byteValue; + private static readonly MethodWrapper valueOfByte; + private static readonly TypeWrapper javaLangBoolean; + private static readonly MethodWrapper booleanValue; + private static readonly MethodWrapper valueOfBoolean; + private static readonly TypeWrapper javaLangShort; + private static readonly MethodWrapper shortValue; + private static readonly MethodWrapper valueOfShort; + private static readonly TypeWrapper javaLangCharacter; + private static readonly MethodWrapper charValue; + private static readonly MethodWrapper valueOfCharacter; + private static readonly TypeWrapper javaLangInteger; + private static readonly MethodWrapper intValue; + private static readonly MethodWrapper valueOfInteger; + private static readonly TypeWrapper javaLangFloat; + private static readonly MethodWrapper floatValue; + private static readonly MethodWrapper valueOfFloat; + private static readonly TypeWrapper javaLangLong; + private static readonly MethodWrapper longValue; + private static readonly MethodWrapper valueOfLong; + private static readonly TypeWrapper javaLangDouble; + private static readonly MethodWrapper doubleValue; + private static readonly MethodWrapper valueOfDouble; + + static Boxer() + { + ClassLoaderWrapper bootClassLoader = ClassLoaderWrapper.GetBootstrapClassLoader(); + javaLangByte = bootClassLoader.LoadClassByDottedNameFast("java.lang.Byte"); + byteValue = javaLangByte.GetMethodWrapper("byteValue", "()B", false); + byteValue.Link(); + valueOfByte = javaLangByte.GetMethodWrapper("valueOf", "(B)Ljava.lang.Byte;", false); + valueOfByte.Link(); + javaLangBoolean = bootClassLoader.LoadClassByDottedNameFast("java.lang.Boolean"); + booleanValue = javaLangBoolean.GetMethodWrapper("booleanValue", "()Z", false); + booleanValue.Link(); + valueOfBoolean = javaLangBoolean.GetMethodWrapper("valueOf", "(Z)Ljava.lang.Boolean;", false); + valueOfBoolean.Link(); + javaLangShort = bootClassLoader.LoadClassByDottedNameFast("java.lang.Short"); + shortValue = javaLangShort.GetMethodWrapper("shortValue", "()S", false); + shortValue.Link(); + valueOfShort = javaLangShort.GetMethodWrapper("valueOf", "(S)Ljava.lang.Short;", false); + valueOfShort.Link(); + javaLangCharacter = bootClassLoader.LoadClassByDottedNameFast("java.lang.Character"); + charValue = javaLangCharacter.GetMethodWrapper("charValue", "()C", false); + charValue.Link(); + valueOfCharacter = javaLangCharacter.GetMethodWrapper("valueOf", "(C)Ljava.lang.Character;", false); + valueOfCharacter.Link(); + javaLangInteger = bootClassLoader.LoadClassByDottedNameFast("java.lang.Integer"); + intValue = javaLangInteger.GetMethodWrapper("intValue", "()I", false); + intValue.Link(); + valueOfInteger = javaLangInteger.GetMethodWrapper("valueOf", "(I)Ljava.lang.Integer;", false); + valueOfInteger.Link(); + javaLangFloat = bootClassLoader.LoadClassByDottedNameFast("java.lang.Float"); + floatValue = javaLangFloat.GetMethodWrapper("floatValue", "()F", false); + floatValue.Link(); + valueOfFloat = javaLangFloat.GetMethodWrapper("valueOf", "(F)Ljava.lang.Float;", false); + valueOfFloat.Link(); + javaLangLong = bootClassLoader.LoadClassByDottedNameFast("java.lang.Long"); + longValue = javaLangLong.GetMethodWrapper("longValue", "()J", false); + longValue.Link(); + valueOfLong = javaLangLong.GetMethodWrapper("valueOf", "(J)Ljava.lang.Long;", false); + valueOfLong.Link(); + javaLangDouble = bootClassLoader.LoadClassByDottedNameFast("java.lang.Double"); + doubleValue = javaLangDouble.GetMethodWrapper("doubleValue", "()D", false); + doubleValue.Link(); + valueOfDouble = javaLangDouble.GetMethodWrapper("valueOf", "(D)Ljava.lang.Double;", false); + valueOfDouble.Link(); + } + + internal static void EmitUnbox(CodeEmitter ilgen, TypeWrapper tw, bool cast) + { + if (tw == PrimitiveTypeWrapper.BYTE) + { + if (cast) + { + javaLangByte.EmitCheckcast(ilgen); + } + byteValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.BOOLEAN) + { + if (cast) + { + javaLangBoolean.EmitCheckcast(ilgen); + } + booleanValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.SHORT) + { + if (cast) + { + javaLangShort.EmitCheckcast(ilgen); + } + shortValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.CHAR) + { + if (cast) + { + javaLangCharacter.EmitCheckcast(ilgen); + } + charValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.INT) + { + if (cast) + { + javaLangInteger.EmitCheckcast(ilgen); + } + intValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.FLOAT) + { + if (cast) + { + javaLangFloat.EmitCheckcast(ilgen); + } + floatValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.LONG) + { + if (cast) + { + javaLangLong.EmitCheckcast(ilgen); + } + longValue.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.DOUBLE) + { + if (cast) + { + javaLangDouble.EmitCheckcast(ilgen); + } + doubleValue.EmitCall(ilgen); + } + else + { + throw new InvalidOperationException(); + } + } + + internal static void EmitBox(CodeEmitter ilgen, TypeWrapper tw) + { + if (tw == PrimitiveTypeWrapper.BYTE) + { + valueOfByte.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.BOOLEAN) + { + valueOfBoolean.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.SHORT) + { + valueOfShort.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.CHAR) + { + valueOfCharacter.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.INT) + { + valueOfInteger.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.FLOAT) + { + valueOfFloat.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.LONG) + { + valueOfLong.EmitCall(ilgen); + } + else if (tw == PrimitiveTypeWrapper.DOUBLE) + { + valueOfDouble.EmitCall(ilgen); + } + else + { + throw new InvalidOperationException(); + } + } + } +} diff --git a/runtime/IKVM.Runtime.8.csproj b/runtime/IKVM.Runtime.8.csproj index 15f4814c..5635c0fd 100644 --- a/runtime/IKVM.Runtime.8.csproj +++ b/runtime/IKVM.Runtime.8.csproj @@ -36,7 +36,7 @@ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> - <DefineConstants>TRACE;DEBUG</DefineConstants> + <DefineConstants>TRACE;DEBUG;EMITTERS</DefineConstants> <DocumentationFile> </DocumentationFile> <DebugSymbols>true</DebugSymbols> @@ -87,6 +87,7 @@ <Compile Include="AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Assertions.cs" /> <Compile Include="atomic.cs" /> <Compile Include="attributes.cs"> <SubType>Code</SubType> @@ -94,6 +95,7 @@ <Compile Include="BigEndianBinaryReader.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Boxer.cs" /> <Compile Include="ByteCode.cs"> <SubType>Code</SubType> </Compile> @@ -120,6 +122,7 @@ <Compile Include="DynamicClassLoader.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="DynamicMethodUtils.cs" /> <Compile Include="DynamicTypeWrapper.cs" /> <Compile Include="ExceptionHelper.cs"> <SubType>Code</SubType> @@ -145,11 +148,23 @@ <Compile Include="MemberWrapper.cs"> <SubType>Code</SubType> </Compile> - <Compile Include="openjdk.cs" /> + <Compile Include="MethodHandleUtil.cs" /> + <Compile Include="openjdk\java.io.cs" /> + <Compile Include="openjdk\java.lang.cs" /> <Compile Include="openjdk\java.lang.invoke.cs" /> + <Compile Include="openjdk\java.lang.reflect.cs" /> + <Compile Include="openjdk\java.net.cs" /> + <Compile Include="openjdk\java.nio.cs" /> + <Compile Include="openjdk\java.security.cs" /> + <Compile Include="openjdk\java.util.cs" /> + <Compile Include="openjdk\java.util.prefs.cs" /> + <Compile Include="openjdk\misc.cs" /> <Compile Include="openjdk\sun.management.cs" /> + <Compile Include="openjdk\sun.misc.cs" /> <Compile Include="openjdk\sun.nio.ch.cs" /> + <Compile Include="openjdk\sun.reflect.cs" /> <Compile Include="openjdk\sun.security.krb5.cs" /> + <Compile Include="openjdk\sun.util.locale.provider.cs" /> <Compile Include="PassiveWeakDictionary.cs" /> <Compile Include="profiler.cs"> <SubType>Code</SubType> diff --git a/runtime/runtime.build b/runtime/runtime.build index 96e1bb2a..4cb81818 100644 --- a/runtime/runtime.build +++ b/runtime/runtime.build @@ -1,4 +1,27 @@ <?xml version="1.0"?> +<!-- + Copyright (C) 2002-2013 Jeroen Frijters + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jeroen Frijters + jeroen@frijters.net + +--> <project name="IKVM.Runtime" default="full"> <include buildfile="../ikvm.include" /> @@ -20,7 +43,11 @@ <target name="signed"> <property name="signed" value="SIGNCODE" /> <property name="signoption" value="-key:ikvm-key" /> - <property name="ilasm_signoption" value="/key:@ikvm-key" /> + <call target="full" /> + </target> + + <target name="no-ref-emit"> + <property name="no-ref-emit" value="true" /> <call target="full" /> </target> @@ -60,7 +87,7 @@ </target> <target name="defs"> - <property name="defs" value="TRACE" /> + <property name="defs" value="TRACE;EMITTERS" /> <if test="${property::exists('signed')}"> <property name="defs" value="${defs};${signed}" /> </if> @@ -70,6 +97,9 @@ <if test="${first-pass}"> <property name="defs" value="${defs};FIRST_PASS" /> </if> + <if test="${property::exists('no-ref-emit')}"> + <property name="defs" value="${defs};NO_REF_EMIT" /> + </if> </target> <target name="IKVM.Runtime.JNI" depends="JniAssemblyInfo.cs defs"> @@ -107,9 +137,11 @@ <include name="../CommonAssemblyInfo.cs" /> <include name="AssemblyInfo.cs" /> <include name="AssemblyClassLoader.cs" /> + <include name="Assertions.cs" /> <include name="atomic.cs" /> <include name="attributes.cs" /> <include name="BigEndianBinaryReader.cs" /> + <include name="Boxer.cs" /> <include name="ByteCode.cs" /> <include name="ByteCodeHelper.cs" /> <include name="ClassFile.cs" /> @@ -120,6 +152,7 @@ <include name="CoreClasses.cs" /> <include name="DotNetTypeWrapper.cs" /> <include name="DynamicClassLoader.cs" /> + <include name="DynamicMethodUtils.cs" /> <include name="DynamicTypeWrapper.cs" /> <include name="ExceptionHelper.cs" /> <include name="intrinsics.cs" /> @@ -127,7 +160,7 @@ <include name="JsrInliner.cs" /> <include name="LocalVars.cs" /> <include name="MemberWrapper.cs" /> - <include name="openjdk.cs" /> + <include name="MethodHandleUtil.cs" /> <include name="PassiveWeakDictionary.cs" /> <include name="profiler.cs" /> <include name="ReflectUtil.cs" /> @@ -151,10 +184,22 @@ <include name="fdlibm/s_log1p.cs" /> <include name="fdlibm/s_scalbn.cs" /> <include name="fdlibm/s_tan.cs" /> + <include name="openjdk/java.io.cs" /> + <include name="openjdk/java.lang.cs" /> <include name="openjdk/java.lang.invoke.cs" /> + <include name="openjdk/java.lang.reflect.cs" /> + <include name="openjdk/java.net.cs" /> + <include name="openjdk/java.nio.cs" /> + <include name="openjdk/java.security.cs" /> + <include name="openjdk/java.util.cs" /> + <include name="openjdk/java.util.prefs.cs" /> + <include name="openjdk/misc.cs" /> <include name="openjdk/sun.management.cs" /> + <include name="openjdk/sun.misc.cs" /> <include name="openjdk/sun.nio.ch.cs" /> + <include name="openjdk/sun.reflect.cs" /> <include name="openjdk/sun.security.krb5.cs" /> + <include name="openjdk/sun.util.locale.provider.cs" /> <include name="stubgen/ClassFileWriter.cs" /> <include name="stubgen/SerialVersionUID.cs" /> <include name="stubgen/StubGenerator.cs" /> |