< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page
*** 351,10 ***
--- 351,22 ---
  
    // resolved class - need to call vm to get java mirror of the class
    __ cmp(r3, (u1)JVM_CONSTANT_Class);
    __ br(Assembler::NE, notClass);
  
+   __ load_resolved_klass_at_offset(r2, r1, r3, rscratch1); // kills r3=tag
+ 
+   __ cmp(r3, zr); // resolved_klass ?= null
+   __ br(Assembler::EQ, call_ldc);
+ 
+   const int mirror_offset = in_bytes(Klass::java_mirror_offset());
+   __ ldr(r3, Address(r3, mirror_offset));
+   __ resolve_oop_handle(r3, rscratch1, rscratch2);
+   __ push_ptr(r3);
+ 
+   __ b(Done);
+ 
    __ bind(call_ldc);
    __ mov(c_rarg1, is_ldc_wide(type) ? 1 : 0);
    call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::ldc), c_rarg1);
    __ push_ptr(r0);
    __ verify_oop(r0);

*** 2308,11 ***
                                              Register Rcache,
                                              Register index) {
    const Register temp = r19;
    assert_different_registers(Rcache, index, temp);
  
!   Label resolved;
  
    Bytecodes::Code code = bytecode();
    switch (code) {
    case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
    case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;
--- 2320,11 ---
                                              Register Rcache,
                                              Register index) {
    const Register temp = r19;
    assert_different_registers(Rcache, index, temp);
  
!   Label resolved, clinit_barrier_slow;
  
    Bytecodes::Code code = bytecode();
    switch (code) {
    case Bytecodes::_nofast_getfield: code = Bytecodes::_getfield; break;
    case Bytecodes::_nofast_putfield: code = Bytecodes::_putfield; break;

*** 2330,17 ***
--- 2342,25 ---
    __ ldarb(temp, temp);
    __ subs(zr, temp, (int) code);  // have we resolved this bytecode?
    __ br(Assembler::EQ, resolved);
  
    // resolve first time through
+   __ bind(clinit_barrier_slow);
    address entry = CAST_FROM_FN_PTR(address, InterpreterRuntime::resolve_from_cache);
    __ mov(temp, (int) code);
    __ call_VM(noreg, entry, temp);
  
    // Update registers with resolved info
    __ load_field_entry(Rcache, index);
    __ bind(resolved);
+ 
+   // Class initialization barrier for static fields
+   if (VM_Version::supports_fast_class_init_checks() &&
+       (bytecode() == Bytecodes::_getstatic || bytecode() == Bytecodes::_putstatic)) {
+     __ ldr(temp, Address(Rcache, ResolvedFieldEntry::field_holder_offset()));
+     __ clinit_barrier(temp, rscratch1, nullptr, &clinit_barrier_slow);
+   }
  }
  
  void TemplateTable::load_resolved_field_entry(Register obj,
                                                Register cache,
                                                Register tos_state,
< prev index next >