Mercurial > hg > graal-compiler
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | baa7d4400c62 |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2012, 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 | |
65 while (len-- > 0) { | 64 while (len-- > 0) { |
66 h = 31*h + (0xFFFFFFFFL & buf[s]); | 65 h = 31*h + (0xFFL & buf[s]); |
67 s++; | 66 s++; |
68 } | 67 } |
69 return h & 0xFFFFFFFFL; | 68 return h & 0xFFFFFFFFL; |
70 } | 69 } |
71 } | 70 } |