501 public native Long getMethodIntxOption(Executable method, String name);
502 public native Long getMethodUintxOption(Executable method, String name);
503 public native Double getMethodDoubleOption(Executable method, String name);
504 public native String getMethodStringOption(Executable method, String name);
505 private final List<BiFunction<Executable,String,Object>> methodOptionGetters
506 = Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption,
507 this::getMethodUintxOption, this::getMethodDoubleOption,
508 this::getMethodStringOption);
509
510 public Object getMethodOption(Executable method, String name) {
511 return methodOptionGetters.stream()
512 .map(f -> f.apply(method, name))
513 .filter(x -> x != null)
514 .findAny()
515 .orElse(null);
516 }
517
518 // Safepoint Checking
519 public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
520
521 // Sharing
522 public native boolean isShared(Object o);
523 public native boolean isSharedClass(Class<?> c);
524 public native boolean areSharedStringsIgnored();
525
526 // Compiler Directive
527 public native int addCompilerDirective(String compDirect);
528 public native void removeCompilerDirective(int count);
529 }
|
501 public native Long getMethodIntxOption(Executable method, String name);
502 public native Long getMethodUintxOption(Executable method, String name);
503 public native Double getMethodDoubleOption(Executable method, String name);
504 public native String getMethodStringOption(Executable method, String name);
505 private final List<BiFunction<Executable,String,Object>> methodOptionGetters
506 = Arrays.asList(this::getMethodBooleanOption, this::getMethodIntxOption,
507 this::getMethodUintxOption, this::getMethodDoubleOption,
508 this::getMethodStringOption);
509
510 public Object getMethodOption(Executable method, String name) {
511 return methodOptionGetters.stream()
512 .map(f -> f.apply(method, name))
513 .filter(x -> x != null)
514 .findAny()
515 .orElse(null);
516 }
517
518 // Safepoint Checking
519 public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
520
521 // Sharing & archiving
522 public native boolean isShared(Object o);
523 public native boolean isSharedClass(Class<?> c);
524 public native boolean areSharedStringsIgnored();
525 public native Object getResolvedReferences(Class<?> c);
526
527 // Compiler Directive
528 public native int addCompilerDirective(String compDirect);
529 public native void removeCompilerDirective(int count);
530 }
|