21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/macroAssembler.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreterRuntime.hpp" 29 #include "interpreter/interp_masm.hpp" 30 #include "interpreter/templateTable.hpp" 31 #include "memory/universe.inline.hpp" 32 #include "oops/methodData.hpp" 33 #include "oops/objArrayKlass.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "prims/methodHandles.hpp" 36 #include "runtime/sharedRuntime.hpp" 37 #include "runtime/stubRoutines.hpp" 38 #include "runtime/synchronizer.hpp" 39 #include "utilities/macros.hpp" 40 41 #ifndef CC_INTERP 42 43 #define __ _masm-> 44 45 // Global Register Names 46 static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); 47 static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); 48 49 // Platform-dependent initialization 50 void TemplateTable::pd_initialize() { 51 // No x86 specific initialization 52 } 53 54 // Address Computation: local variables 55 static inline Address iaddress(int n) { 56 return Address(rlocals, Interpreter::local_offset_in_bytes(n)); 57 } 58 59 static inline Address laddress(int n) { 60 return iaddress(n + 1); 61 } 62 4324 __ load_unsigned_byte(rbx, at_bcp(1)); 4325 ExternalAddress wtable((address)Interpreter::_wentry_point); 4326 __ jump(ArrayAddress(wtable, Address(noreg, rbx, Address::times_ptr))); 4327 // Note: the rbcp increment step is part of the individual wide bytecode implementations 4328 } 4329 4330 // Multi arrays 4331 void TemplateTable::multianewarray() { 4332 transition(vtos, atos); 4333 4334 Register rarg = LP64_ONLY(c_rarg1) NOT_LP64(rax); 4335 __ load_unsigned_byte(rax, at_bcp(3)); // get number of dimensions 4336 // last dim is on top of stack; we want address of first one: 4337 // first_addr = last_addr + (ndims - 1) * stackElementSize - 1*wordsize 4338 // the latter wordSize to point to the beginning of the array. 4339 __ lea(rarg, Address(rsp, rax, Interpreter::stackElementScale(), -wordSize)); 4340 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), rarg); 4341 __ load_unsigned_byte(rbx, at_bcp(3)); 4342 __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts 4343 } 4344 #endif /* !CC_INTERP */ 4345 | 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/macroAssembler.hpp" 27 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreterRuntime.hpp" 29 #include "interpreter/interp_masm.hpp" 30 #include "interpreter/templateTable.hpp" 31 #include "memory/universe.inline.hpp" 32 #include "oops/methodData.hpp" 33 #include "oops/objArrayKlass.hpp" 34 #include "oops/oop.inline.hpp" 35 #include "prims/methodHandles.hpp" 36 #include "runtime/sharedRuntime.hpp" 37 #include "runtime/stubRoutines.hpp" 38 #include "runtime/synchronizer.hpp" 39 #include "utilities/macros.hpp" 40 41 #define __ _masm-> 42 43 // Global Register Names 44 static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); 45 static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); 46 47 // Platform-dependent initialization 48 void TemplateTable::pd_initialize() { 49 // No x86 specific initialization 50 } 51 52 // Address Computation: local variables 53 static inline Address iaddress(int n) { 54 return Address(rlocals, Interpreter::local_offset_in_bytes(n)); 55 } 56 57 static inline Address laddress(int n) { 58 return iaddress(n + 1); 59 } 60 4322 __ load_unsigned_byte(rbx, at_bcp(1)); 4323 ExternalAddress wtable((address)Interpreter::_wentry_point); 4324 __ jump(ArrayAddress(wtable, Address(noreg, rbx, Address::times_ptr))); 4325 // Note: the rbcp increment step is part of the individual wide bytecode implementations 4326 } 4327 4328 // Multi arrays 4329 void TemplateTable::multianewarray() { 4330 transition(vtos, atos); 4331 4332 Register rarg = LP64_ONLY(c_rarg1) NOT_LP64(rax); 4333 __ load_unsigned_byte(rax, at_bcp(3)); // get number of dimensions 4334 // last dim is on top of stack; we want address of first one: 4335 // first_addr = last_addr + (ndims - 1) * stackElementSize - 1*wordsize 4336 // the latter wordSize to point to the beginning of the array. 4337 __ lea(rarg, Address(rsp, rax, Interpreter::stackElementScale(), -wordSize)); 4338 call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), rarg); 4339 __ load_unsigned_byte(rbx, at_bcp(3)); 4340 __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts 4341 } |