< prev index next >

src/hotspot/cpu/arm/templateTable_arm.cpp

Print this page
rev 50604 : imported patch jep181-rev1
rev 50605 : imported patch jep181-rev2


4259   __ jump_from_interpreted(Rmethod);
4260 }
4261 
4262 
4263 void TemplateTable::fast_invokevfinal(int byte_no) {
4264   transition(vtos, vtos);
4265   assert(byte_no == f2_byte, "use this argument");
4266   __ stop("fast_invokevfinal is not used on ARM");
4267 }
4268 
4269 
4270 void TemplateTable::invokeinterface(int byte_no) {
4271   transition(vtos, vtos);
4272   assert(byte_no == f1_byte, "use this argument");
4273 
4274   const Register Ritable = R1_tmp;
4275   const Register Rrecv   = R2_tmp;
4276   const Register Rinterf = R5_tmp;
4277   const Register Rindex  = R4_tmp;
4278   const Register Rflags  = R3_tmp;
4279   const Register Rklass  = R3_tmp;
4280 
4281   prepare_invoke(byte_no, Rinterf, Rmethod, Rrecv, Rflags);
4282 
4283   // Special case of invokeinterface called for virtual method of
4284   // java.lang.Object.  See cpCacheOop.cpp for details.
4285   // This code isn't produced by javac, but could be produced by
4286   // another compliant java compiler.
4287   Label notMethod;
4288   __ tbz(Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift, notMethod);
4289 




4290   invokevirtual_helper(Rmethod, Rrecv, Rflags);
4291   __ bind(notMethod);
4292 
4293   // Get receiver klass into Rklass - also a null check
4294   __ load_klass(Rklass, Rrecv);
4295 

4296   Label no_such_interface;















4297 
4298   // Receiver subtype check against REFC.
4299   __ lookup_interface_method(// inputs: rec. class, interface
4300                              Rklass, Rinterf, noreg,
4301                              // outputs:  scan temp. reg1, scan temp. reg2
4302                              noreg, Ritable, Rtemp,
4303                              no_such_interface);
4304 
4305   // profile this call
4306   __ profile_virtual_call(R0_tmp, Rklass);
4307 
4308   // Get declaring interface class from method
4309   __ ldr(Rtemp, Address(Rmethod, Method::const_offset()));
4310   __ ldr(Rtemp, Address(Rtemp, ConstMethod::constants_offset()));
4311   __ ldr(Rinterf, Address(Rtemp, ConstantPool::pool_holder_offset_in_bytes()));
4312 
4313   // Get itable index from method
4314   __ ldr_s32(Rtemp, Address(Rmethod, Method::itable_index_offset()));
4315   __ add(Rtemp, Rtemp, (-Method::itable_index_max)); // small negative constant is too large for an immediate on arm32
4316   __ neg(Rindex, Rtemp);




4259   __ jump_from_interpreted(Rmethod);
4260 }
4261 
4262 
4263 void TemplateTable::fast_invokevfinal(int byte_no) {
4264   transition(vtos, vtos);
4265   assert(byte_no == f2_byte, "use this argument");
4266   __ stop("fast_invokevfinal is not used on ARM");
4267 }
4268 
4269 
4270 void TemplateTable::invokeinterface(int byte_no) {
4271   transition(vtos, vtos);
4272   assert(byte_no == f1_byte, "use this argument");
4273 
4274   const Register Ritable = R1_tmp;
4275   const Register Rrecv   = R2_tmp;
4276   const Register Rinterf = R5_tmp;
4277   const Register Rindex  = R4_tmp;
4278   const Register Rflags  = R3_tmp;
4279   const Register Rklass  = R2_tmp; // Note! Same register with Rrecv
4280 
4281   prepare_invoke(byte_no, Rinterf, Rmethod, Rrecv, Rflags);
4282 
4283   // First check for Object case, then private interface method,
4284   // then regular interface method.




4285 
4286   // Special case of invokeinterface called for virtual method of
4287   // java.lang.Object.  See cpCache.cpp for details.
4288   Label notObjectMethod;
4289   __ tbz(Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift, notObjectMethod);
4290   invokevirtual_helper(Rmethod, Rrecv, Rflags);
4291   __ bind(notObjectMethod);
4292 
4293   // Get receiver klass into Rklass - also a null check
4294   __ load_klass(Rklass, Rrecv);
4295 
4296   // Check for private method invocation - indicated by vfinal
4297   Label no_such_interface;
4298 
4299   Label notVFinal;
4300   __ tbz(Rflags, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal);
4301 
4302   Label subtype;
4303   __ check_klass_subtype(Rklass, Rinterf, R1_tmp, R3_tmp, noreg, subtype);
4304   // If we get here the typecheck failed
4305   __ b(no_such_interface);
4306   __ bind(subtype);
4307 
4308   // do the call
4309   __ profile_final_call(R0_tmp);
4310   __ jump_from_interpreted(Rmethod);
4311 
4312   __ bind(notVFinal);
4313 
4314   // Receiver subtype check against REFC.
4315   __ lookup_interface_method(// inputs: rec. class, interface
4316                              Rklass, Rinterf, noreg,
4317                              // outputs:  scan temp. reg1, scan temp. reg2
4318                              noreg, Ritable, Rtemp,
4319                              no_such_interface);
4320 
4321   // profile this call
4322   __ profile_virtual_call(R0_tmp, Rklass);
4323 
4324   // Get declaring interface class from method
4325   __ ldr(Rtemp, Address(Rmethod, Method::const_offset()));
4326   __ ldr(Rtemp, Address(Rtemp, ConstMethod::constants_offset()));
4327   __ ldr(Rinterf, Address(Rtemp, ConstantPool::pool_holder_offset_in_bytes()));
4328 
4329   // Get itable index from method
4330   __ ldr_s32(Rtemp, Address(Rmethod, Method::itable_index_offset()));
4331   __ add(Rtemp, Rtemp, (-Method::itable_index_max)); // small negative constant is too large for an immediate on arm32
4332   __ neg(Rindex, Rtemp);


< prev index next >