mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
JDK-8374852: remove VerifyIntrinsicChecks and refactor opaque flag
This commit is contained in:
parent
943cf928b1
commit
cbfa496f00
@ -675,9 +675,6 @@
|
||||
product(bool, PrintIntrinsics, false, DIAGNOSTIC, \
|
||||
"prints attempted and successful inlining of intrinsics") \
|
||||
\
|
||||
develop(bool, VerifyIntrinsicChecks, false, \
|
||||
"Verify in intrinsic that Java level checks work as expected") \
|
||||
\
|
||||
develop(bool, StressReflectiveCode, false, \
|
||||
"Use inexact types at allocations, etc., to test reflection") \
|
||||
\
|
||||
|
||||
@ -951,8 +951,7 @@ void LibraryCallKit::generate_string_range_check(Node* array,
|
||||
Node* offset,
|
||||
Node* count,
|
||||
bool char_count,
|
||||
bool halt_on_oob,
|
||||
bool is_opaque) {
|
||||
bool halt_on_oob) {
|
||||
if (stopped()) {
|
||||
return; // already stopped
|
||||
}
|
||||
@ -964,10 +963,10 @@ void LibraryCallKit::generate_string_range_check(Node* array,
|
||||
}
|
||||
|
||||
// Offset and count must not be negative
|
||||
generate_negative_guard(offset, bailout, nullptr, is_opaque);
|
||||
generate_negative_guard(count, bailout, nullptr, is_opaque);
|
||||
generate_negative_guard(offset, bailout, nullptr, halt_on_oob);
|
||||
generate_negative_guard(count, bailout, nullptr, halt_on_oob);
|
||||
// Offset + count must not exceed length of array
|
||||
generate_limit_guard(offset, count, load_array_length(array), bailout, is_opaque);
|
||||
generate_limit_guard(offset, count, load_array_length(array), bailout, halt_on_oob);
|
||||
|
||||
if (bailout->req() > 1) {
|
||||
if (halt_on_oob) {
|
||||
@ -1151,7 +1150,7 @@ bool LibraryCallKit::inline_countPositives() {
|
||||
Node* len = argument(2);
|
||||
|
||||
ba = must_be_not_null(ba, true);
|
||||
generate_string_range_check(ba, offset, len, false, true, !VerifyIntrinsicChecks);
|
||||
generate_string_range_check(ba, offset, len, false, true);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
@ -6226,8 +6225,8 @@ bool LibraryCallKit::inline_encodeISOArray(bool ascii) {
|
||||
}
|
||||
|
||||
// Check source & target bounds
|
||||
generate_string_range_check(src, src_offset, length, src_elem == T_BYTE, true, !VerifyIntrinsicChecks);
|
||||
generate_string_range_check(dst, dst_offset, length, false, true, !VerifyIntrinsicChecks);
|
||||
generate_string_range_check(src, src_offset, length, src_elem == T_BYTE, true);
|
||||
generate_string_range_check(dst, dst_offset, length, false, true);
|
||||
if (stopped()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -166,8 +166,7 @@ class LibraryCallKit : public GraphKit {
|
||||
bool is_opaque = false);
|
||||
void generate_string_range_check(Node* array, Node* offset,
|
||||
Node* length, bool char_count,
|
||||
bool halt_on_oob = false,
|
||||
bool is_opaque = false);
|
||||
bool halt_on_oob = false);
|
||||
Node* current_thread_helper(Node* &tls_output, ByteSize handle_offset,
|
||||
bool is_immutable);
|
||||
Node* generate_current_thread(Node* &tls_output);
|
||||
|
||||
@ -24,15 +24,15 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8361842
|
||||
* @summary Verify the effectiveness of the `VerifyIntrinsicChecks` VM flag
|
||||
* through (bypassing `StringCoding::encodeAsciiArray`, and) feeding
|
||||
* @summary Verify the effectiveness of intrinsics range and limit checks
|
||||
* (bypassing `StringCoding::encodeAsciiArray`, and) feeding
|
||||
* invalid input to an intrinsified `StringCoding::encodeAsciiArray0`
|
||||
* (note the `0` suffix!).
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @build java.base/java.lang.Helper
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @comment `vm.debug == true` is required since redundant intrinsics checks
|
||||
* are only added in debug builds
|
||||
* @requires vm.debug == true & vm.flavor == "server" & !vm.graal.enabled
|
||||
* @requires (os.arch != "riscv64" | (os.arch == "riscv64" & vm.cpu.features ~= ".*rvv.*"))
|
||||
* @run main/othervm compiler.intrinsics.TestVerifyIntrinsicChecks verify
|
||||
@ -55,7 +55,6 @@ public final class TestVerifyIntrinsicChecks {
|
||||
"-Xcomp",
|
||||
"-XX:-TieredCompilation",
|
||||
"-XX:CompileCommand=inline,java.lang.StringCoding::encodeAsciiArray0",
|
||||
"-XX:+VerifyIntrinsicChecks",
|
||||
"--patch-module", "java.base=%s/java.base".formatted(System.getProperty("test.patch.path")),
|
||||
"compiler.intrinsics.TestVerifyIntrinsicChecks",
|
||||
"crash");
|
||||
|
||||
@ -48,27 +48,6 @@
|
||||
* @run main/othervm/timeout=1200 -XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:AVX3Threshold=0 compiler.intrinsics.string.TestCountPositives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8281146
|
||||
* @summary Verify `StringCoding::countPositives` intrinsic Java wrapper checks
|
||||
* by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main/othervm
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* compiler.intrinsics.string.TestCountPositives
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import java.lang.Helper;
|
||||
|
||||
@ -31,26 +31,6 @@
|
||||
* @run main/othervm/timeout=1200 --add-opens=java.base/sun.nio.cs=ALL-UNNAMED -Xbatch -Xmx256m compiler.intrinsics.string.TestEncodeIntrinsics
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 6896617 8274242
|
||||
* @summary Verify `sun.nio.cs.ISO_8859_1.Encoder::encodeISOArray` intrinsic
|
||||
* Java wrapper checks by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @run main/othervm/timeout=1200
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* --add-opens=java.base/sun.nio.cs=ALL-UNNAMED -Xbatch -Xmx256m
|
||||
* compiler.intrinsics.string.TestEncodeIntrinsics
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
@ -47,27 +47,6 @@
|
||||
* @run main/othervm/timeout=1200 -XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:AVX3Threshold=0 compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 8054307
|
||||
* @summary Verify `StringCoding::hasNegatives` intrinsic Java wrapper checks
|
||||
* by enabling the ones in the VM intrinsic using
|
||||
* `-XX:+VerifyIntrinsicChecks`
|
||||
* @comment This does not check out-of-range conditions. The
|
||||
* `-XX:+VerifyIntrinsicChecks` version of this test simply ensures
|
||||
* that the VM intrinsic will produce no spurious errors.
|
||||
* @key randomness
|
||||
* @library /compiler/patches
|
||||
* @library /test/lib
|
||||
* @comment `vm.debug == true` is required since `VerifyIntrinsicChecks` is a
|
||||
* development flag
|
||||
* @requires vm.debug == true
|
||||
* @build java.base/java.lang.Helper
|
||||
* @run main/othervm
|
||||
* -XX:+VerifyIntrinsicChecks
|
||||
* compiler.intrinsics.string.TestHasNegatives
|
||||
*/
|
||||
|
||||
package compiler.intrinsics.string;
|
||||
|
||||
import java.lang.Helper;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user