Skip to content
Permalink
Browse files
8262508: Vector API's ergonomics is incorrect
Reviewed-by: vlivanov
  • Loading branch information
DamonFool committed Mar 4, 2021
1 parent 718d4d4 commit 351889f1b5d8760f436b4c2402b675de582cd1e3
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
@@ -4084,7 +4084,7 @@ jint Arguments::apply_ergo() {
UseOptoBiasInlining = false;
}

if (!EnableVectorSupport) {
if (!FLAG_IS_DEFAULT(EnableVectorSupport) && !EnableVectorSupport) {
if (!FLAG_IS_DEFAULT(EnableVectorReboxing) && EnableVectorReboxing) {
warning("Disabling EnableVectorReboxing since EnableVectorSupport is turned off.");
}
@@ -0,0 +1,82 @@
/*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package compiler.vectorapi;

/*
* @test TestVectorErgonomics
* @bug 8262508
* @requires vm.compiler2.enabled
* @summary Check ergonomics for Vector API
* @library /test/lib
* @run main/othervm compiler.vectorapi.TestVectorErgonomics
*/

import jdk.test.lib.process.ProcessTools;

public class TestVectorErgonomics {

public static void main(String[] args) throws Throwable {
ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorReboxing=true");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorAggressiveReboxing=true");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");
}
}

0 comments on commit 351889f

Please sign in to comment.