ikvm-commit Mailing List for IKVM.NET (Page 5)
Brought to you by:
jfrijters
You can subscribe to this list here.
2007 |
Jan
(25) |
Feb
(22) |
Mar
(32) |
Apr
(77) |
May
(111) |
Jun
(129) |
Jul
(223) |
Aug
(109) |
Sep
(60) |
Oct
(60) |
Nov
(36) |
Dec
(55) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(23) |
Feb
(76) |
Mar
(42) |
Apr
(49) |
May
(33) |
Jun
(64) |
Jul
(19) |
Aug
(124) |
Sep
(16) |
Oct
|
Nov
(87) |
Dec
(54) |
2009 |
Jan
(53) |
Feb
(116) |
Mar
(86) |
Apr
(64) |
May
(101) |
Jun
(99) |
Jul
(105) |
Aug
(63) |
Sep
(20) |
Oct
(110) |
Nov
(102) |
Dec
(36) |
2010 |
Jan
(87) |
Feb
(67) |
Mar
(5) |
Apr
(100) |
May
(178) |
Jun
(95) |
Jul
(22) |
Aug
(85) |
Sep
(82) |
Oct
(99) |
Nov
(119) |
Dec
(132) |
2011 |
Jan
(130) |
Feb
(18) |
Mar
(114) |
Apr
(8) |
May
(21) |
Jun
(53) |
Jul
(127) |
Aug
(111) |
Sep
(29) |
Oct
(28) |
Nov
(64) |
Dec
(94) |
2012 |
Jan
(56) |
Feb
(8) |
Mar
(65) |
Apr
(48) |
May
(22) |
Jun
(52) |
Jul
(73) |
Aug
(38) |
Sep
(18) |
Oct
(59) |
Nov
(16) |
Dec
(21) |
2013 |
Jan
(83) |
Feb
(151) |
Mar
(102) |
Apr
(13) |
May
(37) |
Jun
(1) |
Jul
(7) |
Aug
(42) |
Sep
(28) |
Oct
(13) |
Nov
(5) |
Dec
(3) |
2014 |
Jan
(3) |
Feb
(39) |
Mar
(11) |
Apr
(40) |
May
(62) |
Jun
(54) |
Jul
(21) |
Aug
(3) |
Sep
|
Oct
(15) |
Nov
(26) |
Dec
(7) |
2015 |
Jan
(6) |
Feb
(12) |
Mar
(51) |
Apr
(15) |
May
(7) |
Jun
(41) |
Jul
(2) |
Aug
(8) |
Sep
(5) |
Oct
(6) |
Nov
(11) |
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
(19) |
Aug
(2) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jeroen F. <jfr...@us...> - 2015-06-09 09:28:46
|
Update of /cvsroot/ikvm/ikvm/openjdk/sun/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8187/openjdk/sun/awt Modified Files: SunToolkit.java Log Message: Integrated OpenJDK 8u45. Index: SunToolkit.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/sun/awt/SunToolkit.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SunToolkit.java 19 May 2014 12:43:40 -0000 1.24 --- SunToolkit.java 9 Jun 2015 09:28:43 -0000 1.25 *************** *** 1,4 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * --- 1,4 ---- /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * *************** *** 37,40 **** --- 37,43 ---- import java.awt.SystemTray; import java.awt.event.InputEvent; + import java.io.File; + import java.io.IOException; + import java.io.InputStream; import java.net.URL; import java.util.*; *************** *** 44,47 **** --- 47,51 ---- import java.util.concurrent.locks.ReentrantLock; + import sun.awt.datatransfer.DataTransferer; import sun.security.util.SecurityConstants; import sun.util.logging.PlatformLogger; *************** *** 50,53 **** --- 54,58 ---- import sun.awt.im.InputContext; import sun.awt.image.*; + import sun.net.util.URLUtil; import sun.security.action.GetPropertyAction; import sun.security.action.GetBooleanAction; *************** *** 375,379 **** */ public static AppContext targetToAppContext(Object target) { ! if (target == null || GraphicsEnvironment.isHeadless()) { return null; } --- 380,384 ---- */ public static AppContext targetToAppContext(Object target) { ! if (target == null) { return null; } *************** *** 449,458 **** */ public static void insertTargetMapping(Object target, AppContext appContext) { ! if (!GraphicsEnvironment.isHeadless()) { ! if (!setAppContext(target, appContext)) { ! // Target is not a Component/MenuComponent, use the private Map ! // instead. ! appContextMap.put(target, appContext); ! } } } --- 454,461 ---- */ public static void insertTargetMapping(Object target, AppContext appContext) { ! if (!setAppContext(target, appContext)) { ! // Target is not a Component/MenuComponent, use the private Map ! // instead. ! appContextMap.put(target, appContext); } } *************** *** 709,739 **** static Image getImageFromHash(Toolkit tk, URL url) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! try { ! java.security.Permission perm = ! url.openConnection().getPermission(); ! if (perm != null) { ! try { ! sm.checkPermission(perm); ! } catch (SecurityException se) { ! // fallback to checkRead/checkConnect for pre 1.2 ! // security managers ! if ((perm instanceof java.io.FilePermission) && ! perm.getActions().indexOf("read") != -1) { ! sm.checkRead(perm.getName()); ! } else if ((perm instanceof ! java.net.SocketPermission) && ! perm.getActions().indexOf("connect") != -1) { ! sm.checkConnect(url.getHost(), url.getPort()); ! } else { ! throw se; ! } ! } ! } ! } catch (java.io.IOException ioe) { ! sm.checkConnect(url.getHost(), url.getPort()); ! } ! } synchronized (imgCache) { Image img = (Image)imgCache.get(url); --- 712,716 ---- static Image getImageFromHash(Toolkit tk, URL url) { ! checkPermissions(url); synchronized (imgCache) { Image img = (Image)imgCache.get(url); *************** *** 751,758 **** static Image getImageFromHash(Toolkit tk, String filename) { ! SecurityManager security = System.getSecurityManager(); ! if (security != null) { ! security.checkRead(filename); ! } synchronized (imgCache) { Image img = (Image)imgCache.get(filename); --- 728,732 ---- static Image getImageFromHash(Toolkit tk, String filename) { ! checkPermissions(filename); synchronized (imgCache) { Image img = (Image)imgCache.get(filename); *************** *** 776,815 **** } ! public Image createImage(String filename) { ! SecurityManager security = System.getSecurityManager(); ! if (security != null) { ! security.checkRead(filename); } - return createImage(new FileImageSource(filename)); } ! public Image createImage(URL url) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! try { ! java.security.Permission perm = ! url.openConnection().getPermission(); ! if (perm != null) { ! try { ! sm.checkPermission(perm); ! } catch (SecurityException se) { ! // fallback to checkRead/checkConnect for pre 1.2 ! // security managers ! if ((perm instanceof java.io.FilePermission) && ! perm.getActions().indexOf("read") != -1) { ! sm.checkRead(perm.getName()); ! } else if ((perm instanceof ! java.net.SocketPermission) && ! perm.getActions().indexOf("connect") != -1) { ! sm.checkConnect(url.getHost(), url.getPort()); ! } else { ! throw se; ! } ! } ! } ! } catch (java.io.IOException ioe) { ! sm.checkConnect(url.getHost(), url.getPort()); } } return createImage(new URLImageSource(url)); } --- 750,789 ---- } ! protected Image getImageWithResolutionVariant(String fileName, ! String resolutionVariantName) { ! synchronized (imgCache) { ! Image image = getImageFromHash(this, fileName); ! if (image instanceof MultiResolutionImage) { ! return image; ! } ! Image resolutionVariant = getImageFromHash(this, resolutionVariantName); ! image = createImageWithResolutionVariant(image, resolutionVariant); ! imgCache.put(fileName, image); ! return image; } } ! protected Image getImageWithResolutionVariant(URL url, ! URL resolutionVariantURL) { ! synchronized (imgCache) { ! Image image = getImageFromHash(this, url); ! if (image instanceof MultiResolutionImage) { ! return image; } + Image resolutionVariant = getImageFromHash(this, resolutionVariantURL); + image = createImageWithResolutionVariant(image, resolutionVariant); + imgCache.put(url, image); + return image; } + } + + + public Image createImage(String filename) { + checkPermissions(filename); + return createImage(new FileImageSource(filename)); + } + + public Image createImage(URL url) { + checkPermissions(url); return createImage(new URLImageSource(url)); } *************** *** 823,826 **** --- 797,805 ---- } + public static Image createImageWithResolutionVariant(Image image, + Image resolutionVariant) { + return new MultiResolutionToolkitImage(image, resolutionVariant); + } + public int checkImage(Image img, int w, int h, ImageObserver o) { if (!(img instanceof ToolkitImage)) { *************** *** 835,839 **** repbits = tkimg.getImageRep().check(o); } ! return tkimg.check(o) | repbits; } --- 814,818 ---- repbits = tkimg.getImageRep().check(o); } ! return (tkimg.check(o) | repbits) & checkResolutionVariant(img, w, h, o); } *************** *** 857,861 **** } ImageRepresentation ir = tkimg.getImageRep(); ! return ir.prepare(o); } --- 836,938 ---- } ImageRepresentation ir = tkimg.getImageRep(); ! return ir.prepare(o) & prepareResolutionVariant(img, w, h, o); ! } ! ! private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) { ! ToolkitImage rvImage = getResolutionVariant(img); ! int rvw = getRVSize(w); ! int rvh = getRVSize(h); ! // Ignore the resolution variant in case of error ! return (rvImage == null || rvImage.hasError()) ? 0xFFFF : ! checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage. ! getResolutionVariantObserver( ! img, o, w, h, rvw, rvh, true)); ! } ! ! private boolean prepareResolutionVariant(Image img, int w, int h, ! ImageObserver o) { ! ! ToolkitImage rvImage = getResolutionVariant(img); ! int rvw = getRVSize(w); ! int rvh = getRVSize(h); ! // Ignore the resolution variant in case of error ! return rvImage == null || rvImage.hasError() || prepareImage( ! rvImage, rvw, rvh, ! MultiResolutionToolkitImage.getResolutionVariantObserver( ! img, o, w, h, rvw, rvh, true)); ! } ! ! private static int getRVSize(int size){ ! return size == -1 ? -1 : 2 * size; ! } ! ! private static ToolkitImage getResolutionVariant(Image image) { ! if (image instanceof MultiResolutionToolkitImage) { ! Image resolutionVariant = ((MultiResolutionToolkitImage) image). ! getResolutionVariant(); ! if (resolutionVariant instanceof ToolkitImage) { ! return (ToolkitImage) resolutionVariant; ! } ! } ! return null; ! } ! ! protected static boolean imageCached(Object key) { ! return imgCache.containsKey(key); ! } ! ! protected static boolean imageExists(String filename) { ! checkPermissions(filename); ! return filename != null && new File(filename).exists(); ! } ! ! @SuppressWarnings("try") ! protected static boolean imageExists(URL url) { ! checkPermissions(url); ! if (url != null) { ! try (InputStream is = url.openStream()) { ! return true; ! }catch(IOException e){ ! return false; ! } ! } ! return false; ! } ! ! private static void checkPermissions(String filename) { ! SecurityManager security = System.getSecurityManager(); ! if (security != null) { ! security.checkRead(filename); ! } ! } ! ! private static void checkPermissions(URL url) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! try { ! java.security.Permission perm = ! URLUtil.getConnectPermission(url); ! if (perm != null) { ! try { ! sm.checkPermission(perm); ! } catch (SecurityException se) { ! // fallback to checkRead/checkConnect for pre 1.2 ! // security managers ! if ((perm instanceof java.io.FilePermission) && ! perm.getActions().indexOf("read") != -1) { ! sm.checkRead(perm.getName()); ! } else if ((perm instanceof ! java.net.SocketPermission) && ! perm.getActions().indexOf("connect") != -1) { ! sm.checkConnect(url.getHost(), url.getPort()); ! } else { ! throw se; ! } ! } ! } ! } catch (java.io.IOException ioe) { ! sm.checkConnect(url.getHost(), url.getPort()); ! } ! } } *************** *** 1116,1132 **** } - private static String dataTransfererClassName = null; - - protected static void setDataTransfererClassName(String className) { - dataTransfererClassName = className; - } - - public static String getDataTransfererClassName() { - if (dataTransfererClassName == null) { - Toolkit.getDefaultToolkit(); // transferer set during toolkit init - } - return dataTransfererClassName; - } - // Support for window closing event notifications private transient WindowClosingListener windowClosingListener = null; --- 1193,1196 ---- *************** *** 1973,1976 **** --- 2037,2053 ---- } + protected static LightweightFrame getLightweightFrame(Component c) { + for (; c != null; c = c.getParent()) { + if (c instanceof LightweightFrame) { + return (LightweightFrame)c; + } + if (c instanceof Window) { + // Don't traverse owner windows + return null; + } + } + return null; + } + /////////////////////////////////////////////////////////////////////////// // |
From: Jeroen F. <jfr...@us...> - 2015-06-09 09:28:45
|
Update of /cvsroot/ikvm/ikvm/openjdk/java/lang In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8187/openjdk/java/lang Modified Files: Class.java ClassLoader.java StringHelper.java System.java Log Message: Integrated OpenJDK 8u45. Index: Class.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/Class.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Class.java 7 Jul 2014 07:40:35 -0000 1.22 --- Class.java 9 Jun 2015 09:28:43 -0000 1.23 *************** *** 1,4 **** /* ! * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * --- 1,4 ---- /* ! * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * *************** *** 199,209 **** /* ! * Constructor. Only the Java Virtual Machine creates Class ! * objects. */ ! private Class() ! { ! // this constructor is not used, but exists for compatibility ! // (otherwise it would look as if this class doesn't have a constructor, which might break some code) throw new InternalError(); } --- 199,210 ---- /* ! * Private constructor. Only the Java Virtual Machine creates Class objects. ! * This constructor is not used and prevents the default constructor being ! * generated. */ ! private Class(ClassLoader loader) { ! // Initialize final field for classLoader. The initialization value of non-null ! // prevents future JIT optimizations from assuming this final field is null. ! //classLoader = loader; throw new InternalError(); } *************** *** 357,362 **** public static Class<?> forName(String className) throws ClassNotFoundException { ! return forName0(className, true, ! ClassLoader.getClassLoader(Reflection.getCallerClass())); } --- 358,363 ---- public static Class<?> forName(String className) throws ClassNotFoundException { ! Class<?> caller = Reflection.getCallerClass(); ! return forName0(className, true, ClassLoader.getClassLoader(caller), caller); } *************** *** 428,435 **** throws ClassNotFoundException { ! if (sun.misc.VM.isSystemDomainLoader(loader)) { ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! ClassLoader ccl = ClassLoader.getClassLoader(Reflection.getCallerClass()); if (!sun.misc.VM.isSystemDomainLoader(ccl)) { sm.checkPermission( --- 429,440 ---- throws ClassNotFoundException { ! Class<?> caller = null; ! SecurityManager sm = System.getSecurityManager(); ! if (sm != null) { ! // Reflective call to get caller class is only needed if a security manager ! // is present. Avoid the overhead of making this call otherwise. ! caller = Reflection.getCallerClass(); ! if (sun.misc.VM.isSystemDomainLoader(loader)) { ! ClassLoader ccl = ClassLoader.getClassLoader(caller); if (!sun.misc.VM.isSystemDomainLoader(ccl)) { sm.checkPermission( *************** *** 438,447 **** } } ! return forName0(name, initialize, loader); } ! /** Called after security checks have been made. */ private static native Class<?> forName0(String name, boolean initialize, ! ClassLoader loader) throws ClassNotFoundException; --- 443,453 ---- } } ! return forName0(name, initialize, loader, caller); } ! /** Called after security check for system loader access checks have been made. */ private static native Class<?> forName0(String name, boolean initialize, ! ClassLoader loader, ! Class<?> caller) throws ClassNotFoundException; *************** *** 2770,2779 **** static class MethodArray { private Method[] methods; private int length; MethodArray() { ! methods = new Method[20]; length = 0; } --- 2776,2799 ---- static class MethodArray { + // Don't add or remove methods except by add() or remove() calls. private Method[] methods; private int length; + private int defaults; MethodArray() { ! this(20); ! } ! ! MethodArray(int initialSize) { ! if (initialSize < 2) ! throw new IllegalArgumentException("Size should be 2 or more"); ! ! methods = new Method[initialSize]; length = 0; + defaults = 0; + } + + boolean hasDefaults() { + return defaults != 0; } *************** *** 2783,2786 **** --- 2803,2809 ---- } methods[length++] = m; + + if (m != null && m.isDefault()) + defaults++; } *************** *** 2816,2820 **** } ! void addAllNonStatic(Method[] methods) { for (Method candidate : methods) { if (!Modifier.isStatic(candidate.getModifiers())) { --- 2839,2846 ---- } ! /* Add Methods declared in an interface to this MethodArray. ! * Static methods declared in interfaces are not inherited. ! */ ! void addInterfaceMethods(Method[] methods) { for (Method candidate : methods) { if (!Modifier.isStatic(candidate.getModifiers())) { *************** *** 2832,2848 **** } ! void removeByNameAndSignature(Method toRemove) { for (int i = 0; i < length; i++) { Method m = methods[i]; ! if (m != null && ! m.getReturnType() == toRemove.getReturnType() && ! m.getName() == toRemove.getName() && ! arrayContentsEq(m.getParameterTypes(), ! toRemove.getParameterTypes())) { ! methods[i] = null; } } } void compactAndTrim() { int newPos = 0; --- 2858,2890 ---- } ! Method getFirst() { ! for (Method m : methods) ! if (m != null) ! return m; ! return null; ! } ! ! void removeByNameAndDescriptor(Method toRemove) { for (int i = 0; i < length; i++) { Method m = methods[i]; ! if (m != null && matchesNameAndDescriptor(m, toRemove)) { ! remove(i); } } } + private void remove(int i) { + if (methods[i] != null && methods[i].isDefault()) + defaults--; + methods[i] = null; + } + + private boolean matchesNameAndDescriptor(Method m1, Method m2) { + return m1.getReturnType() == m2.getReturnType() && + m1.getName() == m2.getName() && // name is guaranteed to be interned + arrayContentsEq(m1.getParameterTypes(), + m2.getParameterTypes()); + } + void compactAndTrim() { int newPos = 0; *************** *** 2862,2868 **** --- 2904,2949 ---- } + /* Removes all Methods from this MethodArray that have a more specific + * default Method in this MethodArray. + * + * Users of MethodArray are responsible for pruning Methods that have + * a more specific <em>concrete</em> Method. + */ + void removeLessSpecifics() { + if (!hasDefaults()) + return; + + for (int i = 0; i < length; i++) { + Method m = get(i); + if (m == null || !m.isDefault()) + continue; + + for (int j = 0; j < length; j++) { + if (i == j) + continue; + + Method candidate = get(j); + if (candidate == null) + continue; + + if (!matchesNameAndDescriptor(m, candidate)) + continue; + + if (hasMoreSpecificClass(m, candidate)) + remove(j); + } + } + } + Method[] getArray() { return methods; } + + // Returns true if m1 is more specific than m2 + static boolean hasMoreSpecificClass(Method m1, Method m2) { + Class<?> m1Class = m1.getDeclaringClass(); + Class<?> m2Class = m2.getDeclaringClass(); + return m1Class != m2Class && m2Class.isAssignableFrom(m1Class); + } } *************** *** 2892,2898 **** // the end. MethodArray inheritedMethods = new MethodArray(); ! Class<?>[] interfaces = getInterfaces(); ! for (int i = 0; i < interfaces.length; i++) { ! inheritedMethods.addAllNonStatic(interfaces[i].privateGetPublicMethods()); } if (!isInterface()) { --- 2973,2978 ---- // the end. MethodArray inheritedMethods = new MethodArray(); ! for (Class<?> i : getInterfaces()) { ! inheritedMethods.addInterfaceMethods(i.privateGetPublicMethods()); } if (!isInterface()) { *************** *** 2905,2910 **** for (int i = 0; i < supers.length(); i++) { Method m = supers.get(i); ! if (m != null && !Modifier.isAbstract(m.getModifiers())) { ! inheritedMethods.removeByNameAndSignature(m); } } --- 2985,2992 ---- for (int i = 0; i < supers.length(); i++) { Method m = supers.get(i); ! if (m != null && ! !Modifier.isAbstract(m.getModifiers()) && ! !m.isDefault()) { ! inheritedMethods.removeByNameAndDescriptor(m); } } *************** *** 2919,2925 **** for (int i = 0; i < methods.length(); i++) { Method m = methods.get(i); ! inheritedMethods.removeByNameAndSignature(m); } methods.addAllIfNotPresent(inheritedMethods); methods.compactAndTrim(); res = methods.getArray(); --- 3001,3008 ---- for (int i = 0; i < methods.length(); i++) { Method m = methods.get(i); ! inheritedMethods.removeByNameAndDescriptor(m); } methods.addAllIfNotPresent(inheritedMethods); + methods.removeLessSpecifics(); methods.compactAndTrim(); res = methods.getArray(); *************** *** 2996,3001 **** } - private Method getMethod0(String name, Class<?>[] parameterTypes, boolean includeStaticMethods) { // Note: the intent is that the search algorithm this routine // uses be equivalent to the ordering imposed by --- 3079,3097 ---- } private Method getMethod0(String name, Class<?>[] parameterTypes, boolean includeStaticMethods) { + MethodArray interfaceCandidates = new MethodArray(2); + Method res = privateGetMethodRecursive(name, parameterTypes, includeStaticMethods, interfaceCandidates); + if (res != null) + return res; + + // Not found on class or superclass directly + interfaceCandidates.removeLessSpecifics(); + return interfaceCandidates.getFirst(); // may be null + } + + private Method privateGetMethodRecursive(String name, + Class<?>[] parameterTypes, + boolean includeStaticMethods, + MethodArray allInterfaceCandidates) { // Note: the intent is that the search algorithm this routine // uses be equivalent to the ordering imposed by *************** *** 3005,3008 **** --- 3101,3112 ---- // common case where the method being requested is declared in // the class which is being queried. + // + // Due to default methods, unless a method is found on a superclass, + // methods declared in any superinterface needs to be considered. + // Collect all candidates declared in superinterfaces in {@code + // allInterfaceCandidates} and select the most specific if no match on + // a superclass is found. + + // Must _not_ return root methods Method res; // Search declared public methods *************** *** 3026,3030 **** for (Class<?> c : interfaces) if ((res = c.getMethod0(name, parameterTypes, false)) != null) ! return res; // Not found return null; --- 3130,3134 ---- for (Class<?> c : interfaces) if ((res = c.getMethod0(name, parameterTypes, false)) != null) ! allInterfaceCandidates.add(res); // Not found return null; Index: System.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/System.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** System.java 19 May 2014 12:43:38 -0000 1.26 --- System.java 9 Jun 2015 09:28:43 -0000 1.27 *************** *** 638,642 **** * <td>Name of JIT compiler to use</td></tr> * <tr><td><code>java.ext.dirs</code></td> ! * <td>Path of extension directory or directories</td></tr> * <tr><td><code>os.name</code></td> * <td>Operating system name</td></tr> --- 638,645 ---- * <td>Name of JIT compiler to use</td></tr> * <tr><td><code>java.ext.dirs</code></td> ! * <td>Path of extension directory or directories ! * <b>Deprecated.</b> <i>This property, and the mechanism ! * which implements it, may be removed in a future ! * release.</i> </td></tr> * <tr><td><code>os.name</code></td> * <td>Operating system name</td></tr> Index: ClassLoader.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/ClassLoader.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ClassLoader.java 27 May 2014 09:22:30 -0000 1.24 --- ClassLoader.java 9 Jun 2015 09:28:43 -0000 1.25 *************** *** 1376,1380 **** SecurityManager sm = System.getSecurityManager(); if (sm != null) { ! checkClassLoaderPermission(this, Reflection.getCallerClass()); } return parent; --- 1376,1383 ---- SecurityManager sm = System.getSecurityManager(); if (sm != null) { ! // Check access to the parent class loader ! // If the caller's class loader is same as this class loader, ! // permission check is performed. ! checkClassLoaderPermission(parent, Reflection.getCallerClass()); } return parent; *************** *** 1519,1522 **** --- 1522,1530 ---- } + /* + * Checks RuntimePermission("getClassLoader") permission + * if caller's class loader is not null and caller's class loader + * is not the same as or an ancestor of the given cl argument. + */ static void checkClassLoaderPermission(ClassLoader cl, Class<?> caller) { SecurityManager sm = System.getSecurityManager(); Index: StringHelper.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/StringHelper.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StringHelper.java 19 May 2014 12:43:38 -0000 1.9 --- StringHelper.java 9 Jun 2015 09:28:43 -0000 1.10 *************** *** 914,919 **** } // Argument is a String ! if (cs.equals(_this)) ! return true; // Argument is a generic CharSequence int n = _this.length(); --- 914,920 ---- } // Argument is a String ! if (cs instanceof String) { ! return _this.equals(cs); ! } // Argument is a generic CharSequence int n = _this.length(); *************** *** 2231,2235 **** srcCount = 1; } ! if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA lowerChar = ConditionalSpecialCasing.toLowerCaseEx(_this, i, locale); } else { --- 2232,2238 ---- srcCount = 1; } ! if (localeDependent || ! srcChar == '\u03A3' || // GREEK CAPITAL LETTER SIGMA ! srcChar == '\u0130') { // LATIN CAPITAL LETTER I WITH DOT ABOVE lowerChar = ConditionalSpecialCasing.toLowerCaseEx(_this, i, locale); } else { |
From: Jeroen F. <jfr...@us...> - 2015-06-09 07:12:26
|
Update of /cvsroot/ikvm/ikvm/openjdk/sun/java2d/loops In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17629/loops Log Message: Directory /cvsroot/ikvm/ikvm/openjdk/sun/java2d/loops added to the repository |
From: Jeroen F. <jfr...@us...> - 2015-06-01 13:33:51
|
Update of /cvsroot/ikvm/ikvm/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26353 Modified Files: graphics.cs Log Message: Fixed typo. Fix by Daniel Zatonyi <dza...@ch...>. Index: graphics.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/graphics.cs,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** graphics.cs 5 Mar 2015 14:01:47 -0000 1.76 --- graphics.cs 1 Jun 2015 13:33:49 -0000 1.77 *************** *** 233,237 **** { checkState(); ! base.clearRect(x, y, w, h); } --- 233,237 ---- { checkState(); ! base.clipRect(x, y, w, h); } |
From: Jeroen F. <jfr...@us...> - 2015-05-31 12:10:53
|
Update of /cvsroot/ikvm/ikvm/runtime In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26287 Modified Files: MemberWrapper.cs compiler.cs Log Message: Added MethodWrapper.IsFinalizeOrClone property to centralize the logic to detect these two special cased methods. Index: MemberWrapper.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/MemberWrapper.cs,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** MemberWrapper.cs 24 Mar 2015 09:31:46 -0000 1.205 --- MemberWrapper.cs 31 May 2015 12:10:51 -0000 1.206 *************** *** 862,865 **** --- 862,875 ---- } } + + internal bool IsFinalizeOrClone + { + get + { + return IsProtected + && (DeclaringType == CoreClasses.java.lang.Object.Wrapper || DeclaringType == CoreClasses.java.lang.Throwable.Wrapper) + && (Name == StringConstants.CLONE || Name == StringConstants.FINALIZE); + } + } } Index: compiler.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/compiler.cs,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -d -r1.262 -r1.263 *** compiler.cs 21 Mar 2015 06:40:47 -0000 1.262 --- compiler.cs 31 May 2015 12:10:51 -0000 1.263 *************** *** 1500,1504 **** // HACK this code is duplicated in java.lang.invoke.cs ! if(method.IsProtected && (method.DeclaringType == CoreClasses.java.lang.Object.Wrapper || method.DeclaringType == CoreClasses.java.lang.Throwable.Wrapper)) { // HACK we may need to redirect finalize or clone from java.lang.Object/Throwable --- 1500,1504 ---- // HACK this code is duplicated in java.lang.invoke.cs ! if(method.IsFinalizeOrClone) { // HACK we may need to redirect finalize or clone from java.lang.Object/Throwable |
From: Jeroen F. <jfr...@us...> - 2015-05-31 12:02:08
|
Update of /cvsroot/ikvm/ikvm/runtime/openjdk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25729 Modified Files: java.lang.invoke.cs Log Message: Better fix for clone/finalize invocation via MethodHandle. Index: java.lang.invoke.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/openjdk/java.lang.invoke.cs,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** java.lang.invoke.cs 31 May 2015 11:03:28 -0000 1.45 --- java.lang.invoke.cs 31 May 2015 12:02:05 -0000 1.46 *************** *** 906,914 **** dm.EmitCastclass(tw.TypeAsBaseType); } - else if (mw.IsProtected && (mw.DeclaringType == CoreClasses.java.lang.Object.Wrapper || mw.DeclaringType == CoreClasses.java.lang.Throwable.Wrapper)) - { - // HACK we don't support calling clone or finalize on cli.System.Object and cli.System.Exception - dm.EmitCastclass(tw.TypeAsBaseType); - } else if (tw != CoreClasses.cli.System.Object.Wrapper) { --- 906,909 ---- *************** *** 945,949 **** dm.LoadCallerID(); } ! if (doDispatch && !mw.IsStatic) { dm.Callvirt(mw); --- 940,959 ---- dm.LoadCallerID(); } ! // special case for Object.clone() and Object.finalize() ! if (mw.IsProtected ! && (mw.DeclaringType == CoreClasses.java.lang.Object.Wrapper || mw.DeclaringType == CoreClasses.java.lang.Throwable.Wrapper) ! && (mw.Name == StringConstants.FINALIZE || mw.Name == StringConstants.CLONE)) ! { ! if (doDispatch) ! { ! mw.EmitCallvirtReflect(dm.ilgen); ! } ! else ! { ! // we can re-use the implementations from cli.System.Object (even though the object may not in-fact extend cli.System.Object) ! CoreClasses.cli.System.Object.Wrapper.GetMethodWrapper(mw.Name, mw.Signature, false).EmitCall(dm.ilgen); ! } ! } ! else if (doDispatch && !mw.IsStatic) { dm.Callvirt(mw); |
From: Jeroen F. <jfr...@us...> - 2015-05-31 11:03:30
|
Update of /cvsroot/ikvm/ikvm/runtime/openjdk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22095 Modified Files: java.lang.invoke.cs Log Message: Partial fix for Object.clone/finalize invocation via MethodHandle. Open issues: - Object.clone/finalize can't be called on Throwable or cli.System.Object derived objects - Throwable.clone/finalize can't be called on cli.System.Exception derived objects Index: java.lang.invoke.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/openjdk/java.lang.invoke.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** java.lang.invoke.cs 19 Mar 2015 14:59:10 -0000 1.44 --- java.lang.invoke.cs 31 May 2015 11:03:28 -0000 1.45 *************** *** 906,909 **** --- 906,914 ---- dm.EmitCastclass(tw.TypeAsBaseType); } + else if (mw.IsProtected && (mw.DeclaringType == CoreClasses.java.lang.Object.Wrapper || mw.DeclaringType == CoreClasses.java.lang.Throwable.Wrapper)) + { + // HACK we don't support calling clone or finalize on cli.System.Object and cli.System.Exception + dm.EmitCastclass(tw.TypeAsBaseType); + } else if (tw != CoreClasses.cli.System.Object.Wrapper) { |
From: Jeroen F. <jfr...@us...> - 2015-05-31 08:45:43
|
Update of /cvsroot/ikvm/ikvm/runtime/openjdk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13163 Modified Files: sun.misc.cs Log Message: Replaced (broken) TypedReference based field CompareExchange with DynamicMethod based implementation. Index: sun.misc.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/runtime/openjdk/sun.misc.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sun.misc.cs 11 Mar 2015 08:44:44 -0000 1.12 --- sun.misc.cs 31 May 2015 08:45:41 -0000 1.13 *************** *** 1,4 **** /* ! Copyright (C) 2007-2014 Jeroen Frijters Copyright (C) 2009 Volker Berlin (i-net software) --- 1,4 ---- /* ! Copyright (C) 2007-2015 Jeroen Frijters Copyright (C) 2009 Volker Berlin (i-net software) *************** *** 549,554 **** --- 549,556 ---- private delegate int CompareExchangeInt32(object obj, int value, int comparand); private delegate long CompareExchangeInt64(object obj, long value, long comparand); + private delegate object CompareExchangeObject(object obj, object value, object comparand); private static CompareExchangeInt32[] cacheCompareExchangeInt32 = new CompareExchangeInt32[0]; private static CompareExchangeInt64[] cacheCompareExchangeInt64 = new CompareExchangeInt64[0]; + private static CompareExchangeObject[] cacheCompareExchangeObject = new CompareExchangeObject[0]; private static void InterlockedResize<T>(ref T[] array, int newSize) *************** *** 574,587 **** { FieldInfo field = GetFieldInfo(fieldOffset); ! DynamicMethod dm = new DynamicMethod("CompareExchange", field.FieldType, new Type[] { typeof(object), field.FieldType, field.FieldType }, field.DeclaringType); ILGenerator ilgen = dm.GetILGenerator(); ilgen.Emit(OpCodes.Ldarg_0); ilgen.Emit(OpCodes.Castclass, field.DeclaringType); ilgen.Emit(OpCodes.Ldflda, field); ilgen.Emit(OpCodes.Ldarg_1); ilgen.Emit(OpCodes.Ldarg_2); ! ilgen.Emit(OpCodes.Call, typeof(Interlocked).GetMethod("CompareExchange", new Type[] { field.FieldType.MakeByRefType(), field.FieldType, field.FieldType })); ilgen.Emit(OpCodes.Ret); ! return dm.CreateDelegate(field.FieldType == typeof(int) ? typeof(CompareExchangeInt32) : typeof(CompareExchangeInt64)); } --- 576,617 ---- { FieldInfo field = GetFieldInfo(fieldOffset); ! bool primitive = field.FieldType.IsPrimitive; ! Type signatureType = primitive ? field.FieldType : typeof(object); ! MethodInfo compareExchange; ! Type delegateType; ! if (signatureType == typeof(int)) ! { ! compareExchange = InterlockedMethods.CompareExchangeInt32; ! delegateType = typeof(CompareExchangeInt32); ! } ! else if (signatureType == typeof(long)) ! { ! compareExchange = InterlockedMethods.CompareExchangeInt64; ! delegateType = typeof(CompareExchangeInt64); ! } ! else ! { ! compareExchange = InterlockedMethods.CompareExchangeOfT.MakeGenericMethod(field.FieldType); ! delegateType = typeof(CompareExchangeObject); ! } ! DynamicMethod dm = new DynamicMethod("CompareExchange", signatureType, new Type[] { typeof(object), signatureType, signatureType }, field.DeclaringType); ILGenerator ilgen = dm.GetILGenerator(); + // note that we don't bother will special casing static fields, because it is legal to use ldflda on a static field ilgen.Emit(OpCodes.Ldarg_0); ilgen.Emit(OpCodes.Castclass, field.DeclaringType); ilgen.Emit(OpCodes.Ldflda, field); ilgen.Emit(OpCodes.Ldarg_1); + if (!primitive) + { + ilgen.Emit(OpCodes.Castclass, field.FieldType); + } ilgen.Emit(OpCodes.Ldarg_2); ! if (!primitive) ! { ! ilgen.Emit(OpCodes.Castclass, field.FieldType); ! } ! ilgen.Emit(OpCodes.Call, compareExchange); ilgen.Emit(OpCodes.Ret); ! return dm.CreateDelegate(delegateType); } *************** *** 608,613 **** else { Stats.Log("compareAndSwapObject.", offset); ! return Atomic.CompareExchange(obj, new FieldInfo[] { GetFieldInfo(offset) }, update, expect) == expect; } #endif --- 638,648 ---- else { + if (offset >= cacheCompareExchangeObject.Length || cacheCompareExchangeObject[offset] == null) + { + InterlockedResize(ref cacheCompareExchangeObject, (int)offset + 1); + cacheCompareExchangeObject[offset] = (CompareExchangeObject)CreateCompareExchange(offset); + } Stats.Log("compareAndSwapObject.", offset); ! return cacheCompareExchangeObject[offset](obj, update, expect) == expect; } #endif *************** *** 619,628 **** private static Dictionary<Type, Atomic> impls = new Dictionary<Type, Atomic>(); - internal static object CompareExchange(object obj, FieldInfo[] field, object value, object comparand) - { - TypedReference tr = TypedReference.MakeTypedReference(obj, field); - return GetImpl(__reftype(tr)).CompareExchangeImpl(tr, value, comparand); - } - internal static object CompareExchange(object[] array, int index, object value, object comparand) { --- 654,657 ---- *************** *** 644,648 **** } - protected abstract object CompareExchangeImpl(TypedReference tr, object value, object comparand); protected abstract object CompareExchangeImpl(object[] array, int index, object value, object comparand); --- 673,676 ---- *************** *** 650,658 **** where T : class { - protected override object CompareExchangeImpl(TypedReference tr, object value, object comparand) - { - return Interlocked.CompareExchange(ref __refvalue(tr, T), (T)value, (T)comparand); - } - protected override object CompareExchangeImpl(object[] array, int index, object value, object comparand) { --- 678,681 ---- |
From: Jeroen F. <jfr...@us...> - 2015-05-31 08:43:57
|
Update of /cvsroot/ikvm/ikvm/openjdk/sun/misc In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13026 Modified Files: Unsafe.java Log Message: Added Unsafe.staticFieldOffset() and Unsafe.staticFieldBase() methods. Index: Unsafe.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/sun/misc/Unsafe.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Unsafe.java 11 Mar 2015 08:44:44 -0000 1.34 --- Unsafe.java 31 May 2015 08:43:55 -0000 1.35 *************** *** 75,78 **** --- 75,87 ---- return allocateUnsafeFieldId(field); } + + public long staticFieldOffset(Field field) + { + if(!Modifier.isStatic(field.getModifiers())) + { + throw new IllegalArgumentException(); + } + return allocateUnsafeFieldId(field); + } @Deprecated *************** *** 1153,1156 **** --- 1162,1171 ---- return null; } + + @Deprecated + public Object staticFieldBase(Class<?> c) + { + return null; + } public native boolean shouldBeInitialized(Class<?> c); |
From: Jeroen F. <jfr...@us...> - 2015-05-29 16:01:28
|
Update of /cvsroot/ikvm/ikvm/openjdk/java/lang/ref In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv19037 Modified Files: ReferenceQueue.java Log Message: Bug fix. ReferenceQueue should not keep registered (but not yet enqueued) Reference objects alive. Index: ReferenceQueue.java =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/java/lang/ref/ReferenceQueue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReferenceQueue.java 5 Mar 2014 09:39:07 -0000 1.1 --- ReferenceQueue.java 29 May 2015 16:01:25 -0000 1.2 *************** *** 1,4 **** /* ! Copyright (C) 2014 Jeroen Frijters This software is provided 'as-is', without any express or implied --- 1,4 ---- /* ! Copyright (C) 2014-2015 Jeroen Frijters This software is provided 'as-is', without any express or implied *************** *** 29,33 **** static final ReferenceQueue ENQUEUED = new ReferenceQueue(); static final ReferenceQueue NULL = new ReferenceQueue(); ! private volatile Reference<T> activeHead; private volatile Reference<T> head; final Object lock = new Object(); --- 29,33 ---- static final ReferenceQueue ENQUEUED = new ReferenceQueue(); static final ReferenceQueue NULL = new ReferenceQueue(); ! private volatile Link<T> activeHead; private volatile Reference<T> head; final Object lock = new Object(); *************** *** 43,46 **** --- 43,60 ---- } + // NOTE a known problem with this approach is that the WeakReference will not be available + // after we've become only finalizer reachable + private static class Link<T> extends cli.System.WeakReference { + Link<T> next; + + Link(Reference<T> ref) { + super(ref); + } + + Reference<T> get() { + return (Reference<T>)get_Target(); + } + } + public Reference<? extends T> poll() { *************** *** 131,139 **** } ! Reference<T> prev = null; ! Reference<T> curr = activeHead; while (curr != null) { ! if (curr == ref) { if (prev == null) { activeHead = curr.next; --- 145,153 ---- } ! Link<T> prev = null; ! Link<T> curr = activeHead; while (curr != null) { ! if (curr.get() == ref) { if (prev == null) { activeHead = curr.next; *************** *** 141,146 **** prev.next = curr.next; } ! curr.next = head; ! head = curr; lock.notifyAll(); return true; --- 155,160 ---- prev.next = curr.next; } ! ref.next = head; ! head = ref; lock.notifyAll(); return true; *************** *** 156,163 **** final void addToActiveList(Reference<T> ref) { synchronized (lock) { ! ref.next = activeHead; ! activeHead = ref; ! if (ref.next == null) { lock.notifyAll(); } --- 170,178 ---- final void addToActiveList(Reference<T> ref) { + Link<T> link = new Link<T>(ref); synchronized (lock) { ! link.next = activeHead; ! activeHead = link; ! if (link.next == null) { lock.notifyAll(); } *************** *** 167,176 **** private void scanActiveList() { ! Reference<T> prev = null; ! Reference<T> curr = activeHead; while (curr != null) { ! if (!curr.isActive()) { ! Reference<T> next = curr.next; if (prev == null) { activeHead = next; --- 182,192 ---- private void scanActiveList() { ! Link<T> prev = null; ! Link<T> curr = activeHead; while (curr != null) { ! Reference<T> ref = curr.get(); ! if (ref == null || !ref.isActive()) { ! Link<T> next = curr.next; if (prev == null) { activeHead = next; *************** *** 178,184 **** prev.next = next; } ! curr.next = head; ! curr.queue = ENQUEUED; ! head = curr; curr = next; continue; --- 194,202 ---- prev.next = next; } ! if (ref != null) { ! ref.next = head; ! ref.queue = ENQUEUED; ! head = ref; ! } curr = next; continue; |
From: Jeroen F. <jfr...@us...> - 2015-05-06 07:17:43
|
Update of /cvsroot/ikvm/ikvm/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14905 Modified Files: toolkit-0.95.cs Log Message: Fixed drag-n-drop coordinates. Patch by Daniel Zatonyi <dza...@ch...>. Index: toolkit-0.95.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** toolkit-0.95.cs 16 Apr 2015 14:02:10 -0000 1.112 --- toolkit-0.95.cs 6 May 2015 07:17:40 -0000 1.113 *************** *** 1415,1419 **** bool dispatchType) { ! return base.postDropTargetEvent(component, x, y, dropAction, actions, formats, nativeCtxt, eventID, dispatchType); } --- 1415,1423 ---- bool dispatchType) { ! NetComponentPeer peer = (NetComponentPeer)component.getPeer(); ! Control control = peer.Control; ! Point screenPt = new Point(x, y); ! Point clientPt = control.PointToClient(screenPt); ! return base.postDropTargetEvent(component, clientPt.X, clientPt.Y, dropAction, actions, formats, nativeCtxt, eventID, dispatchType); } |
From: Jeroen F. <jfr...@us...> - 2015-04-21 10:23:25
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv27274 Modified Files: Signature.cs Type.cs Log Message: Use sigElementType for MarkerType. Index: Signature.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Signature.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Signature.cs 21 Apr 2015 10:15:39 -0000 1.25 --- Signature.cs 21 Apr 2015 10:23:23 -0000 1.26 *************** *** 579,601 **** foreach (Type type in args) { ! if (type == MarkerType.ModOpt) ! { ! bb.Write(ELEMENT_TYPE_CMOD_OPT); ! } ! else if (type == MarkerType.ModReq) ! { ! bb.Write(ELEMENT_TYPE_CMOD_REQD); ! } ! else if (type == MarkerType.Sentinel) ! { ! bb.Write(SENTINEL); ! } ! else if (type == MarkerType.Pinned) { ! bb.Write(ELEMENT_TYPE_PINNED); } ! else if (type == null) { ! bb.Write(ELEMENT_TYPE_VOID); } else --- 579,589 ---- foreach (Type type in args) { ! if (type == null) { ! bb.Write(ELEMENT_TYPE_VOID); } ! else if (type is MarkerType) { ! bb.Write(type.SigElementType); } else Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** Type.cs 21 Apr 2015 10:15:39 -0000 1.107 --- Type.cs 21 Apr 2015 10:23:23 -0000 1.108 *************** *** 3213,3223 **** { // used by CustomModifiers and SignatureHelper ! internal static readonly Type ModOpt = new MarkerType(); ! internal static readonly Type ModReq = new MarkerType(); // used by SignatureHelper ! internal static readonly Type Sentinel = new MarkerType(); ! internal static readonly Type Pinned = new MarkerType(); ! private MarkerType() { } public override Type BaseType --- 3213,3226 ---- { // used by CustomModifiers and SignatureHelper ! internal static readonly Type ModOpt = new MarkerType(Signature.ELEMENT_TYPE_CMOD_OPT); ! internal static readonly Type ModReq = new MarkerType(Signature.ELEMENT_TYPE_CMOD_REQD); // used by SignatureHelper ! internal static readonly Type Sentinel = new MarkerType(Signature.SENTINEL); ! internal static readonly Type Pinned = new MarkerType(Signature.ELEMENT_TYPE_PINNED); ! private MarkerType(byte sigElementType) ! : base(sigElementType) ! { ! } public override Type BaseType |
From: Jeroen F. <jfr...@us...> - 2015-04-21 10:15:42
|
Update of /cvsroot/ikvm/ikvm/reflect/Reader In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26767/Reader Modified Files: GenericTypeParameter.cs Method.cs TypeDefImpl.cs Log Message: Use sigElementType to implement IsGenericParameter. Index: Method.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/Method.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Method.cs 16 Jul 2012 10:14:38 -0000 1.30 --- Method.cs 21 Apr 2015 10:15:39 -0000 1.31 *************** *** 195,199 **** for (int i = first; i < len && module.GenericParam.records[i].Owner == token; i++) { ! list.Add(new GenericTypeParameter(module, i)); } typeArgs = list.ToArray(); --- 195,199 ---- for (int i = first; i < len && module.GenericParam.records[i].Owner == token; i++) { ! list.Add(new GenericTypeParameter(module, i, Signature.ELEMENT_TYPE_MVAR)); } typeArgs = list.ToArray(); Index: GenericTypeParameter.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/GenericTypeParameter.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GenericTypeParameter.cs 24 Dec 2012 10:49:51 -0000 1.18 --- GenericTypeParameter.cs 21 Apr 2015 10:15:39 -0000 1.19 *************** *** 31,34 **** --- 31,39 ---- abstract class TypeParameterType : TypeInfo { + protected TypeParameterType(byte sigElementType) + : base(sigElementType) + { + } + public sealed override string AssemblyQualifiedName { *************** *** 84,92 **** } - public sealed override bool IsGenericParameter - { - get { return true; } - } - protected sealed override bool ContainsMissingTypeImpl { --- 89,92 ---- *************** *** 184,187 **** --- 184,188 ---- private UnboundGenericMethodParameter(int position) + : base(Signature.ELEMENT_TYPE_MVAR) { this.position = position; *************** *** 260,264 **** private readonly int index; ! internal GenericTypeParameter(ModuleReader module, int index) { this.module = module; --- 261,266 ---- private readonly int index; ! internal GenericTypeParameter(ModuleReader module, int index, byte sigElementType) ! : base(sigElementType) { this.module = module; Index: TypeDefImpl.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/TypeDefImpl.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TypeDefImpl.cs 21 Apr 2015 08:19:33 -0000 1.28 --- TypeDefImpl.cs 21 Apr 2015 10:15:39 -0000 1.29 *************** *** 261,265 **** for (int i = first; i < len && module.GenericParam.records[i].Owner == token; i++) { ! list.Add(new GenericTypeParameter(module, i)); } typeArgs = list.ToArray(); --- 261,265 ---- for (int i = first; i < len && module.GenericParam.records[i].Owner == token; i++) { ! list.Add(new GenericTypeParameter(module, i, Signature.ELEMENT_TYPE_VAR)); } typeArgs = list.ToArray(); |
From: Jeroen F. <jfr...@us...> - 2015-04-21 10:15:41
|
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv26767/Emit Modified Files: MethodBuilder.cs TypeBuilder.cs Log Message: Use sigElementType to implement IsGenericParameter. Index: MethodBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/MethodBuilder.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** MethodBuilder.cs 6 Apr 2015 07:12:29 -0000 1.39 --- MethodBuilder.cs 21 Apr 2015 10:15:39 -0000 1.40 *************** *** 378,382 **** for (int i = 0; i < names.Length; i++) { ! gtpb[i] = new GenericTypeParameterBuilder(names[i], null, this, i); } return (GenericTypeParameterBuilder[])gtpb.Clone(); --- 378,382 ---- for (int i = 0; i < names.Length; i++) { ! gtpb[i] = new GenericTypeParameterBuilder(names[i], this, i); } return (GenericTypeParameterBuilder[])gtpb.Clone(); Index: TypeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/TypeBuilder.cs,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** TypeBuilder.cs 21 Apr 2015 08:19:33 -0000 1.58 --- TypeBuilder.cs 21 Apr 2015 10:15:39 -0000 1.59 *************** *** 43,47 **** private GenericParameterAttributes attr; ! internal GenericTypeParameterBuilder(string name, TypeBuilder type, MethodBuilder method, int position) { this.name = name; --- 43,58 ---- private GenericParameterAttributes attr; ! internal GenericTypeParameterBuilder(string name, TypeBuilder type, int position) ! : this(name, type, null, position, Signature.ELEMENT_TYPE_VAR) ! { ! } ! ! internal GenericTypeParameterBuilder(string name, MethodBuilder method, int position) ! : this(name, null, method, position, Signature.ELEMENT_TYPE_MVAR) ! { ! } ! ! private GenericTypeParameterBuilder(string name, TypeBuilder type, MethodBuilder method, int position, byte sigElementType) ! : base(sigElementType) { this.name = name; *************** *** 112,120 **** } - public override bool IsGenericParameter - { - get { return true; } - } - public override int GenericParameterPosition { --- 123,126 ---- *************** *** 659,663 **** for (int i = 0; i < names.Length; i++) { ! gtpb[i] = new GenericTypeParameterBuilder(names[i], this, null, i); } return (GenericTypeParameterBuilder[])gtpb.Clone(); --- 665,669 ---- for (int i = 0; i < names.Length; i++) { ! gtpb[i] = new GenericTypeParameterBuilder(names[i], this, i); } return (GenericTypeParameterBuilder[])gtpb.Clone(); |
From: Jeroen F. <jfr...@us...> - 2015-04-21 09:46:54
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv24464 Modified Files: Type.cs Log Message: Use sigElementType to implement __IsFunctionPointer. Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** Type.cs 21 Apr 2015 09:36:37 -0000 1.105 --- Type.cs 21 Apr 2015 09:46:52 -0000 1.106 *************** *** 47,51 **** protected readonly Type underlyingType; protected TypeFlags typeFlags; ! private byte sigElementType; // only used if (__IsBuiltIn || HasElementType) [Flags] --- 47,51 ---- protected readonly Type underlyingType; protected TypeFlags typeFlags; ! private byte sigElementType; // only used if (__IsBuiltIn || HasElementType || __IsFunctionPointer) [Flags] *************** *** 218,224 **** } ! public virtual bool __IsFunctionPointer { ! get { return false; } } --- 218,224 ---- } ! public bool __IsFunctionPointer { ! get { return sigElementType == Signature.ELEMENT_TYPE_FNPTR; } } *************** *** 1259,1264 **** get { ! // this property can only be called after __IsBuiltIn or HasElementType returned true ! System.Diagnostics.Debug.Assert((typeFlags & TypeFlags.BuiltIn) != 0 || HasElementType); return sigElementType; } --- 1259,1264 ---- get { ! // this property can only be called after __IsBuiltIn, HasElementType or __IsFunctionPointer returned true ! System.Diagnostics.Debug.Assert((typeFlags & TypeFlags.BuiltIn) != 0 || HasElementType || __IsFunctionPointer); return sigElementType; } *************** *** 3140,3143 **** --- 3140,3144 ---- private FunctionPointerType(Universe universe, __StandAloneMethodSig sig) + : base(Signature.ELEMENT_TYPE_FNPTR) { this.universe = universe; *************** *** 3158,3166 **** } - public override bool __IsFunctionPointer - { - get { return true; } - } - public override __StandAloneMethodSig __MethodSignature { --- 3159,3162 ---- |
From: Jeroen F. <jfr...@us...> - 2015-04-21 09:36:39
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv23523 Modified Files: Signature.cs Type.cs TypeInfo.cs Log Message: Optimized Array, ByRef and Pointer types by storing the signature element type. Index: Signature.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Signature.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Signature.cs 21 Apr 2015 08:19:33 -0000 1.23 --- Signature.cs 21 Apr 2015 09:36:37 -0000 1.24 *************** *** 341,356 **** while (type.HasElementType) { ! if (type.__IsVector) ! { ! bb.Write(ELEMENT_TYPE_SZARRAY); ! } ! else if (type.IsArray) { - int rank = type.GetArrayRank(); - bb.Write(ELEMENT_TYPE_ARRAY); // LAMESPEC the Type production (23.2.12) doesn't include CustomMod* for arrays, but the verifier allows it and ildasm also supports it WriteCustomModifiers(module, bb, type.__GetCustomModifiers()); WriteType(module, bb, type.GetElementType()); ! bb.WriteCompressedUInt(rank); int[] sizes = type.__GetArraySizes(); bb.WriteCompressedUInt(sizes.Length); --- 341,352 ---- while (type.HasElementType) { ! byte sigElementType = type.SigElementType; ! bb.Write(sigElementType); ! if (sigElementType == ELEMENT_TYPE_ARRAY) { // LAMESPEC the Type production (23.2.12) doesn't include CustomMod* for arrays, but the verifier allows it and ildasm also supports it WriteCustomModifiers(module, bb, type.__GetCustomModifiers()); WriteType(module, bb, type.GetElementType()); ! bb.WriteCompressedUInt(type.GetArrayRank()); int[] sizes = type.__GetArraySizes(); bb.WriteCompressedUInt(sizes.Length); *************** *** 367,378 **** return; } - else if (type.IsByRef) - { - bb.Write(ELEMENT_TYPE_BYREF); - } - else if (type.IsPointer) - { - bb.Write(ELEMENT_TYPE_PTR); - } WriteCustomModifiers(module, bb, type.__GetCustomModifiers()); type = type.GetElementType(); --- 363,366 ---- *************** *** 380,384 **** if (type.__IsBuiltIn) { ! bb.Write(type.BuiltInElementType); } else if (type.IsGenericParameter) --- 368,372 ---- if (type.__IsBuiltIn) { ! bb.Write(type.SigElementType); } else if (type.IsGenericParameter) Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** Type.cs 21 Apr 2015 08:19:33 -0000 1.104 --- Type.cs 21 Apr 2015 09:36:37 -0000 1.105 *************** *** 47,51 **** protected readonly Type underlyingType; protected TypeFlags typeFlags; ! private byte elementType; // only used if __IsBuiltIn returns true [Flags] --- 47,51 ---- protected readonly Type underlyingType; protected TypeFlags typeFlags; ! private byte sigElementType; // only used if (__IsBuiltIn || HasElementType) [Flags] *************** *** 95,98 **** --- 95,104 ---- } + internal Type(byte sigElementType) + : this() + { + this.sigElementType = sigElementType; + } + public static Binder DefaultBinder { *************** *** 187,213 **** } ! public virtual bool HasElementType { ! get { return false; } } ! public virtual bool IsArray { ! get { return false; } } ! public virtual bool __IsVector { ! get { return false; } } ! public virtual bool IsByRef { ! get { return false; } } ! public virtual bool IsPointer { ! get { return false; } } --- 193,219 ---- } ! public bool HasElementType { ! get { return IsArray || IsByRef || IsPointer; } } ! public bool IsArray { ! get { return sigElementType == Signature.ELEMENT_TYPE_ARRAY || sigElementType == Signature.ELEMENT_TYPE_SZARRAY; } } ! public bool __IsVector { ! get { return sigElementType == Signature.ELEMENT_TYPE_SZARRAY; } } ! public bool IsByRef { ! get { return sigElementType == Signature.ELEMENT_TYPE_BYREF; } } ! public bool IsPointer { ! get { return sigElementType == Signature.ELEMENT_TYPE_PTR; } } *************** *** 1234,1240 **** { return __IsBuiltIn ! && ((elementType >= Signature.ELEMENT_TYPE_BOOLEAN && elementType <= Signature.ELEMENT_TYPE_R8) ! || elementType == Signature.ELEMENT_TYPE_I ! || elementType == Signature.ELEMENT_TYPE_U); } } --- 1240,1246 ---- { return __IsBuiltIn ! && ((sigElementType >= Signature.ELEMENT_TYPE_BOOLEAN && sigElementType <= Signature.ELEMENT_TYPE_R8) ! || sigElementType == Signature.ELEMENT_TYPE_I ! || sigElementType == Signature.ELEMENT_TYPE_U); } } *************** *** 1249,1259 **** } ! internal byte BuiltInElementType { get { ! // this property can only be called after __IsBuiltIn returned true ! System.Diagnostics.Debug.Assert((typeFlags & TypeFlags.BuiltIn) != 0); ! return elementType; } } --- 1255,1265 ---- } ! internal byte SigElementType { get { ! // this property can only be called after __IsBuiltIn or HasElementType returned true ! System.Diagnostics.Debug.Assert((typeFlags & TypeFlags.BuiltIn) != 0 || HasElementType); ! return sigElementType; } } *************** *** 1312,1316 **** { typeFlags |= TypeFlags.BuiltIn; ! this.elementType = elementType; return true; } --- 1318,1322 ---- { typeFlags |= TypeFlags.BuiltIn; ! this.sigElementType = elementType; return true; } *************** *** 2264,2268 **** private readonly CustomModifiers mods; ! protected ElementHolderType(Type elementType, CustomModifiers mods) { this.elementType = elementType; --- 2270,2275 ---- private readonly CustomModifiers mods; ! protected ElementHolderType(Type elementType, CustomModifiers mods, byte sigElementType) ! : base(sigElementType) { this.elementType = elementType; *************** *** 2307,2315 **** } - public sealed override bool HasElementType - { - get { return true; } - } - public sealed override Module Module { --- 2314,2317 ---- *************** *** 2399,2403 **** private ArrayType(Type type, CustomModifiers mods) ! : base(type, mods) { } --- 2401,2405 ---- private ArrayType(Type type, CustomModifiers mods) ! : base(type, mods, Signature.ELEMENT_TYPE_SZARRAY) { } *************** *** 2439,2452 **** } - public override bool IsArray - { - get { return true; } - } - - public override bool __IsVector - { - get { return true; } - } - public override int GetArrayRank() { --- 2441,2444 ---- *************** *** 2487,2491 **** private MultiArrayType(Type type, int rank, int[] sizes, int[] lobounds, CustomModifiers mods) ! : base(type, mods) { this.rank = rank; --- 2479,2483 ---- private MultiArrayType(Type type, int rank, int[] sizes, int[] lobounds, CustomModifiers mods) ! : base(type, mods, Signature.ELEMENT_TYPE_ARRAY) { this.rank = rank; *************** *** 2527,2535 **** } - public override bool IsArray - { - get { return true; } - } - public override int GetArrayRank() { --- 2519,2522 ---- *************** *** 2711,2715 **** private ByRefType(Type type, CustomModifiers mods) ! : base(type, mods) { } --- 2698,2702 ---- private ByRefType(Type type, CustomModifiers mods) ! : base(type, mods, Signature.ELEMENT_TYPE_BYREF) { } *************** *** 2735,2743 **** } - public override bool IsByRef - { - get { return true; } - } - internal override string GetSuffix() { --- 2722,2725 ---- *************** *** 2759,2763 **** private PointerType(Type type, CustomModifiers mods) ! : base(type, mods) { } --- 2741,2745 ---- private PointerType(Type type, CustomModifiers mods) ! : base(type, mods, Signature.ELEMENT_TYPE_PTR) { } *************** *** 2783,2791 **** } - public override bool IsPointer - { - get { return true; } - } - internal override string GetSuffix() { --- 2765,2768 ---- Index: TypeInfo.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/TypeInfo.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TypeInfo.cs 5 Sep 2012 08:58:52 -0000 1.1 --- TypeInfo.cs 21 Apr 2015 09:36:37 -0000 1.2 *************** *** 54,57 **** --- 54,62 ---- } + internal TypeInfo(byte sigElementType) + : base(sigElementType) + { + } + public IEnumerable<ConstructorInfo> DeclaredConstructors { |
From: Jeroen F. <jfr...@us...> - 2015-04-21 08:19:35
|
Update of /cvsroot/ikvm/ikvm/reflect/Reader In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv18293/Reader Modified Files: TypeDefImpl.cs Log Message: Optimized built-in type handling a bit. Index: TypeDefImpl.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Reader/TypeDefImpl.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** TypeDefImpl.cs 6 Apr 2015 07:06:31 -0000 1.27 --- TypeDefImpl.cs 21 Apr 2015 08:19:33 -0000 1.28 *************** *** 44,48 **** this.typeName = module.GetString(module.TypeDef.records[index].TypeName); this.typeNamespace = module.GetString(module.TypeDef.records[index].TypeNamespace); ! MarkEnumOrValueType(typeNamespace, typeName); } --- 44,48 ---- this.typeName = module.GetString(module.TypeDef.records[index].TypeName); this.typeNamespace = module.GetString(module.TypeDef.records[index].TypeNamespace); ! MarkKnownType(typeNamespace, typeName); } |
From: Jeroen F. <jfr...@us...> - 2015-04-21 06:48:05
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11549 Modified Files: Type.cs Universe.cs Log Message: Added new public APIs to help deal with built-in types even when they are not defined in mscorlib: - Type.__IsBuiltIn - Universe.GetBuiltInType(string ns, string name) Index: Universe.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Universe.cs,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** Universe.cs 6 Apr 2015 07:12:29 -0000 1.79 --- Universe.cs 21 Apr 2015 06:48:03 -0000 1.80 *************** *** 854,857 **** --- 854,906 ---- } + public Type GetBuiltInType(string ns, string name) + { + if (ns != "System") + { + return null; + } + switch (name) + { + case "Boolean": + return System_Boolean; + case "Char": + return System_Char; + case "Object": + return System_Object; + case "String": + return System_String; + case "Single": + return System_Single; + case "Double": + return System_Double; + case "SByte": + return System_SByte; + case "Int16": + return System_Int16; + case "Int32": + return System_Int32; + case "Int64": + return System_Int64; + case "IntPtr": + return System_IntPtr; + case "UIntPtr": + return System_UIntPtr; + case "TypedReference": + return System_TypedReference; + case "Byte": + return System_Byte; + case "UInt16": + return System_UInt16; + case "UInt32": + return System_UInt32; + case "UInt64": + return System_UInt64; + case "Void": + return System_Void; + default: + return null; + } + } + public Assembly[] GetAssemblies() { Index: Type.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Type.cs,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** Type.cs 6 Apr 2015 07:06:31 -0000 1.102 --- Type.cs 21 Apr 2015 06:48:03 -0000 1.103 *************** *** 1247,1250 **** --- 1247,1278 ---- } + public bool __IsBuiltIn + { + get + { + // [ECMA 335] 8.2.2 Built-in value and reference types + Universe u = this.Universe; + return this == u.System_Boolean + || this == u.System_Char + || this == u.System_Object + || this == u.System_String + || this == u.System_Single + || this == u.System_Double + || this == u.System_SByte + || this == u.System_Int16 + || this == u.System_Int32 + || this == u.System_Int64 + || this == u.System_IntPtr + || this == u.System_UIntPtr + || this == u.System_TypedReference + || this == u.System_Byte + || this == u.System_UInt16 + || this == u.System_UInt32 + || this == u.System_UInt64 + || this == u.System_Void // [LAMESPEC] missing from ECMA list for some reason + ; + } + } + public bool IsEnum { |
From: Jeroen F. <jfr...@us...> - 2015-04-19 09:55:11
|
Update of /cvsroot/ikvm/ikvm/openjdk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv7578 Modified Files: openjdk.build Log Message: Fixed build to allow nasgen to work with 1.8.0_40. Index: openjdk.build =================================================================== RCS file: /cvsroot/ikvm/ikvm/openjdk/openjdk.build,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** openjdk.build 19 Feb 2015 08:14:24 -0000 1.112 --- openjdk.build 19 Apr 2015 09:55:08 -0000 1.113 *************** *** 230,234 **** </exec> <exec program="java" useruntimeengine="false"> ! <arg line="-cp ${OpenJDK.dir}/nashorn/buildtools/nasgen/src" /> <arg value="jdk.nashorn.internal.tools.nasgen.Main" /> <arg value="${OpenJDK.dir}/nashorn/src" /> --- 230,234 ---- </exec> <exec program="java" useruntimeengine="false"> ! <arg value="-Xbootclasspath/p:${OpenJDK.dir}/nashorn/buildtools/nasgen/src${pathsep}${OpenJDK.dir}/nashorn/src" /> <arg value="jdk.nashorn.internal.tools.nasgen.Main" /> <arg value="${OpenJDK.dir}/nashorn/src" /> |
From: Jeroen F. <jfr...@us...> - 2015-04-16 14:02:12
|
Update of /cvsroot/ikvm/ikvm/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv3004 Modified Files: toolkit-0.95.cs Log Message: Handle more text sources for clipboard copy by using an appropriate Reader for the source data. Patch by Daniel Zatonyi <dza...@ch...>. Index: toolkit-0.95.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** toolkit-0.95.cs 16 Apr 2015 13:57:53 -0000 1.111 --- toolkit-0.95.cs 16 Apr 2015 14:02:10 -0000 1.112 *************** *** 5541,5545 **** --- 5541,5565 ---- { if (contents is string) + { obj.SetText((string) transferable.getTransferData(flavor)); + } + else + { + try + { + java.io.Reader reader = flavor.getReaderForText(transferable); + java.io.StringWriter writer = new java.io.StringWriter(); + char[] buffer = new char[1024]; + int n; + while ((n = reader.read(buffer)) != -1) + { + writer.write(buffer, 0, n); + } + obj.SetText(writer.toString()); + } + catch + { + } + } } else if (java.awt.datatransfer.DataFlavor.imageFlavor.equals(flavor)) |
From: Jeroen F. <jfr...@us...> - 2015-04-16 13:57:55
|
Update of /cvsroot/ikvm/ikvm/awt In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv2623 Modified Files: toolkit-0.95.cs Log Message: Added support for "high contrast" desktop property. Inspired by patch from Daniel Zatonyi <dza...@ch...>. Index: toolkit-0.95.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/awt/toolkit-0.95.cs,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** toolkit-0.95.cs 17 Nov 2014 16:47:17 -0000 1.110 --- toolkit-0.95.cs 16 Apr 2015 13:57:53 -0000 1.111 *************** *** 778,787 **** protected internal override Object lazilyLoadDesktopProperty(String name) { ! if ("win.defaultGUI.font".Equals(name)) { ! Font font = Control.DefaultFont; ! return C2J.ConvertFont(font); } - return null; } --- 778,790 ---- protected internal override Object lazilyLoadDesktopProperty(String name) { ! switch (name) { ! case "win.defaultGUI.font": ! return C2J.ConvertFont(Control.DefaultFont); ! case "win.highContrast.on": ! return java.lang.Boolean.valueOf(SystemInformation.HighContrast); ! default: ! return null; } } |
From: Jeroen F. <jfr...@us...> - 2015-04-07 11:55:53
|
Update of /cvsroot/ikvm/ikvm/reflect In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11025 Modified Files: MethodInfo.cs Module.cs Log Message: Added Module.__TryGetImplMap() public API to get ImplMap by token. Index: Module.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Module.cs,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Module.cs 30 May 2013 15:22:36 -0000 1.60 --- Module.cs 7 Apr 2015 11:55:51 -0000 1.61 *************** *** 569,572 **** --- 569,587 ---- } + public bool __TryGetImplMap(int token, out ImplMapFlags mappingFlags, out string importName, out string importScope) + { + foreach (int i in ImplMap.Filter(token)) + { + mappingFlags = (ImplMapFlags)(ushort)ImplMap.records[i].MappingFlags; + importName = GetString(ImplMap.records[i].ImportName); + importScope = GetString(ModuleRef.records[(ImplMap.records[i].ImportScope & 0xFFFFFF) - 1]); + return true; + } + mappingFlags = 0; + importName = null; + importScope = null; + return false; + } + #if !NO_AUTHENTICODE public virtual System.Security.Cryptography.X509Certificates.X509Certificate GetSignerCertificate() Index: MethodInfo.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/MethodInfo.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MethodInfo.cs 15 Aug 2012 08:14:28 -0000 1.13 --- MethodInfo.cs 7 Apr 2015 11:55:51 -0000 1.14 *************** *** 110,125 **** public bool __TryGetImplMap(out ImplMapFlags mappingFlags, out string importName, out string importScope) { ! Module module = this.Module; ! foreach (int i in module.ImplMap.Filter(GetCurrentToken())) ! { ! mappingFlags = (ImplMapFlags)(ushort)module.ImplMap.records[i].MappingFlags; ! importName = module.GetString(module.ImplMap.records[i].ImportName); ! importScope = module.GetString(module.ModuleRef.records[(module.ImplMap.records[i].ImportScope & 0xFFFFFF) - 1]); ! return true; ! } ! mappingFlags = 0; ! importName = null; ! importScope = null; ! return false; } --- 110,114 ---- public bool __TryGetImplMap(out ImplMapFlags mappingFlags, out string importName, out string importScope) { ! return Module.__TryGetImplMap(GetCurrentToken(), out mappingFlags, out importName, out importScope); } |
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv533/Emit Modified Files: CustomAttributeBuilder.cs EventBuilder.cs FieldBuilder.cs MethodBuilder.cs ParameterBuilder.cs PropertyBuilder.cs TypeBuilder.cs Log Message: Fixed known custom attribute handling. They should be recognized by type name, not type identity. Index: FieldBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/FieldBuilder.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FieldBuilder.cs 16 Jul 2012 10:14:38 -0000 1.20 --- FieldBuilder.cs 6 Apr 2015 07:12:29 -0000 1.21 *************** *** 125,150 **** public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! Universe u = this.Module.universe; ! if (customBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_FieldOffsetAttribute) ! { ! customBuilder = customBuilder.DecodeBlob(this.Module.Assembly); ! SetOffset((int)customBuilder.GetConstructorArgument(0)); ! } ! else if (customBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_MarshalAsAttribute) ! { ! FieldMarshal.SetMarshalAsAttribute(typeBuilder.ModuleBuilder, pseudoToken, customBuilder); ! attribs |= FieldAttributes.HasFieldMarshal; ! } ! else if (customBuilder.Constructor.DeclaringType == u.System_NonSerializedAttribute) ! { ! attribs |= FieldAttributes.NotSerialized; ! } ! else if (customBuilder.Constructor.DeclaringType == u.System_Runtime_CompilerServices_SpecialNameAttribute) ! { ! attribs |= FieldAttributes.SpecialName; ! } ! else { ! typeBuilder.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder); } } --- 125,146 ---- public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! switch (customBuilder.KnownCA) { ! case KnownCA.FieldOffsetAttribute: ! SetOffset((int)customBuilder.DecodeBlob(this.Module.Assembly).GetConstructorArgument(0)); ! break; ! case KnownCA.MarshalAsAttribute: ! FieldMarshal.SetMarshalAsAttribute(typeBuilder.ModuleBuilder, pseudoToken, customBuilder); ! attribs |= FieldAttributes.HasFieldMarshal; ! break; ! case KnownCA.NonSerializedAttribute: ! attribs |= FieldAttributes.NotSerialized; ! break; ! case KnownCA.SpecialNameAttribute: ! attribs |= FieldAttributes.SpecialName; ! break; ! default: ! typeBuilder.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder); ! break; } } Index: EventBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/EventBuilder.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EventBuilder.cs 15 Oct 2012 23:14:45 -0000 1.8 --- EventBuilder.cs 6 Apr 2015 07:12:29 -0000 1.9 *************** *** 98,103 **** public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! Universe u = typeBuilder.ModuleBuilder.universe; ! if (customBuilder.Constructor.DeclaringType == u.System_Runtime_CompilerServices_SpecialNameAttribute) { attributes |= EventAttributes.SpecialName; --- 98,102 ---- public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! if (customBuilder.KnownCA == KnownCA.SpecialNameAttribute) { attributes |= EventAttributes.SpecialName; Index: TypeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/TypeBuilder.cs,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** TypeBuilder.cs 6 Apr 2015 07:06:31 -0000 1.56 --- TypeBuilder.cs 6 Apr 2015 07:12:29 -0000 1.57 *************** *** 612,640 **** public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! Universe u = this.ModuleBuilder.universe; ! Type type = customBuilder.Constructor.DeclaringType; ! if (type == u.System_Runtime_InteropServices_StructLayoutAttribute) ! { ! SetStructLayoutPseudoCustomAttribute(customBuilder.DecodeBlob(this.Assembly)); ! } ! else if (type == u.System_SerializableAttribute) ! { ! attribs |= TypeAttributes.Serializable; ! } ! else if (type == u.System_Runtime_InteropServices_ComImportAttribute) ! { ! attribs |= TypeAttributes.Import; ! } ! else if (type == u.System_Runtime_CompilerServices_SpecialNameAttribute) ! { ! attribs |= TypeAttributes.SpecialName; ! } ! else { ! if (type == u.System_Security_SuppressUnmanagedCodeSecurityAttribute) ! { attribs |= TypeAttributes.HasSecurity; ! } ! this.ModuleBuilder.SetCustomAttribute(token, customBuilder); } } --- 612,635 ---- public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! switch (customBuilder.KnownCA) { ! case KnownCA.StructLayoutAttribute: ! SetStructLayoutPseudoCustomAttribute(customBuilder.DecodeBlob(this.Assembly)); ! break; ! case KnownCA.SerializableAttribute: ! attribs |= TypeAttributes.Serializable; ! break; ! case KnownCA.ComImportAttribute: ! attribs |= TypeAttributes.Import; ! break; ! case KnownCA.SpecialNameAttribute: ! attribs |= TypeAttributes.SpecialName; ! break; ! case KnownCA.SuppressUnmanagedCodeSecurityAttribute: attribs |= TypeAttributes.HasSecurity; ! goto default; ! default: ! this.ModuleBuilder.SetCustomAttribute(token, customBuilder); ! break; } } Index: ParameterBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ParameterBuilder.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ParameterBuilder.cs 12 Jul 2012 15:10:58 -0000 1.5 --- ParameterBuilder.cs 6 Apr 2015 07:12:29 -0000 1.6 *************** *** 97,121 **** public void SetCustomAttribute(CustomAttributeBuilder customAttributeBuilder) { ! Universe u = moduleBuilder.universe; ! if (customAttributeBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_InAttribute) ! { ! flags |= (short)ParameterAttributes.In; ! } ! else if (customAttributeBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_OutAttribute) ! { ! flags |= (short)ParameterAttributes.Out; ! } ! else if (customAttributeBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_OptionalAttribute) ! { ! flags |= (short)ParameterAttributes.Optional; ! } ! else if (customAttributeBuilder.Constructor.DeclaringType == u.System_Runtime_InteropServices_MarshalAsAttribute) ! { ! FieldMarshal.SetMarshalAsAttribute(moduleBuilder, PseudoToken, customAttributeBuilder); ! flags |= (short)ParameterAttributes.HasFieldMarshal; ! } ! else { ! moduleBuilder.SetCustomAttribute(PseudoToken, customAttributeBuilder); } } --- 97,118 ---- public void SetCustomAttribute(CustomAttributeBuilder customAttributeBuilder) { ! switch (customAttributeBuilder.KnownCA) { ! case KnownCA.InAttribute: ! flags |= (short)ParameterAttributes.In; ! break; ! case KnownCA.OutAttribute: ! flags |= (short)ParameterAttributes.Out; ! break; ! case KnownCA.OptionalAttribute: ! flags |= (short)ParameterAttributes.Optional; ! break; ! case KnownCA.MarshalAsAttribute: ! FieldMarshal.SetMarshalAsAttribute(moduleBuilder, PseudoToken, customAttributeBuilder); ! flags |= (short)ParameterAttributes.HasFieldMarshal; ! break; ! default: ! moduleBuilder.SetCustomAttribute(PseudoToken, customAttributeBuilder); ! break; } } Index: MethodBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/MethodBuilder.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** MethodBuilder.cs 16 Feb 2015 12:24:28 -0000 1.38 --- MethodBuilder.cs 6 Apr 2015 07:12:29 -0000 1.39 *************** *** 256,285 **** public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! Universe u = this.ModuleBuilder.universe; ! Type type = customBuilder.Constructor.DeclaringType; ! if (type == u.System_Runtime_InteropServices_DllImportAttribute) ! { ! attributes |= MethodAttributes.PinvokeImpl; ! SetDllImportPseudoCustomAttribute(customBuilder.DecodeBlob(this.Module.Assembly)); ! } ! else if (type == u.System_Runtime_CompilerServices_MethodImplAttribute) ! { ! SetMethodImplAttribute(customBuilder.DecodeBlob(this.Module.Assembly)); ! } ! else if (type == u.System_Runtime_InteropServices_PreserveSigAttribute) ! { ! implFlags |= MethodImplAttributes.PreserveSig; ! } ! else if (type == u.System_Runtime_CompilerServices_SpecialNameAttribute) ! { ! attributes |= MethodAttributes.SpecialName; ! } ! else { ! if (type == u.System_Security_SuppressUnmanagedCodeSecurityAttribute) ! { attributes |= MethodAttributes.HasSecurity; ! } ! this.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder); } } --- 256,280 ---- public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! switch (customBuilder.KnownCA) { ! case KnownCA.DllImportAttribute: ! SetDllImportPseudoCustomAttribute(customBuilder.DecodeBlob(this.Module.Assembly)); ! attributes |= MethodAttributes.PinvokeImpl; ! break; ! case KnownCA.MethodImplAttribute: ! SetMethodImplAttribute(customBuilder.DecodeBlob(this.Module.Assembly)); ! break; ! case KnownCA.PreserveSigAttribute: ! implFlags |= MethodImplAttributes.PreserveSig; ! break; ! case KnownCA.SpecialNameAttribute: ! attributes |= MethodAttributes.SpecialName; ! break; ! case KnownCA.SuppressUnmanagedCodeSecurityAttribute: attributes |= MethodAttributes.HasSecurity; ! goto default; ! default: ! this.ModuleBuilder.SetCustomAttribute(pseudoToken, customBuilder); ! break; } } Index: CustomAttributeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/CustomAttributeBuilder.cs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** CustomAttributeBuilder.cs 13 Sep 2013 12:09:43 -0000 1.22 --- CustomAttributeBuilder.cs 6 Apr 2015 07:12:29 -0000 1.23 *************** *** 669,672 **** --- 669,752 ---- return bb.ToArray(); } + + internal KnownCA KnownCA + { + get + { + TypeName typeName = con.DeclaringType.TypeName; + switch (typeName.Namespace) + { + case "System": + switch (typeName.Name) + { + case "SerializableAttribute": + return KnownCA.SerializableAttribute; + case "NonSerializedAttribute": + return KnownCA.NonSerializedAttribute; + } + break; + case "System.Runtime.CompilerServices": + switch (typeName.Name) + { + case "MethodImplAttribute": + return KnownCA.MethodImplAttribute; + case "SpecialNameAttribute": + return KnownCA.SpecialNameAttribute; + } + break; + case "System.Runtime.InteropServices": + switch (typeName.Name) + { + case "DllImportAttribute": + return KnownCA.DllImportAttribute; + case "ComImportAttribute": + return KnownCA.ComImportAttribute; + case "MarshalAsAttribute": + return KnownCA.MarshalAsAttribute; + case "PreserveSigAttribute": + return KnownCA.PreserveSigAttribute; + case "InAttribute": + return KnownCA.InAttribute; + case "OutAttribute": + return KnownCA.OutAttribute; + case "OptionalAttribute": + return KnownCA.OptionalAttribute; + case "StructLayoutAttribute": + return KnownCA.StructLayoutAttribute; + case "FieldOffsetAttribute": + return KnownCA.FieldOffsetAttribute; + } + break; + } + if (typeName.Matches("System.Security.SuppressUnmanagedCodeSecurityAttribute")) + { + return KnownCA.SuppressUnmanagedCodeSecurityAttribute; + } + return KnownCA.Unknown; + } + } + } + + // These are the pseudo-custom attributes that are recognized by name by the runtime (i.e. the type identity is not considered). + // The corresponding list in the runtime is at https://github.com/dotnet/coreclr/blob/1afe5ce4f45045d724a4e129df4b816655d486fb/src/md/compiler/custattr_emit.cpp#L38 + // Note that we only need to handle a subset of the types, since we don't need the ones that are only used for validation by the runtime. + enum KnownCA + { + Unknown, + DllImportAttribute, + ComImportAttribute, + SerializableAttribute, + NonSerializedAttribute, + MethodImplAttribute, + MarshalAsAttribute, + PreserveSigAttribute, + InAttribute, + OutAttribute, + OptionalAttribute, + StructLayoutAttribute, + FieldOffsetAttribute, + SpecialNameAttribute, + // the following is not part of the runtime known custom attributes, but we handle it here for efficiency and convenience + SuppressUnmanagedCodeSecurityAttribute, } } Index: PropertyBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/PropertyBuilder.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PropertyBuilder.cs 15 Oct 2012 23:14:45 -0000 1.9 --- PropertyBuilder.cs 6 Apr 2015 07:12:29 -0000 1.10 *************** *** 95,100 **** public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! Universe u = typeBuilder.ModuleBuilder.universe; ! if (customBuilder.Constructor.DeclaringType == u.System_Runtime_CompilerServices_SpecialNameAttribute) { attributes |= PropertyAttributes.SpecialName; --- 95,99 ---- public void SetCustomAttribute(CustomAttributeBuilder customBuilder) { ! if (customBuilder.KnownCA == KnownCA.SpecialNameAttribute) { attributes |= PropertyAttributes.SpecialName; |
From: Jeroen F. <jfr...@us...> - 2015-04-06 07:06:33
|
Update of /cvsroot/ikvm/ikvm/reflect/Emit In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32715/Emit Modified Files: EnumBuilder.cs ModuleBuilder.cs TypeBuilder.cs Log Message: Added internal Type.TypeName virtual property to retrieve type name with a single virtual method call. Index: ModuleBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/ModuleBuilder.cs,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** ModuleBuilder.cs 6 Apr 2015 06:54:43 -0000 1.103 --- ModuleBuilder.cs 6 Apr 2015 07:06:31 -0000 1.104 *************** *** 469,475 **** rec.TypeDefId = type.MetadataToken; } ! rec.TypeName = this.Strings.Add(type.__Name); ! string ns = type.__Namespace; ! rec.TypeNamespace = ns == null ? 0 : this.Strings.Add(ns); if (type.IsNested) { --- 469,473 ---- rec.TypeDefId = type.MetadataToken; } ! SetTypeNameAndTypeNamespace(type.TypeName, out rec.TypeName, out rec.TypeNamespace); if (type.IsNested) { *************** *** 485,488 **** --- 483,492 ---- } + private void SetTypeNameAndTypeNamespace(TypeName name, out int typeName, out int typeNamespace) + { + typeName = this.Strings.Add(name.Name); + typeNamespace = name.Namespace == null ? 0 : this.Strings.Add(name.Namespace); + } + public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute) { *************** *** 651,655 **** foreach (Type type in types) { ! if (type.__Namespace == name.Namespace && type.__Name == name.Name) { return type; --- 655,659 ---- foreach (Type type in types) { ! if (type.TypeName == name) { return type; *************** *** 663,667 **** foreach (Type type in types) { ! if (new TypeName(type.__Namespace, type.__Name).ToLowerInvariant() == lowerCaseName) { return type; --- 667,671 ---- foreach (Type type in types) { ! if (type.TypeName.ToLowerInvariant() == lowerCaseName) { return type; *************** *** 909,915 **** rec.ResolutionScope = ImportAssemblyRef(type.Assembly); } ! rec.TypeName = this.Strings.Add(type.__Name); ! string ns = type.__Namespace; ! rec.TypeNamespace = ns == null ? 0 : this.Strings.Add(ns); token = 0x01000000 | this.TypeRef.AddRecord(rec); } --- 913,917 ---- rec.ResolutionScope = ImportAssemblyRef(type.Assembly); } ! SetTypeNameAndTypeNamespace(type.TypeName, out rec.TypeName, out rec.TypeNamespace); token = 0x01000000 | this.TypeRef.AddRecord(rec); } *************** *** 1221,1227 **** // LAMESPEC ECMA says that TypeDefId is a row index, but it should be a token rec.TypeDefId = type.MetadataToken; ! rec.TypeName = this.Strings.Add(type.__Name); ! string ns = type.__Namespace; ! rec.TypeNamespace = ns == null ? 0 : this.Strings.Add(ns); if (type.IsNested) { --- 1223,1227 ---- // LAMESPEC ECMA says that TypeDefId is a row index, but it should be a token rec.TypeDefId = type.MetadataToken; ! SetTypeNameAndTypeNamespace(type.TypeName, out rec.TypeName, out rec.TypeNamespace); if (type.IsNested) { *************** *** 1605,1610 **** TypeRefTable.Record rec = new TypeRefTable.Record(); rec.ResolutionScope = resolutionScope; ! rec.TypeName = this.Strings.Add(name); ! rec.TypeNamespace = ns == null ? 0 : this.Strings.Add(ns); return 0x01000000 | this.TypeRef.AddRecord(rec); } --- 1605,1609 ---- TypeRefTable.Record rec = new TypeRefTable.Record(); rec.ResolutionScope = resolutionScope; ! SetTypeNameAndTypeNamespace(new TypeName(ns, name), out rec.TypeName, out rec.TypeNamespace); return 0x01000000 | this.TypeRef.AddRecord(rec); } Index: TypeBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/TypeBuilder.cs,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** TypeBuilder.cs 16 Feb 2015 12:24:28 -0000 1.55 --- TypeBuilder.cs 6 Apr 2015 07:06:31 -0000 1.56 *************** *** 811,822 **** } ! public override string __Name ! { ! get { return name; } ! } ! ! public override string __Namespace { ! get { return ns; } } --- 811,817 ---- } ! internal override TypeName TypeName { ! get { return new TypeName(ns, name); } } *************** *** 1089,1100 **** } ! public override string __Name ! { ! get { return underlyingType.__Name; } ! } ! ! public override string __Namespace { ! get { return underlyingType.__Namespace; } } --- 1084,1090 ---- } ! internal override TypeName TypeName { ! get { return underlyingType.TypeName; } } Index: EnumBuilder.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Emit/EnumBuilder.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EnumBuilder.cs 11 Oct 2012 10:19:39 -0000 1.8 --- EnumBuilder.cs 6 Apr 2015 07:06:31 -0000 1.9 *************** *** 40,51 **** } ! public override string __Name ! { ! get { return typeBuilder.__Name; } ! } ! ! public override string __Namespace { ! get { return typeBuilder.__Namespace; } } --- 40,46 ---- } ! internal override TypeName TypeName { ! get { return typeBuilder.TypeName; } } |
From: Jeroen F. <jfr...@us...> - 2015-04-06 06:54:46
|
Update of /cvsroot/ikvm/ikvm/reflect/Metadata In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv32174/Metadata Modified Files: Tables.cs Log Message: Renamed TypeNameSpace to TypeNamespace for consistency. Index: Tables.cs =================================================================== RCS file: /cvsroot/ikvm/ikvm/reflect/Metadata/Tables.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Tables.cs 14 Oct 2012 15:00:22 -0000 1.30 --- Tables.cs 6 Apr 2015 06:54:43 -0000 1.31 *************** *** 619,623 **** internal int ResolutionScope; internal int TypeName; ! internal int TypeNameSpace; } --- 619,623 ---- internal int ResolutionScope; internal int TypeName; ! internal int TypeNamespace; } *************** *** 628,632 **** records[i].ResolutionScope = mr.ReadResolutionScope(); records[i].TypeName = mr.ReadStringIndex(); ! records[i].TypeNameSpace = mr.ReadStringIndex(); } } --- 628,632 ---- records[i].ResolutionScope = mr.ReadResolutionScope(); records[i].TypeName = mr.ReadStringIndex(); ! records[i].TypeNamespace = mr.ReadStringIndex(); } } *************** *** 638,642 **** mw.WriteResolutionScope(records[i].ResolutionScope); mw.WriteStringIndex(records[i].TypeName); ! mw.WriteStringIndex(records[i].TypeNameSpace); } } --- 638,642 ---- mw.WriteResolutionScope(records[i].ResolutionScope); mw.WriteStringIndex(records[i].TypeName); ! mw.WriteStringIndex(records[i].TypeNamespace); } } |