7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
authortwisti
Tue, 01 Feb 2011 05:51:24 -0800
changeset 8316 0816329cc3ee
parent 8315 1503f9d7681f
child 8317 34de38f6de90
7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work() Reviewed-by: jrose, never
hotspot/src/share/vm/oops/cpCacheOop.cpp
--- a/hotspot/src/share/vm/oops/cpCacheOop.cpp	Tue Feb 01 03:38:44 2011 -0800
+++ b/hotspot/src/share/vm/oops/cpCacheOop.cpp	Tue Feb 01 05:51:24 2011 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -98,15 +98,15 @@
 // Atomically sets f1 if it is still NULL, otherwise it keeps the
 // current value.
 void ConstantPoolCacheEntry::set_f1_if_null_atomic(oop f1) {
-    // Use barriers as in oop_store
-    HeapWord* f1_addr = (HeapWord*) &_f1;
-    update_barrier_set_pre(f1_addr, f1);
-    void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL);
-    bool success = (result == NULL);
-    if (success) {
-      update_barrier_set((void*) f1_addr, f1);
-    }
+  // Use barriers as in oop_store
+  oop* f1_addr = (oop*) &_f1;
+  update_barrier_set_pre(f1_addr, f1);
+  void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL);
+  bool success = (result == NULL);
+  if (success) {
+    update_barrier_set(f1_addr, f1);
   }
+}
 
 #ifdef ASSERT
 // It is possible to have two different dummy methodOops created