8166188: G1 Needs pre barrier on dereference of weak JNI handles

Add low tag to jweaks and G1 barrier for jweak loads.

Co-authored-by: Martin Doerr <martin.doerr@sap.com>
Co-authored-by: Volker Simonis <volker.simonis@sap.com>
Reviewed-by: mgerdin, mdoerr, pliden, dlong, dcubed, coleenp, aph, tschatzl
This commit is contained in:
Kim Barrett 2017-02-15 22:19:13 -05:00
parent 6a5e6f2ae1
commit 28477cf493
37 changed files with 1061 additions and 429 deletions

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
@ -2272,13 +2272,9 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
__ reset_last_Java_frame();
// Unpack oop result
// Unpack oop result, e.g. JNIHandles::resolve result.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
NearLabel L;
__ compare64_and_branch(Z_RET, (RegisterOrConstant)0L, Assembler::bcondEqual, L);
__ z_lg(Z_RET, 0, Z_RET);
__ bind(L);
__ verify_oop(Z_RET);
__ resolve_jobject(Z_RET, /* tmp1 */ Z_R13, /* tmp2 */ Z_R7);
}
if (CheckJNICalls) {