411 public boolean hasCompiledCode() {
412 return getCompiledCode() != 0L;
413 }
414
415 /**
416 * @param level
417 * @return true if the currently installed code was generated at {@code level}.
418 */
419 public boolean hasCompiledCodeAtLevel(int level) {
420 long compiledCode = getCompiledCode();
421 if (compiledCode != 0) {
422 return UNSAFE.getInt(compiledCode + config().nmethodCompLevelOffset) == level;
423 }
424 return false;
425 }
426
427 @Override
428 public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) {
429 ProfilingInfo info;
430
431 if (methodData == null) {
432 long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset);
433 if (metaspaceMethodData != 0) {
434 methodData = new HotSpotMethodData(metaspaceMethodData, this);
435 String methodDataFilter = Option.TraceMethodDataFilter.getString();
436 if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) {
437 System.out.println(methodData.toString());
438 }
439 }
440 }
441
442 if (methodData == null || (!methodData.hasNormalData() && !methodData.hasExtraData())) {
443 // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in
444 // case of a deoptimization.
445 info = DefaultProfilingInfo.get(TriState.FALSE);
446 } else {
447 info = new HotSpotProfilingInfo(methodData, this, includeNormal, includeOSR);
448 }
449 return info;
450 }
451
|
411 public boolean hasCompiledCode() {
412 return getCompiledCode() != 0L;
413 }
414
415 /**
416 * @param level
417 * @return true if the currently installed code was generated at {@code level}.
418 */
419 public boolean hasCompiledCodeAtLevel(int level) {
420 long compiledCode = getCompiledCode();
421 if (compiledCode != 0) {
422 return UNSAFE.getInt(compiledCode + config().nmethodCompLevelOffset) == level;
423 }
424 return false;
425 }
426
427 @Override
428 public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) {
429 ProfilingInfo info;
430
431 if (Option.UseProfilingInformation.getBoolean() && methodData == null) {
432 long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset);
433 if (metaspaceMethodData != 0) {
434 methodData = new HotSpotMethodData(metaspaceMethodData, this);
435 String methodDataFilter = Option.TraceMethodDataFilter.getString();
436 if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) {
437 System.out.println(methodData.toString());
438 }
439 }
440 }
441
442 if (methodData == null || (!methodData.hasNormalData() && !methodData.hasExtraData())) {
443 // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in
444 // case of a deoptimization.
445 info = DefaultProfilingInfo.get(TriState.FALSE);
446 } else {
447 info = new HotSpotProfilingInfo(methodData, this, includeNormal, includeOSR);
448 }
449 return info;
450 }
451
|