< prev index next >

src/cpu/sparc/vm/jniFastGetField_sparc.cpp

Print this page
rev 12692 : 8176100: [REDO][REDO] G1 Needs pre barrier on dereference of weak JNI handles
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2017, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -66,10 +66,11 @@
   Address cnt_addr(O3, cnt_addrlit.low10());
   __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
   speculative_load_pclist[count] = __ pc();
   switch (type) {

@@ -145,10 +146,11 @@
   Address cnt_addr(G3, cnt_addrlit.low10());
   __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
   __ add (O5, O4, O5);
 
 #ifndef _LP64
   assert(count < LIST_CAPACITY-1, "LIST_CAPACITY too small");

@@ -217,10 +219,11 @@
   Address cnt_addr(O3, cnt_addrlit.low10());
   __ ld (cnt_addr, G4);
   __ andcc (G4, 1, G0);
   __ br (Assembler::notZero, false, Assembler::pn, label1);
   __ delayed()->srl (O2, 2, O4);
+  __ andn (O1, JNIHandles::weak_tag_mask, O1);
   __ ld_ptr (O1, 0, O5);
 
   assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
   speculative_load_pclist[count] = __ pc();
   switch (type) {
< prev index next >