RFR: 8294460: CodeSection::alignment checks for CodeBuffer::SECT_STUBS incorrectly

Vladimir Kozlov kvn at openjdk.org
Thu Oct 20 19:14:46 UTC 2022


On Thu, 13 Oct 2022 13:50:55 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

> This is a fix for an apparent code bug:
> 
> 
> inline int CodeSection::alignment(int section) {
>   if (section == CodeBuffer::SECT_CONSTS) {
>     return (int) sizeof(jdouble);
>   }
>   if (section == CodeBuffer::SECT_INSTS) {
>     return (int) CodeEntryAlignment;
>   }
>   if (CodeBuffer::SECT_STUBS) {   <--- here must be (section == CodeBuffer::SECT_STUBS) condition!
>     // CodeBuffer installer expects sections to be HeapWordSize aligned
>     return HeapWordSize;
>   }
>   ShouldNotReachHere();
>   return 0;
> }
> 
> 
> Also, the section size initializer code is moved to initialize_misc() to fix the code path that works with uninitialized data.

Good. I will test it.

-------------

PR: https://git.openjdk.org/jdk/pull/10699


More information about the hotspot-compiler-dev mailing list