comparison agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 4ca6dc0799b6
children
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
59 // VM's Hashtable::hash_symbol 59 // VM's Hashtable::hash_symbol
60 protected static long hashSymbol(byte[] buf) { 60 protected static long hashSymbol(byte[] buf) {
61 long h = 0; 61 long h = 0;
62 int s = 0; 62 int s = 0;
63 int len = buf.length; 63 int len = buf.length;
64 // Emulate the unsigned int in java_lang_String::hash_code
64 while (len-- > 0) { 65 while (len-- > 0) {
65 h = 31*h + (0xFFL & buf[s]); 66 h = 31*h + (0xFFFFFFFFL & buf[s]);
66 s++; 67 s++;
67 } 68 }
68 return h & 0xFFFFFFFFL; 69 return h & 0xFFFFFFFFL;
69 } 70 }
70 } 71 }