|
46 | 46 | import org.robovm.compiler.plugin.AbstractCompilerPlugin; |
47 | 47 | import org.robovm.compiler.plugin.CompilerPlugin; |
48 | 48 | import org.robovm.compiler.target.framework.FrameworkTarget; |
49 | | -import org.robovm.compiler.util.generic.SootClassUtils; |
50 | 49 | import org.robovm.compiler.util.generic.SootMethodType; |
51 | 50 | import soot.Body; |
52 | 51 | import soot.BooleanType; |
|
88 | 87 | import soot.tagkit.SignatureTag; |
89 | 88 | import soot.util.Chain; |
90 | 89 |
|
91 | | -import java.io.UnsupportedEncodingException; |
92 | 90 | import java.util.ArrayList; |
93 | 91 | import java.util.Arrays; |
94 | 92 | import java.util.Collections; |
@@ -696,7 +694,6 @@ public void beforeClass(Config config, Clazz clazz, ModuleBuilder moduleBuilder) |
696 | 694 | @Override |
697 | 695 | public void beforeLinker(Config config, Linker linker, Set<Clazz> classes) { |
698 | 696 | preloadClassesForFramework(config, linker, classes); |
699 | | - preloadObjCClassHosts(config, linker, classes); |
700 | 697 | } |
701 | 698 |
|
702 | 699 | private static <E> List<E> l(E head, List<E> tail) { |
@@ -2032,49 +2029,6 @@ private void preloadClassesForFramework(Config config, Linker linker, Set<Clazz> |
2032 | 2029 | } |
2033 | 2030 | } |
2034 | 2031 |
|
2035 | | - private void preloadObjCClassHosts(Config config, Linker linker, Set<Clazz> classes) { |
2036 | | - // TODO: remove once resolved on Idea side |
2037 | | - // affects only debug builds |
2038 | | - // workaround for Idea Bug: https://youtrack.jetbrains.com/issue/IDEA-332794 |
2039 | | - // Idea debugger is not happy if inner class is being loaded before host ones and |
2040 | | - // ignores breakpoints inside. |
2041 | | - // preload if all ObjCClass's is happening in ObjCClass.java, static initializer |
2042 | | - // workaround -- is to preload all hosts before loading ObjCClass |
2043 | | - if (config.isDebug()) { |
2044 | | - SootClass objCObjectClazz = classes.stream() |
2045 | | - .filter( c -> c.getClassName().equals(OBJC_OBJECT)) |
2046 | | - .map(Clazz::getSootClass) |
2047 | | - .findFirst() |
2048 | | - .orElse(null); |
2049 | | - Set<String> objClassHosts = new HashSet<>(); |
2050 | | - if (objCObjectClazz != null) { |
2051 | | - // proceed if we link with ObjObject |
2052 | | - // look for all ObjCClasses, and these are internal -- preload hosts as well |
2053 | | - for (Clazz clazz : classes) { |
2054 | | - SootClass sootClass = clazz.getSootClass(); |
2055 | | - // skip if doesn't extend ObjCClass |
2056 | | - if (!SootClassUtils.isAssignableFrom(sootClass, objCObjectClazz)) |
2057 | | - continue; |
2058 | | - // skip if not inner |
2059 | | - String hostClassName = SootClassUtils.getEnclosingClassName(sootClass); |
2060 | | - if (hostClassName == null) |
2061 | | - hostClassName = SootClassUtils.getDeclaringClassName(sootClass); |
2062 | | - if (hostClassName != null) |
2063 | | - objClassHosts.add(hostClassName); |
2064 | | - } |
2065 | | - |
2066 | | - if (!objClassHosts.isEmpty()) { |
2067 | | - try { |
2068 | | - byte[] bytes = StringUtils.join(objClassHosts, ",").getBytes("UTF8"); |
2069 | | - linker.addRuntimeData(OBJC_CLASS + ".preloadClasses", bytes); |
2070 | | - } catch (UnsupportedEncodingException e) { |
2071 | | - config.getLogger().error("Failed to prepare ObjCClass' hosts preload list"); |
2072 | | - } |
2073 | | - } |
2074 | | - } |
2075 | | - } |
2076 | | - } |
2077 | | - |
2078 | 2032 | public static class MethodCompiler extends AbstractMethodCompiler { |
2079 | 2033 | // structure to expose CustomClasses to objc side |
2080 | 2034 | // check https://opensource.apple.com/source/objc4/objc4-437/runtime/objc-runtime-new.h for details |
|
0 commit comments