8199417: Modularize interpreter GC barriers

Reviewed-by: coleenp, rkennke
This commit is contained in:
Erik Österlund 2018-04-11 16:07:42 +02:00
parent 1094fd9927
commit 2a0986b882
77 changed files with 3087 additions and 2434 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -2516,28 +2516,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// Unbox oop result, e.g. JNIHandles::resolve value in I0.
if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
Label done, not_weak;
__ br_null(I0, false, Assembler::pn, done); // Use NULL as-is.
__ delayed()->andcc(I0, JNIHandles::weak_tag_mask, G0); // Test for jweak
__ brx(Assembler::zero, true, Assembler::pt, not_weak);
__ delayed()->ld_ptr(I0, 0, I0); // Maybe resolve (untagged) jobject.
// Resolve jweak.
__ ld_ptr(I0, -JNIHandles::weak_tag_value, I0);
#if INCLUDE_ALL_GCS
if (UseG1GC) {
// Copy to O0 because macro doesn't allow pre_val in input reg.
__ mov(I0, O0);
__ g1_write_barrier_pre(noreg /* obj */,
noreg /* index */,
0 /* offset */,
O0 /* pre_val */,
G3_scratch /* tmp */,
true /* preserve_o_regs */);
}
#endif // INCLUDE_ALL_GCS
__ bind(not_weak);
__ verify_oop(I0);
__ bind(done);
__ resolve_jobject(I0, G3_scratch);
}
if (CheckJNICalls) {