1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2020, 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. |
222 } |
222 } |
223 |
223 |
224 // Pick hashing algorithm. |
224 // Pick hashing algorithm. |
225 unsigned int SymbolTable::hash_symbol(const char* s, int len) { |
225 unsigned int SymbolTable::hash_symbol(const char* s, int len) { |
226 return use_alternate_hashcode() ? |
226 return use_alternate_hashcode() ? |
227 AltHashing::murmur3_32(seed(), (const jbyte*)s, len) : |
227 AltHashing::halfsiphash_64(seed(), (const int8_t*)s, len) : |
228 java_lang_String::hash_code(s, len); |
228 java_lang_String::hash_code(s, len); |
229 } |
229 } |
230 |
230 |
231 |
231 |
232 // We take care not to be blocking while holding the |
232 // We take care not to be blocking while holding the |
648 |
648 |
649 volatile int StringTable::_parallel_claimed_idx = 0; |
649 volatile int StringTable::_parallel_claimed_idx = 0; |
650 |
650 |
651 // Pick hashing algorithm |
651 // Pick hashing algorithm |
652 unsigned int StringTable::hash_string(const jchar* s, int len) { |
652 unsigned int StringTable::hash_string(const jchar* s, int len) { |
653 return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) : |
653 return use_alternate_hashcode() ? AltHashing::halfsiphash_64(seed(), s, len) : |
654 java_lang_String::hash_code(s, len); |
654 java_lang_String::hash_code(s, len); |
655 } |
655 } |
656 |
656 |
657 oop StringTable::lookup(int index, jchar* name, |
657 oop StringTable::lookup(int index, jchar* name, |
658 int len, unsigned int hash) { |
658 int len, unsigned int hash) { |