hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp
changeset 33628 09241459a8b8
parent 30764 fec48bf5a827
child 35061 be6025ebffea
--- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp	Mon Nov 02 12:34:27 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp	Tue Nov 03 09:41:03 2015 +0100
@@ -40,12 +40,14 @@
 private:
   G1StringDedupEntry* _next;
   unsigned int      _hash;
+  bool              _latin1;
   typeArrayOop      _obj;
 
 public:
   G1StringDedupEntry() :
     _next(NULL),
     _hash(0),
+    _latin1(false),
     _obj(NULL) {
   }
 
@@ -69,6 +71,14 @@
     _hash = hash;
   }
 
+  bool latin1() {
+    return _latin1;
+  }
+
+  void set_latin1(bool latin1) {
+    _latin1 = latin1;
+  }
+
   typeArrayOop obj() {
     return _obj;
   }
@@ -152,7 +162,7 @@
   }
 
   // Adds a new table entry to the given hash bucket.
-  void add(typeArrayOop value, unsigned int hash, G1StringDedupEntry** list);
+  void add(typeArrayOop value, bool latin1, unsigned int hash, G1StringDedupEntry** list);
 
   // Removes the given table entry from the table.
   void remove(G1StringDedupEntry** pentry, uint worker_id);
@@ -162,20 +172,20 @@
 
   // Returns an existing character array in the given hash bucket, or NULL
   // if no matching character array exists.
-  typeArrayOop lookup(typeArrayOop value, unsigned int hash,
+  typeArrayOop lookup(typeArrayOop value, bool latin1, unsigned int hash,
                       G1StringDedupEntry** list, uintx &count);
 
   // Returns an existing character array in the table, or inserts a new
   // table entry if no matching character array exists.
-  typeArrayOop lookup_or_add_inner(typeArrayOop value, unsigned int hash);
+  typeArrayOop lookup_or_add_inner(typeArrayOop value, bool latin1, unsigned int hash);
 
   // Thread safe lookup or add of table entry
-  static typeArrayOop lookup_or_add(typeArrayOop value, unsigned int hash) {
+  static typeArrayOop lookup_or_add(typeArrayOop value, bool latin1, unsigned int hash) {
     // Protect the table from concurrent access. Also note that this lock
     // acts as a fence for _table, which could have been replaced by a new
     // instance if the table was resized or rehashed.
     MutexLockerEx ml(StringDedupTable_lock, Mutex::_no_safepoint_check_flag);
-    return _table->lookup_or_add_inner(value, hash);
+    return _table->lookup_or_add_inner(value, latin1, hash);
   }
 
   // Returns true if the hashtable is currently using a Java compatible
@@ -188,7 +198,7 @@
 
   // Computes the hash code for the given character array, using the
   // currently active hash function and hash seed.
-  static unsigned int hash_code(typeArrayOop value);
+  static unsigned int hash_code(typeArrayOop value, bool latin1);
 
   static uintx unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl,
                                  size_t partition_begin,