# HG changeset patch # User redestad # Date 1553543827 -3600 # Node ID 75445a7c2c048188c1a0ce54e903c5e43f1c0fcf # Parent 7816d989bf21dfa6f19e320cb86b6f03b6f84f34 8221343: x86_32 crashes on startup with "_hwm out of range" Reviewed-by: thartmann, kvn diff -r 7816d989bf21 -r 75445a7c2c04 src/hotspot/share/opto/matcher.cpp --- a/src/hotspot/share/opto/matcher.cpp Mon Mar 25 19:49:32 2019 +0300 +++ b/src/hotspot/share/opto/matcher.cpp Mon Mar 25 20:57:07 2019 +0100 @@ -416,14 +416,20 @@ return rms; } -//---------------------------init_first_stack_mask----------------------------- +#define NOF_STACK_MASKS (3*6+5) + // Create the initial stack mask used by values spilling to the stack. // Disallow any debug info in outgoing argument areas by setting the // initial mask accordingly. void Matcher::init_first_stack_mask() { // Allocate storage for spill masks as masks for the appropriate load type. - RegMask *rms = (RegMask*)C->comp_arena()->Amalloc_D(sizeof(RegMask) * (3*6+5)); + RegMask *rms = (RegMask*)C->comp_arena()->Amalloc_D(sizeof(RegMask) * NOF_STACK_MASKS); + + // Initialize empty placeholder masks into the newly allocated arena + for (int i = 0; i < NOF_STACK_MASKS; i++) { + new (rms + i) RegMask(); + } idealreg2spillmask [Op_RegN] = &rms[0]; idealreg2spillmask [Op_RegI] = &rms[1];