[OpenJDK 2D-Dev] RFR: 8047931: Remove unused medialib code

Vadim Pakhnushev vadim.pakhnushev at oracle.com
Wed May 4 17:50:03 UTC 2016

Hi Andrew,

Thanks for the review!
I think I'll file a follow-up bug for unneeded data types and 
corresponding functions removal.


On 04.05.2016 18:18, Andrew Brygin wrote:
> Hello Vadim,
>   the change looks fine to me.
>   Probably, there is more room for optimization: we actually use only mlib images
>   with types MLIB_BYTE, and MLIB_SHORT (see allocateArray() and allocateReasterArray())
>   so routines for other types likely can be eliminated.
> Thanks,
> Andrew
>> On May 4, 2016, at 1:08 PM, Vadim Pakhnushev <vadim.pakhnushev at oracle.com> wrote:
>> Ping?
>> On 25.04.2016 20:13, Vadim Pakhnushev wrote:
>>> Hi all,
>>> Please review this cleanup fix:
>>> https://bugs.openjdk.java.net/browse/JDK-8047931
>>> While investigating unused files in the sparc build, it was found that there are a lot of unused code in the medialib.
>>> So without further ado, here's the whopping 35000 lines removal webrev:
>>> http://cr.openjdk.java.net/~vadim/8047931/webrev.00/
>>> At least on Windows, it reduced the size of the mlib_image.dll by almost 180KB from 663KB to 486KB and shortened the build by 3 minutes on my i5.
>>> It was tested with the JPRT build on all platforms.
>>> Some notes in order of the files in the webrev:
>>> Awt2dLibraries.gmk
>>> Deleted removed files from the sparc exclude list.
>>> mlib_ImageAffine.c
>>> Main entry point mlib_ImageAffine always pass NULL as a colormap to the mlib_ImageAffine_alltypes.
>>> This is basically a starting point for the majority of removal which leads to removal of colormap parameters of several other functions and elimination of several if (colormap != NULL) blocks.
>>> Which in turn leads to removal of function pointer arrays such as mlib_AffineFunArr_bl_i and mlib_AffineFunArr_bc_i.
>>> mlib_ImageAffine.h
>>> Removed colormap parameters and related declarations.
>>> mlib_ImageAffineEdge.c
>>> Removed parts of the code in the mlib_ImageAffineEdge* functions related to the colormaps.
>>> mlib_ImageConv*
>>> mlib_v_ImageConv*
>>> Removed 2x2 through 7x7 convolution functions as we only use NxM ones.
>>> mlib_image_proto.h
>>> Basically removed all functions with a colormap parameter.
>>> mlib_v_ImageAffine*
>>> Removed sparc implementations of unused mlib_ImageAffine* functions.
>>> Thanks,
>>> Vadim

More information about the 2d-dev mailing list