< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java

Print this page
rev 52509 : [mq]: graal2


  43 import org.graalvm.compiler.options.OptionKey;
  44 import org.graalvm.compiler.options.OptionValues;
  45 import org.graalvm.compiler.serviceprovider.GraalServices;
  46 import org.junit.Assert;
  47 import org.junit.Assume;
  48 import org.junit.BeforeClass;
  49 import org.junit.Test;
  50 
  51 import jdk.vm.ci.meta.ResolvedJavaMethod;
  52 
  53 /**
  54  * Test on-stack-replacement with locks.
  55  */
  56 public class GraalOSRLockTest extends GraalOSRTestBase {
  57 
  58     private static boolean TestInSeparateThread = false;
  59     private static final String COMPILE_ONLY_FLAG = "-Xcomp";
  60 
  61     @BeforeClass
  62     public static void checkVMArguments() {

  63         /*
  64          * Note: The -Xcomp execution mode of the VM will stop most of the OSR test cases from
  65          * working as every method is compiled at level3 (followed by level4 on the second
  66          * invocation). The tests in this class are written in a way that they expect a method to be
  67          * executed at the invocation BCI with the interpreter and then perform an OSR to an
  68          * installed nmethod at a given BCI.
  69          *
  70          */
  71         List<String> arguments = GraalServices.getInputArguments();
  72         Assume.assumeTrue("cannot check for monitors without", arguments != null);
  73         for (String arg : arguments) {
  74             Assume.assumeFalse(arg.equals(COMPILE_ONLY_FLAG));
  75         }
  76     }
  77 
  78     // testing only
  79     public static boolean isMonitorLockHeld(Object o) {
  80         return isMonitorLockHeldByThread(o, null);
  81     }
  82 




  43 import org.graalvm.compiler.options.OptionKey;
  44 import org.graalvm.compiler.options.OptionValues;
  45 import org.graalvm.compiler.serviceprovider.GraalServices;
  46 import org.junit.Assert;
  47 import org.junit.Assume;
  48 import org.junit.BeforeClass;
  49 import org.junit.Test;
  50 
  51 import jdk.vm.ci.meta.ResolvedJavaMethod;
  52 
  53 /**
  54  * Test on-stack-replacement with locks.
  55  */
  56 public class GraalOSRLockTest extends GraalOSRTestBase {
  57 
  58     private static boolean TestInSeparateThread = false;
  59     private static final String COMPILE_ONLY_FLAG = "-Xcomp";
  60 
  61     @BeforeClass
  62     public static void checkVMArguments() {
  63         assumeManagementLibraryIsLoadable();
  64         /*
  65          * Note: The -Xcomp execution mode of the VM will stop most of the OSR test cases from
  66          * working as every method is compiled at level3 (followed by level4 on the second
  67          * invocation). The tests in this class are written in a way that they expect a method to be
  68          * executed at the invocation BCI with the interpreter and then perform an OSR to an
  69          * installed nmethod at a given BCI.
  70          *
  71          */
  72         List<String> arguments = GraalServices.getInputArguments();
  73         Assume.assumeTrue("cannot check for monitors without", arguments != null);
  74         for (String arg : arguments) {
  75             Assume.assumeFalse(arg.equals(COMPILE_ONLY_FLAG));
  76         }
  77     }
  78 
  79     // testing only
  80     public static boolean isMonitorLockHeld(Object o) {
  81         return isMonitorLockHeldByThread(o, null);
  82     }
  83 


< prev index next >