diff src/cpu/sparc/vm/nativeInst_sparc.cpp @ 2375:d673ef06fe96

7028374: race in fix_oop_relocations for scavengeable nmethods Reviewed-by: kvn
author never
date Fri, 18 Mar 2011 15:52:42 -0700
parents f95d63e2154a
children 1d1603768966
line wrap: on
line diff
--- a/src/cpu/sparc/vm/nativeInst_sparc.cpp	Fri Mar 18 09:03:43 2011 -0700
+++ b/src/cpu/sparc/vm/nativeInst_sparc.cpp	Fri Mar 18 15:52:42 2011 -0700
@@ -52,6 +52,22 @@
   ICache::invalidate_range(instaddr, 7 * BytesPerInstWord);
 }
 
+void NativeInstruction::verify_data64_sethi(address instaddr, intptr_t x) {
+  ResourceMark rm;
+  unsigned char buffer[10 * BytesPerInstWord];
+  CodeBuffer buf(buffer, 10 * BytesPerInstWord);
+  MacroAssembler masm(&buf);
+
+  Register destreg = inv_rd(*(unsigned int *)instaddr);
+  // Generate the proper sequence into a temporary buffer and compare
+  // it with the original sequence.
+  masm.patchable_sethi(x, destreg);
+  int len = buffer - masm.pc();
+  for (int i = 0; i < len; i++) {
+    assert(instaddr[i] == buffer[i], "instructions must match");
+  }
+}
+
 void NativeInstruction::verify() {
   // make sure code pattern is actually an instruction address
   address addr = addr_at(0);