changeset 9445:6efaf77e82a1 icedtea-3.3.0

8170188, PR3280: jtreg test compiler/types/TestMeetIncompatibleInterfaceArrays.java causes JVM crash Contributed-by: snazarki Reviewed-by: aph, adinn
author adinn
date Wed, 30 Nov 2016 07:10:08 -0500
parents c5e0cfd29f1b
children 9e43b1c17a3a
files src/cpu/aarch64/vm/interp_masm_aarch64.cpp src/cpu/aarch64/vm/interp_masm_aarch64.hpp src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp src/cpu/aarch64/vm/templateTable_aarch64.cpp
diffstat 4 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Tue Sep 27 09:25:26 2016 +0100
+++ b/src/cpu/aarch64/vm/interp_masm_aarch64.cpp	Wed Nov 30 07:10:08 2016 -0500
@@ -1451,14 +1451,20 @@
 // Jump if ((*counter_addr += increment) & mask) satisfies the condition.
 void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr,
                                                         int increment, int mask,
-                                                        Register scratch, bool preloaded,
+                                                        Register scratch, Register scratch2,
+							bool preloaded,
                                                         Condition cond, Label* where) {
   if (!preloaded) {
     ldrw(scratch, counter_addr);
   }
   add(scratch, scratch, increment);
   strw(scratch, counter_addr);
-  ands(scratch, scratch, mask);
+  if (operand_valid_for_logical_immediate(/*is32*/true, mask)) {
+    andsw(scratch, scratch, mask);
+  } else {
+    movw(scratch2, (unsigned)mask);
+    andsw(scratch, scratch, scratch2);
+  }
   br(cond, *where);
 }
 
--- a/src/cpu/aarch64/vm/interp_masm_aarch64.hpp	Tue Sep 27 09:25:26 2016 +0100
+++ b/src/cpu/aarch64/vm/interp_masm_aarch64.hpp	Wed Nov 30 07:10:08 2016 -0500
@@ -234,7 +234,8 @@
                              bool decrement = false);
   void increment_mask_and_jump(Address counter_addr,
                                int increment, int mask,
-                               Register scratch, bool preloaded,
+                               Register scratch, Register scratch2,
+			       bool preloaded,
                                Condition cond, Label* where);
   void set_mdp_flag_at(Register mdp_in, int flag_constant);
   void test_mdp_data_at(Register mdp_in, int offset, Register value,
--- a/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Tue Sep 27 09:25:26 2016 +0100
+++ b/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Wed Nov 30 07:10:08 2016 -0500
@@ -345,7 +345,7 @@
       // Increment counter in the MDO
       const Address mdo_invocation_counter(r0, in_bytes(MethodData::invocation_counter_offset()) +
                                                 in_bytes(InvocationCounter::counter_offset()));
-      __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rscratch1, false, Assembler::EQ, overflow);
+      __ increment_mask_and_jump(mdo_invocation_counter, increment, mask, rscratch1, rscratch2, false, Assembler::EQ, overflow);
       __ b(done);
     }
     __ bind(no_mdo);
@@ -354,7 +354,7 @@
                   MethodCounters::invocation_counter_offset() +
                   InvocationCounter::counter_offset());
     __ get_method_counters(rmethod, rscratch2, done);
-    __ increment_mask_and_jump(invocation_counter, increment, mask, rscratch1, false, Assembler::EQ, overflow);
+    __ increment_mask_and_jump(invocation_counter, increment, mask, rscratch1, rscratch2, false, Assembler::EQ, overflow);
     __ bind(done);
   } else {
     const Address backedge_counter(rscratch2,
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Tue Sep 27 09:25:26 2016 +0100
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Wed Nov 30 07:10:08 2016 -0500
@@ -1762,14 +1762,14 @@
         const Address mdo_backedge_counter(r1, in_bytes(MethodData::backedge_counter_offset()) +
                                            in_bytes(InvocationCounter::counter_offset()));
         __ increment_mask_and_jump(mdo_backedge_counter, increment, mask,
-                                   r0, false, Assembler::EQ, &backedge_counter_overflow);
+                                   r0, rscratch2, false, Assembler::EQ, &backedge_counter_overflow);
         __ b(dispatch);
       }
       __ bind(no_mdo);
       // Increment backedge counter in MethodCounters*
       __ ldr(rscratch1, Address(rmethod, Method::method_counters_offset()));
       __ increment_mask_and_jump(Address(rscratch1, be_offset), increment, mask,
-                                 r0, false, Assembler::EQ, &backedge_counter_overflow);
+                                 r0, rscratch2, false, Assembler::EQ, &backedge_counter_overflow);
     } else {
       // increment counter
       __ ldr(rscratch2, Address(rmethod, Method::method_counters_offset()));