merge vm_version_x86_{32,64}.hpp

David Holmes - Sun Microsystems David.Holmes at Sun.COM
Sun Feb 22 16:10:08 PST 2009


Hi Vladimir,

Christian's proposal was to take the existing four files:

 > vm_version_x86_32.cpp, vm_version_x86_32.hpp,
 > vm_version_x86_64.cpp, vm_version_x86_64.hpp

and to factor out the common code into:

 > vm_version_x86.cpp and vm_version_x86.hpp

the question asked was then whether to deal with the platform specific 
code by:

a) keeping the existing 4 files in addition to the 2 new ones (assuming 
all four are still needed); or

b) use ifdef's in the new files and discard the 4 old ones

I responded that the tendency in HS has been to use separate files 
rather than ifdef's - hence I would vote for (a) with a view to 
maintaining consistency.

But that's just my view.

Cheers,
David

Vladimir Kozlov said the following on 02/23/09 10:00:
> Sorry,
> 
> It could be small misunderstanding. I should not be using
> 'common' word in my replay to Christian.
> 
> What Christian asked, I suggested to him and he agreed
> is to have 2 files with #ifdef:
> 
> vm_version_x86.cpp and vm_version_x86.hpp
> 
> instead of current 4 files:
> 
> vm_version_x86_32.cpp, vm_version_x86_32.hpp,
> vm_version_x86_64.cpp, vm_version_x86_64.hpp
> 
> That is all.
> 
> Thanks,
> Vladimir
> 
> David Holmes - Sun Microsystems wrote:
>> Vladimir Kozlov said the following on 02/23/09 09:38:
>>> Actually we are merging x86 source as much as possible
>>> to avoid duplicated changes for 32- and 64-bits.
>>> Steve Goldman started this work and Tom did additional changes.
>>> So Christian's suggestion is in the line with this work.
>>>
>>> It is better to have 2 files with few #ifdef then 4 separate file
>>> which have 80% (or more) of the same duplicated code.
>>
>> But what Christian is doing is factoring out that 80% into 1 file and 
>> then we have two files with the 20% that is different. I'd rather see 
>> that than a single file with 20% of the code ifdef'd.
>>
>> Just my 2c.
>>
>> David
>>
>>> Thanks,
>>> Vladimir
>>>
>>> David Holmes - Sun Microsystems wrote:
>>>> Looking at the HS sources the tendency has been to separate files 
>>>> rather #ifdefs. I know it's not 100% consistent but I'd rather not 
>>>> help swing the pendulum back the other way unless there's a really 
>>>> good reason for doing so.
>>>>
>>>> David Holmes
>>>>
>>>> Vladimir Kozlov said the following on 02/23/09 06:21:
>>>>> Common vm_version_x86.{cpp,hpp} with #ifdef as we did for 
>>>>> assembler_x86.?pp
>>>>>
>>>>> Vladimir
>>>>>
>>>>> Christian Thalinger wrote:
>>>>>> On Fri, 2009-02-20 at 11:35 -0500, Paul Hohensee wrote:
>>>>>>> Feel free. :)  In general, if you're changing things somewhere, 
>>>>>>> feel free to refactor.
>>>>>>
>>>>>> Great :-)  Should I merge them into a common vm_version_x86.{cpp,hpp}
>>>>>> plus specific vm_version_x86_{32,64}.{cpp,hpp} files or just a single
>>>>>> vm_version_x86.{cpp,hpp} with #ifdef's?
>>>>>>
>>>>>> There would be very few #ifdef's but I would prefer the former 
>>>>>> approach.
>>>>>>
>>>>>> -- Christian
>>>>>>



More information about the hotspot-dev mailing list