< prev index next >

src/share/vm/classfile/vmSymbols.cpp

Print this page




 311 }
 312 
 313 vmIntrinsics::ID vmIntrinsics::for_raw_conversion(BasicType src, BasicType dest) {
 314 #define SRC_DEST(s,d) (((int)(s) << 4) + (int)(d))
 315   switch (SRC_DEST(src, dest)) {
 316   case SRC_DEST(T_INT, T_FLOAT):   return vmIntrinsics::_intBitsToFloat;
 317   case SRC_DEST(T_FLOAT, T_INT):   return vmIntrinsics::_floatToRawIntBits;
 318 
 319   case SRC_DEST(T_LONG, T_DOUBLE): return vmIntrinsics::_longBitsToDouble;
 320   case SRC_DEST(T_DOUBLE, T_LONG): return vmIntrinsics::_doubleToRawLongBits;
 321   }
 322 #undef SRC_DEST
 323 
 324   return vmIntrinsics::_none;
 325 }
 326 
 327 // Some intrinsics produce different results if they are not pinned
 328 bool vmIntrinsics::should_be_pinned(vmIntrinsics::ID id) {
 329   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 330   switch(id) {
 331 #ifdef TRACE_HAVE_INTRINSICS
 332   case vmIntrinsics::_counterTime:
 333 #endif
 334   case vmIntrinsics::_currentTimeMillis:
 335   case vmIntrinsics::_nanoTime:
 336     return true;
 337   default:
 338     return false;
 339   }
 340 }
 341 
 342 #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
 343 static const char* vm_intrinsic_name_bodies =
 344   VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
 345                    VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
 346 
 347 static const char* vm_intrinsic_name_table[vmIntrinsics::ID_LIMIT];
 348 
 349 const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
 350   const char** nt = &vm_intrinsic_name_table[0];
 351   if (nt[_none] == NULL) {




 311 }
 312 
 313 vmIntrinsics::ID vmIntrinsics::for_raw_conversion(BasicType src, BasicType dest) {
 314 #define SRC_DEST(s,d) (((int)(s) << 4) + (int)(d))
 315   switch (SRC_DEST(src, dest)) {
 316   case SRC_DEST(T_INT, T_FLOAT):   return vmIntrinsics::_intBitsToFloat;
 317   case SRC_DEST(T_FLOAT, T_INT):   return vmIntrinsics::_floatToRawIntBits;
 318 
 319   case SRC_DEST(T_LONG, T_DOUBLE): return vmIntrinsics::_longBitsToDouble;
 320   case SRC_DEST(T_DOUBLE, T_LONG): return vmIntrinsics::_doubleToRawLongBits;
 321   }
 322 #undef SRC_DEST
 323 
 324   return vmIntrinsics::_none;
 325 }
 326 
 327 // Some intrinsics produce different results if they are not pinned
 328 bool vmIntrinsics::should_be_pinned(vmIntrinsics::ID id) {
 329   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 330   switch(id) {
 331 #ifdef JFR_HAVE_INTRINSICS
 332   case vmIntrinsics::_counterTime:
 333 #endif
 334   case vmIntrinsics::_currentTimeMillis:
 335   case vmIntrinsics::_nanoTime:
 336     return true;
 337   default:
 338     return false;
 339   }
 340 }
 341 
 342 #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
 343 static const char* vm_intrinsic_name_bodies =
 344   VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
 345                    VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
 346 
 347 static const char* vm_intrinsic_name_table[vmIntrinsics::ID_LIMIT];
 348 
 349 const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
 350   const char** nt = &vm_intrinsic_name_table[0];
 351   if (nt[_none] == NULL) {


< prev index next >