--- old/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2019-04-11 21:28:13.861952829 +0000 +++ new/src/cpu/ppc/vm/macroAssembler_ppc.cpp 2019-04-11 21:28:13.751952132 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2018, SAP SE. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017, SAP SE. 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 @@ -2220,6 +2220,34 @@ stbx(R0, Rtmp, Robj); } +// Kills R31 if value is a volatile register. +void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) { + Label done; + cmpdi(CCR0, value, 0); + beq(CCR0, done); // Use NULL as-is. + + clrrdi(tmp1, value, JNIHandles::weak_tag_size); +#if INCLUDE_ALL_GCS + if (UseG1GC) { andi_(tmp2, value, JNIHandles::weak_tag_mask); } +#endif + ld(value, 0, tmp1); // Resolve (untagged) jobject. + +#if INCLUDE_ALL_GCS + if (UseG1GC) { + Label not_weak; + beq(CCR0, not_weak); // Test for jweak tag. + verify_oop(value); + g1_write_barrier_pre(noreg, // obj + noreg, // offset + value, // pre_val + tmp1, tmp2, needs_frame); + bind(not_weak); + } +#endif // INCLUDE_ALL_GCS + verify_oop(value); + bind(done); +} + #if INCLUDE_ALL_GCS // General G1 pre-barrier generator. // Goal: record the previous value if it is not null. @@ -2281,7 +2309,7 @@ bind(runtime); - // VM call need frame to access(write) O register. + // May need to preserve LR. Also needed if current frame is not compatible with C calling convention. if (needs_frame) { save_LR_CR(Rtmp1); push_frame_reg_args(0, Rtmp2);