src/share/vm/classfile/vmSymbols.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8039525 Sdiff src/share/vm/classfile

src/share/vm/classfile/vmSymbols.cpp

Print this page




 261     // (We have already proven that there are no duplicates in the list.)
 262     SID sid2 = NO_SID;
 263     for (int index = (int)FIRST_SID; index < (int)SID_LIMIT; index++) {
 264       Symbol* sym2 = symbol_at((SID)index);
 265       if (sym2 == symbol) {
 266         sid2 = (SID)index;
 267         break;
 268       }
 269     }
 270     // Unless it's a duplicate, assert that the sids are the same.
 271     if (_symbols[sid] != _symbols[sid2]) {
 272       assert(sid == sid2, "binary same as linear search");
 273     }
 274   }
 275 #endif //ASSERT
 276 
 277   return sid;
 278 }
 279 
 280 vmSymbols::SID vmSymbols::find_sid(const char* symbol_name) {
 281   Symbol* symbol = SymbolTable::probe(symbol_name, (int) strlen(symbol_name));
 282   if (symbol == NULL)  return NO_SID;
 283   return find_sid(symbol);
 284 }
 285 
 286 static vmIntrinsics::ID wrapper_intrinsic(BasicType type, bool unboxing) {
 287 #define TYPE2(type, unboxing) ((int)(type)*2 + ((unboxing) ? 1 : 0))
 288   switch (TYPE2(type, unboxing)) {
 289 #define BASIC_TYPE_CASE(type, box, unbox) \
 290     case TYPE2(type, false):  return vmIntrinsics::box; \
 291     case TYPE2(type, true):   return vmIntrinsics::unbox
 292     BASIC_TYPE_CASE(T_BOOLEAN, _Boolean_valueOf,   _booleanValue);
 293     BASIC_TYPE_CASE(T_BYTE,    _Byte_valueOf,      _byteValue);
 294     BASIC_TYPE_CASE(T_CHAR,    _Character_valueOf, _charValue);
 295     BASIC_TYPE_CASE(T_SHORT,   _Short_valueOf,     _shortValue);
 296     BASIC_TYPE_CASE(T_INT,     _Integer_valueOf,   _intValue);
 297     BASIC_TYPE_CASE(T_LONG,    _Long_valueOf,      _longValue);
 298     BASIC_TYPE_CASE(T_FLOAT,   _Float_valueOf,     _floatValue);
 299     BASIC_TYPE_CASE(T_DOUBLE,  _Double_valueOf,    _doubleValue);
 300 #undef BASIC_TYPE_CASE
 301   }




 261     // (We have already proven that there are no duplicates in the list.)
 262     SID sid2 = NO_SID;
 263     for (int index = (int)FIRST_SID; index < (int)SID_LIMIT; index++) {
 264       Symbol* sym2 = symbol_at((SID)index);
 265       if (sym2 == symbol) {
 266         sid2 = (SID)index;
 267         break;
 268       }
 269     }
 270     // Unless it's a duplicate, assert that the sids are the same.
 271     if (_symbols[sid] != _symbols[sid2]) {
 272       assert(sid == sid2, "binary same as linear search");
 273     }
 274   }
 275 #endif //ASSERT
 276 
 277   return sid;
 278 }
 279 
 280 vmSymbols::SID vmSymbols::find_sid(const char* symbol_name) {
 281   Symbol* symbol = SymbolTable::lookup_and_ignore_hash(symbol_name, (int) strlen(symbol_name));
 282   if (symbol == NULL)  return NO_SID;
 283   return find_sid(symbol);
 284 }
 285 
 286 static vmIntrinsics::ID wrapper_intrinsic(BasicType type, bool unboxing) {
 287 #define TYPE2(type, unboxing) ((int)(type)*2 + ((unboxing) ? 1 : 0))
 288   switch (TYPE2(type, unboxing)) {
 289 #define BASIC_TYPE_CASE(type, box, unbox) \
 290     case TYPE2(type, false):  return vmIntrinsics::box; \
 291     case TYPE2(type, true):   return vmIntrinsics::unbox
 292     BASIC_TYPE_CASE(T_BOOLEAN, _Boolean_valueOf,   _booleanValue);
 293     BASIC_TYPE_CASE(T_BYTE,    _Byte_valueOf,      _byteValue);
 294     BASIC_TYPE_CASE(T_CHAR,    _Character_valueOf, _charValue);
 295     BASIC_TYPE_CASE(T_SHORT,   _Short_valueOf,     _shortValue);
 296     BASIC_TYPE_CASE(T_INT,     _Integer_valueOf,   _intValue);
 297     BASIC_TYPE_CASE(T_LONG,    _Long_valueOf,      _longValue);
 298     BASIC_TYPE_CASE(T_FLOAT,   _Float_valueOf,     _floatValue);
 299     BASIC_TYPE_CASE(T_DOUBLE,  _Double_valueOf,    _doubleValue);
 300 #undef BASIC_TYPE_CASE
 301   }


src/share/vm/classfile/vmSymbols.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File