7 * under the terms of the GNU General Public License version 2 only, as 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 "interpreter/interpreter.hpp" 28 #include "interpreter/interpreterRuntime.hpp" 29 #include "memory/allocation.inline.hpp" 30 #include "memory/universe.hpp" 31 #include "oops/method.hpp" 32 #include "oops/oop.inline.hpp" 33 #include "runtime/handles.inline.hpp" 34 #include "runtime/icache.hpp" 35 #include "runtime/interfaceSupport.inline.hpp" 36 #include "runtime/signature.hpp" 37 38 #define __ _masm-> 39 40 // Implementation of SignatureHandlerGenerator 41 Register InterpreterRuntime::SignatureHandlerGenerator::from() { return rlocals; } 42 Register InterpreterRuntime::SignatureHandlerGenerator::to() { return sp; } 43 Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; } 44 45 void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { 46 const Address src(from(), Interpreter::local_offset_in_bytes(offset())); 47 48 switch (_num_int_args) { 49 case 0: 50 __ ldr(c_rarg1, src); 51 _num_int_args++; 52 break; 53 case 1: 54 __ ldr(c_rarg2, src); 55 _num_int_args++; 56 break; 57 case 2: 58 __ ldr(c_rarg3, src); 59 _num_int_args++; 60 break; 61 case 3: 62 __ ldr(c_rarg4, src); 63 _num_int_args++; | 7 * under the terms of the GNU General Public License version 2 only, as 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 "interpreter/interp_masm.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 // Implementation of SignatureHandlerGenerator 42 Register InterpreterRuntime::SignatureHandlerGenerator::from() { return rlocals; } 43 Register InterpreterRuntime::SignatureHandlerGenerator::to() { return sp; } 44 Register InterpreterRuntime::SignatureHandlerGenerator::temp() { return rscratch1; } 45 46 InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator( 47 const methodHandle& method, CodeBuffer* buffer) : NativeSignatureIterator(method) { 48 _masm = new MacroAssembler(buffer); 49 _num_int_args = (method->is_static() ? 1 : 0); 50 _num_fp_args = 0; 51 _stack_offset = 0; 52 } 53 54 void InterpreterRuntime::SignatureHandlerGenerator::pass_int() { 55 const Address src(from(), Interpreter::local_offset_in_bytes(offset())); 56 57 switch (_num_int_args) { 58 case 0: 59 __ ldr(c_rarg1, src); 60 _num_int_args++; 61 break; 62 case 1: 63 __ ldr(c_rarg2, src); 64 _num_int_args++; 65 break; 66 case 2: 67 __ ldr(c_rarg3, src); 68 _num_int_args++; 69 break; 70 case 3: 71 __ ldr(c_rarg4, src); 72 _num_int_args++; |