-
Notifications
You must be signed in to change notification settings - Fork 4
WIP: IL2CPP patches #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unity
Are you sure you want to change the base?
Conversation
Unity sets System.AppDomain.CurrentDomain.BaseDirectory to null which causes all kinds of problems.
Raises NotImplemented exceptions in Unity otherwise. Refs and MultiFns are broken as a result.
Unity sets System.AppDomain.CurrentDomain.BaseDirectory to null which causes all kinds of problems.
Raises NotImplemented exceptions in Unity otherwise. Refs and MultiFns are broken as a result.
Use superclass in place of stub class for type hinting
This is a port of @ztellman's pending patch http://dev.clojure.org/jira/browse/CLJ-1529 This patch avoids unnecessary lookups on symbols that are known to be lexically bound, resulting in significant speedup in many cases. Details are on the Jira page.
Namespace qualified types skip the slow string comparison code path. This commit also documents when each lookup path can be expected to succeed.
Fixes protocol loading bugs
Lookups for unqualified, unimported types will throw an exception (as they should). This patch removes lookup logic that was in place due to a mono bug where types with slashes in their names could not be found. The compiler no longer emits such types, so the slow path is no longer needed.
:else (BigDecimal/Create x))) ;;; (BigDecimal. x))) | ||
(instance? BigInteger x) (clojure.lang.BigDecimal/Create ^BigInteger x) ;;; (BigDecimal. ^BigInteger x) | ||
(number? x) (clojure.lang.BigDecimal/Create (long x)) ;;; (BigDecimal/valueOf (long x)) | ||
:else (throw (InvalidCastException. (str "Cannot cast " (type x) " to BigDecimal."))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this one
(mm %))) | ||
dval #((.dispatchFn ^clojure.lang.MultiFn @mmvar) %) | ||
dval #(@mmvar %) | ||
tag (if (keyword? retag) | ||
#(assoc %1 retag %2) | ||
retag)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chunk above, looks fine to me but I feel like I'm missing something.
Hi @spacepluk, I've had a look at this but I wasn't very successful. I'd love to pick it up if you'd maybe explain a couple of things to me? |
Hey @txus, The last thing I can remember is that most dynamic call sites were already removed and it seemed to work fine on iOS if you avoided the cases that were still generating dynamic call sites. I think there were two cases that weren't easy to fix. The one I remember more clearly was that for some reason the The second "big" problem was that we're hitting some dark corners of il2cpp with our bytecode, and sometimes it will get stuck in an endless loop while transpiling. That's not imposible to work around but definitely not fun without the source. This happened mostly with webgl/android builds but also occasionally on iOS. So, my conclusion about this is that @ra and @timsgardner were right from the beginning and the way to go is implementing a new compiler. But hey, I had to try! :) There's still potential of getting something usable out of this if we manage to find a solution for those two issues, but I don't think it's going to be an easy hack like I expected at the beginning. And I think spending our efforts on magic will be more useful/fun. |
This PR tracks the changes needed clojure-clr in order to add IL2CPP support on Arcadia. In-depth explanation coming-soon™.