8144856: fix assert in CompiledStaticCall::set_to_interpreted
Summary: trivial cleanup in assert code.
Reviewed-by: kvn, goetz, thartmann
--- a/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp Tue May 10 00:17:46 2016 -0700
+++ b/hotspot/src/cpu/aarch64/vm/compiledIC_aarch64.cpp Mon May 09 23:49:22 2016 -0700
@@ -92,9 +92,11 @@
#ifndef PRODUCT
NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
- assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(),
+ // read the value once
+ volatile intptr_t data = method_holder->data();
+ assert(data == 0 || data == (intptr_t)callee(),
"a) MT-unsafe modification of inline cache");
- assert(method_holder->data() == 0 || jump->jump_destination() == entry,
+ assert(data == 0 || jump->jump_destination() == entry,
"b) MT-unsafe modification of inline cache");
#endif
// Update stub.
--- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Tue May 10 00:17:46 2016 -0700
+++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp Mon May 09 23:49:22 2016 -0700
@@ -178,10 +178,15 @@
NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub);
NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
- assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(),
+#ifdef ASSERT
+ // read the value once
+ volatile intptr_t data = method_holder->data();
+ volatile address destination = jump->jump_destination();
+ assert(data == 0 || data == (intptr_t)callee(),
"a) MT-unsafe modification of inline cache");
- assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry,
+ assert(destination == (address)-1 || destination == entry,
"b) MT-unsafe modification of inline cache");
+#endif
// Update stub.
method_holder->set_data((intptr_t)callee());
--- a/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Tue May 10 00:17:46 2016 -0700
+++ b/hotspot/src/cpu/sparc/vm/compiledIC_sparc.cpp Mon May 09 23:49:22 2016 -0700
@@ -101,10 +101,15 @@
NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
- assert(method_holder->data() == 0 || method_holder->data() == (intptr_t)callee(),
+#ifdef ASSERT
+ // read the value once
+ intptr_t data = method_holder->data();
+ address destination = jump->jump_destination();
+ assert(data == 0 || data == (intptr_t)callee(),
"a) MT-unsafe modification of inline cache");
- assert(jump->jump_destination() == (address)-1 || jump->jump_destination() == entry,
+ assert(destination == (address)-1 || destination == entry,
"b) MT-unsafe modification of inline cache");
+#endif
// Update stub.
method_holder->set_data((intptr_t)callee());