--- old/src/hotspot/share/opto/mulnode.cpp 2020-02-06 19:18:19.648548908 +0100 +++ new/src/hotspot/share/opto/mulnode.cpp 2020-02-06 19:18:19.478548922 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,10 @@ #include "opto/mulnode.hpp" #include "opto/phaseX.hpp" #include "opto/subnode.hpp" +#include "utilities/macros.hpp" +#if INCLUDE_SHENANDOAHGC +#include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp" +#endif // Portions of code courtesy of Clifford Click @@ -474,6 +478,15 @@ Node *load = in(1); uint lop = load->Opcode(); +#if INCLUDE_SHENANDOAHGC + if (UseShenandoahGC && ShenandoahBarrierC2Support::is_gc_state_load(load)) { + // Do not touch the load+mask, we would match the whole sequence exactly. + // Converting the load to LoadUB/LoadUS would mismatch and waste a register + // on the barrier fastpath. + return NULL; + } +#endif + // Masking bits off of a Character? Hi bits are already zero. if( lop == Op_LoadUS && (mask & 0xFFFF0000) ) // Can we make a smaller mask?