[aarch64-port-dev ] A few fixes for lambdas

Andrew Haley aph at redhat.com
Tue Sep 3 07:25:51 PDT 2013


I've been kicking the tyres of Lambdas, and I have noticed a few thinkos
that I made, some way back in Dec 2012.

Andrew.


# HG changeset patch
# User aph
# Date 1378218141 -3600
# Node ID 9a45e1894e290674555275c7ca5d8ee4ed0165d6
# Parent  3a09edaa2c42ea1b910484d4c3d878858dd9634a
A few fixes for lambdas

diff -r 3a09edaa2c42 -r 9a45e1894e29 src/cpu/aarch64/vm/interp_masm_aarch64.cpp
--- a/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Thu Aug 29 17:15:33 2013 +0100
+++ b/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Tue Sep 03 15:22:21 2013 +0100
@@ -127,7 +127,7 @@
     // we have to change the following assembler code to calculate the
     // plain index.
     assert(ConstantPool::decode_invokedynamic_index(~123) == 123, "else change next line");
-    eonw(index, index, 0);  // convert to plain index
+    eonw(index, index, zr);  // convert to plain index
   } else if (index_size == sizeof(u1)) {
     load_unsigned_byte(index, Address(rbcp, bcp_offset));
   } else {
@@ -798,6 +798,8 @@
   // %%% this does 64bit counters at best it is wasting space
   // at worst it is a rare bug when counters overflow

+  assert_different_registers(rscratch2, rscratch1, mdp_in, reg);
+
   Address addr1(mdp_in, constant);
   Address addr2(rscratch2, reg, Address::lsl(0));
   Address &addr = addr1;
diff -r 3a09edaa2c42 -r 9a45e1894e29 src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Thu Aug 29 17:15:33 2013 +0100
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Tue Sep 03 15:22:21 2013 +0100
@@ -1226,7 +1226,7 @@
     SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
     VMReg r = regs[member_arg_pos].first();
     if (r->is_stack()) {
-      __ ldr(member_reg, Address(sp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
+      __ ldr(member_reg, Address(sp, r->reg2stack() * VMRegImpl::stack_slot_size));
     } else {
       // no data motion is needed
       member_reg = r->as_Register();
@@ -1245,7 +1245,7 @@
       // platform, pick a temp and load the receiver from stack.
       fatal("receiver always in a register");
       receiver_reg = r2;  // known to be free at this point
-      __ ldr(receiver_reg, Address(sp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
+      __ ldr(receiver_reg, Address(sp, r->reg2stack() * VMRegImpl::stack_slot_size));
     } else {
       // no data motion is needed
       receiver_reg = r->as_Register();
diff -r 3a09edaa2c42 -r 9a45e1894e29 src/cpu/aarch64/vm/templateTable_aarch64.cpp
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Thu Aug 29 17:15:33 2013 +0100
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Tue Sep 03 15:22:21 2013 +0100
@@ -3075,10 +3075,11 @@
   __ verify_oop(r2);
   __ null_check(r2);

-  // Note:  rax_mtype is already pushed (if necessary) by prepare_invoke
-
   // FIXME: profile the LambdaForm also
-  __ profile_final_call(rscratch1);
+
+  // r13 is safe to use here as a scratch reg because it is about to
+  // be clobbered by jump_from_interpreted().
+  __ profile_final_call(r13);

   __ jump_from_interpreted(rmethod, r0);
 }



More information about the aarch64-port-dev mailing list