From: Domenico De F. <dom...@gm...> - 2011-05-19 15:34:50
|
Hi all, I finally decided to make the big jump to the C backend. After a few attempts, I managed to compile my project without errors. In order to do this, I had to write a skeleton for the class UITableViewController. I must say, I found the C backend is painfully unreadable and it took me some time to understand how to manipulate it. I hope however it will get better with time as I get used to it. Now as I try to run the Xcode project, I obtain the following error: XMLVM Error: Unsatisfied red class dependency: (java_util_TimeZone___INIT___):(path to the application source)/java_util_TimeZone.m:805 Does it mean that the class TimeZone needs some other class which is in the red list? Or that it misses that constructor? I'm not sure I understood from the slides how to remove classes from the red list. Should I retrieve the class TimeZone from the Harmony distribution and insert it into the src/xmlvm2c/lib/proxies? I also see that there already is a native_java_lang_TimeZone.c class in the src/xmlvm2c/lib/proxies folder; should I use that one and implement the missing method? I'm sorry about all the questions, but I don't find the passage from the Objective-C backend really natural. Thank your for your attention -- Domenico De Fano |
From: Sascha H. <sa...@gm...> - 2011-05-19 16:46:08
|
Hi Domenico, these are all good questions, no worries. I think we haven't done a terrific job in documenting all of this so far. I hope I will find some time soon to update out docs on how this works. Let me give you some background on what the redlist is: We are loading resources recursively. For each class C we have a list of dependencies. These are classes that are used from within that class C. Unfortunately, if we do this even on a simple HelloWorld application, we would end up with almost the whole harmony SDK. So what we did it, we created stop signs for the recursive loading algorithm and said... this class, don't load it, we probably don't need it. This make sense because there are a lot of classes that we don't need in a mobile application. In a first step we red listed a lot of classes and our approach is to take classes of whenever we need them. Sometimes taking of a class from the list might require some more work like implementing that class' native methods, or removing/chaning other methods. I am not sure about java.util.TimeZone. It sounds like it could be a bit of work to make it work fine. But you can try yourself what happens by modifying the redlist.txt. Just remove java.util.TimeZone from it. And if other classes are missing, remove those, too. If native methods needs to be implemented and you hit them, then you need to implement those or find a different way of simplifying the class. I hope that makes sense. // Sascha On Thu, May 19, 2011 at 5:34 PM, Domenico De Fano <dom...@gm...>wrote: > Hi all, > > I finally decided to make the big jump to the C backend. After a few > attempts, I managed to compile my project without errors. > In order to do this, I had to write a skeleton for the class > UITableViewController. I must say, I found the C backend is painfully > unreadable and it took me some > time to understand how to manipulate it. I hope however it will get better > with time as I get used to it. > Now as I try to run the Xcode project, I obtain the following error: > > XMLVM Error: Unsatisfied red class dependency: > (java_util_TimeZone___INIT___):(path to the application > source)/java_util_TimeZone.m:805 > > Does it mean that the class TimeZone needs some other class which is in the > red list? Or that it misses that constructor? > > I'm not sure I understood from the slides how to remove classes from the > red list. Should I retrieve the class TimeZone from the > Harmony distribution and insert it into the src/xmlvm2c/lib/proxies? > I also see that there already is a native_java_lang_TimeZone.c class in the > > src/xmlvm2c/lib/proxies folder; should I use that one and implement the > missing method? > > I'm sorry about all the questions, but I don't find the passage from the > Objective-C backend really natural. > > Thank your for your attention > > > -- > Domenico De Fano > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Xmlvm-developers mailing list > Xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers > > |
From: Arno P. <ar...@pu...> - 2011-05-19 16:53:43
|
to add to this: there is a little bit of information on the C backend and the redlist in the slides: xmlvm/doc/slides Arno On 5/19/11 9:45 AM, Sascha Haeberling wrote: > Hi Domenico, > > these are all good questions, no worries. I think we haven't done a > terrific job in documenting all of this so far. I hope I will find some > time soon to update out docs on how this works. > > Let me give you some background on what the redlist is: We are loading > resources recursively. For each class C we have a list of dependencies. > These are classes that are used from within that class C. Unfortunately, > if we do this even on a simple HelloWorld application, we would end up > with almost the whole harmony SDK. So what we did it, we created stop > signs for the recursive loading algorithm and said... this class, don't > load it, we probably don't need it. This make sense because there are a > lot of classes that we don't need in a mobile application. > In a first step we red listed a lot of classes and our approach is to > take classes of whenever we need them. Sometimes taking of a class from > the list might require some more work like implementing that class' > native methods, or removing/chaning other methods. > > I am not sure about java.util.TimeZone. It sounds like it could be a bit > of work to make it work fine. But you can try yourself what happens > by modifying the redlist.txt. Just remove java.util.TimeZone from it. > And if other classes are missing, remove those, too. If native methods > needs to be implemented and you hit them, then you need to implement > those or find a different way of simplifying the class. > > I hope that makes sense. > > // Sascha > > On Thu, May 19, 2011 at 5:34 PM, Domenico De Fano <dom...@gm... > <mailto:dom...@gm...>> wrote: > > Hi all, > > I finally decided to make the big jump to the C backend. After a few > attempts, I managed to compile my project without errors. > In order to do this, I had to write a skeleton for the class > UITableViewController. I must say, I found the C backend is > painfully unreadable and it took me some > time to understand how to manipulate it. I hope however it will get > better with time as I get used to it. > Now as I try to run the Xcode project, I obtain the following error: > > XMLVM Error: Unsatisfied red class dependency: > (java_util_TimeZone___INIT___):(path to the application > source)/java_util_TimeZone.m:805 > > Does it mean that the class TimeZone needs some other class which is > in the red list? Or that it misses that constructor? > > I'm not sure I understood from the slides how to remove classes from > the red list. Should I retrieve the class TimeZone from the > Harmony distribution and insert it into the src/xmlvm2c/lib/proxies? > I also see that there already is a native_java_lang_TimeZone.c class > in the > src/xmlvm2c/lib/proxies folder; should I use that one and implement > the missing method? > > I'm sorry about all the questions, but I don't find the passage from > the Objective-C backend really natural. > > Thank your for your attention > > > -- > Domenico De Fano > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Xmlvm-developers mailing list > Xml...@li... > <mailto:Xml...@li...> > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers > > > > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > > > > _______________________________________________ > Xmlvm-developers mailing list > Xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers |
From: Arno P. <ar...@pu...> - 2011-05-21 21:48:28
|
just some clarifications on the red list: the red list contains those classes of Apache Harmony that we will never use under iOS (e.g., AWT or Swing). We are still fine tuning the red list and there are classes on that list that might be desirable to have. In those cases simply remove the classes to be included from xmlvm/lib/redlist.txt. Whenever you remove a class from the red list, you should run "ant gen-c-native-skeletons". If the class you removed from the red list happens to have a native method, a new file will be created in xmlvm/src/xmlvm2c/lib/native. Those native methods need to be implemented manually using Posix API. Hope this makes things a little clearer. Arno On 5/20/11 1:11 AM, Domenico De Fano wrote: > Hi, > > Thank you Sascha, that couldn't have been more clear! > Now I'm not sure about the native library. Does it contain those java > classes that > need to be implemented in C, right? > I'm asking because I searched for java.util.TimeZone in the red list but > I couldn't find it; > instead, in the native library there is a native_java_util_TimeZone.c > Does it mean that this class cannot be directly cross-compiled from the > Harmony version > and thus that I need to implement the methods in c? > > Thank you again for your help! > > P.S: Arno, I read the slides as a first step as you suggested me. It > helped me a lot > to understand the basics of the C backend, but I had some doubts left on > the red list topic. > > On Thu, May 19, 2011 at 6:53 PM, Arno Puder <ar...@pu... > <mailto:ar...@pu...>> wrote: > > > to add to this: there is a little bit of information on the C backend > and the redlist in the slides: xmlvm/doc/slides > > Arno > > > On 5/19/11 9:45 AM, Sascha Haeberling wrote: > > Hi Domenico, > > > > these are all good questions, no worries. I think we haven't done a > > terrific job in documenting all of this so far. I hope I will > find some > > time soon to update out docs on how this works. > > > > Let me give you some background on what the redlist is: We are > loading > > resources recursively. For each class C we have a list of > dependencies. > > These are classes that are used from within that class C. > Unfortunately, > > if we do this even on a simple HelloWorld application, we would > end up > > with almost the whole harmony SDK. So what we did it, we created stop > > signs for the recursive loading algorithm and said... this class, > don't > > load it, we probably don't need it. This make sense because there > are a > > lot of classes that we don't need in a mobile application. > > In a first step we red listed a lot of classes and our approach is to > > take classes of whenever we need them. Sometimes taking of a > class from > > the list might require some more work like implementing that class' > > native methods, or removing/chaning other methods. > > > > I am not sure about java.util.TimeZone. It sounds like it could > be a bit > > of work to make it work fine. But you can try yourself what happens > > by modifying the redlist.txt. Just remove java.util.TimeZone from it. > > And if other classes are missing, remove those, too. If native > methods > > needs to be implemented and you hit them, then you need to implement > > those or find a different way of simplifying the class. > > > > I hope that makes sense. > > > > // Sascha > > > > On Thu, May 19, 2011 at 5:34 PM, Domenico De Fano > <dom...@gm... <mailto:dom...@gm...> > > <mailto:dom...@gm... <mailto:dom...@gm...>>> wrote: > > > > Hi all, > > > > I finally decided to make the big jump to the C backend. > After a few > > attempts, I managed to compile my project without errors. > > In order to do this, I had to write a skeleton for the class > > UITableViewController. I must say, I found the C backend is > > painfully unreadable and it took me some > > time to understand how to manipulate it. I hope however it > will get > > better with time as I get used to it. > > Now as I try to run the Xcode project, I obtain the following > error: > > > > XMLVM Error: Unsatisfied red class dependency: > > (java_util_TimeZone___INIT___):(path to the application > > source)/java_util_TimeZone.m:805 > > > > Does it mean that the class TimeZone needs some other class > which is > > in the red list? Or that it misses that constructor? > > > > I'm not sure I understood from the slides how to remove > classes from > > the red list. Should I retrieve the class TimeZone from the > > Harmony distribution and insert it into the > src/xmlvm2c/lib/proxies? > > I also see that there already is a > native_java_lang_TimeZone.c class > > in the > > src/xmlvm2c/lib/proxies folder; should I use that one and > implement > > the missing method? > > > > I'm sorry about all the questions, but I don't find the > passage from > > the Objective-C backend really natural. > > > > Thank your for your attention > > > > > > -- > > Domenico De Fano > > > > > ------------------------------------------------------------------------------ > > What Every C/C++ and Fortran developer Should Know! > > Read this article and learn how Intel has extended the reach > of its > > next-generation tools to help Windows* and Linux* C/C++ and > Fortran > > developers boost performance applications - including clusters. > > http://p.sf.net/sfu/intel-dev2devmay > > _______________________________________________ > > Xmlvm-developers mailing list > > Xml...@li... > <mailto:Xml...@li...> > > <mailto:Xml...@li... > <mailto:Xml...@li...>> > > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers > > > > > > > > > > > ------------------------------------------------------------------------------ > > What Every C/C++ and Fortran developer Should Know! > > Read this article and learn how Intel has extended the reach of its > > next-generation tools to help Windows* and Linux* C/C++ and Fortran > > developers boost performance applications - including clusters. > > http://p.sf.net/sfu/intel-dev2devmay > > > > > > > > _______________________________________________ > > Xmlvm-developers mailing list > > Xml...@li... > <mailto:Xml...@li...> > > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers > > ------------------------------------------------------------------------------ > What Every C/C++ and Fortran developer Should Know! > Read this article and learn how Intel has extended the reach of its > next-generation tools to help Windows* and Linux* C/C++ and Fortran > developers boost performance applications - including clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Xmlvm-developers mailing list > Xml...@li... > <mailto:Xml...@li...> > https://lists.sourceforge.net/lists/listinfo/xmlvm-developers > > |