Hello everyone, Thanks a lot for the response. Now, since I have a very small change in the String class is it possible for me to just add that extra field in the init_fields method of vm_string.cpp and somehow recompile the DLL? Basically I am not sure what kind of setup I need to do this change? I am still not very clear as to what classes are involved in a String Literal creation. As far as I understand there are no Java methods involved. For example when we write something like : String str ="Test String" ; The VM automatically calls the native methods and instantiates a String object at compile time itself. The String.intern() method can be called on already existing String objects and not during string literal creation. Can someone point me to any documentation that tells about the sequence of methods that are called for a string literal creation? And what sort of setup would I need to make the changes to vm_strings.cpp class and recompile the DLL.
Thanks and Regards Megha On Thu, Apr 10, 2008 at 4:03 AM, Tim Ellison <[EMAIL PROTECTED]> wrote: > Gregory Shimansky wrote: > > > On 10 April 2008 Aleksey Shipilev wrote: > > > > > Hi Megha! > > > > > > Probably you're on the right way. Modifying the String class is tough > > > task since it is kernel class and should be provided with appropriate > > > > > > > Actually it is formally not a kernel class. It is not included with > > other kernel classes in DRLVM. But VM uses the knowledge of field names in > > String that hold the data (they are count, offset and value). > > > > That's right. It started off life as a kernel class, but we agreed there > was enough common behavior in there that it made sense to share it across > all implementations. However, recognizing that the VM/JIT will have some > knowledge of it's shape, any changes require special consideration first (a > so-called 'golden-ticket'). > > see: http://markmail.org/message/bdme4cylnlmltkwt > > Regards, > Tim > > > support from the VM. vm_strings.cpp is the part of DRLVM that provides > > > such the support. You must be able to recompile it during the normal > > > build process of DRLVM then, and particularly this thing would reside > > > in libharmonyvm.so or harmonyvm.dll. > > > > > > Thanks, > > > Aleksey. > > > > > > On Thu, Apr 10, 2008 at 6:18 AM, Megha Chauhan <[EMAIL PROTECTED]> > > > wrote: > > > > > > > Hello, > > > > > > > > > > > I am a graduate student at the university of Illinois at > > > > chicago,USA. > > > > > As part of my research I have modified the String class of > > > > harmony > > > > > JDK. I have added another character array(value_sample) to the > > > > class > > > > > which keeps a copy of the value array. Now the problem I am > > > > facing is > > > > > in the case of a string literal since no constructor for the > > > > string > > > > > class is called explicitly , the value of value_sample > > > > array(which was > > > > > added by me) is set to null. I have tried to look into creation > > > > of > > > > > string constants but have not found much except that it is > > > > > instantiated by the native code at compile time. I have looked in > > > > to > > > > > the vm_strings.cpp class and have seen that the VM initialises > > > > the > > > > > fields for String object in the init_fields method. > > > > > I was thinking of adding the new filed I have crested here and > > > > > recompiling the code. > > > > > Am I on the right track? > > > > > Also I would like to know which DLL file holds the code for > > > > > vm_string.cpp class and how can I recompile the DLL ? > > > > > Your help will be greatly appreciated as I have been struggling > > > > with > > > > > this issue for more than a month now. > > > > > Thanks and Regards > > > > > Megha Chauhan > > > > > > > > > > > > >
