< prev index next >

src/hotspot/share/classfile/vmSymbols.cpp

Print this page
rev 52849 : [mq]: q-mirror-reflection


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




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


< prev index next >