1 /* |
1 /* |
2 * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 1997-2009 Sun Microsystems, Inc. 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. |
89 // lookup only, won't add. Also calculate hash. |
89 // lookup only, won't add. Also calculate hash. |
90 static symbolOop lookup_only(const char* name, int len, unsigned int& hash); |
90 static symbolOop lookup_only(const char* name, int len, unsigned int& hash); |
91 // Only copy to C string to be added if lookup failed. |
91 // Only copy to C string to be added if lookup failed. |
92 static symbolOop lookup(symbolHandle sym, int begin, int end, TRAPS); |
92 static symbolOop lookup(symbolHandle sym, int begin, int end, TRAPS); |
93 |
93 |
|
94 // jchar (utf16) version of lookups |
|
95 static symbolOop lookup_unicode(const jchar* name, int len, TRAPS); |
|
96 static symbolOop lookup_only_unicode(const jchar* name, int len, unsigned int& hash); |
|
97 |
94 static void add(constantPoolHandle cp, int names_count, |
98 static void add(constantPoolHandle cp, int names_count, |
95 const char** names, int* lengths, int* cp_indices, |
99 const char** names, int* lengths, int* cp_indices, |
96 unsigned int* hashValues, TRAPS); |
100 unsigned int* hashValues, TRAPS); |
97 |
101 |
98 // GC support |
102 // GC support |
110 static symbolOop lookup(int index, const char* name, int len, TRAPS); |
114 static symbolOop lookup(int index, const char* name, int len, TRAPS); |
111 |
115 |
112 // Needed for preloading classes in signatures when compiling. |
116 // Needed for preloading classes in signatures when compiling. |
113 // Returns the symbol is already present in symbol table, otherwise |
117 // Returns the symbol is already present in symbol table, otherwise |
114 // NULL. NO ALLOCATION IS GUARANTEED! |
118 // NULL. NO ALLOCATION IS GUARANTEED! |
115 static symbolOop probe(const char* name, int len); |
119 static symbolOop probe(const char* name, int len) { |
|
120 unsigned int ignore_hash; |
|
121 return lookup_only(name, len, ignore_hash); |
|
122 } |
|
123 static symbolOop probe_unicode(const jchar* name, int len) { |
|
124 unsigned int ignore_hash; |
|
125 return lookup_only_unicode(name, len, ignore_hash); |
|
126 } |
116 |
127 |
117 // Histogram |
128 // Histogram |
118 static void print_histogram() PRODUCT_RETURN; |
129 static void print_histogram() PRODUCT_RETURN; |
119 |
130 |
120 // Debugging |
131 // Debugging |