< prev index next >

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Print this page




  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/macroAssembler.inline.hpp"
  28 #include "gc/shared/barrierSet.hpp"
  29 #include "gc/shared/barrierSetAssembler.hpp"
  30 #include "interp_masm_aarch64.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "interpreter/interpreterRuntime.hpp"
  33 #include "logging/log.hpp"
  34 #include "oops/arrayOop.hpp"
  35 #include "oops/markWord.hpp"
  36 #include "oops/method.hpp"
  37 #include "oops/methodData.hpp"
  38 #include "prims/jvmtiExport.hpp"
  39 #include "prims/jvmtiThreadState.hpp"
  40 #include "runtime/basicLock.hpp"
  41 #include "runtime/biasedLocking.hpp"
  42 #include "runtime/frame.inline.hpp"
  43 #include "runtime/safepointMechanism.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/thread.inline.hpp"
  46 
  47 
  48 void InterpreterMacroAssembler::narrow(Register result) {
  49 
  50   // Get method->_constMethod->_result_type
  51   ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
  52   ldr(rscratch1, Address(rscratch1, Method::const_offset()));
  53   ldrb(rscratch1, Address(rscratch1, ConstMethod::result_type_offset()));
  54 
  55   Label done, notBool, notByte, notChar;


 269                                            Register result, Register index, Register tmp) {
 270   assert_different_registers(result, index);
 271 
 272   get_constant_pool(result);
 273   // load pointer for resolved_references[] objArray
 274   ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 275   ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 276   resolve_oop_handle(result, tmp);
 277   // Add in the index
 278   add(index, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
 279   load_heap_oop(result, Address(result, index, Address::uxtw(LogBytesPerHeapOop)));
 280 }
 281 
 282 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
 283                              Register cpool, Register index, Register klass, Register temp) {
 284   add(temp, cpool, index, LSL, LogBytesPerWord);
 285   ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
 286   ldr(klass, Address(cpool,  ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
 287   add(klass, klass, temp, LSL, LogBytesPerWord);
 288   ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
 289 }
 290 
 291 void InterpreterMacroAssembler::load_resolved_method_at_index(int byte_no,
 292                                                               Register method,
 293                                                               Register cache) {
 294   const int method_offset = in_bytes(
 295     ConstantPoolCache::base_offset() +
 296       ((byte_no == TemplateTable::f2_byte)
 297        ? ConstantPoolCacheEntry::f2_offset()
 298        : ConstantPoolCacheEntry::f1_offset()));
 299 
 300   ldr(method, Address(cache, method_offset)); // get f1 Method*
 301 }
 302 
 303 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 304 // subtype of super_klass.
 305 //
 306 // Args:
 307 //      r0: superklass
 308 //      Rsub_klass: subklass
 309 //
 310 // Kills:
 311 //      r2, r5
 312 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 313                                                   Label& ok_is_subtype) {
 314   assert(Rsub_klass != r0, "r0 holds superklass");
 315   assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
 316   assert(Rsub_klass != r5, "r5 holds 2ndary super array scan ptr");
 317 
 318   // Profile the not-null value's klass.
 319   profile_typecheck(r2, Rsub_klass, r5); // blows r2, reloads r5
 320 




  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/macroAssembler.inline.hpp"
  28 #include "gc/shared/barrierSet.hpp"
  29 #include "gc/shared/barrierSetAssembler.hpp"
  30 #include "interp_masm_aarch64.hpp"
  31 #include "interpreter/interpreter.hpp"
  32 #include "interpreter/interpreterRuntime.hpp"
  33 #include "logging/log.hpp"
  34 #include "oops/arrayOop.hpp"
  35 #include "oops/markOop.hpp"
  36 #include "oops/method.hpp"
  37 #include "oops/methodData.hpp"
  38 #include "prims/jvmtiExport.hpp"
  39 #include "prims/jvmtiThreadState.hpp"
  40 #include "runtime/basicLock.hpp"
  41 #include "runtime/biasedLocking.hpp"
  42 #include "runtime/frame.inline.hpp"
  43 #include "runtime/safepointMechanism.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/thread.inline.hpp"
  46 
  47 
  48 void InterpreterMacroAssembler::narrow(Register result) {
  49 
  50   // Get method->_constMethod->_result_type
  51   ldr(rscratch1, Address(rfp, frame::interpreter_frame_method_offset * wordSize));
  52   ldr(rscratch1, Address(rscratch1, Method::const_offset()));
  53   ldrb(rscratch1, Address(rscratch1, ConstMethod::result_type_offset()));
  54 
  55   Label done, notBool, notByte, notChar;


 269                                            Register result, Register index, Register tmp) {
 270   assert_different_registers(result, index);
 271 
 272   get_constant_pool(result);
 273   // load pointer for resolved_references[] objArray
 274   ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 275   ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 276   resolve_oop_handle(result, tmp);
 277   // Add in the index
 278   add(index, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
 279   load_heap_oop(result, Address(result, index, Address::uxtw(LogBytesPerHeapOop)));
 280 }
 281 
 282 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
 283                              Register cpool, Register index, Register klass, Register temp) {
 284   add(temp, cpool, index, LSL, LogBytesPerWord);
 285   ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
 286   ldr(klass, Address(cpool,  ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
 287   add(klass, klass, temp, LSL, LogBytesPerWord);
 288   ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));












 289 }
 290 
 291 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 292 // subtype of super_klass.
 293 //
 294 // Args:
 295 //      r0: superklass
 296 //      Rsub_klass: subklass
 297 //
 298 // Kills:
 299 //      r2, r5
 300 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 301                                                   Label& ok_is_subtype) {
 302   assert(Rsub_klass != r0, "r0 holds superklass");
 303   assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
 304   assert(Rsub_klass != r5, "r5 holds 2ndary super array scan ptr");
 305 
 306   // Profile the not-null value's klass.
 307   profile_typecheck(r2, Rsub_klass, r5); // blows r2, reloads r5
 308 


< prev index next >