< prev index next >

src/cpu/zero/vm/cppInterpreter_zero.cpp

Print this page
rev 12692 : 8176100: [REDO][REDO] G1 Needs pre barrier on dereference of weak JNI handles
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as --- 1,7 ---- /* ! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as
*** 404,417 **** // If the result was an oop then unbox it and store it in // oop_temp where the garbage collector can see it before // we release the handle it might be protected by. if (handler->result_type() == &ffi_type_pointer) { ! if (result[0]) ! istate->set_oop_temp(*(oop *) result[0]); ! else istate->set_oop_temp(NULL); } // Reset handle block thread->active_handles()->clear(); --- 404,419 ---- // If the result was an oop then unbox it and store it in // oop_temp where the garbage collector can see it before // we release the handle it might be protected by. if (handler->result_type() == &ffi_type_pointer) { ! if (result[0] == 0) { istate->set_oop_temp(NULL); + } else { + jobject handle = reinterpret_cast<jobject>(result[0]); + istate->set_oop_temp(JNIHandles::resolve(handle)); + } } // Reset handle block thread->active_handles()->clear();
< prev index next >