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 bool vmIntrinsics::is_disabled_by_flags(methodHandle method, methodHandle compilation_context) {
421 vmIntrinsics::ID id = method->intrinsic_id();
422 assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
423
424 // Check if the intrinsic corresponding to 'method' has been disabled on
425 // the command line by using the DisableIntrinsic flag (either globally
426 // or on a per-method level, see src/share/vm/compiler/abstractCompiler.hpp
427 // for details).
428 // Usually, the compilation context is the caller of the method 'method'.
429 // The only case when for a non-recursive method 'method' the compilation context
430 // is not the caller of the 'method' (but it is the method itself) is
431 // java.lang.ref.Referene::get.
432 // For java.lang.ref.Reference::get, the intrinsic version is used
433 // instead of the compiled version so that the value in the referent
434 // field can be registered by the G1 pre-barrier code. The intrinsified
435 // version of Reference::get also adds a memory barrier to prevent
436 // commoning reads from the referent field across safepoint since GC
437 // can change the referent field's value. See Compile::Compile()
438 // in src/share/vm/opto/compile.cpp or
439 // GraphBuilder::GraphBuilder() in src/share/vm/c1/c1_GraphBuilder.cpp
440 // for more details.
441 ccstr disable_intr = NULL;
442 if ((DisableIntrinsic[0] != '\0' && strstr(DisableIntrinsic, vmIntrinsics::name_at(id)) != NULL) ||
443 (!compilation_context.is_null() &&
444 CompilerOracle::has_option_value(compilation_context, "DisableIntrinsic", disable_intr) &&
445 strstr(disable_intr, vmIntrinsics::name_at(id)) != NULL)
446 ) {
447 return true;
448 }
449
450 // -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
451 // the following switch statement.
452 if (!InlineNatives) {
453 switch (id) {
454 case vmIntrinsics::_indexOf:
455 case vmIntrinsics::_compareTo:
456 case vmIntrinsics::_equals:
457 case vmIntrinsics::_equalsC:
458 case vmIntrinsics::_getAndAddInt:
459 case vmIntrinsics::_getAndAddLong:
460 case vmIntrinsics::_getAndSetInt:
461 case vmIntrinsics::_getAndSetLong:
462 case vmIntrinsics::_getAndSetObject:
463 case vmIntrinsics::_loadFence:
464 case vmIntrinsics::_storeFence:
465 case vmIntrinsics::_fullFence:
466 case vmIntrinsics::_Reference_get:
467 break;
468 default:
|
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 bool vmIntrinsics::is_disabled_by_flags(methodHandle method) {
421 vmIntrinsics::ID id = method->intrinsic_id();
422 assert(id != vmIntrinsics::_none, "must be a VM intrinsic");
423
424 // Check if the intrinsic corresponding to 'method' has been disabled on
425 // the command line by using the DisableIntrinsic flag (either globally
426 // or on a per-method level, see src/share/vm/compiler/abstractCompiler.hpp
427 // for details).
428 // Usually, the compilation context is the caller of the method 'method'.
429 // The only case when for a non-recursive method 'method' the compilation context
430 // is not the caller of the 'method' (but it is the method itself) is
431 // java.lang.ref.Referene::get.
432 // For java.lang.ref.Reference::get, the intrinsic version is used
433 // instead of the compiled version so that the value in the referent
434 // field can be registered by the G1 pre-barrier code. The intrinsified
435 // version of Reference::get also adds a memory barrier to prevent
436 // commoning reads from the referent field across safepoint since GC
437 // can change the referent field's value. See Compile::Compile()
438 // in src/share/vm/opto/compile.cpp or
439 // GraphBuilder::GraphBuilder() in src/share/vm/c1/c1_GraphBuilder.cpp
440 // for more details.
441
442 // -XX:-InlineNatives disables nearly all intrinsics except the ones listed in
443 // the following switch statement.
444 if (!InlineNatives) {
445 switch (id) {
446 case vmIntrinsics::_indexOf:
447 case vmIntrinsics::_compareTo:
448 case vmIntrinsics::_equals:
449 case vmIntrinsics::_equalsC:
450 case vmIntrinsics::_getAndAddInt:
451 case vmIntrinsics::_getAndAddLong:
452 case vmIntrinsics::_getAndSetInt:
453 case vmIntrinsics::_getAndSetLong:
454 case vmIntrinsics::_getAndSetObject:
455 case vmIntrinsics::_loadFence:
456 case vmIntrinsics::_storeFence:
457 case vmIntrinsics::_fullFence:
458 case vmIntrinsics::_Reference_get:
459 break;
460 default:
|