On 28 февраля 2008 Tony Wu wrote: > On 2/28/08, Jimmy,Jing Lv <[EMAIL PROTECTED]> wrote: > > Hi, > > > > Thanks Gregory, I find it may not be proper to using java code at > > that phase. > > I search the current DRLVM to find what does System.loadLibrary() > > exactly do, it traces to kernel_classes > > (java_lang_System,java_lang_VMExecutionEngine,etc) and class_support > > (classloader), at last, natives_load_library() in natives_support.cpp > > was invoked and called port_dso_load_ex(), then apr_dso_load() (which > > was in dso.cpp). This seems a APR method which was implemented in both > > windows and linux. > > What's more, I check Harmony PortLib, and find > > hysl_open_shared_library(in hysl.c) which was used to load library for > > zlib in Harmony. So it seems good for our use to load library for all > > platforms(please correct me if I'm wrong). > > To sum up, I'd like to raise 2 possible way to solve the problem IMO: > > 1. we call the vm method natives_load_library() to load library, which > > may requires the vm to export such method and drlvm guru may offer > > help for that? > > How to handle the other VMs? I think it's not a public api. > > > 2. we call the portib hysl_open_shared_library() to load the library, > > if it does work well for it. > > +1 to portlib. Anyway we have the portlib in classlib already
I also think that using VM internal functionality is not an option. We can't make the agent depend on it. So port library is the only option. -- Gregory
