src/share/vm/classfile/altHashing.hpp

Mon, 07 Jul 2014 10:12:40 +0200

author
stefank
date
Mon, 07 Jul 2014 10:12:40 +0200
changeset 6992
2c6ef90f030a
parent 6351
f9e35a9dc8c7
child 6876
710a3c8b516e
child 10008
fd3484fadbe3
permissions
-rw-r--r--

8049421: G1 Class Unloading after completing a concurrent mark cycle
Reviewed-by: tschatzl, ehelin, brutisso, coleenp, roland, iveresov
Contributed-by: stefan.karlsson@oracle.com, mikael.gerdin@oracle.com

coleenp@3865 1 /*
minqi@6351 2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
coleenp@3865 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@3865 4 *
coleenp@3865 5 * This code is free software; you can redistribute it and/or modify it
coleenp@3865 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@3865 7 * published by the Free Software Foundation.
coleenp@3865 8 *
coleenp@3865 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@3865 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@3865 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@3865 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@3865 13 * accompanied this code).
coleenp@3865 14 *
coleenp@3865 15 * You should have received a copy of the GNU General Public License version
coleenp@3865 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@3865 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@3865 18 *
coleenp@3865 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@3865 20 * or visit www.oracle.com if you need additional information or have any
coleenp@3865 21 * questions.
coleenp@3865 22 *
coleenp@3865 23 */
coleenp@3865 24
coleenp@3865 25 #ifndef SHARE_VM_CLASSFILE_ALTHASHING_HPP
coleenp@3865 26 #define SHARE_VM_CLASSFILE_ALTHASHING_HPP
coleenp@3865 27
coleenp@3865 28 #include "prims/jni.h"
coleenp@3865 29 #include "classfile/symbolTable.hpp"
coleenp@3865 30
coleenp@3865 31 /**
coleenp@3865 32 * Hashing utilities.
coleenp@3865 33 *
coleenp@3865 34 * Implementation of Murmur3 hashing.
coleenp@3865 35 * This code was translated from src/share/classes/sun/misc/Hashing.java
coleenp@3865 36 * code in the JDK.
coleenp@3865 37 */
coleenp@3865 38
coleenp@3865 39 class AltHashing : AllStatic {
coleenp@3865 40
coleenp@3865 41 // utility function copied from java/lang/Integer
minqi@6351 42 static juint Integer_rotateLeft(juint i, int distance) {
minqi@6351 43 return (i << distance) | (i >> (32-distance));
coleenp@3865 44 }
minqi@6351 45 static juint murmur3_32(const int* data, int len);
minqi@6351 46 static juint murmur3_32(juint seed, const int* data, int len);
coleenp@3865 47
coleenp@3865 48 #ifndef PRODUCT
coleenp@3865 49 // Hashing functions used for internal testing
minqi@6351 50 static juint murmur3_32(const jbyte* data, int len);
minqi@6351 51 static juint murmur3_32(const jchar* data, int len);
coleenp@3865 52 static void testMurmur3_32_ByteArray();
coleenp@3865 53 static void testEquivalentHashes();
coleenp@3865 54 #endif // PRODUCT
coleenp@3865 55
coleenp@3865 56 public:
minqi@6351 57 static juint compute_seed();
minqi@6351 58 static juint murmur3_32(juint seed, const jbyte* data, int len);
minqi@6351 59 static juint murmur3_32(juint seed, const jchar* data, int len);
coleenp@3865 60 NOT_PRODUCT(static void test_alt_hash();)
coleenp@3865 61 };
coleenp@3865 62 #endif // SHARE_VM_CLASSFILE_ALTHASHING_HPP

mercurial