< prev index next >

src/cpu/ppc/vm/stubGenerator_ppc.cpp

Print this page
rev 12310 : Reserve R30 to a cleared content register on C1 and C2 code

Several times a 0 is loaded to a register as a temporary value. This can be
improved by caching a 0 into a register.

I didn't notice a performance drop since only applying this patch showed no
drop of performance, hence there are more registers available than normally
needed and this caching technique can be applied.

Despite setting R30_zero as a dedicated register and initialized with 0 for the
C1 and C2 code, new rules for storing 0 related to stb,sth,stw,std were added.

@@ -262,10 +262,13 @@
       // when called via a c2i.
 
       // Pass initial_caller_sp to framemanager.
       __ mr(R21_tmp1, R1_SP);
 
+      // Zero the register that caches zero (optimization)
+      __ li(R30_zero, 0);
+
       // Do a light-weight C-call here, r_new_arg_entry holds the address
       // of the interpreter entry point (frame manager or native entry)
       // and save runtime-value of LR in return_address.
       assert(r_new_arg_entry != tos && r_new_arg_entry != R19_method && r_new_arg_entry != R16_thread,
              "trashed r_new_arg_entry");
< prev index next >