2273N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 1612N/A * Copyright 2009, 2010 Red Hat, Inc. 1612N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1612N/A * This code is free software; you can redistribute it and/or modify it 1612N/A * under the terms of the GNU General Public License version 2 only, as 1612N/A * published by the Free Software Foundation. 1612N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1612N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1612N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1612N/A * version 2 for more details (a copy is included in the LICENSE file that 1612N/A * You should have received a copy of the GNU General Public License version 1612N/A * 2 along with this work; if not, write to the Free Software Foundation, 1612N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1612N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1612N/A // Create and push our stack frame 1612N/A // Create the oopmap. We use the one oopmap for every call site in 1612N/A // the wrapper, which results in the odd mild inefficiency but is a 1612N/A // damn sight easier to code. 1612N/A // Set up the oop_tmp slot if required: 1612N/A // - For static methods we use it to handlize the class argument 1612N/A // for the call, and to protect the same during slow path locks 1612N/A // - For methods returning oops, we use it to protect the return 1612N/A // value across safepoints or slow path unlocking. 1612N/A // Set up the monitor slot, for synchronized methods 1612N/A // Start building the argument list 1612N/A // First argument is the JNIEnv 1612N/A // For static methods, the second argument is the class 1612N/A // The oop_tmp slot is registered in the oopmap, 1612N/A // so we need to clear it. This is one of the 1612N/A // mild inefficiencies I mentioned earlier. 1612N/A // The oopmap is now complete, and everything is written 1612N/A // into the frame except the PC. 1612N/A // Set up the Java frame anchor 1612N/A // Change the thread state to _thread_in_native 1612N/A // Start the transition back to _thread_in_Java 1612N/A // Make sure new state is visible in the GC thread 1612N/A // Handle safepoint operations, pending suspend requests, 1612N/A // and pending asynchronous exceptions. 1612N/A // Finally we can change the thread state to _thread_in_Java 1612N/A // If there is a pending exception then we can just unwind and 1612N/A // return. It seems totally wrong that unlocking is skipped here 1612N/A // but apparently the template interpreter does this so we do too. 1612N/A // If the result was an oop then unbox it before 1612N/A // releasing the handle it might be protected by