200 it->push(&_type_signatures[i]); 201 } 202 } 203 204 void vmSymbols::serialize(SerializeClosure* soc) { 205 soc->do_region((u_char*)&_symbols[FIRST_SID], 206 (SID_LIMIT - FIRST_SID) * sizeof(_symbols[0])); 207 soc->do_region((u_char*)_type_signatures, sizeof(_type_signatures)); 208 } 209 210 211 BasicType vmSymbols::signature_type(const Symbol* s) { 212 assert(s != NULL, "checking"); 213 if (s->utf8_length() == 1) { 214 BasicType result = char2type(s->byte_at(0)); 215 if (is_java_primitive(result) || result == T_VOID) { 216 assert(s == _type_signatures[result], ""); 217 return result; 218 } 219 } 220 if (s->byte_at(0) =='Q') { 221 return T_VALUETYPE; 222 } else { 223 return T_OBJECT; 224 } 225 } 226 227 228 static int mid_hint = (int)vmSymbols::FIRST_SID+1; 229 230 #ifndef PRODUCT 231 static int find_sid_calls, find_sid_probes; 232 // (Typical counts are calls=7000 and probes=17000.) 233 #endif 234 235 vmSymbols::SID vmSymbols::find_sid(const Symbol* symbol) { 236 // Handle the majority of misses by a bounds check. 237 // Then, use a binary search over the index. 238 // Expected trip count is less than log2_SID_LIMIT, about eight. 239 // This is slow but acceptable, given that calls are not 240 // dynamically common. (Method*::intrinsic_id has a cache.) 241 NOT_PRODUCT(find_sid_calls++); 242 int min = (int)FIRST_SID, max = (int)SID_LIMIT - 1; 243 SID sid = NO_SID, sid1; 244 int cmp1; | 200 it->push(&_type_signatures[i]); 201 } 202 } 203 204 void vmSymbols::serialize(SerializeClosure* soc) { 205 soc->do_region((u_char*)&_symbols[FIRST_SID], 206 (SID_LIMIT - FIRST_SID) * sizeof(_symbols[0])); 207 soc->do_region((u_char*)_type_signatures, sizeof(_type_signatures)); 208 } 209 210 211 BasicType vmSymbols::signature_type(const Symbol* s) { 212 assert(s != NULL, "checking"); 213 if (s->utf8_length() == 1) { 214 BasicType result = char2type(s->byte_at(0)); 215 if (is_java_primitive(result) || result == T_VOID) { 216 assert(s == _type_signatures[result], ""); 217 return result; 218 } 219 } 220 return T_OBJECT; 221 } 222 223 224 static int mid_hint = (int)vmSymbols::FIRST_SID+1; 225 226 #ifndef PRODUCT 227 static int find_sid_calls, find_sid_probes; 228 // (Typical counts are calls=7000 and probes=17000.) 229 #endif 230 231 vmSymbols::SID vmSymbols::find_sid(const Symbol* symbol) { 232 // Handle the majority of misses by a bounds check. 233 // Then, use a binary search over the index. 234 // Expected trip count is less than log2_SID_LIMIT, about eight. 235 // This is slow but acceptable, given that calls are not 236 // dynamically common. (Method*::intrinsic_id has a cache.) 237 NOT_PRODUCT(find_sid_calls++); 238 int min = (int)FIRST_SID, max = (int)SID_LIMIT - 1; 239 SID sid = NO_SID, sid1; 240 int cmp1; |