8 * published by the Free Software Foundation. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 * 24 */ 25 26 #include "precompiled.hpp" 27 #include "asm/assembler.inline.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterRuntime.hpp" 30 #include "memory/allocation.inline.hpp" 31 #include "memory/universe.hpp" 32 #include "oops/method.hpp" 33 #include "oops/oop.inline.hpp" 34 #include "runtime/handles.inline.hpp" 35 #include "runtime/icache.hpp" 36 #include "runtime/interfaceSupport.inline.hpp" 37 #include "runtime/signature.hpp" 38 39 #define __ _masm-> 40 41 // Access macros for Java and C arguments. 42 // The first Java argument is at index -1. 43 #define locals_j_arg_at(index) (Interpreter::local_offset_in_bytes(index)), R18_locals 44 // The first C argument is at index 0. 45 #define sp_c_arg_at(index) ((index)*wordSize + _abi(carg_1)), R1_SP 46 47 // Implementation of SignatureHandlerGenerator 48 49 void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { 50 Argument jni_arg(jni_offset()); 51 Register r = jni_arg.is_register() ? jni_arg.as_register() : R0; 52 53 __ lwa(r, locals_j_arg_at(offset())); // sign extension of integer 54 if (DEBUG_ONLY(true ||) !jni_arg.is_register()) { 55 __ std(r, sp_c_arg_at(jni_arg.number())); 56 } 57 } 58 59 void InterpreterRuntime::SignatureHandlerGenerator::pass_long() { 60 Argument jni_arg(jni_offset()); 61 Register r = jni_arg.is_register() ? jni_arg.as_register() : R0; 62 63 __ ld(r, locals_j_arg_at(offset()+1)); // long resides in upper slot 64 if (DEBUG_ONLY(true ||) !jni_arg.is_register()) { 65 __ std(r, sp_c_arg_at(jni_arg.number())); 66 } 67 } | 8 * published by the Free Software Foundation. 9 * 10 * This code is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 * 24 */ 25 26 #include "precompiled.hpp" 27 #include "asm/assembler.inline.hpp" 28 #include "interpreter/interp_masm.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "memory/allocation.inline.hpp" 32 #include "memory/universe.hpp" 33 #include "oops/method.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "runtime/handles.inline.hpp" 36 #include "runtime/icache.hpp" 37 #include "runtime/interfaceSupport.inline.hpp" 38 #include "runtime/signature.hpp" 39 40 #define __ _masm-> 41 42 // Access macros for Java and C arguments. 43 // The first Java argument is at index -1. 44 #define locals_j_arg_at(index) (Interpreter::local_offset_in_bytes(index)), R18_locals 45 // The first C argument is at index 0. 46 #define sp_c_arg_at(index) ((index)*wordSize + _abi(carg_1)), R1_SP 47 48 // Implementation of SignatureHandlerGenerator 49 50 InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( 51 const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { 52 _masm = new MacroAssembler(buffer); 53 _num_used_fp_arg_regs = 0; 54 } 55 56 void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { 57 Argument jni_arg(jni_offset()); 58 Register r = jni_arg.is_register() ? jni_arg.as_register() : R0; 59 60 __ lwa(r, locals_j_arg_at(offset())); // sign extension of integer 61 if (DEBUG_ONLY(true ||) !jni_arg.is_register()) { 62 __ std(r, sp_c_arg_at(jni_arg.number())); 63 } 64 } 65 66 void InterpreterRuntime::SignatureHandlerGenerator::pass_long() { 67 Argument jni_arg(jni_offset()); 68 Register r = jni_arg.is_register() ? jni_arg.as_register() : R0; 69 70 __ ld(r, locals_j_arg_at(offset()+1)); // long resides in upper slot 71 if (DEBUG_ONLY(true ||) !jni_arg.is_register()) { 72 __ std(r, sp_c_arg_at(jni_arg.number())); 73 } 74 } |