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

src/share/vm/classfile/vmSymbols.cpp

Print this page




 307   return wrapper_intrinsic(type, false);
 308 }
 309 vmIntrinsics::ID vmIntrinsics::for_unboxing(BasicType type) {
 310   return wrapper_intrinsic(type, true);
 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 
 328 #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
 329 static const char* vm_intrinsic_name_bodies =
 330   VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
 331                    VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
 332 
 333 static const char* vm_intrinsic_name_table[vmIntrinsics::ID_LIMIT];
 334 
 335 const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
 336   const char** nt = &vm_intrinsic_name_table[0];
 337   if (nt[_none] == NULL) {
 338     char* string = (char*) &vm_intrinsic_name_bodies[0];
 339     for (int index = FIRST_ID; index < ID_LIMIT; index++) {
 340       nt[index] = string;
 341       string += strlen(string); // skip string body
 342       string += 1;              // skip trailing null
 343     }
 344     assert(!strcmp(nt[_hashCode], "_hashCode"), "lined up");
 345     nt[_none] = "_none";
 346   }




 307   return wrapper_intrinsic(type, false);
 308 }
 309 vmIntrinsics::ID vmIntrinsics::for_unboxing(BasicType type) {
 310   return wrapper_intrinsic(type, true);
 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 bool vmIntrinsics::preserves_state(vmIntrinsics::ID id) {
 328   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 329   switch(id) {
 330 #ifdef TRACE_HAVE_INTRINSICS
 331   case vmIntrinsics::_classID:
 332   case vmIntrinsics::_threadID:
 333   case vmIntrinsics::_counterTime:
 334 #endif
 335   case vmIntrinsics::_currentTimeMillis:
 336   case vmIntrinsics::_nanoTime:
 337   case vmIntrinsics::_floatToRawIntBits:
 338   case vmIntrinsics::_intBitsToFloat:
 339   case vmIntrinsics::_doubleToRawLongBits:
 340   case vmIntrinsics::_longBitsToDouble:
 341   case vmIntrinsics::_getClass:
 342   case vmIntrinsics::_isInstance:
 343   case vmIntrinsics::_currentThread:
 344   case vmIntrinsics::_dabs:
 345   case vmIntrinsics::_dsqrt:
 346   case vmIntrinsics::_dsin:
 347   case vmIntrinsics::_dcos:
 348   case vmIntrinsics::_dtan:
 349   case vmIntrinsics::_dlog:
 350   case vmIntrinsics::_dlog10:
 351   case vmIntrinsics::_dexp:
 352   case vmIntrinsics::_dpow:
 353   case vmIntrinsics::_checkIndex:
 354   case vmIntrinsics::_Reference_get:
 355   case vmIntrinsics::_updateCRC32:
 356   case vmIntrinsics::_updateBytesCRC32:
 357   case vmIntrinsics::_updateByteBufferCRC32:
 358     return true;
 359   default:
 360     return false;
 361   }
 362 }
 363 
 364 bool vmIntrinsics::can_trap(vmIntrinsics::ID id) {
 365   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 366   switch(id) {
 367 #ifdef TRACE_HAVE_INTRINSICS
 368   case vmIntrinsics::_counterTime:
 369 #endif
 370   case vmIntrinsics::_currentTimeMillis:
 371   case vmIntrinsics::_nanoTime:
 372   case vmIntrinsics::_floatToRawIntBits:
 373   case vmIntrinsics::_intBitsToFloat:
 374   case vmIntrinsics::_doubleToRawLongBits:
 375   case vmIntrinsics::_longBitsToDouble:
 376   case vmIntrinsics::_currentThread:
 377   case vmIntrinsics::_dabs:
 378   case vmIntrinsics::_dsqrt:
 379   case vmIntrinsics::_dsin:
 380   case vmIntrinsics::_dcos:
 381   case vmIntrinsics::_dtan:
 382   case vmIntrinsics::_dlog:
 383   case vmIntrinsics::_dlog10:
 384   case vmIntrinsics::_dexp:
 385   case vmIntrinsics::_dpow:
 386   case vmIntrinsics::_updateCRC32:
 387   case vmIntrinsics::_updateBytesCRC32:
 388   case vmIntrinsics::_updateByteBufferCRC32:
 389     return false;
 390   default:
 391     return true;
 392   }
 393 }
 394 
 395 bool vmIntrinsics::does_virtual_dispatch(vmIntrinsics::ID id) {
 396   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 397   switch(id) {
 398   case vmIntrinsics::_hashCode:
 399   case vmIntrinsics::_clone:
 400     return true;
 401     break;
 402   default:
 403     return false;
 404   }
 405 }
 406 
 407 int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) {
 408   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 409   switch (id) {
 410   case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
 411   case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
 412     return 1;
 413   case vmIntrinsics::_digestBase_implCompressMB:
 414     return 3;
 415   default:
 416     return 0;
 417   }
 418 }
 419 
 420 // Processing command-line flags (functionality common to the C1
 421 // and the C2 compiler).
 422 bool vmIntrinsics::is_disabled_by_flags(vmIntrinsics::ID id) {
 423   assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
 424   switch (id) {
 425   case vmIntrinsics::_isInstance:
 426   case vmIntrinsics::_isAssignableFrom:
 427   case vmIntrinsics::_getModifiers:
 428   case vmIntrinsics::_isInterface:
 429   case vmIntrinsics::_isArray:
 430   case vmIntrinsics::_isPrimitive:
 431   case vmIntrinsics::_getSuperclass:
 432   case vmIntrinsics::_Class_cast:
 433   case vmIntrinsics::_getLength:
 434   case vmIntrinsics::_newArray:
 435     if (!InlineClassNatives) return true;
 436     break;
 437   case vmIntrinsics::_currentThread:
 438   case vmIntrinsics::_isInterrupted:
 439     if (!InlineThreadNatives) return true;
 440     break;
 441   case vmIntrinsics::_floatToRawIntBits:
 442   case vmIntrinsics::_intBitsToFloat:
 443   case vmIntrinsics::_doubleToRawLongBits:
 444   case vmIntrinsics::_longBitsToDouble:
 445   case vmIntrinsics::_dabs:
 446   case vmIntrinsics::_dsqrt:
 447   case vmIntrinsics::_dsin:
 448   case vmIntrinsics::_dcos:
 449   case vmIntrinsics::_dtan:
 450   case vmIntrinsics::_dlog:
 451   case vmIntrinsics::_dexp:
 452   case vmIntrinsics::_dpow:
 453   case vmIntrinsics::_dlog10:
 454   case vmIntrinsics::_datan2:
 455   case vmIntrinsics::_min:
 456   case vmIntrinsics::_max:
 457   case vmIntrinsics::_floatToIntBits:
 458   case vmIntrinsics::_doubleToLongBits:
 459     if (!InlineMathNatives) return true;
 460     break;
 461   case vmIntrinsics::_arraycopy:
 462     if (!InlineArrayCopy) return true;
 463     break;
 464   case vmIntrinsics::_updateCRC32:
 465   case vmIntrinsics::_updateBytesCRC32:
 466   case vmIntrinsics::_updateByteBufferCRC32:
 467     if (!UseCRC32Intrinsics) return true;
 468     break;
 469   case vmIntrinsics::_getObject:
 470   case vmIntrinsics::_getBoolean:
 471   case vmIntrinsics::_getByte:
 472   case vmIntrinsics::_getShort:
 473   case vmIntrinsics::_getChar:
 474   case vmIntrinsics::_getInt:
 475   case vmIntrinsics::_getLong:
 476   case vmIntrinsics::_getFloat:
 477   case vmIntrinsics::_getDouble:
 478   case vmIntrinsics::_putObject:
 479   case vmIntrinsics::_putBoolean:
 480   case vmIntrinsics::_putByte:
 481   case vmIntrinsics::_putShort:
 482   case vmIntrinsics::_putChar:
 483   case vmIntrinsics::_putInt:
 484   case vmIntrinsics::_putLong:
 485   case vmIntrinsics::_putFloat:
 486   case vmIntrinsics::_putDouble:
 487   case vmIntrinsics::_getObjectVolatile:
 488   case vmIntrinsics::_getBooleanVolatile:
 489   case vmIntrinsics::_getByteVolatile:
 490   case vmIntrinsics::_getShortVolatile:
 491   case vmIntrinsics::_getCharVolatile:
 492   case vmIntrinsics::_getIntVolatile:
 493   case vmIntrinsics::_getLongVolatile:
 494   case vmIntrinsics::_getFloatVolatile:
 495   case vmIntrinsics::_getDoubleVolatile:
 496   case vmIntrinsics::_putObjectVolatile:
 497   case vmIntrinsics::_putBooleanVolatile:
 498   case vmIntrinsics::_putByteVolatile:
 499   case vmIntrinsics::_putShortVolatile:
 500   case vmIntrinsics::_putCharVolatile:
 501   case vmIntrinsics::_putIntVolatile:
 502   case vmIntrinsics::_putLongVolatile:
 503   case vmIntrinsics::_putFloatVolatile:
 504   case vmIntrinsics::_putDoubleVolatile:
 505   case vmIntrinsics::_getByte_raw:
 506   case vmIntrinsics::_getShort_raw:
 507   case vmIntrinsics::_getChar_raw:
 508   case vmIntrinsics::_getInt_raw:
 509   case vmIntrinsics::_getLong_raw:
 510   case vmIntrinsics::_getFloat_raw:
 511   case vmIntrinsics::_getDouble_raw:
 512   case vmIntrinsics::_putByte_raw:
 513   case vmIntrinsics::_putShort_raw:
 514   case vmIntrinsics::_putChar_raw:
 515   case vmIntrinsics::_putInt_raw:
 516   case vmIntrinsics::_putLong_raw:
 517   case vmIntrinsics::_putFloat_raw:
 518   case vmIntrinsics::_putDouble_raw:
 519   case vmIntrinsics::_putOrderedObject:
 520   case vmIntrinsics::_putOrderedLong:
 521   case vmIntrinsics::_putOrderedInt:
 522   case vmIntrinsics::_getAndAddInt:
 523   case vmIntrinsics::_getAndAddLong:
 524   case vmIntrinsics::_getAndSetInt:
 525   case vmIntrinsics::_getAndSetLong:
 526   case vmIntrinsics::_getAndSetObject:
 527     if (!InlineUnsafeOps) return true;
 528     break;
 529   case vmIntrinsics::_getShortUnaligned:
 530   case vmIntrinsics::_getCharUnaligned:
 531   case vmIntrinsics::_getIntUnaligned:
 532   case vmIntrinsics::_getLongUnaligned:
 533   case vmIntrinsics::_putShortUnaligned:
 534   case vmIntrinsics::_putCharUnaligned:
 535   case vmIntrinsics::_putIntUnaligned:
 536   case vmIntrinsics::_putLongUnaligned:
 537   case vmIntrinsics::_allocateInstance:
 538   case vmIntrinsics::_getAddress_raw:
 539   case vmIntrinsics::_putAddress_raw:
 540     if (!InlineUnsafeOps || !UseUnalignedAccesses) return true;
 541     break;
 542   case vmIntrinsics::_hashCode:
 543     if (!InlineObjectHash) return true;
 544     break;
 545   case vmIntrinsics::_aescrypt_encryptBlock:
 546   case vmIntrinsics::_aescrypt_decryptBlock:
 547     if (!UseAESIntrinsics) return true;
 548     break;
 549   case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt:
 550   case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt:
 551     if (!UseAESIntrinsics) return true;
 552     break;
 553   case vmIntrinsics::_sha_implCompress:
 554     if (!UseSHA1Intrinsics) return true;
 555     break;
 556   case vmIntrinsics::_sha2_implCompress:
 557     if (!UseSHA256Intrinsics) return true;
 558     break;
 559   case vmIntrinsics::_sha5_implCompress:
 560     if (!UseSHA512Intrinsics) return true;
 561     break;
 562   case vmIntrinsics::_digestBase_implCompressMB:
 563     if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) return true;
 564     break;
 565   case vmIntrinsics::_ghash_processBlocks:
 566     if (!UseGHASHIntrinsics) return true;
 567     break;
 568   case vmIntrinsics::_updateBytesCRC32C:
 569   case vmIntrinsics::_updateDirectByteBufferCRC32C:
 570     if (!UseCRC32CIntrinsics) return true;
 571     break;
 572   case vmIntrinsics::_copyMemory:
 573     if (!InlineArrayCopy || !InlineUnsafeOps) return true;
 574     break;
 575 #ifdef COMPILER1
 576   case vmIntrinsics::_checkIndex:
 577     if (!InlineNIOCheckIndex) return true;
 578     break;
 579 #endif // COMPILER1
 580 #ifdef COMPILER2
 581   case vmIntrinsics::_clone:
 582   case vmIntrinsics::_copyOf:
 583   case vmIntrinsics::_copyOfRange:
 584     // These intrinsics use both the objectcopy and the arraycopy
 585     // intrinsic mechanism.
 586     if (!InlineObjectCopy || !InlineArrayCopy) return true;
 587     break;
 588   case vmIntrinsics::_compareTo:
 589      if (!SpecialStringCompareTo) return true;
 590      break;
 591   case vmIntrinsics::_indexOf:
 592     if (!SpecialStringIndexOf) return true;
 593     break;
 594   case vmIntrinsics::_equals:
 595     if (!SpecialStringEquals) return true;
 596     break;
 597   case vmIntrinsics::_equalsC:
 598     if (!SpecialArraysEquals) return true;
 599     break;
 600   case vmIntrinsics::_encodeISOArray:
 601     if (!SpecialEncodeISOArray) return true;
 602     break;
 603   case vmIntrinsics::_getCallerClass:
 604     if (!InlineReflectionGetCallerClass) return true;
 605     break;
 606   case vmIntrinsics::_multiplyToLen:
 607       if (!UseMultiplyToLenIntrinsic) return true;
 608       break;
 609   case vmIntrinsics::_squareToLen:
 610     if (!UseSquareToLenIntrinsic) return true;
 611     break;
 612   case vmIntrinsics::_mulAdd:
 613     if (!UseMulAddIntrinsic) return true;
 614     break;
 615   case vmIntrinsics::_montgomeryMultiply:
 616     if (!UseMontgomeryMultiplyIntrinsic) return true;
 617     break;
 618   case vmIntrinsics::_montgomerySquare:
 619     if (!UseMontgomerySquareIntrinsic) return true;
 620     break;
 621   case vmIntrinsics::_addExactI:
 622   case vmIntrinsics::_addExactL:
 623   case vmIntrinsics::_decrementExactI:
 624   case vmIntrinsics::_decrementExactL:
 625   case vmIntrinsics::_incrementExactI:
 626   case vmIntrinsics::_incrementExactL:
 627   case vmIntrinsics::_multiplyExactI:
 628   case vmIntrinsics::_multiplyExactL:
 629   case vmIntrinsics::_negateExactI:
 630   case vmIntrinsics::_negateExactL:
 631   case vmIntrinsics::_subtractExactI:
 632   case vmIntrinsics::_subtractExactL:
 633     if (!UseMathExactIntrinsics || !InlineMathNatives) return true;
 634     break;
 635 #endif // COMPILER2
 636   default:
 637     return false;
 638   }
 639 
 640   return false;
 641 }
 642 
 643 #define VM_INTRINSIC_INITIALIZE(id, klass, name, sig, flags) #id "\0"
 644 static const char* vm_intrinsic_name_bodies =
 645   VM_INTRINSICS_DO(VM_INTRINSIC_INITIALIZE,
 646                    VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE);
 647 
 648 static const char* vm_intrinsic_name_table[vmIntrinsics::ID_LIMIT];
 649 
 650 const char* vmIntrinsics::name_at(vmIntrinsics::ID id) {
 651   const char** nt = &vm_intrinsic_name_table[0];
 652   if (nt[_none] == NULL) {
 653     char* string = (char*) &vm_intrinsic_name_bodies[0];
 654     for (int index = FIRST_ID; index < ID_LIMIT; index++) {
 655       nt[index] = string;
 656       string += strlen(string); // skip string body
 657       string += 1;              // skip trailing null
 658     }
 659     assert(!strcmp(nt[_hashCode], "_hashCode"), "lined up");
 660     nt[_none] = "_none";
 661   }


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