mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-14 18:03:44 +00:00
8227237: [Graal] org.graalvm.compiler.api.directives.test.ProbabilityDirectiveTest fails with -Xcomp
Reviewed-by: kvn
This commit is contained in:
parent
f111dd0cbb
commit
d307ec4dba
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,6 +24,8 @@
|
||||
|
||||
package org.graalvm.compiler.api.directives.test;
|
||||
|
||||
import jdk.vm.ci.meta.ResolvedJavaMethod;
|
||||
|
||||
import org.graalvm.compiler.api.directives.GraalDirectives;
|
||||
import org.graalvm.compiler.core.test.GraalCompilerTest;
|
||||
import org.graalvm.compiler.graph.iterators.NodeIterable;
|
||||
@ -37,6 +39,15 @@ import org.junit.Test;
|
||||
|
||||
public class ProbabilityDirectiveTest extends GraalCompilerTest {
|
||||
|
||||
/**
|
||||
* Called before a test is compiled.
|
||||
*/
|
||||
@Override
|
||||
protected void before(ResolvedJavaMethod method) {
|
||||
// don't let -Xcomp pollute profile
|
||||
method.reprofile();
|
||||
}
|
||||
|
||||
public static int branchProbabilitySnippet(int arg) {
|
||||
if (GraalDirectives.injectBranchProbability(0.125, arg > 0)) {
|
||||
GraalDirectives.controlFlowAnchor(); // prevent removal of the if
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user