< prev index next >

src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp

Print this page

        

@@ -574,11 +574,11 @@
       __ mov(c_rarg0, rthread);
       __ mov(c_rarg1, r1);
       __ mov(c_rarg2, (int64_t)alloc_value_receiver);
 
       __ lea(rscratch1, RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::allocate_value_types)));
-      __ blrt(rscratch1, 3, 0, 1);
+      __ blr(rscratch1);
 
       oop_maps->add_gc_map((int)(__ pc() - start), map);
       __ reset_last_Java_frame(false);
 
       RegisterSaver::restore_live_registers(masm);

@@ -883,23 +883,11 @@
 
   __ str(rmethod, Address(rthread, JavaThread::callee_target_offset()));
   __ br(rscratch1);
 }
 
-// ---------------------------------------------------------------
-AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
-                                                            int total_args_passed,
-                                                            int comp_args_on_stack,
-                                                            const BasicType *sig_bt,
-                                                            const VMRegPair *regs,
-                                                            AdapterFingerPrint* fingerprint) {
-  address i2c_entry = __ pc();
-
-  gen_i2c_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs);
-
-  address c2i_unverified_entry = __ pc();
-  Label skip_fixup;
+static void gen_inline_cache_check(MacroAssembler *masm, Label& skip_fixup) {
 
   Label ok;
 
   Register holder = rscratch2;
   Register receiver = j_rarg0;

@@ -932,10 +920,11 @@
     __ far_jump(RuntimeAddress(SharedRuntime::get_ic_miss_stub()));
     __ block_comment("} c2i_unverified_entry");
   }
 }
 
+
 // ---------------------------------------------------------------
 AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
                                                             int comp_args_on_stack,
                                                             const GrowableArray<SigEntry>* sig,
                                                             const VMRegPair* regs,

@@ -950,11 +939,10 @@
   gen_i2c_adapter(masm, comp_args_on_stack, sig, regs);
 
   address c2i_unverified_entry = __ pc();
   Label skip_fixup;
 
-
   gen_inline_cache_check(masm, skip_fixup);
 
   OopMapSet* oop_maps = new OopMapSet();
   int frame_complete = CodeOffsets::frame_never_safe;
   int frame_size_in_words = 0;

@@ -968,13 +956,36 @@
   }
 
   // Scalarized c2i adapter
   address c2i_entry = __ pc();
 
-  // Not implemented
-  // BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
-  // bs->c2i_entry_barrier(masm);
+  // Class initialization barrier for static methods
+  address c2i_no_clinit_check_entry = NULL;
+
+  if (VM_Version::supports_fast_class_init_checks()) {
+    Label L_skip_barrier;
+    { // Bypass the barrier for non-static methods
+        Register flags  = rscratch1;
+      __ ldrw(flags, Address(rmethod, Method::access_flags_offset()));
+      __ tst(flags, JVM_ACC_STATIC);
+      __ br(Assembler::NE, L_skip_barrier); // non-static
+    }
+
+    Register klass = rscratch1;
+    __ load_method_holder(klass, rmethod);
+    // We pass rthread to this function on x86
+    __ clinit_barrier(klass, rscratch2, &L_skip_barrier /*L_fast_path*/);
+
+    __ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub())); // slow path
+
+    __ bind(L_skip_barrier);
+    c2i_no_clinit_check_entry = __ pc();
+  }
+
+//  FIXME: Not Implemented
+//  BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
+//  bs->c2i_entry_barrier(masm);
 
   gen_c2i_adapter(masm, sig_cc, regs_cc, skip_fixup, i2c_entry, oop_maps, frame_complete, frame_size_in_words, true);
 
   address c2i_unverified_value_entry = c2i_unverified_entry;
 

@@ -988,14 +999,10 @@
     c2i_value_entry = __ pc();
     Label unused;
     gen_c2i_adapter(masm, sig, regs, value_entry_skip_fixup, i2c_entry, oop_maps, frame_complete, frame_size_in_words, false);
   }
 
-  // TODO fix this
-  // Class initialization barrier for static methods
-  address c2i_no_clinit_check_entry = NULL;
-
   __ flush();
 
   // The c2i adapter might safepoint and trigger a GC. The caller must make sure that
   // the GC knows about the location of oop argument locations passed to the c2i adapter.
 
< prev index next >