5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 #include "classfile/javaClasses.inline.hpp" 26 #include "code/scopeDesc.hpp" 27 #include "memory/oopFactory.hpp" 28 #include "oops/cpCache.inline.hpp" 29 #include "oops/generateOopMap.hpp" 30 #include "oops/method.inline.hpp" 31 #include "oops/objArrayOop.inline.hpp" 32 #include "oops/typeArrayOop.inline.hpp" 33 #include "compiler/compileBroker.hpp" 34 #include "compiler/disassembler.hpp" 35 #include "jvmci/jvmciCompilerToVM.hpp" 36 #include "jvmci/jvmciCodeInstaller.hpp" 37 #include "jvmci/jvmciRuntime.hpp" 38 #include "runtime/jniHandles.inline.hpp" 39 #include "runtime/timerTrace.hpp" 40 #include "runtime/vframe_hp.hpp" 41 42 43 void JNIHandleMark::push_jni_handle_block() { 44 JavaThread* thread = JavaThread::current(); 45 if (thread != NULL) { 46 // Allocate a new block for JNI handles. 47 // Inlined code from jni_PushLocalFrame() 48 JNIHandleBlock* java_handles = ((JavaThread*)thread)->active_handles(); 49 JNIHandleBlock* compile_handles = JNIHandleBlock::allocate_block(thread); 50 assert(compile_handles != NULL && java_handles != NULL, "should not be NULL"); 51 compile_handles->set_pop_frame_link(java_handles); 52 thread->set_active_handles(compile_handles); 53 } 54 } 55 56 void JNIHandleMark::pop_jni_handle_block() { 57 JavaThread* thread = JavaThread::current(); | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 #include "precompiled.hpp" 25 #include "ci/ciUtilities.inline.hpp" 26 #include "classfile/javaClasses.inline.hpp" 27 #include "code/scopeDesc.hpp" 28 #include "memory/oopFactory.hpp" 29 #include "oops/cpCache.inline.hpp" 30 #include "oops/generateOopMap.hpp" 31 #include "oops/method.inline.hpp" 32 #include "oops/objArrayOop.inline.hpp" 33 #include "oops/typeArrayOop.inline.hpp" 34 #include "compiler/compileBroker.hpp" 35 #include "compiler/disassembler.hpp" 36 #include "jvmci/jvmciCompilerToVM.hpp" 37 #include "jvmci/jvmciCodeInstaller.hpp" 38 #include "jvmci/jvmciRuntime.hpp" 39 #include "runtime/interfaceSupport.inline.hpp" 40 #include "runtime/jniHandles.inline.hpp" 41 #include "runtime/timerTrace.hpp" 42 #include "runtime/vframe_hp.hpp" 43 44 45 void JNIHandleMark::push_jni_handle_block() { 46 JavaThread* thread = JavaThread::current(); 47 if (thread != NULL) { 48 // Allocate a new block for JNI handles. 49 // Inlined code from jni_PushLocalFrame() 50 JNIHandleBlock* java_handles = ((JavaThread*)thread)->active_handles(); 51 JNIHandleBlock* compile_handles = JNIHandleBlock::allocate_block(thread); 52 assert(compile_handles != NULL && java_handles != NULL, "should not be NULL"); 53 compile_handles->set_pop_frame_link(java_handles); 54 thread->set_active_handles(compile_handles); 55 } 56 } 57 58 void JNIHandleMark::pop_jni_handle_block() { 59 JavaThread* thread = JavaThread::current(); |