equal
deleted
inserted
replaced
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 } |