comparison src/share/vm/oops/oop.cpp @ 14340:cd6b3f1a94ff

8033792: AltHashing used jint for imprecise bit shifting Summary: AltHashing used jint the way of juint in bit shifting which could lead loss of precision. Fix by change _seed defined as juint. Reviewed-by: coleenp, ccheung Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 10 Feb 2014 21:29:14 -0800
parents 746b070f5022
children 4ca6dc0799b6 78bbf4d43a14
comparison
equal deleted inserted replaced
14339:9bfa5faf122e 14340:cd6b3f1a94ff
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 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.
100 Handle object(this); 100 Handle object(this);
101 return ObjectSynchronizer::identity_hash_value_for(object); 101 return ObjectSynchronizer::identity_hash_value_for(object);
102 } 102 }
103 103
104 // When String table needs to rehash 104 // When String table needs to rehash
105 unsigned int oopDesc::new_hash(jint seed) { 105 unsigned int oopDesc::new_hash(juint seed) {
106 EXCEPTION_MARK; 106 EXCEPTION_MARK;
107 ResourceMark rm; 107 ResourceMark rm;
108 int length; 108 int length;
109 jchar* chars = java_lang_String::as_unicode_string(this, length, THREAD); 109 jchar* chars = java_lang_String::as_unicode_string(this, length, THREAD);
110 if (chars != NULL) { 110 if (chars != NULL) {