RFR: 8203220: Introduce ATTRIBUTE_ALIGNED macro

Thomas Schatzl thomas.schatzl at oracle.com
Tue May 15 15:07:29 UTC 2018


Hi,

On Tue, 2018-05-15 at 15:31 +0200, Per Liden wrote:
> This patch introduces a global ATTRIBUTE_ALIGNED(x) macro, which
> expands 
> to __attribute__((aligned(x)) or the equivalent of that.
> 
> We already use this attribute is some parts of the code, but we
> haven't 
> had a macro in globalDefinitions.hpp for this.
> 
> In the src/hotspot/cpu/x86/macroAssembler_x86_*.cpp files I chose to 
> keep the ALIGNED_(x) and just define it as ATTRIBUTE_ALIGNED(x),
> instead of changing all uses of it.
> 
> Also, for GCC I've included a workaround for a known bug (see the 
> comment in the file). I thought it would be nice to include that
> since it might otherwise affect quite a few systems.
> 
> And finally, we don't really have a uniform naming standard for
> these types of attributes. E.g. we have NOINLINE/ALWAYSINLINE and we
> have ATTRIBUTE_PRINTF. I chose to use the ATTRIBUTE_ prefix, instead
> of just ALIGNED, since ALIGNED is somewhat generic and we already
> have at least one place where a variable is named ALIGNED, so it
> would conflict.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8203220
> Webrev: http://cr.openjdk.java.net/~pliden/8203220/webrev.0

  - it would have been nice to have the ALIGNED_ macro in
macroAssembler_* replaced by the new ATTRIBUTE_ALIGNED - there are only
a few uses of it and it does not seem worth to have an extra macro in
all these places.

Feel free to ignore, but if you change that I do not need to re-review.

Looks good.

Thanks,
  Thomas


More information about the hotspot-dev mailing list