" + Class2HTML.referenceType(type)
+ printWriter.print("" + access + " " + Class2HTML.referenceType(type)
+ " " + htmlName + "(");
for (int i = 0; i < args.length; i++) {
printWriter.print(Class2HTML.referenceType(args[i]));
@@ -521,7 +533,7 @@ private void writeMethod(final Method method, final int methodNumber) throws IOE
printWriter.print("");
@@ -529,14 +541,14 @@ private void writeMethod(final Method method, final int methodNumber) throws IOE
}
printWriter.println("");
}
- if (code != null) { // No code, an abstract method, e.g.
+ if (code != null) { // No code, an abstract method, for example
// System.out.println(name + "\n" + Utility.codeToString(code, constantPool, 0, -1));
// Print the byte code
try (ByteSequence stream = new ByteSequence(code)) {
stream.mark(stream.available());
findGotos(stream, c);
stream.reset();
- printWriter.println("Byte offset | " + "Instruction | Argument | ");
+ printWriter.println("Byte offset | Instruction | Argument | ");
while (stream.available() > 0) {
final int offset = stream.getIndex();
final String str = codeToHTML(stream, methodNumber);
@@ -548,7 +560,7 @@ private void writeMethod(final Method method, final int methodNumber) throws IOE
if (gotoSet.get(offset)) {
anchor = "";
}
- String anchor2;
+ final String anchor2;
if (stream.getIndex() == code.length) {
anchor2 = "" + offset + "";
} else {
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ConstantHTML.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ConstantHTML.java
index b3197f6d45a..8b04a25452e 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ConstantHTML.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ConstantHTML.java
@@ -98,9 +98,9 @@ String referenceConstant(final int index) {
private void writeConstant(final int index) {
final byte tag = constants[index].getTag();
- int classIndex;
- int nameIndex;
- String ref;
+ final int classIndex;
+ final int nameIndex;
+ final String ref;
// The header is always the same
printWriter.println(" " + index + " " + Const.getConstantName(tag) + "
");
/*
@@ -122,10 +122,11 @@ private void writeConstant(final int index) {
// Get method name and its class
final String methodName = constantPool.constantToString(nameIndex, Const.CONSTANT_NameAndType);
final String htmlMethodName = Class2HTML.toHTML(methodName);
- // Partially compacted class name, i.e., / -> .
+ // Partially compacted class name, that is, / -> .
final String methodClass = constantPool.constantToString(classIndex, Const.CONSTANT_Class);
String shortMethodClass = Utility.compactClassName(methodClass); // I.e., remove java.lang.
shortMethodClass = Utility.compactClassName(shortMethodClass, classPackage + ".", true); // Remove class package prefix
+ shortMethodClass = Class2HTML.toHTML(shortMethodClass);
// Get method signature
final ConstantNameAndType c2 = constantPool.getConstant(nameIndex, Const.CONSTANT_NameAndType, ConstantNameAndType.class);
final String signature = constantPool.constantToString(c2.getSignatureIndex(), Const.CONSTANT_Utf8);
@@ -146,11 +147,11 @@ private void writeConstant(final int index) {
if (methodClass.equals(className)) {
ref = "" + htmlMethodName + "";
} else {
- ref = "" + shortMethodClass + "." + htmlMethodName;
+ ref = "" + shortMethodClass + "." + htmlMethodName;
}
constantRef[index] = retType + " " + shortMethodClass
+ "." + htmlMethodName + " " + argTypes;
- printWriter.println("" + retType + " " + ref + argTypes + " \n
" + "- Class index("
+ printWriter.println("
" + retType + " " + ref + argTypes + " \n
");
break;
case Const.CONSTANT_Fieldref:
@@ -162,14 +163,16 @@ private void writeConstant(final int index) {
final String fieldClass = constantPool.constantToString(classIndex, Const.CONSTANT_Class);
String shortFieldClass = Utility.compactClassName(fieldClass); // I.e., remove java.lang.
shortFieldClass = Utility.compactClassName(shortFieldClass, classPackage + ".", true); // Remove class package prefix
+ shortFieldClass = Class2HTML.toHTML(shortFieldClass);
final String fieldName = constantPool.constantToString(nameIndex, Const.CONSTANT_NameAndType);
+ final String htmlFieldName = Class2HTML.toHTML(fieldName);
if (fieldClass.equals(className)) {
- ref = "" + fieldName + "";
+ ref = "" + htmlFieldName + "";
} else {
- ref = "" + shortFieldClass + "." + fieldName + "\n";
+ ref = "" + shortFieldClass + "." + htmlFieldName + "\n";
}
constantRef[index] = "" + shortFieldClass + "." + fieldName + "";
+ + className + "_cp.html#cp" + index + "\" TARGET=ConstantPool>" + htmlFieldName + "";
printWriter.println("" + ref + "
\n" + "
");
break;
@@ -179,7 +182,8 @@ private void writeConstant(final int index) {
final String className2 = constantPool.constantToString(index, tag); // / -> .
String shortClassName = Utility.compactClassName(className2); // I.e., remove java.lang.
shortClassName = Utility.compactClassName(shortClassName, classPackage + ".", true); // Remove class package prefix
- ref = "" + shortClassName + "";
+ shortClassName = Class2HTML.toHTML(shortClassName);
+ ref = "" + shortClassName + "";
constantRef[index] = "" + shortClassName + "";
printWriter.println("" + ref + "
\n");
break;
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
index 510fe4a03a6..bfb8982dc82 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/InstructionFinder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,7 +25,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
-import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -34,48 +33,49 @@
import com.sun.org.apache.bcel.internal.generic.ClassGenException;
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
import com.sun.org.apache.bcel.internal.generic.InstructionList;
+import jdk.xml.internal.Utils;
/**
- * InstructionFinder is a tool to search for given instructions patterns, i.e., match sequences of instructions in an
- * instruction list via regular expressions. This can be used, e.g., in order to implement a peep hole optimizer that
+ * InstructionFinder is a tool to search for given instructions patterns, that is, match sequences of instructions in an
+ * instruction list via regular expressions. This can be used, for example, in order to implement a peep hole optimizer that
* looks for code patterns and replaces them with faster equivalents.
*
*
* This class internally uses the java.util.regex package to search for regular expressions.
- *
+ *
+ *
* A typical application would look like this:
- *
+ *
*
- *
- *
- * InstructionFinder f = new InstructionFinder(il);
- * String pat = "IfInstruction ICONST_0 GOTO ICONST_1 NOP (IFEQ|IFNE)";
+ * InstructionFinder f = new InstructionFinder(il);
+ * String pat = "IfInstruction ICONST_0 GOTO ICONST_1 NOP (IFEQ|IFNE)";
*
* for (Iterator i = f.search(pat, constraint); i.hasNext(); ) {
- * InstructionHandle[] match = (InstructionHandle[])i.next();
- * ...
- * il.delete(match[1], match[5]);
- * ...
+ * InstructionHandle[] match = (InstructionHandle[])i.next();
+ * ...
+ * il.delete(match[1], match[5]);
+ * ...
* }
- *
- *
+
*
*
* @see com.sun.org.apache.bcel.internal.generic.Instruction
* @see InstructionList
- * @LastModified: Sept 2025
+ * @LastModified: Nov 2026
*/
public class InstructionFinder {
/**
* Code patterns found may be checked using an additional user-defined constraint object whether they really match the
- * needed criterion. I.e., check constraints that can not expressed with regular expressions.
+ * needed criterion. I.e., check constraints that cannot expressed with regular expressions.
*/
public interface CodeConstraint {
/**
- * @param match array of instructions matching the requested pattern
- * @return true if the matched area is really useful
+ * Checks if the matched code area is really useful.
+ *
+ * @param match array of instructions matching the requested pattern.
+ * @return true if the matched area is really useful.
*/
boolean checkCode(InstructionHandle[] match);
}
@@ -171,12 +171,12 @@ public interface CodeConstraint {
* Replace symbolic names of instructions with the appropriate character and remove all white space from string. Meta
* characters such as +, * are ignored.
*
- * @param pattern The pattern to compile
- * @return translated regular expression string
+ * @param pattern The pattern to compile.
+ * @return translated regular expression string.
*/
private static String compilePattern(final String pattern) {
// Bug: BCEL-77 - Instructions are assumed to be english, to avoid odd Locale issues
- final String lower = pattern.toLowerCase(Locale.ENGLISH);
+ final String lower = Utils.toLowerCase(pattern);
final StringBuilder buf = new StringBuilder();
final int size = pattern.length();
for (int i = 0; i < size; i++) {
@@ -209,7 +209,7 @@ private static char makeChar(final short opcode) {
/**
* Map symbolic instruction names like "getfield" to a single character.
*
- * @param pattern instruction pattern in lower case
+ * @param pattern instruction pattern in lower case.
* @return encoded string for a pattern such as "BranchInstruction".
*/
private static String mapName(final String pattern) {
@@ -243,8 +243,11 @@ private static String precompile(final short from, final short to, final short e
private InstructionHandle[] handles; // map instruction
// list to array
+
/**
- * @param il instruction list to search for given patterns
+ * Constructs an InstructionFinder.
+ *
+ * @param il instruction list to search for given patterns.
*/
public InstructionFinder(final InstructionList il) {
this.il = il;
@@ -252,21 +255,23 @@ public InstructionFinder(final InstructionList il) {
}
/**
- * @return the inquired instruction list
+ * Gets the inquired instruction list.
+ *
+ * @return The inquired instruction list.
*/
public final InstructionList getInstructionList() {
return il;
}
/**
- * @return the matched piece of code as an array of instruction (handles)
+ * @return The matched piece of code as an array of instruction (handles).
*/
private InstructionHandle[] getMatch(final int matchedFrom, final int matchLength) {
return Arrays.copyOfRange(handles, matchedFrom, matchedFrom + matchLength);
}
/**
- * Reread the instruction list, e.g., after you've altered the list upon a match.
+ * Reread the instruction list, for example, after you've altered the list upon a match.
*/
public final void reread() {
final int size = il.getLength();
@@ -282,8 +287,8 @@ public final void reread() {
/**
* Start search beginning from the start of the given instruction list.
*
- * @param pattern the instruction pattern to search for, where case is ignored
- * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area
+ * @param pattern The instruction pattern to search for, where case is ignored.
+ * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area.
*/
public final Iterator search(final String pattern) {
return search(pattern, il.getStart(), null);
@@ -292,9 +297,9 @@ public final Iterator search(final String pattern) {
/**
* Start search beginning from the start of the given instruction list. Check found matches with the constraint object.
*
- * @param pattern the instruction pattern to search for, case is ignored
- * @param constraint constraints to be checked on matching code
- * @return instruction handle or 'null' if the match failed
+ * @param pattern The instruction pattern to search for, case is ignored.
+ * @param constraint constraints to be checked on matching code.
+ * @return instruction handle or 'null' if the match failed.
*/
public final Iterator search(final String pattern, final CodeConstraint constraint) {
return search(pattern, il.getStart(), constraint);
@@ -303,17 +308,17 @@ public final Iterator search(final String pattern, final Co
/**
* Start search beginning from 'from'.
*
- * @param pattern the instruction pattern to search for, where case is ignored
- * @param from where to start the search in the instruction list
- * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area
+ * @param pattern The instruction pattern to search for, where case is ignored.
+ * @param from where to start the search in the instruction list.
+ * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area.
*/
public final Iterator search(final String pattern, final InstructionHandle from) {
return search(pattern, from, null);
}
/**
- * Search for the given pattern in the instruction list. You can search for any valid opcode via its symbolic name, e.g.
- * "istore". You can also use a super class or an interface name to match a whole set of instructions, e.g.
+ * Search for the given pattern in the instruction list. You can search for any valid opcode via its symbolic name, for example
+ * "istore". You can also use a super class or an interface name to match a whole set of instructions, for example
* "BranchInstruction" or "LoadInstruction". "istore" is also an alias for all "istore_x" instructions. Additional
* aliases are "if" for "ifxx", "if_icmp" for "if_icmpxx", "if_acmp" for "if_acmpxx".
*
@@ -321,9 +326,9 @@ public final Iterator search(final String pattern, final In
* pattern.
*
* For the rest the usual pattern matching rules for regular expressions apply.
- *
+ *
* Example pattern:
- *
+ *
*
* search("BranchInstruction NOP ((IfInstruction|GOTO)+ ISTORE Instruction)*");
*
@@ -331,11 +336,12 @@ public final Iterator search(final String pattern, final In
*
* If you alter the instruction list upon a match such that other matching areas are affected, you should call reread()
* to update the finder and call search() again, because the matches are cached.
+ *
*
- * @param pattern the instruction pattern to search for, where case is ignored
- * @param from where to start the search in the instruction list
- * @param constraint optional CodeConstraint to check the found code pattern for user-defined constraints
- * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area
+ * @param pattern The instruction pattern to search for, where case is ignored.
+ * @param from where to start the search in the instruction list.
+ * @param constraint optional CodeConstraint to check the found code pattern for user-defined constraints.
+ * @return iterator of matches where e.nextElement() returns an array of instruction handles describing the matched area.
*/
public final Iterator search(final String pattern, final InstructionHandle from, final CodeConstraint constraint) {
final String search = compilePattern(pattern);
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/MethodHTML.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/MethodHTML.java
index a75a58bedbf..0b0c74a7ba9 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/MethodHTML.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/MethodHTML.java
@@ -55,13 +55,13 @@ final class MethodHTML {
printWriter.print(charset.name());
printWriter.println("\">");
printWriter.println("");
- printWriter.println("| Access flags | Type | " + "Field name |
");
+ printWriter.println("| Access flags | Type | Field name |
");
for (final Field field : fields) {
writeField(field);
}
printWriter.println("
");
printWriter.println("| Access flags | "
- + "Return type | Method name | " + "Arguments |
");
+ + "Return type | Method name | Arguments | ");
for (int i = 0; i < methods.length; i++) {
writeMethod(methods[i], i);
}
@@ -72,16 +72,16 @@ final class MethodHTML {
/**
* Print field of class.
*
- * @param field field to print
+ * @param field field to print.
*/
private void writeField(final Field field) {
final String type = Utility.signatureToString(field.getSignature());
final String name = field.getName();
String access = Utility.accessToString(field.getAccessFlags());
- Attribute[] attributes;
+ final Attribute[] attributes;
access = Utility.replace(access, " ", " ");
printWriter.print("| " + access + " | \n" + Class2HTML.referenceType(type) + " | " + name + " | ");
+ + Class2HTML.toHTML(name) + "\">" + Class2HTML.toHTML(name) + "");
attributes = field.getAttributes();
// Write them to the Attributes.html file with anchor "[]"
for (int i = 0; i < attributes.length; i++) {
@@ -91,7 +91,8 @@ private void writeField(final Field field) {
if (attributes[i].getTag() == Const.ATTR_CONSTANT_VALUE) { // Default value
final String str = attributes[i].toString();
// Reference attribute in _attributes.html
- printWriter.print("= " + str + " | \n");
+ printWriter.print("= "
+ + Class2HTML.toHTML(str) + " | \n");
break;
}
}
@@ -107,7 +108,6 @@ private void writeMethod(final Method method, final int methodNumber) {
final String type = Utility.methodSignatureReturnType(signature, false);
// Get method name
final String name = method.getName();
- String htmlName;
// Get method's access flags
String access = Utility.accessToString(method.getAccessFlags());
// Get the method's attributes, the Code Attribute in particular
@@ -116,9 +116,9 @@ private void writeMethod(final Method method, final int methodNumber) {
* HTML doesn't like names like and spaces are places to break lines. Both we don't want...
*/
access = Utility.replace(access, " ", " ");
- htmlName = Class2HTML.toHTML(name);
+ final String htmlName = Class2HTML.toHTML(name);
printWriter.print("| " + access + " | ");
- printWriter.print("" + Class2HTML.referenceType(type) + " | " + ""
+ printWriter.print(" | " + Class2HTML.referenceType(type) + " | "
+ htmlName + " | \n(");
for (int i = 0; i < args.length; i++) {
printWriter.print(Class2HTML.referenceType(args[i]));
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ModularRuntimeImage.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ModularRuntimeImage.java
index fd7cd0d2dc3..4d9ed07e821 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ModularRuntimeImage.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/ModularRuntimeImage.java
@@ -1,6 +1,5 @@
/*
- * reserved comment block
- * DO NOT REMOVE OR ALTER!
+ * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -42,6 +41,7 @@
* Wraps a Java 9 JEP 220 modular runtime image. Requires the JRT NIO file system.
*
* @since 6.3
+ * @LastModified: Nov 2026
*/
public class ModularRuntimeImage implements Closeable {
@@ -63,8 +63,7 @@ public ModularRuntimeImage() {
* Constructs an instance using the JRT file system implementation from a specific Java Home.
*
* @param javaHome Path to a Java 9 or greater home.
- *
- * @throws IOException an I/O error occurs accessing the file system
+ * @throws IOException Thrown if I/O error occurs accessing the file system.
*/
public ModularRuntimeImage(final String javaHome) throws IOException {
final Map emptyMap = Collections.emptyMap();
@@ -85,10 +84,19 @@ public void close() throws IOException {
classLoader.close();
}
if (fileSystem != null) {
- fileSystem.close();
+ try {
+ fileSystem.close();
+ } catch (final UnsupportedOperationException e) {
+ // do nothing
+ }
}
}
+ /**
+ * Gets the file system.
+ *
+ * @return The file system.
+ */
public FileSystem getFileSystem() {
return fileSystem;
}
@@ -97,8 +105,8 @@ public FileSystem getFileSystem() {
* Lists all entries in the given directory.
*
* @param dirPath directory path.
- * @return a list of dir entries if an I/O error occurs
- * @throws IOException an I/O error occurs accessing the file system
+ * @return A list of dir entries if an I/O error occurs.
+ * @throws IOException Thrown if I/O error occurs accessing the file system.
*/
public List list(final Path dirPath) throws IOException {
final List list = new ArrayList<>();
@@ -112,8 +120,8 @@ public List list(final Path dirPath) throws IOException {
* Lists all entries in the given directory.
*
* @param dirName directory path.
- * @return a list of dir entries if an I/O error occurs
- * @throws IOException an I/O error occurs accessing the file system
+ * @return A list of dir entries if an I/O error occurs.
+ * @throws IOException Thrown if I/O error occurs accessing the file system.
*/
public List list(final String dirName) throws IOException {
return list(fileSystem.getPath(dirName));
@@ -122,8 +130,8 @@ public List list(final String dirName) throws IOException {
/**
* Lists all modules.
*
- * @return a list of modules
- * @throws IOException an I/O error occurs accessing the file system
+ * @return A list of modules.
+ * @throws IOException Thrown if I/O error occurs accessing the file system.
*/
public List modules() throws IOException {
return list(MODULES_PATH);
@@ -132,8 +140,8 @@ public List modules() throws IOException {
/**
* Lists all packages.
*
- * @return a list of modules
- * @throws IOException an I/O error occurs accessing the file system
+ * @return A list of modules.
+ * @throws IOException Thrown if I/O error occurs accessing the file system.
*/
public List packages() throws IOException {
return list(PACKAGES_PATH);
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/Repository.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/Repository.java
index c44e36d0a81..4cfff10cc2e 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/Repository.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/Repository.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -26,7 +26,7 @@
* used in the Repository.setRepository method.
*
* @see com.sun.org.apache.bcel.internal.Repository
- * @LastModified: Sept 2025
+ * @LastModified: Nov 2026
*/
public interface Repository {
@@ -37,30 +37,41 @@ public interface Repository {
/**
* Finds the class with the name provided, if the class isn't there, return NULL.
+ *
+ * @param className The class name.
+ * @return The JavaClass instance, or null.
*/
JavaClass findClass(String className);
/**
* Finds the JavaClass instance for the given run-time class object.
*
- * @throws ClassNotFoundException if the class can't be found.
+ * @param clazz The class.
+ * @return The JavaClass instance.
+ * @throws ClassNotFoundException Thrown if the class can't be found.
*/
JavaClass loadClass(Class> clazz) throws ClassNotFoundException;
/**
* Finds the class with the name provided, if the class isn't there, make an attempt to load it.
*
- * @throws ClassNotFoundException if the class can't be found.
+ * @param className The class name.
+ * @return The JavaClass instance.
+ * @throws ClassNotFoundException Thrown if the class can't be found.
*/
JavaClass loadClass(String className) throws ClassNotFoundException;
/**
- * Removes class from repository
+ * Removes class from repository.
+ *
+ * @param clazz The class to remove.
*/
void removeClass(JavaClass clazz);
/**
- * Stores the provided class under "clazz.getClassName()"
+ * Stores the provided class under "clazz.getClassName()".
+ *
+ * @param clazz The class to store.
*/
void storeClass(JavaClass clazz);
}
diff --git a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java
index 470c6ea17b6..907cdce0dff 100644
--- a/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java
+++ b/src/java.xml/share/classes/com/sun/org/apache/bcel/internal/util/SyntheticRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2026, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@@ -40,7 +40,7 @@
*
* @see com.sun.org.apache.bcel.internal.Repository
*
- * @LastModified: Feb 2023
+ * @LastModified: Nov 2026
*/
public class SyntheticRepository implements Repository {
diff --git a/src/java.xml/share/classes/jdk/xml/internal/Utils.java b/src/java.xml/share/classes/jdk/xml/internal/Utils.java
index f7f5c49387b..59d59265766 100644
--- a/src/java.xml/share/classes/jdk/xml/internal/Utils.java
+++ b/src/java.xml/share/classes/jdk/xml/internal/Utils.java
@@ -29,6 +29,7 @@
import java.net.URI;
import java.nio.file.Path;
import java.util.Arrays;
+import java.util.Locale;
import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Stream;
@@ -182,4 +183,24 @@ public static URI createURI(String systemId) {
return Path.of(systemId).toUri();
}
}
+
+ // converts the input to upper case using the ROOT locale
+ public static String toUpperCase(CharSequence input) {
+ return input == null ? null : input.toString().toUpperCase(Locale.ROOT);
+ }
+
+ // converts the input to lower case using the ROOT locale
+ public static String toLowerCase(CharSequence input) {
+ return input == null ? null : input.toString().toLowerCase(Locale.ROOT);
+ }
+
+ // converts the input to upper case using the specified locale
+ public static String toUpperCase(CharSequence input, Locale locale) {
+ return input == null ? null : input.toString().toUpperCase(locale);
+ }
+
+ // converts the input to lower case using the specified locale
+ public static String toLowerCase(CharSequence input, Locale locale) {
+ return input == null ? null : input.toString().toLowerCase(locale);
+ }
}
diff --git a/src/java.xml/share/legal/bcel.md b/src/java.xml/share/legal/bcel.md
index b64fc3640d4..52a913982c9 100644
--- a/src/java.xml/share/legal/bcel.md
+++ b/src/java.xml/share/legal/bcel.md
@@ -1,10 +1,10 @@
-## Apache Commons Byte Code Engineering Library (BCEL) Version 6.10.0
+## Apache Commons Byte Code Engineering Library (BCEL) Version 6.13.0
### Apache Commons BCEL Notice
Apache Commons BCEL
- Copyright 2004-2022 The Apache Software Foundation
+ Copyright 2004-2026 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
From bb5483e59a76396177c1c5b2f875d236921aecab Mon Sep 17 00:00:00 2001
From: Richard Reingruber
Date: Fri, 13 Nov 2026 06:53:36 +0000
Subject: [PATCH 15/95] 8396909: [AIX] make test TEST=gtest:... does not work
Reviewed-by: erikj, stuefe
---
make/RunTests.gmk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/make/RunTests.gmk b/make/RunTests.gmk
index 051be9021d7..20ad612ecee 100644
--- a/make/RunTests.gmk
+++ b/make/RunTests.gmk
@@ -526,6 +526,7 @@ define SetupRunGtestTestBody
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/gtest, \
$$(CD) $$($1_TEST_SUPPORT_DIR) && \
+ $(if $(call isTargetOs, aix), LIBPATH=$$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT):$$$$LIBPATH) \
$$(FIXPATH) $$(TEST_IMAGE_DIR)/hotspot/gtest/$$($1_VARIANT)/gtestLauncher \
-jdk $(JDK_UNDER_TEST) $$($1_GTEST_FILTER) \
--gtest_output=xml:$$($1_TEST_RESULTS_DIR)/gtest.xml \
@@ -545,7 +546,7 @@ define SetupRunGtestTestBody
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
$$(if $$(wildcard $$($1_RESULT_FILE)), \
$$(eval $1_RUN := $$(shell $$(AWK) \
- '/==========.* tests? from .* test (cases?|suites?) ran/ { print $$$$2 }' \
+ '/\==========.* tests? from .* test (cases?|suites?) ran/ { print $$$$2 }' \
$$($1_RESULT_FILE))) \
$$(if $$($1_RUN), , $$(eval $1_RUN := 0)) \
$$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \
From 69131198ec23360f0a65fd581f075dadb55c5bdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20H=C3=A4ssig?=
Date: Fri, 13 Nov 2026 07:51:30 +0000
Subject: [PATCH 16/95] 8396457: C2: Missed Ideal optimization opportunity in
PhaseIterGVN for MinI/MaxI
Reviewed-by: thartmann, chagedorn
---
src/hotspot/share/opto/phaseX.cpp | 14 +++++
.../igvn/TestMinMax3HopNotification.java | 60 +++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 test/hotspot/jtreg/compiler/igvn/TestMinMax3HopNotification.java
diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp
index 937a575cdc4..e7d5791f3fd 100644
--- a/src/hotspot/share/opto/phaseX.cpp
+++ b/src/hotspot/share/opto/phaseX.cpp
@@ -36,6 +36,7 @@
#include "opto/idealGraphPrinter.hpp"
#include "opto/loopnode.hpp"
#include "opto/machnode.hpp"
+#include "opto/node.hpp"
#include "opto/opcodes.hpp"
#include "opto/phaseX.hpp"
#include "opto/regalloc.hpp"
@@ -2832,6 +2833,19 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_
}
}
}
+ // Check for MinI/MaxI(MinI/MaxI(AddI(x, conx), other), AddI(y, cony))
+ // -> MinI/MaxI(AddI(x, MinI/MaxI(conx, cony)), other), where all
+ // operations are either MinI or MaxI. This requires a 3-hop
+ // notification like above.
+ if (use_op == Op_AddI) {
+ for (DUIterator_Fast imax, i = use->fast_outs(imax); i < imax; i++) {
+ if (Node* u2 = use->fast_out(i); u2 != nullptr && u2->is_MinMax()) {
+ add_users_to_worklist_if(worklist, u2, [](Node* u1) {
+ return u1->is_MinMax();
+ });
+ }
+ }
+ }
// Check for A | (B | C) and (B | C) | A where A == B or A == C.
if (use_op == Op_OrI || use_op == Op_OrL) {
diff --git a/test/hotspot/jtreg/compiler/igvn/TestMinMax3HopNotification.java b/test/hotspot/jtreg/compiler/igvn/TestMinMax3HopNotification.java
new file mode 100644
index 00000000000..42a052216e1
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/igvn/TestMinMax3HopNotification.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2026, 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
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8396457
+ * @summary Test that the three-hop notification for MinI/MaxI happens.
+ * @library /test/lib
+ * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:+IgnoreUnrecognizedVMOptions -XX:VerifyIterativeGVN=1110
+ * -XX:CompileCommand=compileonly,${test.main.class}::test*
+ * ${test.main.class}
+ * @run main ${test.main.class}
+ */
+
+package compiler.igvn;
+
+import jdk.test.lib.Asserts;
+
+public class TestMinMax3HopNotification {
+ public static void main(String[] args) {
+ for (int i = 0; i < 1_000; i++) {
+ testMin(i, i + 1, i + 2);
+ testMax(i, i + 1, i + 2);
+ }
+ }
+
+ static int testMin(int x, int y, int z) {
+ int dz = 100; for (int i = 0; i < 100; i++) { dz--; }
+ int a = x & 0xFF;
+ int inner = (dz == 0) ? a : (y & 0xFF);
+ return Math.min(Math.min(inner + 1, z), a + 2);
+ }
+
+ static int testMax(int x, int y, int z) {
+ int dz = 100; for (int i = 0; i < 100; i++) { dz--; }
+ int a = x & 0xFF;
+ int inner = (dz == 0) ? a : (y & 0xFF);
+ return Math.max(Math.max(inner + 1, z), a + 2);
+ }
+}
From b43590b69ca18edc6c824a50b93be8114f0b0b0d Mon Sep 17 00:00:00 2001
From: Marc Chevalier
Date: Fri, 13 Nov 2026 10:31:46 +0000
Subject: [PATCH 17/95] 8396947: C2: make is/isa/as for Type be like for Node
Reviewed-by: qamai, chagedorn
---
src/hotspot/cpu/aarch64/aarch64.ad | 24 +-
src/hotspot/cpu/aarch64/aarch64_vector.ad | 4 +-
src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 | 4 +-
.../shenandoahBarrierSetAssembler_aarch64.cpp | 2 +-
src/hotspot/cpu/arm/arm.ad | 2 +-
src/hotspot/cpu/arm/arm_32.ad | 2 +-
.../shenandoahBarrierSetAssembler_ppc.cpp | 2 +-
src/hotspot/cpu/ppc/ppc.ad | 78 +--
.../shenandoahBarrierSetAssembler_riscv.cpp | 2 +-
src/hotspot/cpu/riscv/riscv.ad | 22 +-
src/hotspot/cpu/riscv/riscv_v.ad | 2 +-
src/hotspot/cpu/s390/s390.ad | 12 +-
src/hotspot/cpu/x86/x86.ad | 196 +++---
src/hotspot/share/adlc/output_c.cpp | 6 +-
src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp | 4 +-
.../share/gc/shared/c2/barrierSetC2.cpp | 12 +-
.../share/gc/shared/c2/barrierSetC2.hpp | 2 +-
.../shenandoah/c2/shenandoahBarrierSetC2.cpp | 26 +-
src/hotspot/share/opto/addnode.cpp | 96 +--
src/hotspot/share/opto/addnode.hpp | 2 +-
src/hotspot/share/opto/arraycopynode.cpp | 20 +-
src/hotspot/share/opto/buildOopMap.cpp | 12 +-
src/hotspot/share/opto/callGenerator.cpp | 2 +-
src/hotspot/share/opto/callnode.cpp | 64 +-
src/hotspot/share/opto/callnode.hpp | 8 +-
src/hotspot/share/opto/castnode.cpp | 64 +-
src/hotspot/share/opto/castnode.hpp | 2 +-
src/hotspot/share/opto/cfgnode.cpp | 44 +-
src/hotspot/share/opto/cfgnode.hpp | 2 +-
src/hotspot/share/opto/chaitin.cpp | 30 +-
src/hotspot/share/opto/compile.cpp | 94 +--
src/hotspot/share/opto/connode.cpp | 28 +-
src/hotspot/share/opto/convertnode.cpp | 62 +-
src/hotspot/share/opto/countbitsnode.cpp | 12 +-
src/hotspot/share/opto/divnode.cpp | 18 +-
src/hotspot/share/opto/doCall.cpp | 14 +-
src/hotspot/share/opto/escape.cpp | 186 +++---
src/hotspot/share/opto/generateOptoStub.cpp | 8 +-
src/hotspot/share/opto/graphKit.cpp | 98 +--
src/hotspot/share/opto/graphKit.hpp | 6 +-
src/hotspot/share/opto/idealGraphPrinter.cpp | 24 +-
src/hotspot/share/opto/idealKit.cpp | 6 +-
src/hotspot/share/opto/ifnode.cpp | 12 +-
src/hotspot/share/opto/intrinsicnode.cpp | 24 +-
src/hotspot/share/opto/lcm.cpp | 8 +-
src/hotspot/share/opto/library_call.cpp | 155 +++--
src/hotspot/share/opto/loopPredicate.cpp | 8 +-
src/hotspot/share/opto/loopTransform.cpp | 40 +-
src/hotspot/share/opto/loopnode.cpp | 62 +-
src/hotspot/share/opto/loopopts.cpp | 8 +-
src/hotspot/share/opto/machnode.cpp | 26 +-
src/hotspot/share/opto/machnode.hpp | 4 +-
src/hotspot/share/opto/macro.cpp | 86 +--
src/hotspot/share/opto/macroArrayCopy.cpp | 26 +-
src/hotspot/share/opto/matcher.cpp | 38 +-
src/hotspot/share/opto/memnode.cpp | 217 +++---
src/hotspot/share/opto/memnode.hpp | 2 +-
src/hotspot/share/opto/movenode.cpp | 16 +-
src/hotspot/share/opto/mulnode.cpp | 104 ++-
src/hotspot/share/opto/multnode.cpp | 4 +-
src/hotspot/share/opto/narrowptrnode.cpp | 8 +-
src/hotspot/share/opto/node.cpp | 22 +-
src/hotspot/share/opto/output.cpp | 34 +-
src/hotspot/share/opto/parse1.cpp | 34 +-
src/hotspot/share/opto/parse2.cpp | 63 +-
src/hotspot/share/opto/parse3.cpp | 10 +-
src/hotspot/share/opto/parseHelper.cpp | 20 +-
src/hotspot/share/opto/phaseX.cpp | 40 +-
src/hotspot/share/opto/reachability.hpp | 4 +-
src/hotspot/share/opto/split_if.cpp | 4 +-
src/hotspot/share/opto/stringopts.cpp | 12 +-
src/hotspot/share/opto/subnode.cpp | 132 ++--
src/hotspot/share/opto/subtypenode.cpp | 38 +-
src/hotspot/share/opto/superword.cpp | 13 +-
.../share/opto/superwordVTransformBuilder.cpp | 2 +-
src/hotspot/share/opto/type.cpp | 438 ++++++------
src/hotspot/share/opto/type.hpp | 627 +++++++++++-------
src/hotspot/share/opto/typejavaptr.hpp | 56 +-
src/hotspot/share/opto/valuetypenode.cpp | 36 +-
src/hotspot/share/opto/vector.cpp | 18 +-
src/hotspot/share/opto/vectorIntrinsics.cpp | 38 +-
src/hotspot/share/opto/vectorization.cpp | 2 +-
src/hotspot/share/opto/vectornode.cpp | 85 ++-
src/hotspot/share/opto/vectornode.hpp | 80 +--
src/hotspot/share/opto/vtransform.cpp | 2 +-
test/hotspot/gtest/opto/test_typejavaptr.cpp | 66 +-
86 files changed, 2071 insertions(+), 1957 deletions(-)
diff --git a/src/hotspot/cpu/aarch64/aarch64.ad b/src/hotspot/cpu/aarch64/aarch64.ad
index 738556a6f1d..383f6c0ce66 100644
--- a/src/hotspot/cpu/aarch64/aarch64.ad
+++ b/src/hotspot/cpu/aarch64/aarch64.ad
@@ -1969,7 +1969,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
assert(src_lo != OptoReg::Bad && dst_lo != OptoReg::Bad, "must move at least 1 register");
- if (src_hi != OptoReg::Bad && !bottom_type()->isa_pvectmask()) {
+ if (src_hi != OptoReg::Bad && !bottom_type()->is_pvectmask()) {
assert((src_lo&1)==0 && src_lo+1==src_hi &&
(dst_lo&1)==0 && dst_lo+1==dst_hi,
"expected aligned-adjacent pairs");
@@ -1984,7 +1984,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
int src_offset = ra_->reg2offset(src_lo);
int dst_offset = ra_->reg2offset(dst_lo);
- if (bottom_type()->isa_vect() && !bottom_type()->isa_pvectmask()) {
+ if (bottom_type()->is_vect() && !bottom_type()->is_pvectmask()) {
uint ireg = ideal_reg();
DEBUG_ONLY(int algm = MIN2(RegMask::num_registers(ireg), (int)Matcher::stack_alignment_in_slots()) * VMRegImpl::stack_slot_size);
assert((src_lo_rc != rc_stack) || is_aligned(src_offset, algm), "unaligned vector spill sp offset %d (src)", src_offset);
@@ -2132,7 +2132,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
} else {
st->print("%s", Matcher::regName[dst_lo]);
}
- if (bottom_type()->isa_vect() && !bottom_type()->isa_pvectmask()) {
+ if (bottom_type()->is_vect() && !bottom_type()->is_pvectmask()) {
int vsize = 0;
switch (ideal_reg()) {
case Op_VecD:
@@ -2640,7 +2640,7 @@ static bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
}
const Type* t = imm_node->bottom_type();
- if (!(t->isa_int() || t->isa_long())) {
+ if (!(t->is_int() || t->is_long())) {
return false;
}
@@ -2649,7 +2649,7 @@ static bool is_valid_sve_arith_imm_pattern(Node* n, Node* m) {
case Op_OrV:
case Op_XorV: {
Assembler::SIMD_RegVariant T = Assembler::elemType_to_regVariant(Matcher::vector_element_basic_type(n));
- uint64_t value = t->isa_long() ? (uint64_t)imm_node->get_long() : (uint64_t)imm_node->get_int();
+ uint64_t value = t->is_long() ? (uint64_t)imm_node->get_long() : (uint64_t)imm_node->get_int();
return Assembler::operand_valid_for_sve_logical_immediate(Assembler::regVariant_to_elemBits(T), value);
}
case Op_AddVB:
@@ -8287,8 +8287,8 @@ instruct encodeHeapOop_not_null(iRegNNoSp dst, iRegP src, rFlagsReg cr) %{
%}
instruct decodeHeapOop(iRegPNoSp dst, iRegN src, rFlagsReg cr) %{
- predicate(n->bottom_type()->is_ptr()->ptr() != TypePtr::NotNull &&
- n->bottom_type()->is_ptr()->ptr() != TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() != TypePtr::NotNull &&
+ n->bottom_type()->as_ptr()->ptr() != TypePtr::Constant);
match(Set dst (DecodeN src));
ins_cost(INSN_COST * 3);
format %{ "decode_heap_oop $dst, $src" %}
@@ -8301,8 +8301,8 @@ instruct decodeHeapOop(iRegPNoSp dst, iRegN src, rFlagsReg cr) %{
%}
instruct decodeHeapOop_not_null(iRegPNoSp dst, iRegN src, rFlagsReg cr) %{
- predicate(n->bottom_type()->is_ptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_ptr()->ptr() == TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() == TypePtr::NotNull ||
+ n->bottom_type()->as_ptr()->ptr() == TypePtr::Constant);
match(Set dst (DecodeN src));
ins_cost(INSN_COST * 3);
format %{ "decode_heap_oop_not_null $dst, $src" %}
@@ -8388,7 +8388,7 @@ instruct castII_checked(iRegI dst, rFlagsReg cr)
format %{ "# castII_checked of $dst" %}
ins_encode %{
- __ verify_int_in_range(_idx, bottom_type()->is_int(), $dst$$Register, rscratch1);
+ __ verify_int_in_range(_idx, bottom_type()->as_int(), $dst$$Register, rscratch1);
%}
ins_pipe(pipe_slow);
%}
@@ -8416,7 +8416,7 @@ instruct castII_checked_nosp(iRegINoSp dst, rFlagsReg cr)
format %{ "# castII_checked of $dst" %}
ins_encode %{
- __ verify_int_in_range(_idx, bottom_type()->is_int(), $dst$$Register, rscratch1);
+ __ verify_int_in_range(_idx, bottom_type()->as_int(), $dst$$Register, rscratch1);
%}
ins_pipe(pipe_slow);
%}
@@ -8441,7 +8441,7 @@ instruct castLL_checked(iRegL dst, rFlagsReg cr)
format %{ "# castLL_checked of $dst" %}
ins_encode %{
- __ verify_long_in_range(_idx, bottom_type()->is_long(), $dst$$Register, rscratch1);
+ __ verify_long_in_range(_idx, bottom_type()->as_long(), $dst$$Register, rscratch1);
%}
ins_pipe(pipe_slow);
%}
diff --git a/src/hotspot/cpu/aarch64/aarch64_vector.ad b/src/hotspot/cpu/aarch64/aarch64_vector.ad
index d02caeba6fb..08dba11ee55 100644
--- a/src/hotspot/cpu/aarch64/aarch64_vector.ad
+++ b/src/hotspot/cpu/aarch64/aarch64_vector.ad
@@ -476,11 +476,11 @@ source %{
// On architectures that do not support predicate, masks are stored in
// general vector registers (TypeVect) with sizes ranging from TypeVectA
// to TypeVectX based on the vector size in bytes.
- assert(vt->isa_pvectmask() == nullptr, "mask type is not matched");
+ assert(!vt->is_pvectmask(), "mask type is not matched");
return false;
}
- assert(vt->isa_pvectmask() != nullptr, "expected TypePVectMask on SVE");
+ assert(vt->is_pvectmask(), "expected TypePVectMask on SVE");
switch (opcode) {
case Op_VectorMaskToLong:
case Op_VectorLongToMask:
diff --git a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4 b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
index ab2c3326a9b..a68bd2755ac 100644
--- a/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
+++ b/src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
@@ -466,11 +466,11 @@ source %{
// On architectures that do not support predicate, masks are stored in
// general vector registers (TypeVect) with sizes ranging from TypeVectA
// to TypeVectX based on the vector size in bytes.
- assert(vt->isa_pvectmask() == nullptr, "mask type is not matched");
+ assert(!vt->is_pvectmask(), "mask type is not matched");
return false;
}
- assert(vt->isa_pvectmask() != nullptr, "expected TypePVectMask on SVE");
+ assert(vt->is_pvectmask(), "expected TypePVectMask on SVE");
switch (opcode) {
case Op_VectorMaskToLong:
case Op_VectorLongToMask:
diff --git a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
index 51d3959e475..84e92e2551f 100644
--- a/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp
@@ -702,7 +702,7 @@ void ShenandoahBarrierSetAssembler::compare_and_set_c2(const MachNode* node, Mac
void ShenandoahBarrierSetAssembler::get_and_set_c2(const MachNode* node, MacroAssembler* masm, Register preval,
Register newval, Register addr, Register tmp1, Register tmp2, Register tmp3, bool is_acquire) {
- bool is_narrow = node->bottom_type()->isa_narrowoop();
+ bool is_narrow = node->bottom_type()->is_narrowoop();
ShenandoahBarrierStubC2::load_store_pre(masm, node, addr, tmp1, tmp2, tmp3, is_narrow);
diff --git a/src/hotspot/cpu/arm/arm.ad b/src/hotspot/cpu/arm/arm.ad
index 391c95c3b67..ba23c104b8e 100644
--- a/src/hotspot/cpu/arm/arm.ad
+++ b/src/hotspot/cpu/arm/arm.ad
@@ -434,7 +434,7 @@ uint MachSpillCopyNode::implementation( C2_MacroAssembler *masm,
return size; // Self copy, no move
#ifdef TODO
- if (bottom_type()->isa_vect() != nullptr) {
+ if (bottom_type()->is_vect()) {
}
#endif
diff --git a/src/hotspot/cpu/arm/arm_32.ad b/src/hotspot/cpu/arm/arm_32.ad
index 87ffc46e67a..678249866a7 100644
--- a/src/hotspot/cpu/arm/arm_32.ad
+++ b/src/hotspot/cpu/arm/arm_32.ad
@@ -501,7 +501,7 @@ operand immIRotn() %{
%}
operand immPRot() %{
- predicate(n->get_ptr() == 0 || (AsmOperand::is_rotated_imm(n->get_ptr()) && ((ConPNode*)n)->type()->is_ptr()->reloc() == relocInfo::none));
+ predicate(n->get_ptr() == 0 || (AsmOperand::is_rotated_imm(n->get_ptr()) && ((ConPNode*)n)->type()->as_ptr()->reloc() == relocInfo::none));
match(ConP);
diff --git a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
index cc45d60f329..baeff520d73 100644
--- a/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.cpp
@@ -945,7 +945,7 @@ void ShenandoahBarrierSetAssembler::compare_and_set_c2(const MachNode* node, Mac
}
void ShenandoahBarrierSetAssembler::get_and_set_c2(const MachNode* node, MacroAssembler* masm, Register preval, Register newval, Register addr, Register tmp1, Register tmp2) {
- bool is_narrow = node->bottom_type()->isa_narrowoop();
+ bool is_narrow = node->bottom_type()->is_narrowoop();
ShenandoahBarrierStubC2::load_store_pre(masm, node, addr, preval, tmp1, tmp2, is_narrow);
diff --git a/src/hotspot/cpu/ppc/ppc.ad b/src/hotspot/cpu/ppc/ppc.ad
index 6fc9aa0919a..7fe3200892b 100644
--- a/src/hotspot/cpu/ppc/ppc.ad
+++ b/src/hotspot/cpu/ppc/ppc.ad
@@ -1696,7 +1696,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
if (src_lo == dst_lo && src_hi == dst_hi)
return size; // Self copy, no move.
- if (bottom_type()->isa_vect() != nullptr && ideal_reg() == Op_VecX) {
+ if (bottom_type()->is_vect() && ideal_reg() == Op_VecX) {
int src_offset = ra_->reg2offset(src_lo);
int dst_offset = ra_->reg2offset(dst_lo);
DEBUG_ONLY(int algm = MIN2(RegMask::num_registers(ideal_reg()), (int)Matcher::stack_alignment_in_slots()) * VMRegImpl::stack_slot_size);
@@ -2565,7 +2565,7 @@ loadConLNodesTuple loadConLNodesTuple_create(PhaseRegAlloc *ra_, Node *toc, immL
nodes._large_lo = m2;
nodes._small = nullptr;
nodes._last = nodes._large_lo;
- assert(m2->bottom_type()->isa_long(), "must be long");
+ assert(m2->bottom_type()->is_long(), "must be long");
} else {
loadConLNode *m2 = new loadConLNode();
@@ -2588,7 +2588,7 @@ loadConLNodesTuple loadConLNodesTuple_create(PhaseRegAlloc *ra_, Node *toc, immL
nodes._large_lo = nullptr;
nodes._small = m2;
nodes._last = nodes._small;
- assert(m2->bottom_type()->isa_long(), "must be long");
+ assert(m2->bottom_type()->is_long(), "must be long");
}
return nodes;
@@ -2660,7 +2660,7 @@ loadConLReplicatedNodesTuple loadConLReplicatedNodesTuple_create(Compile *C, Pha
nodes._replicated = m4;
nodes._small = nullptr;
nodes._last = nodes._replicated;
- assert(m2->bottom_type()->isa_long(), "must be long");
+ assert(m2->bottom_type()->is_long(), "must be long");
} else {
loadConLNode *m2 = new loadConLNode();
mtvsrdNode *m3 = new mtvsrdNode();
@@ -2697,7 +2697,7 @@ loadConLReplicatedNodesTuple loadConLReplicatedNodesTuple_create(Compile *C, Pha
nodes._moved = m3;
nodes._replicated = m4;
nodes._last = nodes._replicated;
- assert(m2->bottom_type()->isa_long(), "must be long");
+ assert(m2->bottom_type()->is_long(), "must be long");
}
return nodes;
@@ -2721,7 +2721,7 @@ encode %{
// some asserts
assert(nodes->length() >= 1, "must have created at least 1 node");
- assert(loadConLNodes._last->bottom_type()->isa_long(), "must be long");
+ assert(loadConLNodes._last->bottom_type()->is_long(), "must be long");
%}
enc_class enc_load_long_constP(iRegLdst dst, immP src, iRegLdst toc) %{
@@ -2828,7 +2828,7 @@ encode %{
nodes->push(m1);
nodes->push(m2);
- assert(m2->bottom_type()->isa_ptr(), "must be ptr");
+ assert(m2->bottom_type()->is_ptr(), "must be ptr");
} else {
loadConPNode *m2 = new loadConPNode();
@@ -2844,7 +2844,7 @@ encode %{
ra_->set_pair(m2->_idx, ra_->get_reg_second(this), ra_->get_reg_first(this));
nodes->push(m2);
- assert(m2->bottom_type()->isa_ptr(), "must be ptr");
+ assert(m2->bottom_type()->is_ptr(), "must be ptr");
}
%}
@@ -3022,7 +3022,7 @@ encode %{
if (loadConLNodes._last) nodes->push(loadConLNodes._last);
assert(nodes->length() >= 1, "must have created at least 1 node");
- assert(loadConLNodes._last->bottom_type()->isa_long(), "must be long");
+ assert(loadConLNodes._last->bottom_type()->is_long(), "must be long");
%}
enc_class postalloc_expand_load_replF_constant_vsx(vecX dst, immF src, iRegLdst toc, iRegLdst tmp) %{
@@ -6110,8 +6110,8 @@ instruct encodeP_narrow_oop_shift_0(iRegNdst dst, iRegPsrc src) %{
// shift != 0, base != 0
instruct decodeN(iRegPdst dst, iRegNsrc src, flagsRegCR0 cr0) %{
match(Set dst (DecodeN src));
- predicate((n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull &&
- n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant) &&
+ predicate((n->bottom_type()->as_oopptr()->ptr() != TypePtr::NotNull &&
+ n->bottom_type()->as_oopptr()->ptr() != TypePtr::Constant) &&
CompressedOops::shift() != 0 &&
CompressedOops::base() != nullptr);
ins_cost(4 * DEFAULT_COST); // Should be more expensive than decodeN_Disjoint_isel.
@@ -6145,8 +6145,8 @@ instruct decodeN_nullBase(iRegPdst dst, iRegNsrc src) %{
instruct decodeN_Disjoint_notNull(iRegPdst dst, iRegNsrc src) %{
match(Set dst (DecodeN src));
effect(TEMP_DEF dst);
- predicate((n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) &&
+ predicate((n->bottom_type()->as_oopptr()->ptr() == TypePtr::NotNull ||
+ n->bottom_type()->as_oopptr()->ptr() == TypePtr::Constant) &&
CompressedOops::base_disjoint());
ins_cost(DEFAULT_COST);
@@ -6162,8 +6162,8 @@ instruct decodeN_Disjoint_notNull(iRegPdst dst, iRegNsrc src) %{
instruct decodeN_Disjoint_isel(iRegPdst dst, iRegNsrc src, flagsReg crx) %{
match(Set dst (DecodeN src));
effect(TEMP_DEF dst, TEMP crx);
- predicate((n->bottom_type()->is_oopptr()->ptr() != TypePtr::NotNull &&
- n->bottom_type()->is_oopptr()->ptr() != TypePtr::Constant) &&
+ predicate((n->bottom_type()->as_oopptr()->ptr() != TypePtr::NotNull &&
+ n->bottom_type()->as_oopptr()->ptr() != TypePtr::Constant) &&
CompressedOops::base_disjoint());
ins_cost(3 * DEFAULT_COST); // Has a lower latency than decodeN because of a better ILP.
@@ -6180,8 +6180,8 @@ instruct decodeN_Disjoint_isel(iRegPdst dst, iRegNsrc src, flagsReg crx) %{
// src != 0, shift != 0, base != 0
instruct decodeN_notNull_addBase(iRegPdst dst, iRegNsrc src) %{
match(Set dst (DecodeN src));
- predicate((n->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) &&
+ predicate((n->bottom_type()->as_oopptr()->ptr() == TypePtr::NotNull ||
+ n->bottom_type()->as_oopptr()->ptr() == TypePtr::Constant) &&
CompressedOops::shift() != 0 &&
CompressedOops::base() != nullptr);
ins_cost(2 * DEFAULT_COST);
@@ -8080,7 +8080,7 @@ instruct lShiftL_regI_immGE32(iRegLdst dst, iRegIorL2I src1, uimmI6_ge32 src2) %
// Shift amounts >= 32 are handled by lShiftL_regI_immGE32.
instruct scaledPositiveI2L_lShiftL_convI2L_reg_imm6(iRegLdst dst, iRegIorL2I src1, uimmI5 src2) %{
match(Set dst (LShiftL (ConvI2L src1) src2));
- predicate(((ConvI2LNode*)(_kids[0]->_leaf))->type()->is_long()->is_positive_int());
+ predicate(((ConvI2LNode*)(_kids[0]->_leaf))->type()->as_long()->is_positive_int());
format %{ "SLDI $dst, i2l(positive_int($src1)), $src2" %}
size(4);
@@ -10774,7 +10774,7 @@ instruct indexOf_imm1_char_U(iRegIdst result, iRegPsrc haystack, iRegIorL2I hayc
ins_encode %{
immPOper *needleOper = (immPOper *)$needleImm;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr;
#ifdef VM_LITTLE_ENDIAN
@@ -10807,7 +10807,7 @@ instruct indexOf_imm1_char_L(iRegIdst result, iRegPsrc haystack, iRegIorL2I hayc
ins_encode %{
immPOper *needleOper = (immPOper *)$needleImm;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
@@ -10833,7 +10833,7 @@ instruct indexOf_imm1_char_UL(iRegIdst result, iRegPsrc haystack, iRegIorL2I hay
ins_encode %{
immPOper *needleOper = (immPOper *)$needleImm;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
@@ -10852,15 +10852,15 @@ instruct indexOf_imm1_U(iRegIdst result, iRegPsrc haystack, iRegIorL2I haycnt,
effect(USE_KILL needle, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(180);
format %{ "String IndexOf SCL1 $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $needle, $tmp1, $tmp2, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
guarantee(needle_values, "sanity");
jchar chr;
#ifdef VM_LITTLE_ENDIAN
@@ -10886,15 +10886,15 @@ instruct indexOf_imm1_L(iRegIdst result, iRegPsrc haystack, iRegIorL2I haycnt,
effect(USE_KILL needle, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(180);
format %{ "String IndexOf SCL1 $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $needle, $tmp1, $tmp2, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
guarantee(needle_values, "sanity");
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
@@ -10913,15 +10913,15 @@ instruct indexOf_imm1_UL(iRegIdst result, iRegPsrc haystack, iRegIorL2I haycnt,
effect(USE_KILL needle, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(180);
format %{ "String IndexOf SCL1 $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $needle, $tmp1, $tmp2, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
guarantee(needle_values, "sanity");
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
@@ -10979,15 +10979,15 @@ instruct indexOf_imm_U(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt,
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(250);
format %{ "String IndexOf SCL $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $tmp1, $tmp2, $tmp3, $tmp4, $tmp5, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
__ string_indexof($result$$Register,
$haystack$$Register, $haycnt$$Register,
@@ -11006,15 +11006,15 @@ instruct indexOf_imm_L(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt,
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(250);
format %{ "String IndexOf SCL $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $tmp1, $tmp2, $tmp3, $tmp4, $tmp5, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
__ string_indexof($result$$Register,
$haystack$$Register, $haycnt$$Register,
@@ -11033,15 +11033,15 @@ instruct indexOf_imm_UL(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt
TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr);
// Required for EA: check if it is still a type_array.
predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
- n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop() &&
+ n->in(3)->in(1)->bottom_type()->as_aryptr()->const_oop()->is_type_array());
ins_cost(250);
format %{ "String IndexOf SCL $haystack[0..$haycnt], $needle[0..$needlecntImm]"
" -> $result \t// KILL $haycnt, $tmp1, $tmp2, $tmp3, $tmp4, $tmp5, $cr0, $cr1" %}
ins_encode %{
Node *ndl = in(operand_index($needle)); // The node that defines needle.
- ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array();
+ ciTypeArray* needle_values = ndl->bottom_type()->as_aryptr()->const_oop()->as_type_array();
__ string_indexof($result$$Register,
$haystack$$Register, $haycnt$$Register,
diff --git a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
index 40489bd32cb..329e0c3d3b2 100644
--- a/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
+++ b/src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.cpp
@@ -716,7 +716,7 @@ void ShenandoahBarrierSetAssembler::compare_and_set_c2(const MachNode* node, Mac
void ShenandoahBarrierSetAssembler::get_and_set_c2(const MachNode* node, MacroAssembler* masm, Register preval,
Register newval, Register addr, Register tmp1, Register tmp2, Register tmp3, bool is_acquire) {
- const bool is_narrow = node->bottom_type()->isa_narrowoop();
+ const bool is_narrow = node->bottom_type()->is_narrowoop();
ShenandoahBarrierStubC2::load_store_pre(masm, node, Address(addr, 0), tmp1, tmp2, tmp3, is_narrow);
diff --git a/src/hotspot/cpu/riscv/riscv.ad b/src/hotspot/cpu/riscv/riscv.ad
index d4efa0d9867..583a5cd7828 100644
--- a/src/hotspot/cpu/riscv/riscv.ad
+++ b/src/hotspot/cpu/riscv/riscv.ad
@@ -1648,7 +1648,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
assert(src_lo != OptoReg::Bad && dst_lo != OptoReg::Bad, "must move at least 1 register");
- if (src_hi != OptoReg::Bad && !bottom_type()->isa_pvectmask()) {
+ if (src_hi != OptoReg::Bad && !bottom_type()->is_pvectmask()) {
assert((src_lo & 1) == 0 && src_lo + 1 == src_hi &&
(dst_lo & 1) == 0 && dst_lo + 1 == dst_hi,
"expected aligned-adjacent pairs");
@@ -1667,8 +1667,8 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
// address also needs t0 to materialize an offset outside the 12-bit range.
if (src_lo_rc == rc_stack && dst_lo_rc == rc_stack) {
int last_dst_offset = dst_offset;
- if (bottom_type()->isa_vect() != nullptr) {
- if (!bottom_type()->isa_pvectmask()) {
+ if (bottom_type()->is_vect()) {
+ if (!bottom_type()->is_pvectmask()) {
assert(ideal_reg() == Op_VecA, "Must be Op_VecA");
int vector_reg_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
last_dst_offset += vector_reg_size_in_bytes - 8;
@@ -1688,8 +1688,8 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
}
}
- if (bottom_type()->isa_vect() != nullptr && masm != nullptr) {
- if (!bottom_type()->isa_pvectmask()) {
+ if (bottom_type()->is_vect() && masm != nullptr) {
+ if (!bottom_type()->is_pvectmask()) {
assert(ideal_reg() == Op_VecA, "Must be Op_VecA");
int vector_reg_size_in_bytes = Matcher::scalable_vector_reg_size(T_BYTE);
if (src_lo_rc == rc_stack && dst_lo_rc == rc_stack) {
@@ -1812,11 +1812,11 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
} else {
st->print("%s", Matcher::regName[dst_lo]);
}
- if (bottom_type()->isa_vect() && !bottom_type()->isa_pvectmask()) {
+ if (bottom_type()->is_vect() && !bottom_type()->is_pvectmask()) {
assert(ideal_reg() == Op_VecA, "Must be Op_VecA");
int vsize = Matcher::scalable_vector_reg_size(T_BYTE) * 8;
st->print("\t# vector spill size = %d", vsize);
- } else if (bottom_type()->isa_pvectmask()) {
+ } else if (bottom_type()->is_pvectmask()) {
assert(ideal_reg() == Op_RegVectMask, "Must be Op_RegVectMask");
assert(Matcher::supports_scalable_vector(), "bad register type for spill");
int vsize = Matcher::scalable_predicate_reg_slots() * 32;
@@ -9612,8 +9612,8 @@ instruct encodeHeapOop_not_null(iRegNNoSp dst, iRegP src) %{
%}
instruct decodeHeapOop(iRegPNoSp dst, iRegN src) %{
- predicate(n->bottom_type()->is_ptr()->ptr() != TypePtr::NotNull &&
- n->bottom_type()->is_ptr()->ptr() != TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() != TypePtr::NotNull &&
+ n->bottom_type()->as_ptr()->ptr() != TypePtr::Constant);
match(Set dst (DecodeN src));
ins_cost(ALU_COST);
@@ -9627,8 +9627,8 @@ instruct decodeHeapOop(iRegPNoSp dst, iRegN src) %{
%}
instruct decodeHeapOop_not_null(iRegPNoSp dst, iRegN src) %{
- predicate(n->bottom_type()->is_ptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_ptr()->ptr() == TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() == TypePtr::NotNull ||
+ n->bottom_type()->as_ptr()->ptr() == TypePtr::Constant);
match(Set dst (DecodeN src));
ins_cost(ALU_COST);
diff --git a/src/hotspot/cpu/riscv/riscv_v.ad b/src/hotspot/cpu/riscv/riscv_v.ad
index 8cfea2af528..b576053239d 100644
--- a/src/hotspot/cpu/riscv/riscv_v.ad
+++ b/src/hotspot/cpu/riscv/riscv_v.ad
@@ -272,7 +272,7 @@ source %{
bool Matcher::mask_op_prefers_predicate(int opcode, const TypeVect* vt) {
// Prefer predicate if the mask type is "TypePVectMask".
- return vt->isa_pvectmask() != nullptr;
+ return vt->is_pvectmask();
}
%}
diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad
index bd010470840..2db1b6f90fe 100644
--- a/src/hotspot/cpu/s390/s390.ad
+++ b/src/hotspot/cpu/s390/s390.ad
@@ -1347,7 +1347,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler *masm, PhaseRegAlloc *r
const char *mnemo = nullptr;
unsigned long opc = 0;
- if (bottom_type()->isa_vect() != nullptr && ideal_reg() == Op_VecX) {
+ if (bottom_type()->is_vect() && ideal_reg() == Op_VecX) {
if (src_lo_rc == rc_stack && dst_lo_rc == rc_stack) {
if (masm != nullptr) {
__ z_mvc(Address(Z_SP, 0, dst_offset), Address(Z_SP, 0, src_offset), 16);
@@ -4978,7 +4978,7 @@ instruct decodeN_NN(iRegP dst, iRegN src, flagsReg cr) %{
match(Set dst (DecodeN src));
effect(KILL cr);
predicate((n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) &&
+ n->bottom_type()->as_oopptr()->ptr() == TypePtr::Constant) &&
(CompressedOops::base()== nullptr || !ExpandLoadingBaseDecode_NN));
ins_cost(MEMORY_REF_COST+2 * DEFAULT_COST);
// TODO: s390 port size(VARIABLE_SIZE);
@@ -5045,7 +5045,7 @@ instruct decodeN_Ex(iRegP dst, iRegN src, flagsReg cr) %{
instruct decodeN_NN_Ex(iRegP dst, iRegN src, flagsReg cr) %{
match(Set dst (DecodeN src));
predicate((n->bottom_type()->make_ptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_oopptr()->ptr() == TypePtr::Constant) &&
+ n->bottom_type()->as_oopptr()->ptr() == TypePtr::Constant) &&
CompressedOops::base() != nullptr && ExpandLoadingBaseDecode_NN);
ins_cost(MEMORY_REF_COST+2 * DEFAULT_COST);
// TODO: s390 port size(VARIABLE_SIZE);
@@ -10519,7 +10519,7 @@ instruct indexOf_imm1_U(iRegP haystack, iRegI haycnt, immP needle, immI_1 needle
format %{ "String IndexOf UL [0..$haycnt]($haystack), [0]($needle) -> $result" %}
ins_encode %{
immPOper *needleOper = (immPOper *)$needle;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr;
#ifdef VM_LITTLE_ENDIAN
@@ -10544,7 +10544,7 @@ instruct indexOf_imm1_L(iRegP haystack, iRegI haycnt, immP needle, immI_1 needle
format %{ "String IndexOf L [0..$haycnt]($haystack), [0]($needle) -> $result" %}
ins_encode %{
immPOper *needleOper = (immPOper *)$needle;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
@@ -10563,7 +10563,7 @@ instruct indexOf_imm1_UL(iRegP haystack, iRegI haycnt, immP needle, immI_1 needl
format %{ "String IndexOf UL [0..$haycnt]($haystack), [0]($needle) -> $result" %}
ins_encode %{
immPOper *needleOper = (immPOper *)$needle;
- const TypeOopPtr *t = needleOper->type()->isa_oopptr();
+ const TypeOopPtr* t = needleOper->type()->as_oopptr();
ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char *
jchar chr = (jchar)needle_values->element_value(0).as_byte();
__ string_indexof_char($result$$Register,
diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad
index 652280b2c95..5d922782368 100644
--- a/src/hotspot/cpu/x86/x86.ad
+++ b/src/hotspot/cpu/x86/x86.ad
@@ -1477,7 +1477,7 @@ source %{
bool castLL_is_imm32(const Node* n) {
assert(n->is_CastLL(), "must be a CastLL");
- const TypeLong* t = n->bottom_type()->is_long();
+ const TypeLong* t = n->bottom_type()->as_long();
return (t->_lo == min_jlong || Assembler::is_simm32(t->_lo)) && (t->_hi == max_jlong || Assembler::is_simm32(t->_hi));
}
@@ -2125,7 +2125,7 @@ uint MachSpillCopyNode::implementation(C2_MacroAssembler* masm,
// Self copy, no move
return 0;
}
- if (bottom_type()->isa_vect() != nullptr && bottom_type()->isa_pvectmask() == nullptr) {
+ if (bottom_type()->is_vect() && !bottom_type()->is_pvectmask()) {
uint ireg = ideal_reg();
assert((src_first_rc != rc_int && dst_first_rc != rc_int), "sanity");
assert((ireg == Op_VecS || ireg == Op_VecD || ireg == Op_VecX || ireg == Op_VecY || ireg == Op_VecZ ), "sanity");
@@ -3806,7 +3806,7 @@ bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen
bool Matcher::mask_op_prefers_predicate(int opcode, const TypeVect* vt) {
// Prefer predicate if the mask type is "TypePVectMask".
- return vt->isa_pvectmask() != nullptr;
+ return vt->is_pvectmask();
}
MachOper* Matcher::pd_specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg, bool is_temp) {
@@ -3958,7 +3958,7 @@ uint Matcher::vector_ideal_reg(int size) {
static bool clone_conv(Node* conv, Matcher* matcher, Matcher::MStack& mstack, VectorSet& address_visited) {
if (conv->Opcode() == Op_ConvI2L &&
- conv->as_Type()->type()->is_long()->_lo >= 0 &&
+ conv->as_Type()->type()->as_long()->_lo >= 0 &&
// Are there other uses besides address expressions?
!matcher->is_visited(conv)) {
address_visited.set(conv->_idx); // Flag as address_visited
@@ -4996,7 +4996,7 @@ operand immN0() %{
operand immP31()
%{
- predicate(n->as_Type()->type()->is_ptr()->reloc() == relocInfo::none
+ predicate(n->as_Type()->type()->as_ptr()->reloc() == relocInfo::none
&& (n->get_ptr() >> 31) == 0);
match(ConP);
@@ -5771,7 +5771,7 @@ operand indIndexScale(any_RegP reg, rRegL lreg, immI2 scale)
operand indPosIndexScale(any_RegP reg, rRegI idx, immI2 scale)
%{
constraint(ALLOC_IN_RC(ptr_reg));
- predicate(n->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
+ predicate(n->in(3)->in(1)->as_Type()->type()->as_long()->_lo >= 0);
match(AddP reg (LShiftL (ConvI2L idx) scale));
op_cost(10);
@@ -5804,7 +5804,7 @@ operand indIndexScaleOffset(any_RegP reg, immL32 off, rRegL lreg, immI2 scale)
operand indPosIndexOffset(any_RegP reg, immL32 off, rRegI idx)
%{
constraint(ALLOC_IN_RC(ptr_reg));
- predicate(n->in(2)->in(3)->as_Type()->type()->is_long()->_lo >= 0);
+ predicate(n->in(2)->in(3)->as_Type()->type()->as_long()->_lo >= 0);
match(AddP (AddP reg (ConvI2L idx)) off);
op_cost(10);
@@ -5821,7 +5821,7 @@ operand indPosIndexOffset(any_RegP reg, immL32 off, rRegI idx)
operand indPosIndexScaleOffset(any_RegP reg, immL32 off, rRegI idx, immI2 scale)
%{
constraint(ALLOC_IN_RC(ptr_reg));
- predicate(n->in(2)->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
+ predicate(n->in(2)->in(3)->in(1)->as_Type()->type()->as_long()->_lo >= 0);
match(AddP (AddP reg (LShiftL (ConvI2L idx) scale)) off);
op_cost(10);
@@ -5988,7 +5988,7 @@ operand indIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegL lreg, immI2 scale
operand indPosIndexOffsetNarrow(rRegN reg, immL32 off, rRegI idx)
%{
constraint(ALLOC_IN_RC(ptr_reg));
- predicate(CompressedOops::shift() == 0 && n->in(2)->in(3)->as_Type()->type()->is_long()->_lo >= 0);
+ predicate(CompressedOops::shift() == 0 && n->in(2)->in(3)->as_Type()->type()->as_long()->_lo >= 0);
match(AddP (AddP (DecodeN reg) (ConvI2L idx)) off);
op_cost(10);
@@ -6005,7 +6005,7 @@ operand indPosIndexOffsetNarrow(rRegN reg, immL32 off, rRegI idx)
operand indPosIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegI idx, immI2 scale)
%{
constraint(ALLOC_IN_RC(ptr_reg));
- predicate(CompressedOops::shift() == 0 && n->in(2)->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
+ predicate(CompressedOops::shift() == 0 && n->in(2)->in(3)->in(1)->as_Type()->type()->as_long()->_lo >= 0);
match(AddP (AddP (DecodeN reg) (LShiftL (ConvI2L idx) scale)) off);
op_cost(10);
@@ -9091,8 +9091,8 @@ instruct encodeHeapOop_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
%}
instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{
- predicate(n->bottom_type()->is_ptr()->ptr() != TypePtr::NotNull &&
- n->bottom_type()->is_ptr()->ptr() != TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() != TypePtr::NotNull &&
+ n->bottom_type()->as_ptr()->ptr() != TypePtr::Constant);
match(Set dst (DecodeN src));
effect(KILL cr);
format %{ "decode_heap_oop $dst,$src" %}
@@ -9108,8 +9108,8 @@ instruct decodeHeapOop(rRegP dst, rRegN src, rFlagsReg cr) %{
%}
instruct decodeHeapOop_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
- predicate(n->bottom_type()->is_ptr()->ptr() == TypePtr::NotNull ||
- n->bottom_type()->is_ptr()->ptr() == TypePtr::Constant);
+ predicate(n->bottom_type()->as_ptr()->ptr() == TypePtr::NotNull ||
+ n->bottom_type()->as_ptr()->ptr() == TypePtr::Constant);
match(Set dst (DecodeN src));
effect(KILL cr);
format %{ "decode_heap_oop_not_null $dst,$src" %}
@@ -10490,7 +10490,7 @@ instruct castII_checked(rRegI dst, rFlagsReg cr)
effect(KILL cr);
format %{ "# cast_checked_II $dst" %}
ins_encode %{
- __ verify_int_in_range(_idx, bottom_type()->is_int(), $dst$$Register);
+ __ verify_int_in_range(_idx, bottom_type()->as_int(), $dst$$Register);
%}
ins_pipe(pipe_slow);
%}
@@ -10515,7 +10515,7 @@ instruct castLL_checked_L32(rRegL dst, rFlagsReg cr)
effect(KILL cr);
format %{ "# cast_checked_LL $dst" %}
ins_encode %{
- __ verify_long_in_range(_idx, bottom_type()->is_long(), $dst$$Register, noreg);
+ __ verify_long_in_range(_idx, bottom_type()->as_long(), $dst$$Register, noreg);
%}
ins_pipe(pipe_slow);
%}
@@ -10528,7 +10528,7 @@ instruct castLL_checked(rRegL dst, rRegL tmp, rFlagsReg cr)
effect(KILL cr, TEMP tmp);
format %{ "# cast_checked_LL $dst\tusing $tmp as TEMP" %}
ins_encode %{
- __ verify_long_in_range(_idx, bottom_type()->is_long(), $dst$$Register, $tmp$$Register);
+ __ verify_long_in_range(_idx, bottom_type()->as_long(), $dst$$Register, $tmp$$Register);
%}
ins_pipe(pipe_slow);
%}
@@ -12634,7 +12634,7 @@ instruct rorL_rReg_Var_ndd(rRegL dst, rRegL src, rcx_RegI shift, rFlagsReg cr)
//----------------------------- CompressBits/ExpandBits ------------------------
instruct compressBitsL_reg(rRegL dst, rRegL src, rRegL mask) %{
- predicate(n->bottom_type()->isa_long());
+ predicate(n->bottom_type()->is_long());
match(Set dst (CompressBits src mask));
format %{ "pextq $dst, $src, $mask\t! parallel bit extract" %}
ins_encode %{
@@ -12644,7 +12644,7 @@ instruct compressBitsL_reg(rRegL dst, rRegL src, rRegL mask) %{
%}
instruct expandBitsL_reg(rRegL dst, rRegL src, rRegL mask) %{
- predicate(n->bottom_type()->isa_long());
+ predicate(n->bottom_type()->is_long());
match(Set dst (ExpandBits src mask));
format %{ "pdepq $dst, $src, $mask\t! parallel bit deposit" %}
ins_encode %{
@@ -12654,7 +12654,7 @@ instruct expandBitsL_reg(rRegL dst, rRegL src, rRegL mask) %{
%}
instruct compressBitsL_mem(rRegL dst, rRegL src, memory mask) %{
- predicate(n->bottom_type()->isa_long());
+ predicate(n->bottom_type()->is_long());
match(Set dst (CompressBits src (LoadL mask)));
format %{ "pextq $dst, $src, $mask\t! parallel bit extract" %}
ins_encode %{
@@ -12664,7 +12664,7 @@ instruct compressBitsL_mem(rRegL dst, rRegL src, memory mask) %{
%}
instruct expandBitsL_mem(rRegL dst, rRegL src, memory mask) %{
- predicate(n->bottom_type()->isa_long());
+ predicate(n->bottom_type()->is_long());
match(Set dst (ExpandBits src (LoadL mask)));
format %{ "pdepq $dst, $src, $mask\t! parallel bit deposit" %}
ins_encode %{
@@ -13179,7 +13179,7 @@ instruct xorI_rReg_im1_ndd(rRegI dst, rRegI src, immI_M1 imm)
instruct xorI_rReg_imm(rRegI dst, immI src, rFlagsReg cr)
%{
// Strict predicate check to make selection of xorI_rReg_im1 cost agnostic if immI src is -1.
- predicate(!UseAPX && n->in(2)->bottom_type()->is_int()->get_con() != -1);
+ predicate(!UseAPX && n->in(2)->bottom_type()->as_int()->get_con() != -1);
match(Set dst (XorI dst src));
effect(KILL cr);
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag);
@@ -13194,7 +13194,7 @@ instruct xorI_rReg_imm(rRegI dst, immI src, rFlagsReg cr)
instruct xorI_rReg_rReg_imm_ndd(rRegI dst, rRegI src1, immI src2, rFlagsReg cr)
%{
// Strict predicate check to make selection of xorI_rReg_im1_ndd cost agnostic if immI src2 is -1.
- predicate(UseAPX && n->in(2)->bottom_type()->is_int()->get_con() != -1);
+ predicate(UseAPX && n->in(2)->bottom_type()->as_int()->get_con() != -1);
match(Set dst (XorI src1 src2));
effect(KILL cr);
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
@@ -13766,7 +13766,7 @@ instruct xorL_rReg_im1_ndd(rRegL dst,rRegL src, immL_M1 imm)
instruct xorL_rReg_imm(rRegL dst, immL32 src, rFlagsReg cr)
%{
// Strict predicate check to make selection of xorL_rReg_im1 cost agnostic if immL32 src is -1.
- predicate(!UseAPX && n->in(2)->bottom_type()->is_long()->get_con() != -1L);
+ predicate(!UseAPX && n->in(2)->bottom_type()->as_long()->get_con() != -1L);
match(Set dst (XorL dst src));
effect(KILL cr);
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag);
@@ -13781,7 +13781,7 @@ instruct xorL_rReg_imm(rRegL dst, immL32 src, rFlagsReg cr)
instruct xorL_rReg_rReg_imm(rRegL dst, rRegL src1, immL32 src2, rFlagsReg cr)
%{
// Strict predicate check to make selection of xorL_rReg_im1_ndd cost agnostic if immL32 src2 is -1.
- predicate(UseAPX && n->in(2)->bottom_type()->is_long()->get_con() != -1L);
+ predicate(UseAPX && n->in(2)->bottom_type()->as_long()->get_con() != -1L);
match(Set dst (XorL src1 src2));
effect(KILL cr);
flag(PD::Flag_sets_sign_flag, PD::Flag_sets_zero_flag, PD::Flag_sets_parity_flag, PD::Flag_clears_overflow_flag, PD::Flag_clears_carry_flag, PD::Flag_ndd_demotable_opr1);
@@ -16137,7 +16137,7 @@ instruct compP_rReg_mem(rFlagsRegU cr, rRegP op1, memory op2)
// and raw pointers have no anti-dependencies.
instruct compP_mem_rReg(rFlagsRegU cr, rRegP op1, memory op2)
%{
- predicate(n->in(2)->in(2)->bottom_type()->isa_rawptr() != nullptr &&
+ predicate(n->in(2)->in(2)->bottom_type()->is_rawptr() &&
n->in(2)->as_Load()->barrier_data() == 0);
match(Set cr (CmpP op1 (LoadP op2)));
@@ -18032,7 +18032,7 @@ instruct vconvHF2F_reg_reg(vec dst, vec src) %{
// ---------------------------------------- VectorReinterpret ------------------------------------
instruct reinterpret_mask(kReg dst) %{
- predicate(n->bottom_type()->isa_pvectmask() &&
+ predicate(n->bottom_type()->is_pvectmask() &&
Matcher::vector_length(n) == Matcher::vector_length(n->in(1))); // dst == src
match(Set dst (VectorReinterpret dst));
ins_cost(125);
@@ -18045,10 +18045,10 @@ instruct reinterpret_mask(kReg dst) %{
instruct reinterpret_mask_W2B(kReg dst, kReg src, vec xtmp) %{
predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) &&
- n->bottom_type()->isa_pvectmask() &&
- n->in(1)->bottom_type()->isa_pvectmask() &&
- n->in(1)->bottom_type()->is_pvectmask()->element_basic_type() == T_SHORT &&
- n->bottom_type()->is_pvectmask()->element_basic_type() == T_BYTE); // dst == src
+ n->bottom_type()->is_pvectmask() &&
+ n->in(1)->bottom_type()->is_pvectmask() &&
+ n->in(1)->bottom_type()->as_pvectmask()->element_basic_type() == T_SHORT &&
+ n->bottom_type()->as_pvectmask()->element_basic_type() == T_BYTE); // dst == src
match(Set dst (VectorReinterpret src));
effect(TEMP xtmp);
format %{ "vector_mask_reinterpret_W2B $dst $src\t!" %}
@@ -18065,11 +18065,11 @@ instruct reinterpret_mask_W2B(kReg dst, kReg src, vec xtmp) %{
instruct reinterpret_mask_D2B(kReg dst, kReg src, vec xtmp) %{
predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) &&
- n->bottom_type()->isa_pvectmask() &&
- n->in(1)->bottom_type()->isa_pvectmask() &&
- (n->in(1)->bottom_type()->is_pvectmask()->element_basic_type() == T_INT ||
- n->in(1)->bottom_type()->is_pvectmask()->element_basic_type() == T_FLOAT) &&
- n->bottom_type()->is_pvectmask()->element_basic_type() == T_BYTE); // dst == src
+ n->bottom_type()->is_pvectmask() &&
+ n->in(1)->bottom_type()->is_pvectmask() &&
+ (n->in(1)->bottom_type()->as_pvectmask()->element_basic_type() == T_INT ||
+ n->in(1)->bottom_type()->as_pvectmask()->element_basic_type() == T_FLOAT) &&
+ n->bottom_type()->as_pvectmask()->element_basic_type() == T_BYTE); // dst == src
match(Set dst (VectorReinterpret src));
effect(TEMP xtmp);
format %{ "vector_mask_reinterpret_D2B $dst $src\t!" %}
@@ -18086,11 +18086,11 @@ instruct reinterpret_mask_D2B(kReg dst, kReg src, vec xtmp) %{
instruct reinterpret_mask_Q2B(kReg dst, kReg src, vec xtmp) %{
predicate(UseAVX > 2 && Matcher::vector_length(n) != Matcher::vector_length(n->in(1)) &&
- n->bottom_type()->isa_pvectmask() &&
- n->in(1)->bottom_type()->isa_pvectmask() &&
- (n->in(1)->bottom_type()->is_pvectmask()->element_basic_type() == T_LONG ||
- n->in(1)->bottom_type()->is_pvectmask()->element_basic_type() == T_DOUBLE) &&
- n->bottom_type()->is_pvectmask()->element_basic_type() == T_BYTE); // dst == src
+ n->bottom_type()->is_pvectmask() &&
+ n->in(1)->bottom_type()->is_pvectmask() &&
+ (n->in(1)->bottom_type()->as_pvectmask()->element_basic_type() == T_LONG ||
+ n->in(1)->bottom_type()->as_pvectmask()->element_basic_type() == T_DOUBLE) &&
+ n->bottom_type()->as_pvectmask()->element_basic_type() == T_BYTE); // dst == src
match(Set dst (VectorReinterpret src));
effect(TEMP xtmp);
format %{ "vector_mask_reinterpret_Q2B $dst $src\t!" %}
@@ -18106,7 +18106,7 @@ instruct reinterpret_mask_Q2B(kReg dst, kReg src, vec xtmp) %{
%}
instruct reinterpret(vec dst) %{
- predicate(!n->bottom_type()->isa_pvectmask() &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n) == Matcher::vector_length_in_bytes(n->in(1))); // dst == src
match(Set dst (VectorReinterpret dst));
ins_cost(125);
@@ -18142,7 +18142,7 @@ instruct reinterpret_expand(vec dst, vec src) %{
instruct vreinterpret_expand4(legVec dst, vec src) %{
predicate(UseAVX > 0 &&
- !n->bottom_type()->isa_pvectmask() &&
+ !n->bottom_type()->is_pvectmask() &&
(Matcher::vector_length_in_bytes(n->in(1)) == 4) && // src
(Matcher::vector_length_in_bytes(n->in(1)) < Matcher::vector_length_in_bytes(n))); // src < dst
match(Set dst (VectorReinterpret src));
@@ -18157,7 +18157,7 @@ instruct vreinterpret_expand4(legVec dst, vec src) %{
instruct vreinterpret_expand(legVec dst, vec src) %{
predicate(UseAVX > 0 &&
- !n->bottom_type()->isa_pvectmask() &&
+ !n->bottom_type()->is_pvectmask() &&
(Matcher::vector_length_in_bytes(n->in(1)) > 4) && // src
(Matcher::vector_length_in_bytes(n->in(1)) < Matcher::vector_length_in_bytes(n))); // src < dst
match(Set dst (VectorReinterpret src));
@@ -18175,7 +18175,7 @@ instruct vreinterpret_expand(legVec dst, vec src) %{
%}
instruct reinterpret_shrink(vec dst, legVec src) %{
- predicate(!n->bottom_type()->isa_pvectmask() &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n->in(1)) > Matcher::vector_length_in_bytes(n)); // src > dst
match(Set dst (VectorReinterpret src));
ins_cost(125);
@@ -20888,7 +20888,7 @@ instruct copySignD_imm(regD dst, regD src, regD tmp1, rRegL tmp2, immD zero) %{
//----------------------------- CompressBits/ExpandBits ------------------------
instruct compressBitsI_reg(rRegI dst, rRegI src, rRegI mask) %{
- predicate(n->bottom_type()->isa_int());
+ predicate(n->bottom_type()->is_int());
match(Set dst (CompressBits src mask));
format %{ "pextl $dst, $src, $mask\t! parallel bit extract" %}
ins_encode %{
@@ -20898,7 +20898,7 @@ instruct compressBitsI_reg(rRegI dst, rRegI src, rRegI mask) %{
%}
instruct expandBitsI_reg(rRegI dst, rRegI src, rRegI mask) %{
- predicate(n->bottom_type()->isa_int());
+ predicate(n->bottom_type()->is_int());
match(Set dst (ExpandBits src mask));
format %{ "pdepl $dst, $src, $mask\t! parallel bit deposit" %}
ins_encode %{
@@ -20908,7 +20908,7 @@ instruct expandBitsI_reg(rRegI dst, rRegI src, rRegI mask) %{
%}
instruct compressBitsI_mem(rRegI dst, rRegI src, memory mask) %{
- predicate(n->bottom_type()->isa_int());
+ predicate(n->bottom_type()->is_int());
match(Set dst (CompressBits src (LoadI mask)));
format %{ "pextl $dst, $src, $mask\t! parallel bit extract" %}
ins_encode %{
@@ -20918,7 +20918,7 @@ instruct compressBitsI_mem(rRegI dst, rRegI src, memory mask) %{
%}
instruct expandBitsI_mem(rRegI dst, rRegI src, memory mask) %{
- predicate(n->bottom_type()->isa_int());
+ predicate(n->bottom_type()->is_int());
match(Set dst (ExpandBits src (LoadI mask)));
format %{ "pdepl $dst, $src, $mask\t! parallel bit deposit" %}
ins_encode %{
@@ -22194,7 +22194,7 @@ instruct vround_reg_evex(vec dst, vec src, rRegP tmp, vec xtmp1, vec xtmp2, kReg
// --------------------------------- VectorMaskCmp --------------------------------------
instruct vcmpFD(legVec dst, legVec src1, legVec src2, immI8 cond) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 8 && // src1
Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1
is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE
@@ -22214,7 +22214,7 @@ instruct vcmpFD(legVec dst, legVec src1, legVec src2, immI8 cond) %{
instruct evcmpFD64(vec dst, vec src1, vec src2, immI8 cond, kReg ktmp) %{
predicate(Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 64 && // src1
- n->bottom_type()->isa_pvectmask() == nullptr &&
+ !n->bottom_type()->is_pvectmask() &&
is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE
match(Set dst (VectorMaskCmp (Binary src1 src2) cond));
effect(TEMP ktmp);
@@ -22235,12 +22235,12 @@ instruct evcmpFD64(vec dst, vec src1, vec src2, immI8 cond, kReg ktmp) %{
%}
instruct evcmpFD(kReg dst, vec src1, vec src2, immI8 cond) %{
- predicate(n->bottom_type()->isa_pvectmask() &&
+ predicate(n->bottom_type()->is_pvectmask() &&
is_floating_point_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1 T_FLOAT, T_DOUBLE
match(Set dst (VectorMaskCmp (Binary src1 src2) cond));
format %{ "vector_compare_evex $dst,$src1,$src2,$cond\t!" %}
ins_encode %{
- assert(bottom_type()->isa_pvectmask(), "TypePVectMask expected");
+ assert(bottom_type()->is_pvectmask(), "TypePVectMask expected");
int vlen_enc = vector_length_encoding(this, $src1);
Assembler::ComparisonPredicateFP cmp = booltest_pred_to_comparison_pred_fp($cond$$constant);
KRegister mask = k0; // The comparison itself is not being masked.
@@ -22254,7 +22254,7 @@ instruct evcmpFD(kReg dst, vec src1, vec src2, immI8 cond) %{
%}
instruct vcmp_direct(legVec dst, legVec src1, legVec src2, immI8 cond) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
!Matcher::is_unsigned_booltest_pred(n->in(2)->get_int()) &&
Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && // src1
Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1
@@ -22274,7 +22274,7 @@ instruct vcmp_direct(legVec dst, legVec src1, legVec src2, immI8 cond) %{
%}
instruct vcmp_negate(legVec dst, legVec src1, legVec src2, immI8 cond, legVec xtmp) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
!Matcher::is_unsigned_booltest_pred(n->in(2)->get_int()) &&
Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && // src1
Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1
@@ -22295,7 +22295,7 @@ instruct vcmp_negate(legVec dst, legVec src1, legVec src2, immI8 cond, legVec xt
%}
instruct vcmpu(legVec dst, legVec src1, legVec src2, immI8 cond, legVec xtmp) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr &&
+ predicate(!n->bottom_type()->is_pvectmask() &&
Matcher::is_unsigned_booltest_pred(n->in(2)->get_int()) &&
Matcher::vector_length_in_bytes(n->in(1)->in(1)) >= 4 && // src1
Matcher::vector_length_in_bytes(n->in(1)->in(1)) <= 32 && // src1
@@ -22322,7 +22322,7 @@ instruct vcmpu(legVec dst, legVec src1, legVec src2, immI8 cond, legVec xtmp) %{
%}
instruct vcmp64(vec dst, vec src1, vec src2, immI8 cond, kReg ktmp) %{
- predicate((n->bottom_type()->isa_pvectmask() == nullptr &&
+ predicate((!n->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n->in(1)->in(1)) == 64) && // src1
is_integral_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1
match(Set dst (VectorMaskCmp (Binary src1 src2) cond));
@@ -22357,13 +22357,13 @@ instruct vcmp64(vec dst, vec src1, vec src2, immI8 cond, kReg ktmp) %{
instruct evcmp(kReg dst, vec src1, vec src2, immI8 cond) %{
- predicate(n->bottom_type()->isa_pvectmask() &&
+ predicate(n->bottom_type()->is_pvectmask() &&
is_integral_type(Matcher::vector_element_basic_type(n->in(1)->in(1)))); // src1
match(Set dst (VectorMaskCmp (Binary src1 src2) cond));
format %{ "vector_compared_evex $dst,$src1,$src2,$cond\t!" %}
ins_encode %{
assert(UseAVX > 2, "required");
- assert(bottom_type()->isa_pvectmask(), "TypePVectMask expected");
+ assert(bottom_type()->is_pvectmask(), "TypePVectMask expected");
int vlen_enc = vector_length_encoding(this, $src1);
Assembler::ComparisonPredicate cmp = booltest_pred_to_comparison_pred($cond$$constant);
@@ -22532,7 +22532,7 @@ instruct blendvp(vec dst, vec src, vec mask, rxmm0 tmp) %{
instruct vblendvpI(legVec dst, legVec src1, legVec src2, legVec mask) %{
predicate(UseAVX > 0 && !EnableX86ECoreOpts &&
- n->in(2)->bottom_type()->isa_pvectmask() == nullptr &&
+ !n->in(2)->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n) <= 32 &&
is_integral_type(Matcher::vector_element_basic_type(n)));
match(Set dst (VectorBlend (Binary src1 src2) mask));
@@ -22546,7 +22546,7 @@ instruct vblendvpI(legVec dst, legVec src1, legVec src2, legVec mask) %{
instruct vblendvpFD(legVec dst, legVec src1, legVec src2, legVec mask) %{
predicate(UseAVX > 0 && !EnableX86ECoreOpts &&
- n->in(2)->bottom_type()->isa_pvectmask() == nullptr &&
+ !n->in(2)->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n) <= 32 &&
!is_integral_type(Matcher::vector_element_basic_type(n)));
match(Set dst (VectorBlend (Binary src1 src2) mask));
@@ -22560,7 +22560,7 @@ instruct vblendvpFD(legVec dst, legVec src1, legVec src2, legVec mask) %{
instruct vblendvp(legVec dst, legVec src1, legVec src2, legVec mask, legVec vtmp) %{
predicate(UseAVX > 0 && EnableX86ECoreOpts &&
- n->in(2)->bottom_type()->isa_pvectmask() == nullptr &&
+ !n->in(2)->bottom_type()->is_pvectmask() &&
Matcher::vector_length_in_bytes(n) <= 32);
match(Set dst (VectorBlend (Binary src1 src2) mask));
format %{ "vector_blend $dst,$src1,$src2,$mask\t! using $vtmp as TEMP" %}
@@ -22576,7 +22576,7 @@ instruct vblendvp(legVec dst, legVec src1, legVec src2, legVec mask, legVec vtmp
instruct evblendvp64(vec dst, vec src1, vec src2, vec mask, kReg ktmp) %{
predicate(Matcher::vector_length_in_bytes(n) == 64 &&
- n->in(2)->bottom_type()->isa_pvectmask() == nullptr);
+ !n->in(2)->bottom_type()->is_pvectmask());
match(Set dst (VectorBlend (Binary src1 src2) mask));
format %{ "vector_blend $dst,$src1,$src2,$mask\t! using k2 as TEMP" %}
effect(TEMP ktmp);
@@ -22591,7 +22591,7 @@ instruct evblendvp64(vec dst, vec src1, vec src2, vec mask, kReg ktmp) %{
instruct evblendvp64_masked(vec dst, vec src1, vec src2, kReg mask) %{
- predicate(n->in(2)->bottom_type()->isa_pvectmask() &&
+ predicate(n->in(2)->bottom_type()->is_pvectmask() &&
(!is_subword_type(Matcher::vector_element_basic_type(n)) ||
VM_Version::supports_avx512bw()));
match(Set dst (VectorBlend (Binary src1 src2) mask));
@@ -22790,7 +22790,7 @@ instruct ktest_ge8(rFlagsRegU cr, kReg src1, kReg src2) %{
//------------------------------------- LoadMask --------------------------------------------
instruct loadMask(legVec dst, legVec src) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr && !VM_Version::supports_avx512vlbw());
+ predicate(!n->bottom_type()->is_pvectmask() && !VM_Version::supports_avx512vlbw());
match(Set dst (VectorLoadMask src));
effect(TEMP dst);
format %{ "vector_loadmask_byte $dst, $src\n\t" %}
@@ -22803,7 +22803,7 @@ instruct loadMask(legVec dst, legVec src) %{
%}
instruct loadMask64(kReg dst, vec src, vec xtmp) %{
- predicate(n->bottom_type()->isa_pvectmask() && !VM_Version::supports_avx512vlbw());
+ predicate(n->bottom_type()->is_pvectmask() && !VM_Version::supports_avx512vlbw());
match(Set dst (VectorLoadMask src));
effect(TEMP xtmp);
format %{ "vector_loadmask_64byte $dst, $src\t! using $xtmp as TEMP" %}
@@ -22815,7 +22815,7 @@ instruct loadMask64(kReg dst, vec src, vec xtmp) %{
%}
instruct loadMask_evex(kReg dst, vec src, vec xtmp) %{
- predicate(n->bottom_type()->isa_pvectmask() && VM_Version::supports_avx512vlbw());
+ predicate(n->bottom_type()->is_pvectmask() && VM_Version::supports_avx512vlbw());
match(Set dst (VectorLoadMask src));
effect(TEMP xtmp);
format %{ "vector_loadmask_byte $dst, $src\t! using $xtmp as TEMP" %}
@@ -22830,7 +22830,7 @@ instruct loadMask_evex(kReg dst, vec src, vec xtmp) %{
//------------------------------------- StoreMask --------------------------------------------
instruct vstoreMask1B(vec dst, vec src, immI_1 size) %{
- predicate(Matcher::vector_length(n) < 64 && n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(Matcher::vector_length(n) < 64 && !n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorStoreMask src size));
format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %}
ins_encode %{
@@ -22848,7 +22848,7 @@ instruct vstoreMask1B(vec dst, vec src, immI_1 size) %{
%}
instruct vstoreMask2B(vec dst, vec src, vec xtmp, immI_2 size) %{
- predicate(Matcher::vector_length(n) <= 16 && n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(Matcher::vector_length(n) <= 16 && !n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorStoreMask src size));
effect(TEMP_DEF dst, TEMP xtmp);
format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %}
@@ -22871,7 +22871,7 @@ instruct vstoreMask2B(vec dst, vec src, vec xtmp, immI_2 size) %{
%}
instruct vstoreMask4B(vec dst, vec src, vec xtmp, immI_4 size) %{
- predicate(UseAVX <= 2 && Matcher::vector_length(n) <= 8 && n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(UseAVX <= 2 && Matcher::vector_length(n) <= 8 && !n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorStoreMask src size));
format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %}
effect(TEMP_DEF dst, TEMP xtmp);
@@ -22931,7 +22931,7 @@ instruct storeMask8B_avx(vec dst, vec src, immI_8 size, vec vtmp) %{
%}
instruct vstoreMask4B_evex_novectmask(vec dst, vec src, immI_4 size) %{
- predicate(UseAVX > 2 && n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(UseAVX > 2 && !n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorStoreMask src size));
format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %}
ins_encode %{
@@ -22947,7 +22947,7 @@ instruct vstoreMask4B_evex_novectmask(vec dst, vec src, immI_4 size) %{
%}
instruct vstoreMask8B_evex_novectmask(vec dst, vec src, immI_8 size) %{
- predicate(UseAVX > 2 && n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(UseAVX > 2 && !n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorStoreMask src size));
format %{ "vector_store_mask $dst, $src \t! elem size is $size byte[s]" %}
ins_encode %{
@@ -22963,7 +22963,7 @@ instruct vstoreMask8B_evex_novectmask(vec dst, vec src, immI_8 size) %{
%}
instruct vstoreMask_evex_vectmask(vec dst, kReg mask, immI size) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask() && !VM_Version::supports_avx512vlbw());
+ predicate(n->in(1)->bottom_type()->is_pvectmask() && !VM_Version::supports_avx512vlbw());
match(Set dst (VectorStoreMask mask size));
effect(TEMP_DEF dst);
format %{ "vector_store_mask $dst, $mask \t! elem size is $size byte[s]" %}
@@ -22977,7 +22977,7 @@ instruct vstoreMask_evex_vectmask(vec dst, kReg mask, immI size) %{
%}
instruct vstoreMask_evex(vec dst, kReg mask, immI size) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask() && VM_Version::supports_avx512vlbw());
+ predicate(n->in(1)->bottom_type()->is_pvectmask() && VM_Version::supports_avx512vlbw());
match(Set dst (VectorStoreMask mask size));
effect(TEMP_DEF dst);
format %{ "vector_store_mask $dst, $mask \t! elem size is $size byte[s]" %}
@@ -23577,7 +23577,7 @@ instruct vprotate_immI8(vec dst, vec src, immI8 shift) %{
ins_encode %{
int opcode = this->ideal_Opcode();
int vector_len = vector_length_encoding(this);
- BasicType etype = this->bottom_type()->is_vect()->element_basic_type();
+ BasicType etype = this->bottom_type()->as_vect()->element_basic_type();
__ vprotate_imm(opcode, etype, $dst$$XMMRegister, $src$$XMMRegister, $shift$$constant, vector_len);
%}
ins_pipe( pipe_slow );
@@ -23590,7 +23590,7 @@ instruct vprorate(vec dst, vec src, vec shift) %{
ins_encode %{
int opcode = this->ideal_Opcode();
int vector_len = vector_length_encoding(this);
- BasicType etype = this->bottom_type()->is_vect()->element_basic_type();
+ BasicType etype = this->bottom_type()->as_vect()->element_basic_type();
__ vprotate_var(opcode, etype, $dst$$XMMRegister, $src$$XMMRegister, $shift$$XMMRegister, vector_len);
%}
ins_pipe( pipe_slow );
@@ -23598,11 +23598,11 @@ instruct vprorate(vec dst, vec src, vec shift) %{
// ---------------------------------- Masked Operations ------------------------------------
instruct vmasked_load_avx_non_subword(vec dst, memory mem, vec mask) %{
- predicate(!n->in(3)->bottom_type()->isa_pvectmask());
+ predicate(!n->in(3)->bottom_type()->is_pvectmask());
match(Set dst (LoadVectorMasked mem mask));
format %{ "vector_masked_load $dst, $mem, $mask \t! vector masked copy" %}
ins_encode %{
- BasicType elmType = this->bottom_type()->is_vect()->element_basic_type();
+ BasicType elmType = this->bottom_type()->as_vect()->element_basic_type();
int vlen_enc = vector_length_encoding(this);
__ vmovmask(elmType, $dst$$XMMRegister, $mem$$Address, $mask$$XMMRegister, vlen_enc);
%}
@@ -23611,11 +23611,11 @@ instruct vmasked_load_avx_non_subword(vec dst, memory mem, vec mask) %{
instruct vmasked_load_evex(vec dst, memory mem, kReg mask) %{
- predicate(n->in(3)->bottom_type()->isa_pvectmask());
+ predicate(n->in(3)->bottom_type()->is_pvectmask());
match(Set dst (LoadVectorMasked mem mask));
format %{ "vector_masked_load $dst, $mem, $mask \t! vector masked copy" %}
ins_encode %{
- BasicType elmType = this->bottom_type()->is_vect()->element_basic_type();
+ BasicType elmType = this->bottom_type()->as_vect()->element_basic_type();
int vector_len = vector_length_encoding(this);
__ evmovdqu(elmType, $mask$$KRegister, $dst$$XMMRegister, $mem$$Address, false, vector_len);
%}
@@ -23623,25 +23623,25 @@ instruct vmasked_load_evex(vec dst, memory mem, kReg mask) %{
%}
instruct vmasked_store_avx_non_subword(memory mem, vec src, vec mask) %{
- predicate(!n->in(3)->in(2)->bottom_type()->isa_pvectmask());
+ predicate(!n->in(3)->in(2)->bottom_type()->is_pvectmask());
match(Set mem (StoreVectorMasked mem (Binary src mask)));
format %{ "vector_masked_store $mem, $src, $mask \t! vector masked store" %}
ins_encode %{
const MachNode* src_node = static_cast(this->in(this->operand_index($src)));
int vlen_enc = vector_length_encoding(src_node);
- BasicType elmType = src_node->bottom_type()->is_vect()->element_basic_type();
+ BasicType elmType = src_node->bottom_type()->as_vect()->element_basic_type();
__ vmovmask(elmType, $mem$$Address, $src$$XMMRegister, $mask$$XMMRegister, vlen_enc);
%}
ins_pipe( pipe_slow );
%}
instruct vmasked_store_evex(memory mem, vec src, kReg mask) %{
- predicate(n->in(3)->in(2)->bottom_type()->isa_pvectmask());
+ predicate(n->in(3)->in(2)->bottom_type()->is_pvectmask());
match(Set mem (StoreVectorMasked mem (Binary src mask)));
format %{ "vector_masked_store $mem, $src, $mask \t! vector masked store" %}
ins_encode %{
const MachNode* src_node = static_cast(this->in(this->operand_index($src)));
- BasicType elmType = src_node->bottom_type()->is_vect()->element_basic_type();
+ BasicType elmType = src_node->bottom_type()->as_vect()->element_basic_type();
int vlen_enc = vector_length_encoding(src_node);
__ evmovdqu(elmType, $mask$$KRegister, $mem$$Address, $src$$XMMRegister, true, vlen_enc);
%}
@@ -23715,7 +23715,7 @@ instruct vmask_gen_imm(kReg dst, immL len, rRegL temp) %{
%}
instruct vmask_tolong_evex(rRegL dst, kReg mask, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask());
+ predicate(n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskToLong mask));
effect(TEMP dst, KILL cr);
format %{ "vector_tolong_evex $dst, $mask \t! vector mask tolong" %}
@@ -23732,7 +23732,7 @@ instruct vmask_tolong_evex(rRegL dst, kReg mask, rFlagsReg cr) %{
%}
instruct vmask_tolong_bool(rRegL dst, vec mask, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskToLong mask));
format %{ "vector_tolong_bool $dst, $mask \t! using $xtmp as TEMP" %}
effect(TEMP_DEF dst, TEMP xtmp, KILL cr);
@@ -23748,7 +23748,7 @@ instruct vmask_tolong_bool(rRegL dst, vec mask, vec xtmp, rFlagsReg cr) %{
%}
instruct vmask_tolong_avx(rRegL dst, vec mask, immI size, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskToLong (VectorStoreMask mask size)));
format %{ "vector_tolong_avx $dst, $mask \t! using $xtmp as TEMP" %}
effect(TEMP_DEF dst, TEMP xtmp, KILL cr);
@@ -23764,7 +23764,7 @@ instruct vmask_tolong_avx(rRegL dst, vec mask, immI size, vec xtmp, rFlagsReg cr
%}
instruct vmask_truecount_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask());
+ predicate(n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskTrueCount mask));
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
format %{ "vector_truecount_evex $dst, $mask \t! using $tmp as TEMP" %}
@@ -23781,7 +23781,7 @@ instruct vmask_truecount_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{
%}
instruct vmask_truecount_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskTrueCount mask));
effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr);
format %{ "vector_truecount_bool $dst, $mask \t! using $tmp, $xtmp as TEMP" %}
@@ -23797,7 +23797,7 @@ instruct vmask_truecount_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp, rFlagsRe
%}
instruct vmask_truecount_avx(rRegI dst, vec mask, immI size, rRegL tmp, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskTrueCount (VectorStoreMask mask size)));
effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr);
format %{ "vector_truecount_avx $dst, $mask \t! using $tmp, $xtmp as TEMP" %}
@@ -23813,7 +23813,7 @@ instruct vmask_truecount_avx(rRegI dst, vec mask, immI size, rRegL tmp, vec xtmp
%}
instruct vmask_first_or_last_true_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask());
+ predicate(n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskFirstTrue mask));
match(Set dst (VectorMaskLastTrue mask));
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
@@ -23831,7 +23831,7 @@ instruct vmask_first_or_last_true_evex(rRegI dst, kReg mask, rRegL tmp, rFlagsRe
%}
instruct vmask_first_or_last_true_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskFirstTrue mask));
match(Set dst (VectorMaskLastTrue mask));
effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr);
@@ -23848,7 +23848,7 @@ instruct vmask_first_or_last_true_bool(rRegI dst, vec mask, rRegL tmp, vec xtmp,
%}
instruct vmask_first_or_last_true_avx(rRegI dst, vec mask, immI size, rRegL tmp, vec xtmp, rFlagsReg cr) %{
- predicate(n->in(1)->in(1)->bottom_type()->isa_pvectmask() == nullptr);
+ predicate(!n->in(1)->in(1)->bottom_type()->is_pvectmask());
match(Set dst (VectorMaskFirstTrue (VectorStoreMask mask size)));
match(Set dst (VectorMaskLastTrue (VectorStoreMask mask size)));
effect(TEMP_DEF dst, TEMP tmp, TEMP xtmp, KILL cr);
@@ -23900,7 +23900,7 @@ instruct vcompress_mask_reg_evex(kReg dst, kReg mask, rRegL rtmp1, rRegL rtmp2,
effect(TEMP rtmp1, TEMP rtmp2, KILL cr);
format %{ "mask_compress_evex $dst, $mask\t! using $rtmp1 and $rtmp2 as TEMP" %}
ins_encode %{
- assert(this->in(1)->bottom_type()->isa_pvectmask(), "");
+ assert(this->in(1)->bottom_type()->is_pvectmask(), "");
int mask_len = Matcher::vector_length(this);
__ vector_mask_compress($dst$$KRegister, $mask$$KRegister, $rtmp1$$Register, $rtmp2$$Register, mask_len);
%}
@@ -24570,7 +24570,7 @@ instruct evcmp_masked(kReg dst, vec src1, vec src2, immI8 cond, kReg mask) %{
match(Set dst (VectorMaskCmp (Binary src1 src2) (Binary cond mask)));
format %{ "vcmp_masked $dst, $src1, $src2, $cond, $mask" %}
ins_encode %{
- assert(bottom_type()->isa_pvectmask(), "TypePVectMask expected");
+ assert(bottom_type()->is_pvectmask(), "TypePVectMask expected");
int vlen_enc = vector_length_encoding(this, $src1);
BasicType src1_elem_bt = Matcher::vector_element_basic_type(this, $src1);
@@ -24653,7 +24653,7 @@ instruct mask_not_imm(kReg dst, kReg src, immI_M1 cnt) %{
%}
instruct long_to_maskLE8_avx(vec dst, rRegL src, rRegL rtmp1) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr && Matcher::vector_length(n) <= 8);
+ predicate(!n->bottom_type()->is_pvectmask() && Matcher::vector_length(n) <= 8);
match(Set dst (VectorLongToMask src));
effect(TEMP dst, TEMP rtmp1);
format %{ "long_to_mask_avx $dst, $src\t! using $rtmp1" %}
@@ -24668,7 +24668,7 @@ instruct long_to_maskLE8_avx(vec dst, rRegL src, rRegL rtmp1) %{
instruct long_to_maskGT8_avx(vec dst, rRegL src, rRegL rtmp1, rRegL rtmp2, vec xtmp1, rFlagsReg cr) %{
- predicate(n->bottom_type()->isa_pvectmask() == nullptr && Matcher::vector_length(n) > 8);
+ predicate(!n->bottom_type()->is_pvectmask() && Matcher::vector_length(n) > 8);
match(Set dst (VectorLongToMask src));
effect(TEMP dst, TEMP rtmp1, TEMP rtmp2, TEMP xtmp1, KILL cr);
format %{ "long_to_mask_avx $dst, $src\t! using $rtmp1, $rtmp2, $xtmp1, as TEMP" %}
@@ -24683,7 +24683,7 @@ instruct long_to_maskGT8_avx(vec dst, rRegL src, rRegL rtmp1, rRegL rtmp2, vec x
%}
instruct long_to_mask_evex(kReg dst, rRegL src) %{
- predicate(n->bottom_type()->isa_pvectmask());
+ predicate(n->bottom_type()->is_pvectmask());
match(Set dst (VectorLongToMask src));
format %{ "long_to_mask_evex $dst, $src\t!" %}
ins_encode %{
diff --git a/src/hotspot/share/adlc/output_c.cpp b/src/hotspot/share/adlc/output_c.cpp
index 6adff64b456..ea9d069f1d5 100644
--- a/src/hotspot/share/adlc/output_c.cpp
+++ b/src/hotspot/share/adlc/output_c.cpp
@@ -3751,11 +3751,11 @@ static void path_to_constant(FILE *fp, FormDict &globals,
if ( strcmp(optype,"ConI") == 0 ) {
fprintf(fp, "_leaf->get_int()");
} else if ( (strcmp(optype,"ConP") == 0) ) {
- fprintf(fp, "_leaf->bottom_type()->is_ptr()");
+ fprintf(fp, "_leaf->bottom_type()->as_ptr()");
} else if ( (strcmp(optype,"ConN") == 0) ) {
- fprintf(fp, "_leaf->bottom_type()->is_narrowoop()");
+ fprintf(fp, "_leaf->bottom_type()->as_narrowoop()");
} else if ( (strcmp(optype,"ConNKlass") == 0) ) {
- fprintf(fp, "_leaf->bottom_type()->is_narrowklass()");
+ fprintf(fp, "_leaf->bottom_type()->as_narrowklass()");
} else if ( (strcmp(optype,"ConH") == 0) ) {
fprintf(fp, "_leaf->geth()");
} else if ( (strcmp(optype,"ConF") == 0) ) {
diff --git a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
index 5fa2edf4f42..b3e3f2f6ac4 100644
--- a/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
+++ b/src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
@@ -237,8 +237,8 @@ static void refine_barrier_by_new_val_type(const Node* n) {
const Type* newval_bottom = newval->bottom_type();
TypePtr::PTR newval_type = newval_bottom->make_ptr()->ptr();
uint8_t barrier_data = store->barrier_data();
- if (!newval_bottom->isa_oopptr() &&
- !newval_bottom->isa_narrowoop() &&
+ if (!newval_bottom->is_oopptr() &&
+ !newval_bottom->is_narrowoop() &&
newval_type != TypePtr::Null) {
// newval is neither an OOP nor null, so there is no barrier to refine.
assert(barrier_data == 0, "non-OOP stores should have no barrier data");
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
index a31bfe5bff0..2e9d773e890 100644
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.cpp
@@ -76,7 +76,7 @@ bool C2Access::needs_cpu_membar() const {
// the barriers get omitted and the unsafe reference begins to "pollute"
// the alias analysis of the rest of the graph, either Compile::can_alias
// or Compile::must_alias will throw a diagnostic assert.)
- if (is_mixed || !is_unordered || (mismatched && !_addr.type()->isa_aryptr())) {
+ if (is_mixed || !is_unordered || (mismatched && !_addr.type()->is_aryptr())) {
return true;
}
} else {
@@ -419,12 +419,12 @@ void C2Access::fixup_decorators() {
_decorators |= C2_UNKNOWN_CONTROL_LOAD;
const TypePtr* adr_type = _addr.type();
Node* adr = _addr.node();
- if (!needs_cpu_membar() && adr_type->isa_instptr()) {
+ if (!needs_cpu_membar() && adr_type->is_instptr()) {
assert(adr_type->meet(TypePtr::NULL_PTR) != adr_type->remove_speculative(), "should be not null");
intptr_t offset = Type::OffsetBot;
AddPNode::Ideal_base_and_offset(adr, &gvn(), offset);
if (offset >= 0) {
- int s = Klass::layout_helper_size_in_bytes(adr_type->isa_instptr()->instance_klass()->layout_helper());
+ int s = Klass::layout_helper_size_in_bytes(adr_type->as_instptr()->instance_klass()->layout_helper());
if (offset < s) {
// Guaranteed to be a valid access, no need to pin it
_decorators ^= C2_CONTROL_DEPENDENT_LOAD;
@@ -475,7 +475,7 @@ Node* BarrierSetC2::atomic_cmpxchg_val_at_resolved(C2AtomicParseAccess& access,
} else
#endif
{
- load_store = new CompareAndExchangePNode(kit->control(), mem, adr, new_val, expected_val, adr_type, value_type->is_oopptr(), mo);
+ load_store = new CompareAndExchangePNode(kit->control(), mem, adr, new_val, expected_val, adr_type, value_type->as_oopptr(), mo);
}
} else {
switch (access.type()) {
@@ -607,7 +607,7 @@ Node* BarrierSetC2::atomic_xchg_at_resolved(C2AtomicParseAccess& access, Node* n
} else
#endif
{
- load_store = new GetAndSetPNode(kit->control(), mem, adr, new_val, adr_type, value_type->is_oopptr());
+ load_store = new GetAndSetPNode(kit->control(), mem, adr, new_val, adr_type, value_type->as_oopptr());
}
} else {
switch (access.type()) {
@@ -1016,7 +1016,7 @@ static bool is_array_allocation(const Node* phi) {
}
const MachNode* succ = current->fast_out(i)->as_Mach();
if (succ->ideal_Opcode() == Op_CheckCastPP) {
- if (succ->get_ptr_type()->isa_aryptr()) {
+ if (succ->get_ptr_type()->is_aryptr()) {
// Cast to Java array pointer: phi corresponds to an array allocation.
return true;
}
diff --git a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
index 7fe9dc47767..8ee2fac5425 100644
--- a/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
+++ b/src/hotspot/share/gc/shared/c2/barrierSetC2.hpp
@@ -93,7 +93,7 @@ class C2AccessValuePtr: public C2AccessValue {
C2AccessValuePtr(Node* node, const TypePtr* type) :
C2AccessValue(node, type) {}
- const TypePtr* type() const { return _type->is_ptr(); }
+ const TypePtr* type() const { return _type->as_ptr(); }
};
// This class wraps a bunch of context parameters that are passed around in the
diff --git a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
index 507fdc4777b..20061cb2647 100644
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahBarrierSetC2.cpp
@@ -320,7 +320,7 @@ uint8_t ShenandoahBarrierSetC2::refine_store(Node* n, uint8_t bd) {
// Type system tells us something about nullity?
const Type* newval_bottom = newval->bottom_type();
- assert(newval_bottom->isa_oopptr() || newval_bottom->isa_narrowoop() ||
+ assert(newval_bottom->is_oopptr() || newval_bottom->is_narrowoop() ||
newval_bottom == TypePtr::NULL_PTR, "Should be an oop store");
const TypePtr* newval_type = newval_bottom->make_ptr();
assert(newval_type != nullptr, "Should have been filtered before");
@@ -569,9 +569,9 @@ bool ShenandoahBarrierSetC2::clone_needs_barrier(const TypeOopPtr* src_type, boo
return false;
}
- if (src_type->isa_instptr() != nullptr) {
+ if (src_type->is_instptr()) {
// Instance: need barrier only if there is a possibility of having an oop anywhere in it.
- ciInstanceKlass* ik = src_type->is_instptr()->instance_klass();
+ ciInstanceKlass* ik = src_type->as_instptr()->instance_klass();
if ((src_type->klass_is_exact() || !ik->has_subklass()) &&
!ik->has_injected_fields() && !ik->has_object_fields()) {
if (!src_type->klass_is_exact()) {
@@ -581,9 +581,9 @@ bool ShenandoahBarrierSetC2::clone_needs_barrier(const TypeOopPtr* src_type, boo
}
return false;
}
- } else if (src_type->isa_aryptr() != nullptr) {
+ } else if (src_type->is_aryptr()) {
// Array: need barrier only if array is oop-bearing.
- BasicType src_elem = src_type->isa_aryptr()->elem()->array_element_basic_type();
+ BasicType src_elem = src_type->as_aryptr()->elem()->array_element_basic_type();
if (is_reference_type(src_elem, true) && src_type->is_not_flat()) {
is_oop_array = true;
} else if (!src_type->is_not_flat()) {
@@ -598,7 +598,7 @@ bool ShenandoahBarrierSetC2::clone_needs_barrier(const TypeOopPtr* src_type, boo
}
void ShenandoahBarrierSetC2::clone(GraphKit* kit, Node* src_base, Node* dst_base, Node* size, bool is_array) const {
- const TypeOopPtr* src_type = kit->gvn().type(src_base)->is_oopptr();
+ const TypeOopPtr* src_type = kit->gvn().type(src_base)->as_oopptr();
bool is_oop_array = false;
if (!clone_needs_barrier(src_type, is_oop_array)) {
@@ -641,7 +641,7 @@ void ShenandoahBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCo
Node* const dest_offset = ac->in(ArrayCopyNode::DestPos);
Node* length = ac->in(ArrayCopyNode::Length);
- const TypeOopPtr* src_type = phase->igvn().type(src)->is_oopptr();
+ const TypeOopPtr* src_type = phase->igvn().type(src)->as_oopptr();
bool is_oop_array = false;
if (!clone_needs_barrier(src_type, is_oop_array)) {
@@ -663,7 +663,7 @@ void ShenandoahBarrierSetC2::clone_at_expansion(PhaseMacroExpand* phase, ArrayCo
// This is the full clone, so offsets should equal each other and be at array base.
assert(src_offset == dest_offset, "should be equal");
const jlong offset = src_offset->get_long();
- const TypeAryPtr* const ary_ptr = src->get_ptr_type()->isa_aryptr();
+ const TypeAryPtr* const ary_ptr = src->get_ptr_type()->as_aryptr();
BasicType bt = ary_ptr->elem()->array_element_basic_type();
if (offset != arrayOopDesc::base_offset_in_bytes(bt)) {
// Something is off with flat arrays. Go to runtime instead.
@@ -816,12 +816,12 @@ void ShenandoahBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase p
bool is_native = (bd & ShenandoahBitNative) != 0;
bool is_referent = adr_type != nullptr &&
- adr_type->isa_instptr() &&
- adr_type->is_instptr()->instance_klass()->is_subtype_of(Compile::current()->env()->Reference_klass()) &&
- adr_type->is_instptr()->offset() == java_lang_ref_Reference::referent_offset();
+ adr_type->is_instptr() &&
+ adr_type->as_instptr()->instance_klass()->is_subtype_of(Compile::current()->env()->Reference_klass()) &&
+ adr_type->as_instptr()->offset() == java_lang_ref_Reference::referent_offset();
- bool is_oop_addr = (adr_type != nullptr) && (adr_type->isa_oopptr() || adr_type->isa_narrowoop());
- bool is_raw_addr = (adr_type != nullptr) && (adr_type->isa_rawptr() || adr_type->isa_klassptr());
+ bool is_oop_addr = (adr_type != nullptr) && (adr_type->is_oopptr() || adr_type->is_narrowoop());
+ bool is_raw_addr = (adr_type != nullptr) && (adr_type->is_rawptr() || adr_type->is_klassptr());
verify_gc_barrier_assert(!expect_some_real || (bd == 0) || (bd & ShenandoahBitsReal) != 0, "Without real barriers, metadata should be stripped at this point", bd, n);
diff --git a/src/hotspot/share/opto/addnode.cpp b/src/hotspot/share/opto/addnode.cpp
index 72b4a8ea7cb..957d54f5adc 100644
--- a/src/hotspot/share/opto/addnode.cpp
+++ b/src/hotspot/share/opto/addnode.cpp
@@ -593,12 +593,12 @@ Node* AddINode::Ideal(PhaseGVN* phase, bool can_reshape) {
// positive y and (x <= -(y << z))
if (op1 == Op_URShiftI && op2 == Op_ConI &&
in1->in(2)->Opcode() == Op_ConI) {
- jint z = phase->type(in1->in(2))->is_int()->get_con() & 0x1f; // only least significant 5 bits matter
- jint y = phase->type(in2)->is_int()->get_con();
+ jint z = phase->type(in1->in(2))->as_int()->get_con() & 0x1f; // only least significant 5 bits matter
+ jint y = phase->type(in2)->as_int()->get_con();
if (z < 5 && -5 < y && y < 0) {
const Type* t_in11 = phase->type(in1->in(1));
- if( t_in11 != Type::TOP && (t_in11->is_int()->_lo >= -(y << z))) {
+ if (t_in11 != Type::TOP && (t_in11->as_int()->_lo >= -(y << z))) {
Node* a = phase->transform(new AddINode( in1->in(1), phase->intcon(y<in(2));
}
@@ -626,8 +626,8 @@ Node* AddINode::Identity(PhaseGVN* phase) {
// to be passed a TOP or BOTTOM type, these are filtered out by
// pre-check.
const Type* AddINode::add_ring(const Type* t0, const Type* t1) const {
- const TypeInt* range0 = t0->is_int();
- const TypeInt* range1 = t1->is_int();
+ const TypeInt* range0 = t0->as_int();
+ const TypeInt* range1 = t1->as_int();
jlong lo_sum = (jlong)range0->_lo + (jlong)range1->_lo;
jlong hi_sum = (jlong)range0->_hi + (jlong)range1->_hi;
@@ -678,8 +678,8 @@ Node* AddLNode::Identity(PhaseGVN* phase) {
// to be passed a TOP or BOTTOM type, these are filtered out by
// pre-check.
const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const {
- const TypeLong *r0 = t0->is_long(); // Handy access
- const TypeLong *r1 = t1->is_long();
+ const TypeLong* r0 = t0->as_long(); // Handy access
+ const TypeLong* r1 = t1->as_long();
jlong lo = java_add(r0->_lo, r1->_lo);
jlong hi = java_add(r0->_hi, r1->_hi);
if( !(r0->is_con() && r1->is_con()) ) {
@@ -730,7 +730,7 @@ const Type *AddFNode::add_of_identity( const Type *t1, const Type *t2 ) const {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type *AddFNode::add_ring( const Type *t0, const Type *t1 ) const {
- if (!t0->isa_float_constant() || !t1->isa_float_constant()) {
+ if (!t0->is_float_constant() || !t1->is_float_constant()) {
return bottom_type();
}
return TypeF::make( t0->getf() + t1->getf() );
@@ -747,7 +747,7 @@ const Type* AddHFNode::add_of_identity(const Type* t1, const Type* t2) const {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type* AddHFNode::add_ring(const Type* t0, const Type* t1) const {
- if (!t0->isa_half_float_constant() || !t1->isa_half_float_constant()) {
+ if (!t0->is_half_float_constant() || !t1->is_half_float_constant()) {
return bottom_type();
}
return TypeH::make(t0->getf() + t1->getf());
@@ -773,7 +773,7 @@ const Type *AddDNode::add_of_identity( const Type *t1, const Type *t2 ) const {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type *AddDNode::add_ring( const Type *t0, const Type *t1 ) const {
- if (!t0->isa_double_constant() || !t1->isa_double_constant()) {
+ if (!t0->is_double_constant() || !t1->is_double_constant()) {
return bottom_type();
}
return TypeD::make( t0->getd() + t1->getd() );
@@ -802,12 +802,12 @@ Node *AddPNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Type of left input's right input
const Type *t = phase->type( addp->in(Offset) );
if( t == Type::TOP ) return nullptr;
- const TypeX *t12 = t->is_intptr_t();
+ const TypeX* t12 = t->as_intptr_t();
if( t12->is_con() ) { // Left input is an add of a constant?
// If the right input is a constant, combine constants
const Type *temp_t2 = phase->type( in(Offset) );
if( temp_t2 == Type::TOP ) return nullptr;
- const TypeX *t2 = temp_t2->is_intptr_t();
+ const TypeX* t2 = temp_t2->as_intptr_t();
Node* address;
Node* offset;
if( t2->is_con() ) {
@@ -864,16 +864,16 @@ const Type *AddPNode::bottom_type() const {
return Type::TOP;
}
- const TypeX* tx = t->is_intptr_t();
+ const TypeX* tx = t->as_intptr_t();
intptr_t txoffset = Type::OffsetBot;
if (tx->is_con()) { // Left input is an add of a constant?
txoffset = tx->get_con();
}
- if (tp->isa_aryptr()) {
+ if (tp->is_aryptr()) {
// In the case of a flat value type array, each field has its
// own slice so we need to extract the field being accessed from
// the address computation
- return tp->is_aryptr()->add_field_offset_and_offset(txoffset);
+ return tp->as_aryptr()->add_field_offset_and_offset(txoffset);
}
return tp->add_offset(txoffset);
}
@@ -887,19 +887,19 @@ const Type* AddPNode::Value(PhaseGVN* phase) const {
if( t2 == Type::TOP ) return Type::TOP;
// Left input is a pointer
- const TypePtr *p1 = t1->isa_ptr();
+ const TypePtr* p1 = t1->as_ptr();
// Right input is an int
- const TypeX *p2 = t2->is_intptr_t();
+ const TypeX* p2 = t2->as_intptr_t();
// Add 'em
intptr_t p2offset = Type::OffsetBot;
if (p2->is_con()) { // Left input is an add of a constant?
p2offset = p2->get_con();
}
- if (p1->isa_aryptr()) {
+ if (p1->is_aryptr()) {
// In the case of a flat value type array, each field has its
// own slice so we need to extract the field being accessed from
// the address computation
- return p1->is_aryptr()->add_field_offset_and_offset(p2offset);
+ return p1->as_aryptr()->add_field_offset_and_offset(p2offset);
}
return p1->add_offset(p2offset);
}
@@ -1038,7 +1038,7 @@ Node* OrINode::Ideal(PhaseGVN* phase, bool can_reshape) {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type* OrINode::add_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_or(t1->is_int(), t2->is_int());
+ return RangeInference::infer_or(t1->as_int(), t2->as_int());
}
//=============================================================================
@@ -1098,7 +1098,7 @@ Node* OrLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
//------------------------------add_ring---------------------------------------
const Type* OrLNode::add_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_or(t1->is_long(), t2->is_long());
+ return RangeInference::infer_or(t1->as_long(), t2->as_long());
}
//---------------------------Helper -------------------------------------------
@@ -1186,13 +1186,13 @@ const Type* XorINode::Value(PhaseGVN* phase) const {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type* XorINode::add_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_xor(t1->is_int(), t2->is_int());
+ return RangeInference::infer_xor(t1->as_int(), t2->as_int());
}
//=============================================================================
//------------------------------add_ring---------------------------------------
const Type* XorLNode::add_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_xor(t1->is_long(), t2->is_long());
+ return RangeInference::infer_xor(t1->as_long(), t2->as_long());
}
Node* XorLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
@@ -1249,9 +1249,9 @@ Node* MinMaxNode::build_min_max_long(PhaseGVN* phase, Node* a, Node* b, bool is_
}
Node* MinMaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned, const Type* t, PhaseGVN& gvn) {
- bool is_int = gvn.type(a)->isa_int();
- assert(is_int || gvn.type(a)->isa_long(), "int or long inputs");
- assert(is_int == (gvn.type(b)->isa_int() != nullptr), "inconsistent inputs");
+ bool is_int = gvn.type(a)->is_int();
+ assert(is_int || gvn.type(a)->is_long(), "int or long inputs");
+ assert(is_int == gvn.type(b)->is_int(), "inconsistent inputs");
BasicType bt = is_int ? T_INT: T_LONG;
Node* hook = nullptr;
if (gvn.is_IterGVN()) {
@@ -1263,7 +1263,7 @@ Node* MinMaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned,
Node* res = nullptr;
if (is_int && !is_unsigned) {
res = gvn.transform(build_min_max_int(a, b, is_max));
- assert(gvn.type(res)->is_int()->_lo >= t->is_int()->_lo && gvn.type(res)->is_int()->_hi <= t->is_int()->_hi, "type doesn't match");
+ assert(gvn.type(res)->as_int()->_lo >= t->as_int()->_lo && gvn.type(res)->as_int()->_hi <= t->as_int()->_hi, "type doesn't match");
} else {
Node* cmp = nullptr;
if (is_max) {
@@ -1281,9 +1281,9 @@ Node* MinMaxNode::build_min_max(Node* a, Node* b, bool is_max, bool is_unsigned,
}
Node* MinMaxNode::build_min_max_diff_with_zero(Node* a, Node* b, bool is_max, const Type* t, PhaseGVN& gvn) {
- bool is_int = gvn.type(a)->isa_int();
- assert(is_int || gvn.type(a)->isa_long(), "int or long inputs");
- assert(is_int == (gvn.type(b)->isa_int() != nullptr), "inconsistent inputs");
+ bool is_int = gvn.type(a)->is_int();
+ assert(is_int || gvn.type(a)->is_long(), "int or long inputs");
+ assert(is_int == gvn.type(b)->is_int(), "inconsistent inputs");
BasicType bt = is_int ? T_INT: T_LONG;
Node* zero = gvn.integercon(0, bt);
Node* hook = nullptr;
@@ -1361,7 +1361,7 @@ static ConstAddOperands as_add_with_constant(Node* n) {
if (c_type == Type::TOP) {
return ConstAddOperands(nullptr, 0);
}
- return ConstAddOperands(x, c_type->is_int()->get_con());
+ return ConstAddOperands(x, c_type->as_int()->get_con());
}
Node* MinMaxNode::IdealI(PhaseGVN* phase, bool can_reshape) {
@@ -1428,8 +1428,8 @@ Node* MaxINode::Ideal(PhaseGVN* phase, bool can_reshape) {
}
Node* MaxINode::Identity(PhaseGVN* phase) {
- const TypeInt* t1 = phase->type(in(1))->is_int();
- const TypeInt* t2 = phase->type(in(2))->is_int();
+ const TypeInt* t1 = phase->type(in(1))->as_int();
+ const TypeInt* t2 = phase->type(in(2))->as_int();
// Can we determine the maximum statically?
if (t1->_lo >= t2->_hi) {
@@ -1445,8 +1445,8 @@ Node* MaxINode::Identity(PhaseGVN* phase) {
//------------------------------add_ring---------------------------------------
// Supplied function returns the sum of the inputs.
const Type *MaxINode::add_ring( const Type *t0, const Type *t1 ) const {
- const TypeInt *r0 = t0->is_int(); // Handy access
- const TypeInt *r1 = t1->is_int();
+ const TypeInt* r0 = t0->as_int(); // Handy access
+ const TypeInt* r1 = t1->as_int();
// Otherwise just MAX them bits.
return TypeInt::make( MAX2(r0->_lo,r1->_lo), MAX2(r0->_hi,r1->_hi), MAX2(r0->_widen,r1->_widen) );
@@ -1461,8 +1461,8 @@ Node* MinINode::Ideal(PhaseGVN* phase, bool can_reshape) {
}
Node* MinINode::Identity(PhaseGVN* phase) {
- const TypeInt* t1 = phase->type(in(1))->is_int();
- const TypeInt* t2 = phase->type(in(2))->is_int();
+ const TypeInt* t1 = phase->type(in(1))->as_int();
+ const TypeInt* t2 = phase->type(in(2))->as_int();
// Can we determine the minimum statically?
if (t1->_lo >= t2->_hi) {
@@ -1477,8 +1477,8 @@ Node* MinINode::Identity(PhaseGVN* phase) {
//------------------------------add_ring---------------------------------------
// Supplied function returns the sum of the inputs.
const Type *MinINode::add_ring( const Type *t0, const Type *t1 ) const {
- const TypeInt *r0 = t0->is_int(); // Handy access
- const TypeInt *r1 = t1->is_int();
+ const TypeInt* r0 = t0->as_int(); // Handy access
+ const TypeInt* r1 = t1->as_int();
// Otherwise just MIN them bits.
return TypeInt::make( MIN2(r0->_lo,r1->_lo), MIN2(r0->_hi,r1->_hi), MAX2(r0->_widen,r1->_widen) );
@@ -1584,15 +1584,15 @@ static Node* fold_subI_no_underflow_pattern(Node* n, PhaseGVN* phase) {
}
const Type* MaxLNode::add_ring(const Type* t0, const Type* t1) const {
- const TypeLong* r0 = t0->is_long();
- const TypeLong* r1 = t1->is_long();
+ const TypeLong* r0 = t0->as_long();
+ const TypeLong* r1 = t1->as_long();
return TypeLong::make(MAX2(r0->_lo, r1->_lo), MAX2(r0->_hi, r1->_hi), MAX2(r0->_widen, r1->_widen));
}
Node* MaxLNode::Identity(PhaseGVN* phase) {
- const TypeLong* t1 = phase->type(in(1))->is_long();
- const TypeLong* t2 = phase->type(in(2))->is_long();
+ const TypeLong* t1 = phase->type(in(1))->as_long();
+ const TypeLong* t2 = phase->type(in(2))->as_long();
// Can we determine maximum statically?
if (t1->_lo >= t2->_hi) {
@@ -1618,15 +1618,15 @@ Node* MaxLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
}
const Type* MinLNode::add_ring(const Type* t0, const Type* t1) const {
- const TypeLong* r0 = t0->is_long();
- const TypeLong* r1 = t1->is_long();
+ const TypeLong* r0 = t0->as_long();
+ const TypeLong* r1 = t1->as_long();
return TypeLong::make(MIN2(r0->_lo, r1->_lo), MIN2(r0->_hi, r1->_hi), MAX2(r0->_widen, r1->_widen));
}
Node* MinLNode::Identity(PhaseGVN* phase) {
- const TypeLong* t1 = phase->type(in(1))->is_long();
- const TypeLong* t2 = phase->type(in(2))->is_long();
+ const TypeLong* t1 = phase->type(in(1))->as_long();
+ const TypeLong* t2 = phase->type(in(2))->as_long();
// Can we determine minimum statically?
if (t1->_lo >= t2->_hi) {
@@ -1677,7 +1677,7 @@ Node* MinMaxNode::find_identity_operation(Node* operation, Node* operand) {
// If the operations are different return the operand 'A', as Max(A, Min(A, B)) == A if the value isn't floating point.
// With floating point values, the identity doesn't hold if B == NaN.
const Type* type = bottom_type();
- if (type->isa_int() || type->isa_long()) {
+ if (type->is_int() || type->is_long()) {
return operand;
}
}
diff --git a/src/hotspot/share/opto/addnode.hpp b/src/hotspot/share/opto/addnode.hpp
index e87e2389863..0b47419c9e5 100644
--- a/src/hotspot/share/opto/addnode.hpp
+++ b/src/hotspot/share/opto/addnode.hpp
@@ -230,7 +230,7 @@ class AddPNode : public Node {
AddPNode(Node* base, Node* ptr, Node* off) : Node(nullptr, base, ptr, off) {
init_class_id(Class_AddP);
assert((ptr->bottom_type() == Type::TOP) ||
- ((base == Compile::current()->top()) == (ptr->bottom_type()->make_ptr()->isa_oopptr() == nullptr)),
+ ((base == Compile::current()->top()) == (!ptr->bottom_type()->make_ptr()->is_oopptr())),
"base input only needed for heap addresses");
}
diff --git a/src/hotspot/share/opto/arraycopynode.cpp b/src/hotspot/share/opto/arraycopynode.cpp
index 289ae5011f2..fd1c658ff8f 100644
--- a/src/hotspot/share/opto/arraycopynode.cpp
+++ b/src/hotspot/share/opto/arraycopynode.cpp
@@ -122,8 +122,8 @@ int ArrayCopyNode::get_count(PhaseGVN *phase) const {
return -1;
}
- if (src_type->isa_instptr()) {
- const TypeInstPtr* inst_src = src_type->is_instptr();
+ if (src_type->is_instptr()) {
+ const TypeInstPtr* inst_src = src_type->as_instptr();
ciInstanceKlass* ik = inst_src->instance_klass();
// ciInstanceKlass::nof_nonstatic_fields() doesn't take injected
// fields into account. They are rare anyway so easier to simply
@@ -223,7 +223,7 @@ Node* ArrayCopyNode::try_clone_instance(PhaseGVN *phase, bool can_reshape, int c
}
}
- const TypeInstPtr* dest_type = phase->type(base_dest)->is_instptr();
+ const TypeInstPtr* dest_type = phase->type(base_dest)->as_instptr();
if (dest_type->instance_klass() != ik) {
// At parse time, the exact type of the object to clone was not known. That inexact type was captured by the CheckCastPP
// of the newly allocated cloned object (in dest). The exact type is now known (in src), but the type for the cloned object
@@ -384,7 +384,7 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
return false;
}
- BasicType elem = ary_src->isa_aryptr()->elem()->array_element_basic_type();
+ BasicType elem = ary_src->elem()->array_element_basic_type();
if (is_reference_type(elem, true)) {
elem = T_OBJECT;
}
@@ -404,7 +404,7 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
// If the clone copy is decomposed into load-stores - the address is adjusted to
// point at where the array starts.
const Type* toff = phase->type(src_offset);
- int offset = toff->isa_long() ? (int) toff->is_long()->get_con() : (int) toff->is_int()->get_con();
+ int offset = toff->is_long() ? static_cast(toff->as_long()->get_con()) : toff->as_int()->get_con();
int diff = arrayOopDesc::base_offset_in_bytes(elem) - offset;
assert(diff >= 0, "clone should not start after 1st array element");
if (diff > 0) {
@@ -422,7 +422,7 @@ const TypeAryPtr* ArrayCopyNode::get_address_type(PhaseGVN* phase, const TypePtr
atp = phase->type(n)->isa_ptr();
}
// adjust atp to be the correct array element address type
- return atp->add_offset(Type::OffsetBot)->is_aryptr();
+ return atp->add_offset(Type::OffsetBot)->as_aryptr();
}
void ArrayCopyNode::array_copy_test_overlap(GraphKit& kit, bool disjoint_bases, int count, Node*& backward_ctl) {
@@ -643,7 +643,7 @@ Node *ArrayCopyNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const Type* src_type = phase->type(src);
const Type* dest_type = phase->type(dest);
- if (src_type->isa_aryptr() && dest_type->isa_instptr()) {
+ if (src_type->is_aryptr() && dest_type->is_instptr()) {
// clone used for load of unknown value type can't be optimized at
// this point
return nullptr;
@@ -783,9 +783,9 @@ bool ArrayCopyNode::may_modify(const TypeOopPtr* t_oop, PhaseValues* phase) cons
if (dest->is_top()) {
return false;
}
- const TypeOopPtr* dest_t = phase->type(dest)->is_oopptr();
+ const TypeOopPtr* dest_t = phase->type(dest)->as_oopptr();
assert(!dest_t->is_known_instance() || _dest_type->is_known_instance(), "result of EA not recorded");
- assert(in(ArrayCopyNode::Src)->is_top() || !phase->type(in(ArrayCopyNode::Src))->is_oopptr()->is_known_instance() ||
+ assert(in(ArrayCopyNode::Src)->is_top() || !phase->type(in(ArrayCopyNode::Src))->as_oopptr()->is_known_instance() ||
_src_type->is_known_instance(), "result of EA not recorded");
if (_dest_type != TypeOopPtr::BOTTOM || t_oop->is_known_instance()) {
@@ -859,7 +859,7 @@ bool ArrayCopyNode::modifies(intptr_t offset_lo, intptr_t offset_hi, PhaseValues
return !must_modify;
}
- BasicType ary_elem = ary_t->isa_aryptr()->elem()->array_element_basic_type();
+ BasicType ary_elem = ary_t->elem()->array_element_basic_type();
if (is_reference_type(ary_elem, true)) ary_elem = T_OBJECT;
uint header;
diff --git a/src/hotspot/share/opto/buildOopMap.cpp b/src/hotspot/share/opto/buildOopMap.cpp
index ccf0756eab7..4b34321bf9a 100644
--- a/src/hotspot/share/opto/buildOopMap.cpp
+++ b/src/hotspot/share/opto/buildOopMap.cpp
@@ -235,7 +235,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
assert( def, "since live better have reaching def" );
if (def->is_MachTemp()) {
- assert(!def->bottom_type()->isa_oop_ptr(),
+ assert(!def->bottom_type()->is_oopptr(),
"ADLC only assigns OOP types to MachTemp defs corresponding to xRegN operands");
// Exclude MachTemp definitions even if they are typed as oops.
continue;
@@ -243,7 +243,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
// Classify the reaching def as oop, derived, callee-save, dead, or other
const Type *t = def->bottom_type();
- if( t->isa_oop_ptr() ) { // Oop or derived?
+ if (t->is_oopptr()) { // Oop or derived?
assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
#ifdef _LP64
// 64-bit pointers record oop-ishness on 2 aligned adjacent registers.
@@ -264,7 +264,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
regalloc->C->record_method_not_compilable(ss.as_string());
continue;
}
- if (t->is_ptr()->offset() == 0) { // Not derived?
+ if (t->as_ptr()->offset() == 0) { // Not derived?
if( mcall ) {
// Outgoing argument GC mask responsibility belongs to the callee,
// not the caller. Inspect the inputs to the call, to see if
@@ -324,7 +324,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
omap->set_derived_oop(r, b);
}
- } else if( t->isa_narrowoop() ) {
+ } else if (t->is_narrowoop()) {
assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" );
// Check for a legal reg name in the oopMap and bailout if it is not.
if (!omap->legal_vm_reg_name(r)) {
@@ -358,7 +358,7 @@ OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, i
} else {
// Other - some reaching non-oop value
#ifdef ASSERT
- if (t->isa_rawptr()) {
+ if (t->is_rawptr()) {
ResourceMark rm;
Unique_Node_List worklist;
worklist.push(def);
@@ -519,7 +519,7 @@ static void do_liveness(PhaseRegAlloc* regalloc, PhaseCFG* cfg, Block_List* work
// with these, but are presuming (with trepidation) that not any of
// them are oops. This can be fixed by making get_base_and_disp()
// look at a specific input instead of all inputs.
- assert(!def->bottom_type()->isa_oop_ptr(), "expecting non-oop mem input");
+ assert(!def->bottom_type()->is_oopptr(), "expecting non-oop mem input");
} else if (base != fp || offset == Type::OffsetBot) {
// Do nothing: the fp operand is either not from a memory use
// (base == nullptr) OR the fp is used in a non-memory context
diff --git a/src/hotspot/share/opto/callGenerator.cpp b/src/hotspot/share/opto/callGenerator.cpp
index dc1ee79297a..d3690598704 100644
--- a/src/hotspot/share/opto/callGenerator.cpp
+++ b/src/hotspot/share/opto/callGenerator.cpp
@@ -1303,7 +1303,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
Node* member_name = kit.argument(nargs - 1);
if (member_name->Opcode() == Op_ConP) {
input_not_const = false;
- const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr();
+ const TypeOopPtr* oop_ptr = member_name->bottom_type()->as_oopptr();
ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget();
if (!ciMethod::is_consistent_info(callee, target)) {
diff --git a/src/hotspot/share/opto/callnode.cpp b/src/hotspot/share/opto/callnode.cpp
index cd722763eea..b485c965b06 100644
--- a/src/hotspot/share/opto/callnode.cpp
+++ b/src/hotspot/share/opto/callnode.cpp
@@ -369,42 +369,42 @@ static void format_helper( PhaseRegAlloc *regalloc, outputStream* st, Node *n, c
const Type *t = n->bottom_type();
switch (t->base()) {
case Type::Int:
- st->print(" %s%d]=#" INT32_FORMAT,msg,i,t->is_int()->get_con());
+ st->print(" %s%d]=#" INT32_FORMAT, msg, i, t->as_int()->get_con());
break;
case Type::AnyPtr:
assert( t == TypePtr::NULL_PTR || n->in_dump(), "" );
- st->print(" %s%d]=#null",msg,i);
+ st->print(" %s%d]=#null", msg, i);
break;
case Type::AryPtr:
case Type::InstPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->isa_oopptr()->const_oop()));
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT, msg, i, p2i(t->as_oopptr()->const_oop()));
break;
case Type::KlassPtr:
case Type::AryKlassPtr:
case Type::InstKlassPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_klassptr()->exact_klass()));
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT, msg, i, p2i(t->make_ptr()->as_klassptr()->exact_klass()));
break;
case Type::MetadataPtr:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_metadataptr()->metadata()));
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT, msg, i, p2i(t->make_ptr()->as_metadataptr()->metadata()));
break;
case Type::NarrowOop:
- st->print(" %s%d]=#Ptr" INTPTR_FORMAT,msg,i,p2i(t->make_ptr()->isa_oopptr()->const_oop()));
+ st->print(" %s%d]=#Ptr" INTPTR_FORMAT, msg, i, p2i(t->make_ptr()->as_oopptr()->const_oop()));
break;
case Type::RawPtr:
- st->print(" %s%d]=#Raw" INTPTR_FORMAT,msg,i,p2i(t->is_rawptr()));
+ st->print(" %s%d]=#Raw" INTPTR_FORMAT, msg, i, p2i(t->as_rawptr()));
break;
case Type::DoubleCon:
- st->print(" %s%d]=#%fD",msg,i,t->is_double_constant()->_d);
+ st->print(" %s%d]=#%fD", msg, i, t->as_double_constant()->_d);
break;
case Type::FloatCon:
- st->print(" %s%d]=#%fF",msg,i,t->is_float_constant()->_f);
+ st->print(" %s%d]=#%fF", msg, i, t->as_float_constant()->_f);
break;
case Type::Long:
- st->print(" %s%d]=#" INT64_FORMAT,msg,i,(int64_t)(t->is_long()->get_con()));
+ st->print(" %s%d]=#" INT64_FORMAT, msg, i, (int64_t)(t->as_long()->get_con()));
break;
case Type::Half:
case Type::Top:
- st->print(" %s%d]=_",msg,i);
+ st->print(" %s%d]=_", msg, i);
break;
default: ShouldNotReachHere();
}
@@ -473,7 +473,7 @@ void JVMState::format(PhaseRegAlloc *regalloc, const Node *n, outputStream* st)
st->cr();
st->print(" # ScObj" INT32_FORMAT " ", i);
SafePointScalarObjectNode* spobj = scobjs.at(i);
- ciKlass* cik = spobj->bottom_type()->is_oopptr()->exact_klass();
+ ciKlass* cik = spobj->bottom_type()->as_oopptr()->exact_klass();
assert(cik->is_instance_klass() ||
cik->is_array_klass(), "Not supported allocation.");
ciInstanceKlass *iklass = nullptr;
@@ -865,7 +865,7 @@ bool CallNode::may_modify(const TypeOopPtr* t_oop, PhaseValues* phase) const {
// different signatures. Look for the second pointer argument,
// that is the destination of the copy.
for (uint i = TypeFunc::Parms, j = 0; i < args->cnt(); i++) {
- if (args->field_at(i)->isa_ptr()) {
+ if (args->field_at(i)->is_ptr()) {
j++;
if (j == 2) {
dest = in(i);
@@ -874,11 +874,11 @@ bool CallNode::may_modify(const TypeOopPtr* t_oop, PhaseValues* phase) const {
}
}
guarantee(dest != nullptr, "Call had only one ptr in, broken IR!");
- if (phase->type(dest)->isa_rawptr()) {
+ if (phase->type(dest)->is_rawptr()) {
// may happen for an arraycopy that initializes a newly allocated object. Conservatively return true;
return true;
}
- if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) {
+ if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->as_oopptr(), t_oop, phase)) {
return true;
}
return false;
@@ -889,11 +889,11 @@ bool CallNode::may_modify(const TypeOopPtr* t_oop, PhaseValues* phase) const {
return false;
}
if (t_oop->is_ptr_to_boxed_value() && is_CallStaticJava()) {
- ciKlass* boxing_klass = t_oop->is_instptr()->instance_klass();
+ ciKlass* boxing_klass = t_oop->as_instptr()->instance_klass();
if (as_CallStaticJava()->is_boxing_method()) {
// Skip unrelated boxing methods.
Node* proj = proj_out_or_null(TypeFunc::Parms);
- if ((proj == nullptr) || (phase->type(proj)->is_instptr()->instance_klass() != boxing_klass)) {
+ if ((proj == nullptr) || (phase->type(proj)->as_instptr()->instance_klass() != boxing_klass)) {
return false;
}
}
@@ -1253,14 +1253,14 @@ int CallStaticJavaNode::extract_uncommon_trap_request(const Node* call) {
#ifndef PRODUCT
if (!(call->req() > TypeFunc::Parms &&
call->in(TypeFunc::Parms) != nullptr &&
- call->in(TypeFunc::Parms)->bottom_type()->isa_int() &&
- call->in(TypeFunc::Parms)->bottom_type()->is_int()->is_con())) {
+ call->in(TypeFunc::Parms)->bottom_type()->is_int() &&
+ call->in(TypeFunc::Parms)->bottom_type()->as_int()->is_con())) {
assert(in_dump() != 0, "OK if dumping");
tty->print("[bad uncommon trap]");
return 0;
}
#endif
- return call->in(TypeFunc::Parms)->bottom_type()->is_int()->get_con();
+ return call->in(TypeFunc::Parms)->bottom_type()->as_int()->get_con();
}
// Split if can cause the flat array branch of an array load with unknown type (see
@@ -1634,12 +1634,12 @@ void CallRuntimeNode::calling_convention(BasicType* sig_bt, VMRegPair *parm_regs
void CallLeafVectorNode::calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const {
#ifdef ASSERT
- assert(tf()->range_sig()->field_at(TypeFunc::Parms)->is_vect()->length_in_bytes() * BitsPerByte == _num_bits,
+ assert(tf()->range_sig()->field_at(TypeFunc::Parms)->as_vect()->length_in_bytes() * BitsPerByte == _num_bits,
"return vector size must match");
const TypeTuple* d = tf()->domain_sig();
for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
Node* arg = in(i);
- assert(arg->bottom_type()->is_vect()->length_in_bytes() * BitsPerByte == _num_bits,
+ assert(arg->bottom_type()->as_vect()->length_in_bytes() * BitsPerByte == _num_bits,
"vector argument size must match");
}
#endif
@@ -2134,7 +2134,7 @@ Node* AllocateNode::make_ideal_mark(PhaseGVN* phase, Node* control, Node* mem) {
if (UseCompactObjectHeaders || Arguments::is_valhalla_enabled()) {
Node* klass_node = in(AllocateNode::KlassNode);
Node* proto_adr = phase->transform(AddPNode::make_with_base(phase->C->top(), klass_node, phase->MakeConX(in_bytes(Klass::prototype_header_offset()))));
- mark_node = LoadNode::make(*phase, control, mem, proto_adr, phase->type(proto_adr)->is_ptr(), TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
+ mark_node = LoadNode::make(*phase, control, mem, proto_adr, phase->type(proto_adr)->as_ptr(), TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
} else {
// For now only enable fast locking for non-array types
mark_node = phase->MakeConX(markWord::prototype().value());
@@ -2728,12 +2728,12 @@ bool CallNode::may_modify_arraycopy_helper(const TypeOopPtr* dest_t, const TypeO
return dest_t->instance_id() == t_oop->instance_id();
}
- if (dest_t->isa_instptr() && !dest_t->is_instptr()->instance_klass()->equals(phase->C->env()->Object_klass())) {
+ if (dest_t->is_instptr() && !dest_t->as_instptr()->instance_klass()->equals(phase->C->env()->Object_klass())) {
// clone
- if (t_oop->isa_aryptr()) {
+ if (t_oop->is_aryptr()) {
return false;
}
- if (!t_oop->isa_instptr()) {
+ if (!t_oop->is_instptr()) {
return true;
}
if (dest_t->maybe_java_subtype_of(t_oop) || t_oop->maybe_java_subtype_of(dest_t)) {
@@ -2743,23 +2743,23 @@ bool CallNode::may_modify_arraycopy_helper(const TypeOopPtr* dest_t, const TypeO
return false;
}
- if (dest_t->isa_aryptr()) {
+ if (dest_t->is_aryptr()) {
// arraycopy or array clone
- if (t_oop->isa_instptr()) {
+ if (t_oop->is_instptr()) {
return false;
}
- if (!t_oop->isa_aryptr()) {
+ if (!t_oop->is_aryptr()) {
return true;
}
- const Type* elem = dest_t->is_aryptr()->elem();
+ const Type* elem = dest_t->as_aryptr()->elem();
if (elem == Type::BOTTOM) {
// An array but we don't know what elements are
return true;
}
- dest_t = dest_t->is_aryptr()->with_field_offset(Type::OffsetBot)->add_offset(Type::OffsetBot)->is_oopptr();
- t_oop = t_oop->is_aryptr()->with_field_offset(Type::OffsetBot);
+ dest_t = dest_t->as_aryptr()->with_field_offset(Type::OffsetBot)->add_offset(Type::OffsetBot)->as_oopptr();
+ t_oop = t_oop->as_aryptr()->with_field_offset(Type::OffsetBot);
uint dest_alias = phase->C->get_alias_index(dest_t);
uint t_oop_alias = phase->C->get_alias_index(t_oop);
diff --git a/src/hotspot/share/opto/callnode.hpp b/src/hotspot/share/opto/callnode.hpp
index 7fbc4a5431e..05a7278135a 100644
--- a/src/hotspot/share/opto/callnode.hpp
+++ b/src/hotspot/share/opto/callnode.hpp
@@ -392,7 +392,7 @@ class SafePointNode : public MultiNode {
void verify_input(const JVMState* jvms, uint idx) const {
assert(verify_jvms(jvms), "jvms must match");
Node* n = in(idx);
- assert((!n->bottom_type()->isa_long() && !n->bottom_type()->isa_double()) ||
+ assert((!n->bottom_type()->is_long() && !n->bottom_type()->is_double()) ||
in(idx + 1)->is_top(), "2nd half of long/double");
}
@@ -841,7 +841,7 @@ class CallNode : public SafePointNode {
const TypeTuple* r = tf()->range_sig();
return (!tf()->returns_value_type_as_fields() &&
r->cnt() > TypeFunc::Parms &&
- r->field_at(TypeFunc::Parms)->isa_ptr());
+ r->field_at(TypeFunc::Parms)->is_ptr());
}
// Collect all the interesting edges from a call for use in
@@ -936,8 +936,8 @@ class CallStaticJavaNode : public CallJavaNode {
method != nullptr &&
method->is_method_handle_intrinsic() &&
r->cnt() > TypeFunc::Parms &&
- r->field_at(TypeFunc::Parms)->isa_oopptr() &&
- r->field_at(TypeFunc::Parms)->is_oopptr()->can_be_value_type()) {
+ r->field_at(TypeFunc::Parms)->is_oopptr() &&
+ r->field_at(TypeFunc::Parms)->as_oopptr()->can_be_value_type()) {
// Make sure this call is processed by PhaseMacroExpand::expand_mh_intrinsic_return
C->add_macro_node(this);
}
diff --git a/src/hotspot/share/opto/castnode.cpp b/src/hotspot/share/opto/castnode.cpp
index 4ed2fe54b4d..980dce80d6f 100644
--- a/src/hotspot/share/opto/castnode.cpp
+++ b/src/hotspot/share/opto/castnode.cpp
@@ -97,7 +97,7 @@ const Type* ConstraintCastNode::Value(PhaseGVN* phase) const {
}
case Op_CastPP:
if (in_type == TypePtr::NULL_PTR &&
- _type->isa_ptr() && _type->is_ptr()->_ptr == TypePtr::NotNull) {
+ _type->is_ptr() && _type->as_ptr()->_ptr == TypePtr::NotNull) {
assert(ft == Type::TOP, "special case #3");
break;
}
@@ -177,7 +177,7 @@ TypeNode* ConstraintCastNode::dominating_cast(PhaseGVN* gvn, PhaseTransform* pt)
if (is_CastII() && as_CastII()->has_range_check()) {
return nullptr;
}
- if (type()->isa_rawptr() && (gvn->type_or_null(val) == nullptr || gvn->type(val)->isa_oopptr())) {
+ if (type()->is_rawptr() && (gvn->type_or_null(val) == nullptr || gvn->type(val)->is_oopptr())) {
return nullptr;
}
for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) {
@@ -204,8 +204,8 @@ TypeNode* ConstraintCastNode::dominating_cast(PhaseGVN* gvn, PhaseTransform* pt)
bool ConstraintCastNode::higher_equal_types(PhaseGVN* phase, const Node* other) const {
const Type* t = phase->type(other);
- if ((t->isa_rawptr() && (type()->isa_oopptr() || type()->isa_klassptr())) ||
- ((t->isa_oopptr() || t->isa_klassptr()) && type()->isa_rawptr())) {
+ if ((t->is_rawptr() && (type()->is_oopptr() || type()->is_klassptr())) ||
+ ((t->is_oopptr() || t->is_klassptr()) && type()->is_rawptr())) {
assert(is_CheckCastPP(), "unrelated types from %s", Name());
return false;
}
@@ -229,7 +229,7 @@ Node* ConstraintCastNode::pin_node_under_control_impl() const {
Node* ConstraintCastNode::ideal_cast_of_value_type_node(PhaseGVN* phase) {
ValueTypeNode* vt = in(1)->as_ValueType();
- if (type()->isa_rawptr() != nullptr) {
+ if (type()->is_rawptr()) {
return nullptr;
}
@@ -449,8 +449,8 @@ Node* CastLLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
const Type* t = Value(phase);
const Type* t_in = phase->type(in1);
if (t != Type::TOP && t_in != Type::TOP) {
- const TypeLong* tl = t->is_long();
- const TypeLong* t_in_l = t_in->is_long();
+ const TypeLong* tl = t->as_long();
+ const TypeLong* t_in_l = t_in->as_long();
assert(t_in_l->contains(tl), "CastLL type should be narrower than or equal to the type of its input");
assert((tl != t_in_l) == t_in_l->strictly_contains(tl), "if type differs then this nodes's type must be narrower");
if (tl != t_in_l) {
@@ -474,7 +474,7 @@ Node* CastLLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
//------------------------------Identity---------------------------------------
// If input is already higher or equal to cast type, then this is an identity.
Node* CheckCastPPNode::Identity(PhaseGVN* phase) {
- if (in(1)->is_ValueType() && _type->isa_instptr() && phase->type(in(1))->value_klass()->is_subtype_of(_type->is_instptr()->instance_klass())) {
+ if (in(1)->is_ValueType() && _type->is_instptr() && phase->type(in(1))->value_klass()->is_subtype_of(_type->as_instptr()->instance_klass())) {
return in(1);
}
return ConstraintCastNode::Identity(phase);
@@ -500,20 +500,20 @@ void CastPPNode::verify_type(const Type* in_type, const Type* out_type) {
if (in_type == TypePtr::NULL_PTR || out_type == TypePtr::NULL_PTR) {
return;
}
- if (!in_type->isa_oopptr() && !out_type->isa_oopptr()) {
+ if (!in_type->is_oopptr() && !out_type->is_oopptr()) {
return;
}
- assert(in_type->isa_oopptr() && out_type->isa_oopptr(), "must be both oops or both non-oops");
- if (in_type->isa_aryptr() && out_type->isa_aryptr()) {
- const Type* e1 = in_type->is_aryptr()->elem();
- const Type* e2 = out_type->is_aryptr()->elem();
+ assert(in_type->is_oopptr() && out_type->is_oopptr(), "must be both oops or both non-oops");
+ if (in_type->is_aryptr() && out_type->is_aryptr()) {
+ const Type* e1 = in_type->as_aryptr()->elem();
+ const Type* e2 = out_type->as_aryptr()->elem();
assert(e1->basic_type() == e2->basic_type(), "must both be arrays of the same primitive type or both be oops arrays");
return;
}
- assert(in_type->isa_instptr() && out_type->isa_instptr(), "must be both array oops or both non-array oops");
- assert(in_type->is_instptr()->instance_klass() == out_type->is_instptr()->instance_klass(), "must not cast to a different type");
+ assert(in_type->is_instptr() && out_type->is_instptr(), "must be both array oops or both non-array oops");
+ assert(in_type->as_instptr()->instance_klass() == out_type->as_instptr()->instance_klass(), "must not cast to a different type");
#endif // ASSERT
}
@@ -525,7 +525,7 @@ const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
const Type *inn = phase->type(in(1));
if( inn == Type::TOP ) return Type::TOP; // No information yet
- if (inn->isa_oopptr() && _type->isa_oopptr()) {
+ if (inn->is_oopptr() && _type->is_oopptr()) {
return ConstraintCastNode::Value(phase);
}
@@ -534,11 +534,11 @@ const Type* CheckCastPPNode::Value(PhaseGVN* phase) const {
const Type *result = _type;
if (in_type != nullptr && my_type != nullptr) {
// TODO 8302672
- if (!StressReflectiveCode && my_type->isa_aryptr() && in_type->isa_aryptr()) {
+ if (!StressReflectiveCode && my_type->is_aryptr() && in_type->is_aryptr()) {
// Propagate array properties (not flat/null-free)
// Don't do this when StressReflectiveCode is enabled because it might lead to
// a dying data path while the corresponding flat/null-free check is not folded.
- my_type = my_type->is_aryptr()->update_properties(in_type->is_aryptr());
+ my_type = my_type->as_aryptr()->update_properties(in_type->as_aryptr());
if (my_type == nullptr) {
return Type::TOP; // Inconsistent properties
}
@@ -570,7 +570,7 @@ const Type* CastX2PNode::Value(PhaseGVN* phase) const {
const Type* t = phase->type(in(1));
if (t == Type::TOP) return Type::TOP;
if (t->base() == Type_X && t->singleton()) {
- uintptr_t bits = (uintptr_t) t->is_intptr_t()->get_con();
+ uintptr_t bits = (uintptr_t) t->as_intptr_t()->get_con();
if (bits == 0) return TypePtr::NULL_PTR;
return TypeRawPtr::make((address) bits);
}
@@ -580,7 +580,7 @@ const Type* CastX2PNode::Value(PhaseGVN* phase) const {
//------------------------------Idealize---------------------------------------
static inline bool fits_in_int(const Type* t, bool but_not_min_int = false) {
if (t == Type::TOP) return false;
- const TypeX* tl = t->is_intptr_t();
+ const TypeX* tl = t->as_intptr_t();
jint lo = min_jint;
jint hi = max_jint;
if (but_not_min_int) ++lo; // caller wants to negate the value w/o overflow
@@ -639,7 +639,7 @@ const Type* CastP2XNode::Value(PhaseGVN* phase) const {
const Type* t = phase->type(in(1));
if (t == Type::TOP) return Type::TOP;
if (t->base() == Type::RawPtr && t->singleton()) {
- uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con();
+ uintptr_t bits = (uintptr_t) t->as_rawptr()->get_con();
return TypeX::make(bits);
}
return CastP2XNode::bottom_type();
@@ -657,19 +657,19 @@ Node* CastP2XNode::Identity(PhaseGVN* phase) {
Node* ConstraintCastNode::make_cast_for_type(Node* c, Node* in, const Type* type, const DependencyType& dependency,
const TypeTuple* types) {
- if (type->isa_int()) {
+ if (type->is_int()) {
return new CastIINode(c, in, type, dependency, false, types);
- } else if (type->isa_long()) {
+ } else if (type->is_long()) {
return new CastLLNode(c, in, type, dependency, types);
- } else if (type->isa_half_float()) {
+ } else if (type->is_half_float()) {
return new CastHHNode(c, in, type, dependency, types);
- } else if (type->isa_float()) {
+ } else if (type->is_float()) {
return new CastFFNode(c, in, type, dependency, types);
- } else if (type->isa_double()) {
+ } else if (type->is_double()) {
return new CastDDNode(c, in, type, dependency, types);
- } else if (type->isa_vect()) {
+ } else if (type->is_vect()) {
return new CastVVNode(c, in, type, dependency, types);
- } else if (type->isa_ptr()) {
+ } else if (type->is_ptr()) {
return new CastPPNode(c, in, type, dependency, types);
}
fatal("unreachable. Invalid cast type.");
@@ -698,8 +698,8 @@ Node* ConstraintCastNode::optimize_integer_cast_of_add(PhaseGVN* phase, BasicTyp
Node* x = z->in(1);
Node* y = z->in(2);
- const TypeInteger* tx = phase->type(x)->is_integer(bt);
- const TypeInteger* ty = phase->type(y)->is_integer(bt);
+ const TypeInteger* tx = phase->type(x)->as_integer(bt);
+ const TypeInteger* ty = phase->type(y)->as_integer(bt);
// (Cast (Add x y) tz) is transformed into (Add (Cast x rx) (Cast y ry))
//
@@ -764,7 +764,7 @@ Node* ConstraintCastNode::optimize_integer_cast(PhaseGVN* phase, BasicType bt) {
}
const TypeInteger* ConstraintCastNode::widen_type(const PhaseGVN* phase, const Type* res, BasicType bt) const {
- const TypeInteger* this_type = res->is_integer(bt);
+ const TypeInteger* this_type = res->as_integer(bt);
// At VerifyConstraintCasts == 1, we verify the ConstraintCastNodes that are present during code
// emission. This allows us detecting possible mis-scheduling due to these nodes being pinned at
// the wrong control nodes.
@@ -794,7 +794,7 @@ const TypeInteger* ConstraintCastNode::widen_type(const PhaseGVN* phase, const T
hi = max_signed_integer(bt);
}
// Must filter in the same direction as Value
- return in_type->filter(TypeInteger::make(lo, hi, w, bt))->is_integer(bt);
+ return in_type->filter(TypeInteger::make(lo, hi, w, bt))->as_integer(bt);
}
return this_type;
}
diff --git a/src/hotspot/share/opto/castnode.hpp b/src/hotspot/share/opto/castnode.hpp
index 8998112f0ae..4e511021d12 100644
--- a/src/hotspot/share/opto/castnode.hpp
+++ b/src/hotspot/share/opto/castnode.hpp
@@ -334,7 +334,7 @@ class CheckCastPPNode: public ConstraintCastNode {
virtual uint ideal_reg() const { return Op_RegP; }
private:
- virtual bool depends_only_on_test_impl() const { return !type()->isa_rawptr() && ConstraintCastNode::depends_only_on_test_impl(); }
+ virtual bool depends_only_on_test_impl() const { return !type()->is_rawptr() && ConstraintCastNode::depends_only_on_test_impl(); }
virtual Node* pin_node_under_control_impl() const;
};
diff --git a/src/hotspot/share/opto/cfgnode.cpp b/src/hotspot/share/opto/cfgnode.cpp
index f53614b5358..60cd14f95ac 100644
--- a/src/hotspot/share/opto/cfgnode.cpp
+++ b/src/hotspot/share/opto/cfgnode.cpp
@@ -1245,9 +1245,9 @@ void PhiNode::verify_adr_type(bool recursive) const {
// Flat array elements shouldn't get their own memory slice until flat_accesses_share_alias is cleared.
// It could be the graph has no loads/stores and flat_accesses_share_alias is never cleared. EA could still
// create per-element Phis but that wouldn't be a problem as there are no memory accesses for that array.
- assert(_adr_type == nullptr || _adr_type->isa_aryptr() == nullptr ||
- _adr_type->is_aryptr()->is_known_instance() ||
- !_adr_type->is_aryptr()->is_flat() ||
+ assert(_adr_type == nullptr || !_adr_type->is_aryptr() ||
+ _adr_type->as_aryptr()->is_known_instance() ||
+ !_adr_type->as_aryptr()->is_flat() ||
!Compile::current()->flat_accesses_share_alias() ||
_adr_type == TypeAryPtr::INLINES, "flat array element shouldn't get its own slice yet");
@@ -1390,13 +1390,13 @@ const Type* PhiNode::Value(PhaseGVN* phase) const {
else {
if (jt != ft && jt->base() == ft->base()) {
- if (jt->isa_int() &&
- jt->is_int()->_lo == ft->is_int()->_lo &&
- jt->is_int()->_hi == ft->is_int()->_hi)
+ if (jt->is_int() &&
+ jt->as_int()->_lo == ft->as_int()->_lo &&
+ jt->as_int()->_hi == ft->as_int()->_hi)
jt = ft;
- if (jt->isa_long() &&
- jt->is_long()->_lo == ft->is_long()->_lo &&
- jt->is_long()->_hi == ft->is_long()->_hi)
+ if (jt->is_long() &&
+ jt->as_long()->_lo == ft->as_long()->_lo &&
+ jt->as_long()->_hi == ft->as_long()->_hi)
jt = ft;
}
if (jt != ft) {
@@ -1652,7 +1652,7 @@ Node* PhiNode::unique_input(PhaseValues* phase, bool uncast) {
#endif
while (un != nullptr && un->req() == 2 && un->is_ConstraintCast()) {
Node* next = un->in(1);
- if (phase->type(next)->isa_rawptr() && phase->type(un)->isa_oopptr()) {
+ if (phase->type(next)->is_rawptr() && phase->type(un)->is_oopptr()) {
// risk exposing raw ptr at safepoint
break;
}
@@ -2045,7 +2045,7 @@ static Node* split_flow_path(PhaseGVN *phase, PhiNode *phi) {
// and from half float will return the SHORT basic type, as that wouldn't be returned typically from TypeInt.
static BasicType get_convert_type(Node* convert, const Type* type) {
int convert_op = convert->Opcode();
- if (type->isa_int() && (convert_op == Op_ConvHF2F || convert_op == Op_ConvF2HF)) {
+ if (type->is_int() && (convert_op == Op_ConvHF2F || convert_op == Op_ConvF2HF)) {
return T_SHORT;
}
@@ -2486,9 +2486,9 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// going away
Node* cast = nullptr;
const TypeTuple* extra_types = collect_types(phase);
- if (phi_type->isa_ptr()) {
+ if (phi_type->is_ptr()) {
const Type* uin_type = phase->type(uin);
- if (!phi_type->isa_oopptr() && !uin_type->isa_oopptr()) {
+ if (!phi_type->is_oopptr() && !uin_type->is_oopptr()) {
cast = new CastPPNode(r, uin, phi_type, ConstraintCastNode::DependencyType::NonFloatingNarrowing, extra_types);
} else {
// Use a CastPP for a cast to not null and a CheckCastPP for
@@ -2767,9 +2767,9 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Make narrow type for new phi.
const Type* narrow_t;
if (is_decodeN) {
- narrow_t = TypeNarrowOop::make(this->bottom_type()->is_ptr());
+ narrow_t = TypeNarrowOop::make(this->bottom_type()->as_ptr());
} else {
- narrow_t = TypeNarrowKlass::make(this->bottom_type()->is_ptr());
+ narrow_t = TypeNarrowKlass::make(this->bottom_type()->as_ptr());
}
PhiNode* new_phi = new PhiNode(r, narrow_t);
uint orig_cnt = req();
@@ -2845,7 +2845,7 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
}
// Phi (VB ... VB) => VB (Phi ...) (Phi ...)
- if (EnableVectorReboxing && can_reshape && progress == nullptr && type()->isa_oopptr()) {
+ if (EnableVectorReboxing && can_reshape && progress == nullptr && type()->is_oopptr()) {
progress = merge_through_phi(this, phase->is_IterGVN());
}
@@ -2948,7 +2948,7 @@ class PushValueTypeDown {
for (uint j = 0; j < value_type->field_count(); ++j) {
Node* field = value_type->field_value(j);
const Type* field_type = _phase->type(field);
- if (field_type->isa_instptr() && !field_type->is_valueklassptr() && field_type->is_instptr()->can_be_value_type()) {
+ if (field_type->is_instptr() && !field_type->is_valueklassptr() && field_type->as_instptr()->can_be_value_type()) {
_nodes_from_phi.push(field);
}
}
@@ -3123,7 +3123,7 @@ class PushValueTypeDown {
for (uint j = 0; j < value_type->field_count(); ++j) {
Node* field = value_type->field_value(j);
const Type* field_type = _phase->type(field);
- if (field_type->isa_instptr() && !field_type->is_valueklassptr() && field_type->is_instptr()->can_be_value_type()) {
+ if (field_type->is_instptr() && !field_type->is_valueklassptr() && field_type->as_instptr()->can_be_value_type()) {
after.push(field);
}
}
@@ -3195,7 +3195,7 @@ class PushValueTypeDown {
vt->merge_with(_phase, n->as_ValueType(), i, transform);
} // else nothing to do: phis above vt created by clone_with_phis are initialized to top already.
}
- if (phi == _root_phi && _root_phi->bottom_type()->isa_narrowoop()) {
+ if (phi == _root_phi && _root_phi->bottom_type()->is_narrowoop()) {
return new EncodePNode(_phase->transform(vt), _root_phi->bottom_type());
}
return vt;
@@ -3343,7 +3343,7 @@ const TypeTuple* PhiNode::collect_types(PhaseGVN* phase) const {
}
while (in != nullptr && in->is_ConstraintCast()) {
Node* next = in->in(1);
- if (phase->type(next)->isa_rawptr() && phase->type(in)->isa_oopptr()) {
+ if (phase->type(next)->is_rawptr() && phase->type(in)->is_oopptr()) {
break;
}
ConstraintCastNode* cast = in->as_ConstraintCast();
@@ -3645,7 +3645,7 @@ const Type* CatchNode::Value(PhaseGVN* phase) const {
Node* valid_length_test = call->in(AllocateNode::ValidLengthTest);
const Type* valid_length_test_t = phase->type(valid_length_test);
if (length_type == Type::TOP || klass_type == Type::TOP || valid_length_test_t == Type::TOP ||
- valid_length_test_t->is_int()->is_con(0)) {
+ valid_length_test_t->as_int()->is_con(0)) {
f[CatchProjNode::fall_through_index] = Type::TOP;
}
} else if( call->req() > TypeFunc::Parms ) {
@@ -3677,7 +3677,7 @@ bool CatchProjNode::cmp( const Node &n ) const {
// If only 1 target is possible, choose it if it is the main control
Node* CatchProjNode::Identity(PhaseGVN* phase) {
// If my value is control and no other value is, then treat as ID
- const TypeTuple *t = phase->type(in(0))->is_tuple();
+ const TypeTuple* t = phase->type(in(0))->as_tuple();
if (t->field_at(_con) != Type::CONTROL) return this;
// If we remove the last CatchProj and elide the Catch/CatchProj, then we
// also remove any exception table entry. Thus we must know the call
diff --git a/src/hotspot/share/opto/cfgnode.hpp b/src/hotspot/share/opto/cfgnode.hpp
index cad9f87162c..41b2e9b958c 100644
--- a/src/hotspot/share/opto/cfgnode.hpp
+++ b/src/hotspot/share/opto/cfgnode.hpp
@@ -408,7 +408,7 @@ class PhiNode : public TypeNode {
bool can_be_value_type() const {
const Type* type = _type->make_oopptr();
- return Arguments::is_valhalla_enabled() && type != nullptr && type->isa_instptr() && type->is_instptr()->can_be_value_type();
+ return Arguments::is_valhalla_enabled() && type != nullptr && type->is_instptr() && type->as_instptr()->can_be_value_type();
}
Node* try_push_value_types_down(PhaseGVN* phase, bool can_reshape);
diff --git a/src/hotspot/share/opto/chaitin.cpp b/src/hotspot/share/opto/chaitin.cpp
index e86dc478620..a4eb65c7c47 100644
--- a/src/hotspot/share/opto/chaitin.cpp
+++ b/src/hotspot/share/opto/chaitin.cpp
@@ -883,8 +883,8 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
lrg.and_with(rm);
uint ireg = n->ideal_reg();
- assert( !n->bottom_type()->isa_oop_ptr() || ireg == Op_RegP,
- "oops must be in Op_RegP's" );
+ assert(!n->bottom_type()->is_oopptr() || ireg == Op_RegP,
+ "oops must be in Op_RegP's");
// Check for vector live range (only if vector register is used).
// On SPARC vector uses RegD which could be misaligned so it is not
@@ -916,7 +916,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
lrg.set_scalable_reg_slots(Matcher::scalable_predicate_reg_slots());
}
}
- assert(n_type->isa_vect() == nullptr || lrg._is_vector ||
+ assert(!n_type->is_vect() || lrg._is_vector ||
ireg == Op_RegD || ireg == Op_RegL || ireg == Op_RegVectMask,
"vector must be in vector registers");
@@ -979,7 +979,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
// AMD64 1 1 1 1 1 14 15
// -----------------------------------------------------
lrg.set_reg_pressure(1); // normally one value per register
- if( n_type->isa_oop_ptr() ) {
+ if (n_type->is_oopptr()) {
lrg._is_oop = 1;
}
break;
@@ -1127,7 +1127,7 @@ void PhaseChaitin::gather_lrg_masks( bool after_aggressive ) {
const RegMask &lrgmask_in = lrg_in.mask();
uint kreg = n->in(k)->ideal_reg();
bool is_vect = RegMask::is_vector(kreg);
- assert(n->in(k)->bottom_type()->isa_vect() == nullptr || is_vect ||
+ assert(!n->in(k)->bottom_type()->is_vect() || is_vect ||
kreg == Op_RegD || kreg == Op_RegL || kreg == Op_RegVectMask,
"vector must be in vector registers");
if (lrgmask_in.is_bound(kreg))
@@ -1939,8 +1939,8 @@ Node* PhaseChaitin::find_base_for_derived(Node** derived_base_map, Node* derived
// pointers derived from null! These are always along paths that
// can't happen at run-time but the optimizer cannot deduce it so
// we have to handle it gracefully.
- assert(!derived->bottom_type()->isa_narrowoop() ||
- derived->bottom_type()->make_ptr()->is_ptr()->offset() == 0, "sanity");
+ assert(!derived->bottom_type()->is_narrowoop() ||
+ derived->bottom_type()->make_ptr()->as_ptr()->offset() == 0, "sanity");
const TypePtr *tj = derived->bottom_type()->isa_ptr();
// If its an OOP with a non-zero offset, then it is derived.
if (tj == nullptr || tj->offset() == 0) {
@@ -2108,10 +2108,10 @@ bool PhaseChaitin::stretch_base_pointer_live_ranges(ResourceArea *a) {
// This works because we are still in SSA during this call.
Node *derived = lrgs(neighbor)._def;
const TypePtr *tj = derived->bottom_type()->isa_ptr();
- assert(!derived->bottom_type()->isa_narrowoop() ||
- derived->bottom_type()->make_ptr()->is_ptr()->offset() == 0, "sanity");
+ assert(!derived->bottom_type()->is_narrowoop() ||
+ derived->bottom_type()->make_ptr()->as_ptr()->offset() == 0, "sanity");
// If its an OOP with a non-zero offset, then it is derived.
- if (tj && tj->offset() != 0 && tj->isa_oop_ptr()) {
+ if (tj && tj->offset() != 0 && tj->is_oopptr()) {
Node *base = find_base_for_derived(derived_base_map, derived, maxlrg);
assert(base->_idx < _lrg_map.size(), "");
// Add reaching DEFs of derived pointer and base pointer as a
@@ -2637,20 +2637,20 @@ void PhaseChaitin::verify_base_ptrs(ResourceArea* a) const {
worklist.push(check->in(m));
}
} else if (check->is_Con()) {
- if (is_derived && check->bottom_type()->is_ptr()->offset() != 0) {
+ if (is_derived && check->bottom_type()->as_ptr()->offset() != 0) {
// Derived is null+non-zero offset, base must be null.
- assert(check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad derived pointer");
+ assert(check->bottom_type()->as_ptr()->ptr() == TypePtr::Null, "Bad derived pointer");
} else {
- assert(check->bottom_type()->is_ptr()->offset() == 0, "Bad base pointer");
+ assert(check->bottom_type()->as_ptr()->offset() == 0, "Bad base pointer");
// Base either ConP(nullptr) or loadConP
if (check->is_Mach()) {
assert(check->as_Mach()->ideal_Opcode() == Op_ConP, "Bad base pointer");
} else {
assert(check->Opcode() == Op_ConP &&
- check->bottom_type()->is_ptr()->ptr() == TypePtr::Null, "Bad base pointer");
+ check->bottom_type()->as_ptr()->ptr() == TypePtr::Null, "Bad base pointer");
}
}
- } else if (check->bottom_type()->is_ptr()->offset() == 0) {
+ } else if (check->bottom_type()->as_ptr()->offset() == 0) {
if (check->is_Proj() || (check->is_Mach() &&
(check->as_Mach()->ideal_Opcode() == Op_CreateEx ||
check->as_Mach()->ideal_Opcode() == Op_ThreadLocal ||
diff --git a/src/hotspot/share/opto/compile.cpp b/src/hotspot/share/opto/compile.cpp
index 03de90df0fd..8d22a928326 100644
--- a/src/hotspot/share/opto/compile.cpp
+++ b/src/hotspot/share/opto/compile.cpp
@@ -1441,11 +1441,11 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
TypePtr::PTR ptr = tj->ptr();
// Known instance (scalarizable allocation) alias only with itself.
- bool is_known_inst = tj->isa_oopptr() != nullptr &&
- tj->is_oopptr()->is_known_instance();
+ bool is_known_inst = tj->is_oopptr() &&
+ tj->as_oopptr()->is_known_instance();
// Process weird unsafe references.
- if (offset == Type::OffsetBot && (tj->isa_instptr() /*|| tj->isa_klassptr()*/)) {
+ if (offset == Type::OffsetBot && (tj->is_instptr() /*|| tj->is_klassptr()*/)) {
assert(InlineUnsafeOps || StressReflectiveCode || UseAcmpFastPath || UseHashcodeFastPath, "indeterminate pointers come only from unsafe ops");
assert(!is_known_inst, "scalarizable allocation should not have unsafe references");
tj = TypeOopPtr::BOTTOM;
@@ -1599,12 +1599,12 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
TypePtr::MaybeFlat);
}
- if (tk->isa_aryklassptr() && tk->is_aryklassptr()->elem()->isa_klassptr()) {
+ if (const TypeAryKlassPtr* tk_ary = tk->isa_aryklassptr(); tk_ary != nullptr && tk_ary->elem()->is_klassptr()) {
ciKlass* k = ciObjArrayKlass::make(env()->Object_klass());
if (!k || !k->is_loaded()) { // Only fails for some -Xcomp runs
tj = tk = TypeInstKlassPtr::make(TypePtr::NotNull, env()->Object_klass(), Type::Offset(offset), TypePtr::MaybeFlat);
} else {
- tj = tk = TypeAryKlassPtr::make(TypePtr::NotNull, tk->is_aryklassptr()->elem(), k, Type::Offset(offset), tk->is_not_flat(), tk->is_not_null_free(), tk->is_flat(), tk->is_null_free(), tk->is_atomic(), tk->is_aryklassptr()->is_refined_type());
+ tj = tk = TypeAryKlassPtr::make(TypePtr::NotNull, tk_ary->elem(), k, Type::Offset(offset), tk->is_not_flat(), tk->is_not_null_free(), tk->is_flat(), tk->is_null_free(), tk->is_atomic(), tk_ary->is_refined_type());
}
}
// Check for precise loads from the primary supertype array and force them
@@ -1669,8 +1669,8 @@ void Compile::AliasType::Init(int i, const TypePtr* at) {
BasicType Compile::AliasType::basic_type() const {
if (element() != nullptr) {
- const Type* element = adr_type()->is_aryptr()->elem();
- return element->isa_narrowoop() ? T_OBJECT : element->array_element_basic_type();
+ const Type* element = adr_type()->as_aryptr()->elem();
+ return element->is_narrowoop() ? T_OBJECT : element->array_element_basic_type();
} if (field() != nullptr) {
return field()->layout_type();
} else {
@@ -1693,7 +1693,7 @@ void Compile::AliasType::print_on(outputStream* st) {
adr_type()->dump_on(st);
const TypeOopPtr* tjp = adr_type()->isa_oopptr();
if (field() != nullptr && tjp) {
- if (tjp->is_instptr()->instance_klass() != field()->holder() ||
+ if (tjp->as_instptr()->instance_klass() != field()->holder() ||
tjp->offset() != field()->offset_in_bytes()) {
st->print(" != ");
field()->print();
@@ -1767,7 +1767,7 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
// Try casting the type to the other exactness if possible
if ((check_exact && finst->instance_klass()->is_loaded() && !finst->instance_klass()->is_abstract()) ||
(!check_exact && !finst->is_known_instance())) {
- const TypePtr* xinst = finst->cast_to_exactness(check_exact)->is_ptr();
+ const TypePtr* xinst = finst->cast_to_exactness(check_exact)->as_ptr();
assert(finst == flatten_alias_type(xinst), "exactness must not affect alias type: finst = %s; xinst = %s",
Type::str(finst), Type::str(xinst));
}
@@ -1792,23 +1792,23 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
_alias_types[idx]->Init(idx, flat);
if (flat == TypeInstPtr::KLASS) alias_type(idx)->set_rewritable(false);
if (flat == TypeAryPtr::RANGE) alias_type(idx)->set_rewritable(false);
- if (flat->isa_instptr()) {
+ if (flat->is_instptr()) {
if (flat->offset() == java_lang_Class::klass_offset()
- && flat->is_instptr()->instance_klass() == env()->Class_klass())
+ && flat->as_instptr()->instance_klass() == env()->Class_klass())
alias_type(idx)->set_rewritable(false);
}
ciField* field = nullptr;
- if (flat->isa_aryptr()) {
+ if (flat->is_aryptr()) {
#ifdef ASSERT
const int header_size_min = arrayOopDesc::base_offset_in_bytes(T_BYTE);
// (T_BYTE has the weakest alignment and size restrictions...)
assert(flat->offset() < header_size_min, "array body reference must be OffsetBot");
#endif
- const Type* elemtype = flat->is_aryptr()->elem();
+ const Type* elemtype = flat->as_aryptr()->elem();
if (flat->offset() == TypePtr::OffsetBot) {
alias_type(idx)->set_element(elemtype);
}
- int field_offset = flat->is_aryptr()->field_offset().get();
+ int field_offset = flat->as_aryptr()->field_offset().get();
if (flat->is_flat() &&
field_offset != Type::OffsetBot) {
ciValueKlass* vk = elemtype->value_klass();
@@ -1816,7 +1816,7 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
field = vk->get_field_by_offset(field_offset, false);
}
}
- if (flat->isa_klassptr()) {
+ if (flat->is_klassptr()) {
if (UseCompactObjectHeaders) {
if (flat->offset() == in_bytes(Klass::prototype_header_offset()))
alias_type(idx)->set_rewritable(false);
@@ -1833,7 +1833,7 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
alias_type(idx)->set_rewritable(false);
}
- if (flat->isa_instklassptr()) {
+ if (flat->is_instklassptr()) {
if (flat->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
alias_type(idx)->set_rewritable(false);
}
@@ -1868,7 +1868,7 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
// Set field() and is_rewritable() attributes.
if (field != nullptr) {
alias_type(idx)->set_field(field);
- if (flat->isa_aryptr()) {
+ if (flat->is_aryptr()) {
// Fields of flat arrays are rewritable although they are declared final
assert(flat->is_flat(), "must be a flat array");
alias_type(idx)->set_rewritable(true);
@@ -2143,7 +2143,7 @@ void Compile::process_value_types(PhaseIterGVN &igvn, bool remove) {
}
if (ret != nullptr) {
Node* ret_val = ret->in(TypeFunc::Parms);
- if (igvn.type(ret_val)->isa_oopptr() &&
+ if (igvn.type(ret_val)->is_oopptr() &&
return_val_keeps_allocations_alive(ret_val)) {
igvn.replace_input_of(ret, TypeFunc::Parms, ValueTypeNode::tagged_klass(igvn.type(ret_val)->value_klass(), igvn));
assert(ret_val->outcnt() == 0, "should be dead now");
@@ -2265,9 +2265,9 @@ void Compile::process_flat_accesses(PhaseIterGVN& igvn) {
// object.
ciInstance* loaded_from = nullptr;
if (FoldStableValues) {
- const TypeOopPtr* base_type = igvn.type(loadn->base())->is_oopptr();
+ const TypeOopPtr* base_type = igvn.type(loadn->base())->as_oopptr();
ciObject* oop = base_type->const_oop();
- int off = igvn.type(loadn->ptr())->isa_ptr()->offset();
+ int off = igvn.type(loadn->ptr())->as_ptr()->offset();
if (oop != nullptr && oop->is_instance()) {
ciInstance* holder = oop->as_instance();
@@ -2285,7 +2285,7 @@ void Compile::process_flat_accesses(PhaseIterGVN& igvn) {
} else if (oop != nullptr && oop->is_array() && off != Type::OffsetBot) {
ciArray* array = oop->as_array();
ciConstant elt = array->element_value_by_offset(off);
- const TypeAryPtr* aryptr = base_type->is_aryptr();
+ const TypeAryPtr* aryptr = base_type->as_aryptr();
if (aryptr->is_stable() && aryptr->is_atomic() && is_reference_type(elt.basic_type()) && elt.as_object()->is_instance()) {
loaded_from = elt.as_object()->as_instance();
}
@@ -2464,7 +2464,7 @@ void Compile::adjust_flat_array_access_aliases(PhaseIterGVN& igvn) {
ciArrayKlass* klass = klass_type->exact_klass()->as_array_klass();
assert(klass->is_flat_array_klass(), "must be a flat array");
ciValueKlass* elem_klass = klass->element_klass()->as_value_klass();
- const TypeAryPtr* oop_type = klass_type->as_exact_instance_type()->is_aryptr();
+ const TypeAryPtr* oop_type = klass_type->as_exact_instance_type()->as_aryptr();
assert(oop_type->klass_is_exact(), "must be an exact klass");
Node* base = alloc->in(TypeFunc::Memory);
@@ -2524,7 +2524,7 @@ void Compile::adjust_flat_array_access_aliases(PhaseIterGVN& igvn) {
Node* r = m->in(0);
for (int j = start_alias; j < num_alias_types(); j++) {
const TypePtr* adr_type = get_adr_type(j);
- if (!adr_type->isa_aryptr() || !adr_type->is_flat()) {
+ if (!adr_type->is_aryptr() || !adr_type->is_flat()) {
continue;
}
Node* phi = new PhiNode(r, Type::MEMORY, get_adr_type(j));
@@ -2554,7 +2554,7 @@ void Compile::adjust_flat_array_access_aliases(PhaseIterGVN& igvn) {
igvn.replace_input_of(m->in(0), TypeFunc::Control, top());
for (int j = start_alias; j < num_alias_types(); j++) {
const TypePtr* adr_type = get_adr_type(j);
- if (!adr_type->isa_aryptr() || !adr_type->is_flat()) {
+ if (!adr_type->is_aryptr() || !adr_type->is_flat()) {
continue;
}
MemBarNode* mb = new MemBarCPUOrderNode(this, adr_type, adr_type, nullptr);
@@ -2597,7 +2597,7 @@ void Compile::adjust_flat_array_access_aliases(PhaseIterGVN& igvn) {
igvn.rehash_node_delayed(current);
for (int j = start_alias; j < num_alias_types(); j++) {
const TypePtr* adr_type = get_adr_type(j);
- if (!adr_type->isa_aryptr() || !adr_type->is_flat()) {
+ if (!adr_type->is_aryptr() || !adr_type->is_flat()) {
continue;
}
current->set_memory_at(j, mm);
@@ -3559,7 +3559,7 @@ static bool is_vector_bitwise_op(Node* n) {
}
static bool is_vector_bitwise_cone_root(Node* n) {
- if (n->bottom_type()->isa_pvectmask() || !is_vector_bitwise_op(n)) {
+ if (n->bottom_type()->is_pvectmask() || !is_vector_bitwise_op(n)) {
return false;
}
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
@@ -3860,7 +3860,7 @@ void Compile::process_logic_cone_root(PhaseIterGVN &igvn, Node *n, VectorSet &vi
Unique_Node_List partition;
Unique_Node_List inputs;
if (compute_logic_cone(n, partition, inputs)) {
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
Node* pn = partition.at(partition.size() - 1);
Node* mask = pn->is_predicated_vector() ? pn->in(pn->req()-1) : nullptr;
if (mask == nullptr ||
@@ -3880,7 +3880,7 @@ void Compile::optimize_logic_cones(PhaseIterGVN &igvn) {
while (list.size() > 0) {
Node* n = list.pop();
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
bool supported = Matcher::match_rule_supported_vector(Op_MacroLogicV, vt->length(), vt->element_basic_type());
if (supported) {
VectorSet visited(comp_arena());
@@ -4076,7 +4076,7 @@ void Compile::final_graph_reshaping_impl(Node* n, Final_Reshape_Counts& frc, Uni
int alias_idx = get_alias_index(n->as_Mem()->in_adr_type());
assert( n->in(0) != nullptr || alias_idx != Compile::AliasIdxRaw ||
// oop will be recorded in oop map if load crosses safepoint
- (n->is_Load() && (n->as_Load()->bottom_type()->isa_oopptr() ||
+ (n->is_Load() && (n->as_Load()->bottom_type()->is_oopptr() ||
LoadNode::is_immutable_value(n->in(MemNode::Address)))),
"raw memory operations should have control edge");
}
@@ -4283,12 +4283,12 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
// Some platforms can use the constant pool to load ConP.
// Do this transformation here since IGVN will convert ConN back to ConP.
const Type* t = addp->bottom_type();
- bool is_oop = t->isa_oopptr() != nullptr;
- bool is_klass = t->isa_klassptr() != nullptr;
+ bool is_oop = t->is_oopptr();
+ bool is_klass = t->is_klassptr();
if ((is_oop && UseCompressedOops && Matcher::const_oop_prefer_decode() ) ||
(is_klass && Matcher::const_klass_prefer_decode() &&
- t->isa_klassptr()->exact_klass()->is_in_encoding_range())) {
+ t->as_klassptr()->exact_klass()->is_in_encoding_range())) {
Node* nn = nullptr;
int op = is_oop ? Op_ConN : Op_ConNKlass;
@@ -4494,10 +4494,10 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
// Load [base_reg + offset], val_reg
// NullCheck base_reg
//
- } else if (t->isa_oopptr()) {
+ } else if (t->is_oopptr()) {
new_in2 = ConNode::make(t->make_narrowoop());
- } else if (t->isa_klassptr()) {
- ciKlass* klass = t->is_klassptr()->exact_klass();
+ } else if (t->is_klassptr()) {
+ ciKlass* klass = t->as_klassptr()->exact_klass();
if (klass->is_in_encoding_range()) {
new_in2 = ConNode::make(t->make_narrowklass());
}
@@ -4532,12 +4532,12 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
} else if (in1->Opcode() == Op_ConP) {
const Type* t = in1->bottom_type();
if (t == TypePtr::NULL_PTR) {
- assert(t->isa_oopptr(), "null klass?");
+ assert(t->is_oopptr(), "null klass?");
n->subsume_by(ConNode::make(TypeNarrowOop::NULL_PTR), this);
- } else if (t->isa_oopptr()) {
+ } else if (t->is_oopptr()) {
n->subsume_by(ConNode::make(t->make_narrowoop()), this);
- } else if (t->isa_klassptr()) {
- ciKlass* klass = t->is_klassptr()->exact_klass();
+ } else if (t->is_klassptr()) {
+ ciKlass* klass = t->as_klassptr()->exact_klass();
if (klass->is_in_encoding_range()) {
n->subsume_by(ConNode::make(t->make_narrowklass()), this);
} else {
@@ -4571,7 +4571,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
}
case Op_Phi:
- if (n->as_Phi()->bottom_type()->isa_narrowoop() || n->as_Phi()->bottom_type()->isa_narrowklass()) {
+ if (n->as_Phi()->bottom_type()->is_narrowoop() || n->as_Phi()->bottom_type()->is_narrowklass()) {
// The EncodeP optimization may create Phi with the same edges
// for all paths. It is not handled well by Register Allocator.
Node* unique_in = n->in(1);
@@ -4781,7 +4781,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
}
case Op_ConNKlass: {
const TypePtr* tp = n->as_Type()->type()->make_ptr();
- ciKlass* klass = tp->is_klassptr()->exact_klass();
+ ciKlass* klass = tp->as_klassptr()->exact_klass();
assert(klass->is_in_encoding_range(), "klass cannot be compressed");
break;
}
@@ -5409,20 +5409,20 @@ Compile::SubTypeCheckResult Compile::static_subtype_check(const TypeKlassPtr* su
}
const Type* superelem = superk;
- if (superk->isa_aryklassptr()) {
+ if (const TypeAryKlassPtr* superk_ary = superk->isa_aryklassptr(); superk_ary != nullptr) {
int ignored;
- superelem = superk->is_aryklassptr()->base_element_type(ignored);
+ superelem = superk_ary->base_element_type(ignored);
// Do not fold the subtype check to an array klass pointer comparison for null-able value type arrays
// because null-free [LMyValue <: null-able [LMyValue but the klasses are different. Perform a full test.
- if (!superk->is_aryklassptr()->is_null_free() && superk->is_aryklassptr()->elem()->isa_instklassptr() &&
- superk->is_aryklassptr()->elem()->is_instklassptr()->instance_klass()->is_value_klass()) {
+ if (!superk_ary->is_null_free() && superk_ary->elem()->is_instklassptr() &&
+ superk_ary->elem()->as_instklassptr()->instance_klass()->is_value_klass()) {
return SSC_full_test;
}
}
- if (superelem->isa_instklassptr()) {
- ciInstanceKlass* ik = superelem->is_instklassptr()->instance_klass();
+ if (superelem->is_instklassptr()) {
+ ciInstanceKlass* ik = superelem->as_instklassptr()->instance_klass();
if (!ik->has_subklass()) {
if (!ik->is_final()) {
// Add a dependency if there is a chance of a later subclass.
diff --git a/src/hotspot/share/opto/connode.cpp b/src/hotspot/share/opto/connode.cpp
index 3538342b5d4..779b58a1d66 100644
--- a/src/hotspot/share/opto/connode.cpp
+++ b/src/hotspot/share/opto/connode.cpp
@@ -43,21 +43,21 @@ uint ConNode::hash() const {
//------------------------------make-------------------------------------------
ConNode *ConNode::make(const Type *t) {
- if (t->isa_half_float_constant()) {
- return new ConHNode( t->is_half_float_constant() );
+ if (t->is_half_float_constant()) {
+ return new ConHNode(t->as_half_float_constant());
}
- switch( t->basic_type() ) {
- case T_INT: return new ConINode( t->is_int() );
- case T_LONG: return new ConLNode( t->is_long() );
- case T_FLOAT: return new ConFNode( t->is_float_constant() );
- case T_DOUBLE: return new ConDNode( t->is_double_constant() );
- case T_VOID: return new ConNode ( Type::TOP );
- case T_OBJECT: return new ConPNode( t->is_ptr() );
- case T_ARRAY: return new ConPNode( t->is_aryptr() );
- case T_ADDRESS: return new ConPNode( t->is_ptr() );
- case T_NARROWOOP: return new ConNNode( t->is_narrowoop() );
- case T_NARROWKLASS: return new ConNKlassNode( t->is_narrowklass() );
- case T_METADATA: return new ConPNode( t->is_ptr() );
+ switch (t->basic_type()) {
+ case T_INT: return new ConINode(t->as_int());
+ case T_LONG: return new ConLNode(t->as_long());
+ case T_FLOAT: return new ConFNode(t->as_float_constant());
+ case T_DOUBLE: return new ConDNode(t->as_double_constant());
+ case T_VOID: return new ConNode (Type::TOP);
+ case T_OBJECT: return new ConPNode(t->as_ptr());
+ case T_ARRAY: return new ConPNode(t->as_aryptr());
+ case T_ADDRESS: return new ConPNode(t->as_ptr());
+ case T_NARROWOOP: return new ConNNode(t->as_narrowoop());
+ case T_NARROWKLASS: return new ConNKlassNode(t->as_narrowklass());
+ case T_METADATA: return new ConPNode(t->as_ptr());
// Expected cases: TypePtr::NULL_PTR, any is_rawptr()
// Also seen: AnyPtr(TopPTR *+top);
// %%%% Stop using TypePtr::NULL_PTR to represent nulls: use either TypeRawPtr::NULL_PTR
diff --git a/src/hotspot/share/opto/convertnode.cpp b/src/hotspot/share/opto/convertnode.cpp
index 94d7a5afc65..ec8e160e7a0 100644
--- a/src/hotspot/share/opto/convertnode.cpp
+++ b/src/hotspot/share/opto/convertnode.cpp
@@ -60,7 +60,7 @@ const Type* Conv2BNode::Value(PhaseGVN* phase) const {
return TypeInt::BOOL;
}
if (t->base() != Type::Int) return TypeInt::BOOL;
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
if( ti->_hi < 0 || ti->_lo > 0 ) return TypeInt::ONE;
return TypeInt::BOOL;
}
@@ -77,9 +77,9 @@ Node* Conv2BNode::Ideal(PhaseGVN* phase, bool can_reshape) {
// Get type of comparison to make
const Type* t = phase->type(in(1));
Node* cmp = nullptr;
- if (t->isa_int()) {
+ if (t->is_int()) {
cmp = phase->transform(new CmpINode(in(1), phase->intcon(0)));
- } else if (t->isa_ptr()) {
+ } else if (t->is_ptr()) {
cmp = phase->transform(new CmpPNode(in(1), phase->zerocon(BasicType::T_OBJECT)));
} else {
assert(false, "Unrecognized comparison for Conv2B: %s", NodeClassNames[in(1)->Opcode()]);
@@ -156,7 +156,7 @@ const Type* ConvD2FNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return Type::FLOAT;
- const TypeD *td = t->is_double_constant();
+ const TypeD* td = t->as_double_constant();
return TypeF::make( (float)td->getd() );
}
@@ -188,7 +188,7 @@ const Type* ConvD2INode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return TypeInt::INT;
- const TypeD *td = t->is_double_constant();
+ const TypeD* td = t->as_double_constant();
return TypeInt::make( SharedRuntime::d2i( td->getd() ) );
}
@@ -205,7 +205,7 @@ const Type* ConvD2LNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return TypeLong::LONG;
- const TypeD *td = t->is_double_constant();
+ const TypeD* td = t->as_double_constant();
return TypeLong::make( SharedRuntime::d2l( td->getd() ) );
}
@@ -214,7 +214,7 @@ Node* ConvD2LNode::Identity(PhaseGVN* phase) {
// Remove ConvD2L->ConvL2D->ConvD2L sequences.
if( in(1) ->Opcode() == Op_ConvL2D &&
in(1)->in(1)->Opcode() == Op_ConvD2L )
- return in(1)->in(1);
+ return in(1)->in(1);
return this;
}
@@ -224,7 +224,7 @@ const Type* ConvF2DNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return Type::DOUBLE;
- const TypeF *tf = t->is_float_constant();
+ const TypeF* tf = t->as_float_constant();
return TypeD::make( (double)tf->getf() );
}
@@ -237,7 +237,7 @@ const Type* ConvF2HFNode::Value(PhaseGVN* phase) const {
return TypeInt::SHORT;
}
- const TypeF *tf = t->is_float_constant();
+ const TypeF* tf = t->as_float_constant();
return TypeInt::make( StubRoutines::f2hf(tf->getf()) );
}
@@ -293,7 +293,7 @@ Node* ConvF2HFNode::Ideal(PhaseGVN* phase, bool can_reshape) {
if (conF != nullptr &&
varS != nullptr &&
- conF->bottom_type()->isa_float_constant() != nullptr &&
+ conF->bottom_type()->is_float_constant() &&
Matcher::match_rule_supported(Float16NodeFactory::get_float16_binary_oper(binopF->Opcode())) &&
Matcher::match_rule_supported(Op_ReinterpretS2HF) &&
Matcher::match_rule_supported(Op_ReinterpretHF2S) &&
@@ -338,7 +338,7 @@ const Type* ConvF2INode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return TypeInt::INT;
- const TypeF *tf = t->is_float_constant();
+ const TypeF* tf = t->as_float_constant();
return TypeInt::make( SharedRuntime::f2i( tf->getf() ) );
}
@@ -357,7 +357,7 @@ const Type* ConvF2LNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return TypeLong::LONG;
- const TypeF *tf = t->is_float_constant();
+ const TypeF* tf = t->as_float_constant();
return TypeLong::make( SharedRuntime::f2l( tf->getf() ) );
}
@@ -379,7 +379,7 @@ const Type* ConvHF2FNode::Value(PhaseGVN* phase) const {
return Type::FLOAT;
}
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
if (ti->is_con()) {
return TypeF::make( StubRoutines::hf2f(ti->get_con()) );
}
@@ -391,7 +391,7 @@ const Type* ConvHF2FNode::Value(PhaseGVN* phase) const {
const Type* ConvI2DNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
if( ti->is_con() ) return TypeD::make( (double)ti->get_con() );
return Type::DOUBLE;
}
@@ -401,7 +401,7 @@ const Type* ConvI2DNode::Value(PhaseGVN* phase) const {
const Type* ConvI2FNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
if( ti->is_con() ) return TypeF::make( (float)ti->get_con() );
return Type::FLOAT;
}
@@ -422,14 +422,14 @@ const Type* ConvI2LNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) {
return Type::TOP;
}
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
const Type* tl = TypeLong::make(ti->_lo, ti->_hi, ti->_widen);
// Join my declared type against my incoming type.
tl = tl->filter(_type);
- if (!tl->isa_long()) {
+ if (!tl->is_long()) {
return tl;
}
- const TypeLong* this_type = tl->is_long();
+ const TypeLong* this_type = tl->as_long();
// Do NOT remove this node's type assertion until no more loop ops can happen.
if (phase->C->post_loop_opts_phase()) {
const TypeInt* in_type = phase->type(in(1))->isa_int();
@@ -741,8 +741,8 @@ bool Compile::push_thru_add(PhaseGVN* phase, Node* z, const TypeInteger* tz, con
if (phase->type(y) == Type::TOP) {
return false;
}
- const TypeInteger* tx = phase->type(x)->is_integer(in_bt);
- const TypeInteger* ty = phase->type(y)->is_integer(in_bt);
+ const TypeInteger* tx = phase->type(x)->as_integer(in_bt);
+ const TypeInteger* ty = phase->type(y)->as_integer(in_bt);
if (ranges_overlap(tx, ty, tz, z, true, in_bt) ||
ranges_overlap(tx, ty, tz, z, false, in_bt)) {
@@ -756,7 +756,7 @@ bool Compile::push_thru_add(PhaseGVN* phase, Node* z, const TypeInteger* tz, con
//------------------------------Ideal------------------------------------------
Node* ConvI2LNode::Ideal(PhaseGVN* phase, bool can_reshape) {
- const TypeLong* this_type = this->type()->is_long();
+ const TypeLong* this_type = this->type()->as_long();
if (can_reshape && !phase->C->post_loop_opts_phase()) {
// makes sure we run ::Value to potentially remove type assertion after loop opts
phase->C->record_for_post_loop_opts_igvn(this);
@@ -798,8 +798,8 @@ Node* ConvI2LNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* x = z->in(1);
Node* y = z->in(2);
- Node* cx = find_or_make_convI2L(igvn, x, rx->is_long());
- Node* cy = find_or_make_convI2L(igvn, y, ry->is_long());
+ Node* cx = find_or_make_convI2L(igvn, x, rx->as_long());
+ Node* cy = find_or_make_convI2L(igvn, y, ry->as_long());
switch (op) {
case Op_AddI: return new AddLNode(cx, cy);
case Op_SubI: return new SubLNode(cx, cy);
@@ -816,7 +816,7 @@ Node* ConvI2LNode::Ideal(PhaseGVN* phase, bool can_reshape) {
const Type* ConvL2DNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeLong *tl = t->is_long();
+ const TypeLong* tl = t->as_long();
if( tl->is_con() ) return TypeD::make( (double)tl->get_con() );
return Type::DOUBLE;
}
@@ -826,7 +826,7 @@ const Type* ConvL2DNode::Value(PhaseGVN* phase) const {
const Type* ConvL2FNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeLong *tl = t->is_long();
+ const TypeLong* tl = t->as_long();
if( tl->is_con() ) return TypeF::make( (float)tl->get_con() );
return Type::FLOAT;
}
@@ -843,7 +843,7 @@ Node* ConvL2INode::Identity(PhaseGVN* phase) {
const Type* ConvL2INode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeLong *tl = t->is_long();
+ const TypeLong* tl = t->as_long();
const TypeInt* ti = TypeInt::INT;
if (tl->is_con()) {
// Easy case.
@@ -913,8 +913,8 @@ const Type* RoundDoubleModeNode::Value(PhaseGVN* phase) const {
const Type* ReinterpretS2HFNode::Value(PhaseGVN* phase) const {
const Type* type = phase->type(in(1));
// Convert short constant value to a Half Float constant value
- if ((type->isa_int() && type->is_int()->is_con())) {
- jshort hfval = type->is_int()->get_con();
+ if (type->is_int() && type->as_int()->is_con()) {
+ jshort hfval = type->as_int()->get_con();
return TypeH::make(hfval);
}
return Type::HALF_FLOAT;
@@ -922,7 +922,7 @@ const Type* ReinterpretS2HFNode::Value(PhaseGVN* phase) const {
Node* ReinterpretS2HFNode::Identity(PhaseGVN* phase) {
if (in(1)->Opcode() == Op_ReinterpretHF2S) {
- assert(in(1)->in(1)->bottom_type()->isa_half_float(), "");
+ assert(in(1)->in(1)->bottom_type()->is_half_float(), "");
return in(1)->in(1);
}
return this;
@@ -931,8 +931,8 @@ Node* ReinterpretS2HFNode::Identity(PhaseGVN* phase) {
const Type* ReinterpretHF2SNode::Value(PhaseGVN* phase) const {
const Type* type = phase->type(in(1));
// Convert Half float constant value to short constant value.
- if (type->isa_half_float_constant()) {
- jshort hfval = type->is_half_float_constant()->_f;
+ if (type->is_half_float_constant()) {
+ jshort hfval = type->as_half_float_constant()->_f;
return TypeInt::make(hfval);
}
return TypeInt::SHORT;
diff --git a/src/hotspot/share/opto/countbitsnode.cpp b/src/hotspot/share/opto/countbitsnode.cpp
index 1601b33ea2b..670b50b6bf6 100644
--- a/src/hotspot/share/opto/countbitsnode.cpp
+++ b/src/hotspot/share/opto/countbitsnode.cpp
@@ -69,7 +69,7 @@ const Type* CountLeadingZerosINode::Value(PhaseGVN* phase) const {
//
// A more detailed proof using Z3 can be found at:
// https://github.com/openjdk/jdk/pull/25928#discussion_r2256750507
- const TypeInt* ti = t->is_int();
+ const TypeInt* ti = t->as_int();
return TypeInt::make(count_leading_zeros_int(~ti->_bits._zeros),
count_leading_zeros_int(ti->_bits._ones),
ti->_widen);
@@ -84,7 +84,7 @@ const Type* CountLeadingZerosLNode::Value(PhaseGVN* phase) const {
// The proof of correctness is same as the above comments
// in `CountLeadingZerosINode::Value`.
- const TypeLong* tl = t->is_long();
+ const TypeLong* tl = t->as_long();
return TypeInt::make(count_leading_zeros_long(~tl->_bits._zeros),
count_leading_zeros_long(tl->_bits._ones),
tl->_widen);
@@ -113,7 +113,7 @@ const Type* CountTrailingZerosINode::Value(PhaseGVN* phase) const {
//
// A more detailed proof using Z3 can be found at:
// https://github.com/openjdk/jdk/pull/25928#discussion_r2256750507
- const TypeInt* ti = t->is_int();
+ const TypeInt* ti = t->as_int();
return TypeInt::make(count_trailing_zeros_int(~ti->_bits._zeros),
count_trailing_zeros_int(ti->_bits._ones),
ti->_widen);
@@ -128,7 +128,7 @@ const Type* CountTrailingZerosLNode::Value(PhaseGVN* phase) const {
// The proof of correctness is same as the above comments
// in `CountTrailingZerosINode::Value`.
- const TypeLong* tl = t->is_long();
+ const TypeLong* tl = t->as_long();
return TypeInt::make(count_trailing_zeros_long(~tl->_bits._zeros),
count_trailing_zeros_long(tl->_bits._ones),
tl->_widen);
@@ -158,7 +158,7 @@ const Type* PopCountINode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) {
return Type::TOP;
}
- const TypeInt* tint = t->is_int();
+ const TypeInt* tint = t->as_int();
KnownBits bits = tint->_bits;
return TypeInt::make(population_count(bits._ones), population_count(~bits._zeros), tint->_widen);
@@ -169,7 +169,7 @@ const Type* PopCountLNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) {
return Type::TOP;
}
- const TypeLong* tlong = t->is_long();
+ const TypeLong* tlong = t->as_long();
KnownBits bits = tlong->_bits;
return TypeInt::make(population_count(bits._ones), population_count(~bits._zeros), tlong->_widen);
}
diff --git a/src/hotspot/share/opto/divnode.cpp b/src/hotspot/share/opto/divnode.cpp
index 1c2a4c97eb6..b5efeb227ed 100644
--- a/src/hotspot/share/opto/divnode.cpp
+++ b/src/hotspot/share/opto/divnode.cpp
@@ -659,8 +659,8 @@ const Type* DivINode::Value(PhaseGVN* phase) const {
return TypeInt::ONE;
}
- const TypeInt* i1 = t1->is_int();
- const TypeInt* i2 = t2->is_int();
+ const TypeInt* i1 = t1->as_int();
+ const TypeInt* i2 = t2->as_int();
return compute_signed_div_type(i1, i2);
}
@@ -726,8 +726,8 @@ const Type* DivLNode::Value(PhaseGVN* phase) const {
return TypeLong::ONE;
}
- const TypeLong* i1 = t1->is_long();
- const TypeLong* i2 = t2->is_long();
+ const TypeLong* i1 = t1->as_long();
+ const TypeLong* i2 = t2->as_long();
return compute_signed_div_type(i1, i2);
}
@@ -1105,7 +1105,7 @@ Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Get the modulus
const Type *t = phase->type( in(2) );
if( t == Type::TOP ) return nullptr;
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
// Check for useless control input
// Check for excluding mod-zero case
@@ -1241,8 +1241,8 @@ static const Type* mod_value(const PhaseGVN* phase, const Node* in1, const Node*
return TypeInteger::zero(bt);
}
- const TypeInteger* i1 = t1->is_integer(bt);
- const TypeInteger* i2 = t2->is_integer(bt);
+ const TypeInteger* i1 = t1->as_integer(bt);
+ const TypeInteger* i2 = t2->as_integer(bt);
if (i1->is_con() && i2->is_con()) {
// We must be modulo'ing 2 int constants.
// Special case: min_jlong % '-1' is UB, and e.g., x86 triggers a division error.
@@ -1404,7 +1404,7 @@ Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// Get the modulus
const Type *t = phase->type( in(2) );
if( t == Type::TOP ) return nullptr;
- const TypeLong *tl = t->is_long();
+ const TypeLong* tl = t->as_long();
// Check for useless control input
// Check for excluding mod-zero case
@@ -1614,7 +1614,7 @@ const Type* ModFloatingNode::Value(PhaseGVN* phase) const {
}
const Type* constant_result = get_result_if_constant(dividend_type, divisor_type);
if (constant_result != nullptr) {
- const TypeTuple* tt = t->is_tuple();
+ const TypeTuple* tt = t->as_tuple();
uint cnt = tt->cnt();
uint param_cnt = cnt - TypeFunc::Parms;
const Type** fields = TypeTuple::fields(param_cnt);
diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp
index a0adad57c8e..c75bd65ba75 100644
--- a/src/hotspot/share/opto/doCall.cpp
+++ b/src/hotspot/share/opto/doCall.cpp
@@ -948,7 +948,7 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
if (!default_handler) {
bcis.append(-1);
- const Type* extype = TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr();
+ const Type* extype = TypeOopPtr::make_from_klass(env()->Throwable_klass())->as_instptr();
extype = extype->join(TypeInstPtr::NOTNULL);
extypes.append(extype);
}
@@ -971,7 +971,7 @@ void Parse::catch_call_exceptions(ciExceptionHandlerStream& handlers) {
set_control(ctrl);
// Create exception oop
- const TypeInstPtr* extype = extypes.at(i)->is_instptr();
+ const TypeInstPtr* extype = extypes.at(i)->as_instptr();
Node* ex_oop = _gvn.transform(new CreateExNode(extypes.at(i), ctrl, i_o));
// Handle unloaded exception classes.
@@ -1037,7 +1037,7 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
const TypeInstPtr* ex_type = _gvn.type(ex_node)->isa_instptr();
NOT_PRODUCT(if (ex_type==nullptr) tty->print_cr("*** Exception not InstPtr"));
if (ex_type == nullptr)
- ex_type = TypeOopPtr::make_from_klass(env()->Throwable_klass())->is_instptr();
+ ex_type = TypeOopPtr::make_from_klass(env()->Throwable_klass())->as_instptr();
// determine potential exception handlers
ciExceptionHandlerStream handlers(method(), bci(),
@@ -1127,7 +1127,7 @@ void Parse::catch_inline_exceptions(SafePointNode* ex_map) {
Node* not_subtype_ctrl = gen_subtype_check(ex_klass_node, con);
if (!stopped()) {
PreserveJVMState pjvms(this);
- const TypeInstPtr* tinst = TypeOopPtr::make_from_klass_unique(klass)->cast_to_ptr_type(TypePtr::NotNull)->is_instptr();
+ const TypeInstPtr* tinst = TypeOopPtr::make_from_klass_unique(klass)->cast_to_ptr_type(TypePtr::NotNull)->as_instptr();
assert(klass->has_subklass() || tinst->klass_is_exact(), "lost exactness");
Node* ex_oop = _gvn.transform(new CheckCastPPNode(control(), ex_node, tinst));
if (PrintOpto && WizardMode) {
@@ -1255,18 +1255,18 @@ ciMethod* Compile::optimize_inlining(ciMethod* caller, ciInstanceKlass* klass, c
ciInstanceKlass* actual_receiver = klass;
// Array methods are all inherited from Object, and are monomorphic.
// finalize() call on array is not allowed.
- if (receiver_type->isa_aryptr() &&
+ if (receiver_type->is_aryptr() &&
callee->holder() == env()->Object_klass() &&
callee->name() != ciSymbols::finalize_method_name()) {
return callee;
}
// All other interesting cases are instance klasses.
- if (!receiver_type->isa_instptr()) {
+ if (!receiver_type->is_instptr()) {
return nullptr;
}
- ciInstanceKlass* receiver_klass = receiver_type->is_instptr()->instance_klass();
+ ciInstanceKlass* receiver_klass = receiver_type->as_instptr()->instance_klass();
if (receiver_klass->is_loaded() && receiver_klass->is_initialized() && !receiver_klass->is_interface() &&
(receiver_klass == actual_receiver || receiver_klass->is_subtype_of(actual_receiver))) {
// ikl is a same or better type than the original actual_receiver,
diff --git a/src/hotspot/share/opto/escape.cpp b/src/hotspot/share/opto/escape.cpp
index 611275b3a8a..f4581c022f6 100644
--- a/src/hotspot/share/opto/escape.cpp
+++ b/src/hotspot/share/opto/escape.cpp
@@ -172,7 +172,7 @@ bool ConnectionGraph::compute_escape() {
Node* n = ideal_nodes.at(next);
if (n->is_Mem() &&
!n->in(MemNode::Address)->is_AddP() &&
- _igvn->type(n->in(MemNode::Address))->isa_oopptr()) {
+ _igvn->type(n->in(MemNode::Address))->is_oopptr()) {
// EA expects on-heap memory addresses to be represented by an AddP. An AddP with a zero
// offset can be optimized to its oop base, so recreate it.
Node* addp = AddPNode::make_with_base(n->in(MemNode::Address), n->in(MemNode::Address), _igvn->MakeConX(0));
@@ -601,7 +601,7 @@ bool ConnectionGraph::can_reduce_check_users(Node* n, uint nesting) const {
if (!use_use->is_Load() || !use_use->as_Load()->can_split_through_phi_base(_igvn)) {
NOT_PRODUCT(if (TraceReduceAllocationMerges) tty->print_cr("Can NOT reduce Phi %d on invocation %d. AddP user isn't a [splittable] Load(): %s", n->_idx, _invocation, use_use->Name());)
return false;
- } else if (load_type->isa_narrowklass() || load_type->isa_klassptr()) {
+ } else if (load_type->is_narrowklass() || load_type->is_klassptr()) {
NOT_PRODUCT(if (TraceReduceAllocationMerges) tty->print_cr("Can NOT reduce Phi %d on invocation %d. [Narrow] Klass Load: %s", n->_idx, _invocation, use_use->Name());)
return false;
}
@@ -611,7 +611,7 @@ bool ConnectionGraph::can_reduce_check_users(Node* n, uint nesting) const {
return false;
} else if (use->is_CastPP()) {
const Type* cast_t = _igvn->type(use);
- if (cast_t == nullptr || cast_t->make_ptr()->isa_instptr() == nullptr) {
+ if (cast_t == nullptr || !cast_t->make_ptr()->is_instptr()) {
#ifndef PRODUCT
if (TraceReduceAllocationMerges) {
tty->print_cr("Can NOT reduce Phi %d on invocation %d. CastPP is not to an instance.", n->_idx, _invocation);
@@ -690,7 +690,7 @@ bool ConnectionGraph::can_reduce_phi(PhiNode* ophi) const {
const Type* phi_t = _igvn->type(ophi);
if (phi_t == nullptr ||
phi_t->make_ptr() == nullptr ||
- phi_t->make_ptr()->isa_aryptr() != nullptr) {
+ phi_t->make_ptr()->is_aryptr()) {
return false;
}
@@ -809,9 +809,9 @@ Node* ConnectionGraph::split_castpp_load_through_phi(Node* curr_addp, Node* curr
// The data_phi merging the loads needs to be nullable if
// we are loading pointers.
if (load_type->make_ptr() != nullptr) {
- if (load_type->isa_narrowoop()) {
+ if (load_type->is_narrowoop()) {
load_type = load_type->meet(TypeNarrowOop::NULL_PTR);
- } else if (load_type->isa_ptr()) {
+ } else if (load_type->is_ptr()) {
load_type = load_type->meet(TypePtr::NULL_PTR);
} else {
assert(false, "Unexpected load ptr type.");
@@ -1623,7 +1623,7 @@ bool ConnectionGraph::has_arg_escape(CallJavaNode* call) {
const TypeTuple* d = call->tf()->domain_sig();
for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
const Type* at = d->field_at(i);
- if (at->isa_oopptr() != nullptr) {
+ if (at->is_oopptr()) {
return true;
}
}
@@ -1643,7 +1643,7 @@ void ConnectionGraph::add_objload_to_connection_graph(Node* n, Unique_Node_List<
Node* adr = n->in(MemNode::Address);
#ifdef ASSERT
if (!adr->is_AddP()) {
- assert(_igvn->type(adr)->isa_rawptr(), "sanity");
+ assert(_igvn->type(adr)->is_rawptr(), "sanity");
} else {
assert((ptnode_adr(adr->_idx) == nullptr ||
ptnode_adr(adr->_idx)->as_Field()->is_oop()), "sanity");
@@ -1660,7 +1660,7 @@ void ConnectionGraph::add_proj(Node* n, Unique_Node_List* delayed_worklist
} else if (n->in(0)->is_LoadFlat()) {
// Treat LoadFlat outputs similar to a call return value
add_local_var_and_edge(n, PointsToNode::NoEscape, n->in(0), delayed_worklist);
- } else if (n->as_Proj()->_con >= TypeFunc::Parms && n->in(0)->is_Call() && n->bottom_type()->isa_ptr()) {
+ } else if (n->as_Proj()->_con >= TypeFunc::Parms && n->in(0)->is_Call() && n->bottom_type()->is_ptr()) {
CallNode* call = n->in(0)->as_Call();
assert(call->tf()->returns_value_type_as_fields(), "");
if (n->as_Proj()->_con == TypeFunc::Parms || !returns_an_argument(call) || has_incompatible_argument_return(call)) {
@@ -1714,7 +1714,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node* n, Unique_Node_Listfast_outs(imax); i < imax && !returns_oop; i++) {
ProjNode* pn = n->fast_out(i)->as_Proj();
- if (pn->_con >= TypeFunc::Parms && pn->bottom_type()->isa_ptr()) {
+ if (pn->_con >= TypeFunc::Parms && pn->bottom_type()->is_ptr()) {
returns_oop = true;
}
}
@@ -1845,7 +1845,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node* n, Unique_Node_Listreq(); i++) {
- if (igvn->type(n->in(i))->isa_oopptr()) {
+ if (igvn->type(n->in(i))->is_oopptr()) {
add_local_var_and_edge(n, PointsToNode::GlobalEscape, n->in(i), delayed_worklist);
}
}
@@ -1896,7 +1896,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node* n, Unique_Node_Listin(i);
if (in != nullptr) {
const Type* at = _igvn->type(in);
- if (!at->isa_ptr()) continue;
+ if (!at->is_ptr()) continue;
add_local_var(n, PointsToNode::GlobalEscape);
delayed_worklist->push(n);
@@ -2028,7 +2028,7 @@ void ConnectionGraph::add_final_edges(Node *n) {
// Returned oops always escape, including oop fields of returned scalarized value types.
DEBUG_ONLY(bool has_oop = false;)
for (uint i = TypeFunc::Parms; i < n->req(); i++) {
- if (_igvn->type(n->in(i))->isa_oopptr()) {
+ if (_igvn->type(n->in(i))->is_oopptr()) {
DEBUG_ONLY(has_oop = true;)
add_local_var_and_edge(n, PointsToNode::GlobalEscape, n->in(i), nullptr);
}
@@ -2070,9 +2070,9 @@ void ConnectionGraph::add_final_edges(Node *n) {
for (uint i = 2; i < n->req(); i++) {
Node* adr = n->in(i);
const Type* at = _igvn->type(adr);
- if (!adr->is_top() && at->isa_ptr()) {
+ if (!adr->is_top() && at->is_ptr()) {
assert(at == Type::TOP || at == TypePtr::NULL_PTR ||
- at->isa_ptr() != nullptr, "expecting a pointer");
+ at->is_ptr(), "expecting a pointer");
if (adr->is_AddP()) {
adr = get_addp_base(adr);
}
@@ -2089,7 +2089,7 @@ void ConnectionGraph::add_final_edges(Node *n) {
Node* in = n->in(i);
if (in != nullptr) {
const Type* at = _igvn->type(in);
- if (!at->isa_ptr()) continue;
+ if (!at->is_ptr()) continue;
if (in->is_AddP()) {
in = get_addp_base(in);
@@ -2122,7 +2122,7 @@ void ConnectionGraph::add_to_congraph_unsafe_access(Node* n, uint opcode, Unique
if (adr_type == nullptr) {
return; // skip dead nodes
}
- if (adr_type->isa_oopptr()
+ if (adr_type->is_oopptr()
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
&& adr_type == TypeRawPtr::NOTNULL
&& is_captured_store_address(adr))) {
@@ -2141,7 +2141,7 @@ void ConnectionGraph::add_to_congraph_unsafe_access(Node* n, uint opcode, Unique
return;
}
// Stored value escapes in unsafe access.
- if ((opcode == Op_StoreP) && adr_type->isa_rawptr()) {
+ if ((opcode == Op_StoreP) && adr_type->is_rawptr()) {
delayed_worklist->push(n); // Process unsafe access later.
return;
}
@@ -2164,7 +2164,7 @@ bool ConnectionGraph::add_final_edges_unsafe_access(Node* n, uint opcode) {
}
#endif
- if (adr_type->isa_oopptr()
+ if (adr_type->is_oopptr()
|| ((opcode == Op_StoreP || opcode == Op_StoreN || opcode == Op_StoreNKlass)
&& adr_type == TypeRawPtr::NOTNULL
&& is_captured_store_address(adr))) {
@@ -2177,7 +2177,7 @@ bool ConnectionGraph::add_final_edges_unsafe_access(Node* n, uint opcode) {
assert(ptn != nullptr, "node should be registered");
add_edge(adr_ptn, ptn);
return true;
- } else if ((opcode == Op_StoreP) && adr_type->isa_rawptr()) {
+ } else if ((opcode == Op_StoreP) && adr_type->is_rawptr()) {
// Stored value escapes in unsafe access.
Node* val = n->in(MemNode::ValueIn);
PointsToNode* ptn = ptnode_adr(val->_idx);
@@ -2334,7 +2334,7 @@ bool ConnectionGraph::returns_an_argument(const CallNode* call) {
const TypeTuple* d = call->tf()->domain_sig();
for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
const Type* t = d->field_at(i);
- if (t->isa_ptr() != nullptr &&
+ if (t->is_ptr() &&
call_analyzer->is_arg_returned(i - TypeFunc::Parms)) {
return true;
}
@@ -2350,7 +2350,7 @@ bool ConnectionGraph::has_incompatible_argument_return(const CallNode* call) {
int arg_num = 0;
for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
const Type* t = d->field_at(i);
- if (t->isa_ptr() != nullptr &&
+ if (t->is_ptr() &&
call_analyzer->is_arg_returned(i - TypeFunc::Parms)) {
const bool scalarized_arg = meth->is_scalarized_arg(arg_num);
if (scalarized_arg && !compatible_return(call->as_CallJava(), i)) {
@@ -2379,7 +2379,7 @@ void ConnectionGraph::add_call_node(CallNode* call) {
bool scalar_replaceable = true;
NOT_PRODUCT(const char* nsr_reason = "");
if (call->is_AllocateArray()) {
- if (!kt->isa_aryklassptr()) { // StressReflectiveCode
+ if (!kt->is_aryklassptr()) { // StressReflectiveCode
es = PointsToNode::GlobalEscape;
} else {
int length = call->in(AllocateNode::ALength)->find_int_con(-1);
@@ -2394,10 +2394,10 @@ void ConnectionGraph::add_call_node(CallNode* call) {
}
}
} else { // Allocate instance
- if (!kt->isa_instklassptr()) { // StressReflectiveCode
+ if (!kt->is_instklassptr()) { // StressReflectiveCode
es = PointsToNode::GlobalEscape;
} else {
- const TypeInstKlassPtr* ikt = kt->is_instklassptr();
+ const TypeInstKlassPtr* ikt = kt->as_instklassptr();
ciInstanceKlass* ik = ikt->klass_is_exact() ? ikt->exact_klass()->as_instance_klass() : ikt->instance_klass();
if (ik->is_subclass_of(_compile->env()->Thread_klass()) ||
ik->is_subclass_of(_compile->env()->Reference_klass()) ||
@@ -2504,7 +2504,7 @@ void ConnectionGraph::add_call_node(CallNode* call) {
// Check that the return type is compatible with the type of the argument being returned i.e. that there's no cast that
// fails in the method
bool ConnectionGraph::compatible_return(CallJavaNode* call, uint k) {
- return call->tf()->domain_sig()->field_at(k)->is_instptr()->instance_klass() == call->tf()->range_sig()->field_at(TypeFunc::Parms)->is_instptr()->instance_klass();
+ return call->tf()->domain_sig()->field_at(k)->as_instptr()->instance_klass() == call->tf()->range_sig()->field_at(TypeFunc::Parms)->as_instptr()->instance_klass();
}
void ConnectionGraph::process_call_arguments(CallNode *call) {
@@ -2539,7 +2539,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
continue;
}
const Type *aat = _igvn->type(arg);
- if (arg->is_top() || !at->isa_ptr() || !aat->isa_ptr()) {
+ if (arg->is_top() || !at->is_ptr() || !aat->is_ptr()) {
continue;
}
if (arg->is_AddP()) {
@@ -2558,13 +2558,13 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
PointsToNode::EscapeState arg_esc = arg_ptn->escape_state();
if (is_arraycopy || arg_esc < PointsToNode::ArgEscape) {
assert(aat == Type::TOP || aat == TypePtr::NULL_PTR ||
- aat->isa_ptr() != nullptr, "expecting an Ptr");
- bool arg_has_oops = aat->isa_oopptr() &&
- (aat->isa_instptr() ||
- (aat->isa_aryptr() && (aat->isa_aryptr()->elem() == Type::BOTTOM || aat->isa_aryptr()->elem()->make_oopptr() != nullptr)) ||
- (aat->isa_aryptr() && aat->isa_aryptr()->elem() != nullptr &&
- aat->isa_aryptr()->is_flat() &&
- aat->isa_aryptr()->elem()->value_klass()->contains_oops()));
+ aat->is_ptr(), "expecting an Ptr");
+ bool arg_has_oops = aat->is_oopptr() &&
+ (aat->is_instptr() ||
+ (aat->is_aryptr() && (aat->as_aryptr()->elem() == Type::BOTTOM || aat->as_aryptr()->elem()->make_oopptr() != nullptr)) ||
+ (aat->is_aryptr() && aat->as_aryptr()->elem() != nullptr &&
+ aat->as_aryptr()->is_flat() &&
+ aat->as_aryptr()->elem()->value_klass()->contains_oops()));
if (i == TypeFunc::Parms) {
src_has_oops = arg_has_oops;
}
@@ -2708,12 +2708,12 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
call->proj_out_or_null(di.i_domain_cc() - di.first_field_pos() + TypeFunc::Parms + 1) == nullptr ||
_igvn->type(call->proj_out_or_null(di.i_domain_cc() - di.first_field_pos() + TypeFunc::Parms + 1)) == at,
"scalarized return and scalarized argument should match");
- if (at->isa_ptr() != nullptr && call_analyzer->is_arg_returned(jvms_slot) && ret_arg) {
+ if (at->is_ptr() && call_analyzer->is_arg_returned(jvms_slot) && ret_arg) {
// The call returns arguments.
if (scalarized_arg) {
ProjNode* res_proj = call->proj_out_or_null(di.i_domain_cc() - di.first_field_pos() + TypeFunc::Parms + 1);
if (res_proj != nullptr) {
- assert(_igvn->type(res_proj)->isa_ptr(), "scalarized return and scalarized argument should match");
+ assert(_igvn->type(res_proj)->is_ptr(), "scalarized return and scalarized argument should match");
if (res_proj->_con != TypeFunc::Parms) {
// add an edge between the result projection for a field and the argument projection for the same argument field
PointsToNode* proj_ptn = ptnode_adr(res_proj->_idx);
@@ -2729,7 +2729,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
add_edge(call_ptn, arg_ptn);
}
}
- if (at->isa_oopptr() != nullptr &&
+ if (at->is_oopptr() &&
arg_ptn->escape_state() < PointsToNode::GlobalEscape) {
if (scalarized_arg && !call_analyzer->is_arg_local(jvms_slot)) {
// If the argument is a field of a scalarized value object, the
@@ -2771,7 +2771,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) {
const TypeTuple* d = call->tf()->domain_cc();
for (uint i = TypeFunc::Parms; i < d->cnt(); i++) {
const Type* at = d->field_at(i);
- if (at->isa_oopptr() != nullptr) {
+ if (at->is_oopptr()) {
Node* arg = call->in(i);
if (arg->is_AddP()) {
arg = get_addp_base(arg);
@@ -3264,12 +3264,12 @@ int ConnectionGraph::find_init_values_null(JavaObjectNode* pta, PhaseValues* pha
} else {
// Check only oop fields.
const Type* adr_type = field->ideal_node()->as_AddP()->bottom_type();
- if (adr_type->isa_rawptr()) {
+ if (adr_type->is_rawptr()) {
#ifdef ASSERT
// Raw pointers are used for initializing stores so skip it
// since it should be recorded already
Node* base = get_addp_base(field->ideal_node());
- assert(adr_type->isa_rawptr() && is_captured_store_address(field->ideal_node()), "unexpected pointer type");
+ assert(adr_type->is_rawptr() && is_captured_store_address(field->ideal_node()), "unexpected pointer type");
#endif
continue;
}
@@ -3455,8 +3455,8 @@ void ConnectionGraph::adjust_scalar_replaceable_state(JavaObjectNode* jobj, Uniq
assert(n->is_AddP(), "expect an address computation");
if (n->in(AddPNode::Base)->is_top() &&
n->in(AddPNode::Address)->Opcode() == Op_CheckCastPP) {
- assert(n->in(AddPNode::Address)->bottom_type()->isa_rawptr(), "raw address so raw cast expected");
- assert(_igvn->type(n->in(AddPNode::Address)->in(1))->isa_oopptr(), "cast pattern at unsafe access expected");
+ assert(n->in(AddPNode::Address)->bottom_type()->is_rawptr(), "raw address so raw cast expected");
+ assert(_igvn->type(n->in(AddPNode::Address)->in(1))->is_oopptr(), "cast pattern at unsafe access expected");
set_not_scalar_replaceable(jobj NOT_PRODUCT(COMMA "is used as base of mixed unsafe access"));
return;
}
@@ -3934,21 +3934,21 @@ bool ConnectionGraph::is_oop_field(Node* n, int offset, bool* unsafe) {
return true;
}
const Type* adr_type = n->as_AddP()->bottom_type();
- int field_offset = adr_type->isa_aryptr() ? adr_type->isa_aryptr()->field_offset().get() : Type::OffsetBot;
+ int field_offset = adr_type->is_aryptr() ? adr_type->as_aryptr()->field_offset().get() : Type::OffsetBot;
BasicType bt = T_INT;
if (offset == Type::OffsetBot && field_offset == Type::OffsetBot) {
// Check only oop fields.
- if (!adr_type->isa_aryptr() ||
- adr_type->isa_aryptr()->elem() == Type::BOTTOM ||
- adr_type->isa_aryptr()->elem()->make_oopptr() != nullptr) {
+ if (!adr_type->is_aryptr() ||
+ adr_type->as_aryptr()->elem() == Type::BOTTOM ||
+ adr_type->as_aryptr()->elem()->make_oopptr() != nullptr) {
// OffsetBot is used to reference array's element. Ignore first AddP.
if (find_second_addp(n, n->in(AddPNode::Base)) == nullptr) {
bt = T_OBJECT;
}
}
} else if (offset != oopDesc::klass_offset_in_bytes()) {
- if (adr_type->isa_instptr()) {
- ciField* field = _compile->alias_type(adr_type->is_ptr())->field();
+ if (adr_type->is_instptr()) {
+ ciField* field = _compile->alias_type(adr_type->as_ptr())->field();
if (field != nullptr) {
bt = field->layout_type();
} else {
@@ -3958,14 +3958,14 @@ bool ConnectionGraph::is_oop_field(Node* n, int offset, bool* unsafe) {
(*unsafe) = true;
}
}
- } else if (adr_type->isa_aryptr()) {
+ } else if (adr_type->is_aryptr()) {
if (offset == arrayOopDesc::length_offset_in_bytes()) {
// Ignore array length load.
} else if (find_second_addp(n, n->in(AddPNode::Base)) != nullptr) {
// Ignore first AddP.
} else {
- const Type* elemtype = adr_type->is_aryptr()->elem();
- if (adr_type->is_aryptr()->is_flat() && field_offset != Type::OffsetBot) {
+ const Type* elemtype = adr_type->as_aryptr()->elem();
+ if (adr_type->as_aryptr()->is_flat() && field_offset != Type::OffsetBot) {
ciValueKlass* vk = elemtype->value_klass();
field_offset += vk->payload_offset();
ciField* field = vk->get_field_by_offset(field_offset, false);
@@ -3979,7 +3979,7 @@ bool ConnectionGraph::is_oop_field(Node* n, int offset, bool* unsafe) {
bt = elemtype->array_element_basic_type();
}
}
- } else if (adr_type->isa_rawptr() || adr_type->isa_klassptr()) {
+ } else if (adr_type->is_rawptr() || adr_type->is_klassptr()) {
// Allocation initialization, ThreadLocal field access, unsafe access
if (has_oop_node_outs(n)) {
bt = T_OBJECT;
@@ -4150,7 +4150,7 @@ bool FieldNode::has_base(JavaObjectNode* jobj) const {
bool ConnectionGraph::is_captured_store_address(Node* addp) {
// Handle simple case first.
- assert(_igvn->type(addp)->isa_oopptr() == nullptr, "should be raw access");
+ assert(!_igvn->type(addp)->is_oopptr(), "should be raw access");
if (addp->in(AddPNode::Address)->is_Proj() && addp->in(AddPNode::Address)->in(0)->is_Allocate()) {
return true;
} else if (addp->in(AddPNode::Address)->is_Phi()) {
@@ -4170,7 +4170,7 @@ bool ConnectionGraph::is_captured_store_address(Node* addp) {
int ConnectionGraph::address_offset(Node* adr, PhaseValues* phase) {
const Type *adr_type = phase->type(adr);
- if (adr->is_AddP() && adr_type->isa_oopptr() == nullptr && is_captured_store_address(adr)) {
+ if (adr->is_AddP() && !adr_type->is_oopptr() && is_captured_store_address(adr)) {
// We are computing a raw address for a store captured by an Initialize
// compute an appropriate address type. AddP cases #3 and #5 (see below).
int offs = (int)phase->find_intptr_t_con(adr->in(AddPNode::Offset), Type::OffsetBot);
@@ -4179,7 +4179,7 @@ int ConnectionGraph::address_offset(Node* adr, PhaseValues* phase) {
"offset must be a constant or it is initialization of array");
return offs;
}
- return adr_type->is_ptr()->flat_offset();
+ return adr_type->as_ptr()->flat_offset();
}
Node* ConnectionGraph::get_addp_base(Node *addp) {
@@ -4275,8 +4275,8 @@ Node* ConnectionGraph::get_addp_base(Node *addp) {
base = base->in(AddPNode::Address);
}
if (base->Opcode() == Op_CheckCastPP &&
- base->bottom_type()->isa_rawptr() &&
- _igvn->type(base->in(1))->isa_oopptr()) {
+ base->bottom_type()->is_rawptr() &&
+ _igvn->type(base->in(1))->is_oopptr()) {
base = base->in(1); // Case #9
} else {
// Case #3, #6, and #10
@@ -4285,8 +4285,8 @@ Node* ConnectionGraph::get_addp_base(Node *addp) {
assert(opcode == Op_ConP || opcode == Op_ThreadLocal ||
opcode == Op_CastX2P || uncast_base->is_DecodeNarrowPtr() ||
(_igvn->C->is_osr_compilation() && uncast_base->is_Parm() && uncast_base->as_Parm()->_con == TypeFunc::Parms)||
- (uncast_base->is_Mem() && (uncast_base->bottom_type()->isa_rawptr() != nullptr)) ||
- (uncast_base->is_Mem() && (uncast_base->bottom_type()->isa_klassptr() != nullptr)) ||
+ (uncast_base->is_Mem() && uncast_base->bottom_type()->is_rawptr()) ||
+ (uncast_base->is_Mem() && uncast_base->bottom_type()->is_klassptr()) ||
is_captured_store_address(addp) ||
is_load_array_klass_related(uncast_base), "sanity");
}
@@ -4363,13 +4363,13 @@ bool ConnectionGraph::split_AddP(Node *addp, Node *base) {
assert(addp->in(AddPNode::Address)->is_Proj(), "base of raw address must be result projection from allocation");
intptr_t offs = (int)igvn->find_intptr_t_con(addp->in(AddPNode::Offset), Type::OffsetBot);
assert(offs != Type::OffsetBot, "offset must be a constant");
- if (base_t->isa_aryptr() != nullptr) {
+ if (base_t->is_aryptr()) {
// In the case of a flat value type array, each field has its
// own slice so we need to extract the field being accessed from
// the address computation
- t = base_t->isa_aryptr()->add_field_offset_and_offset(offs)->is_oopptr();
+ t = base_t->as_aryptr()->add_field_offset_and_offset(offs)->as_oopptr();
} else {
- t = base_t->add_offset(offs)->is_oopptr();
+ t = base_t->add_offset(offs)->as_oopptr();
}
}
int inst_id = base_t->instance_id();
@@ -4397,12 +4397,12 @@ bool ConnectionGraph::split_AddP(Node *addp, Node *base) {
return false; // bail out
}
const TypePtr* tinst = base_t->add_offset(t->offset());
- if (tinst->isa_aryptr() && t->isa_aryptr()) {
+ if (tinst->is_aryptr() && t->is_aryptr()) {
// In the case of a flat value type array, each field has its
// own slice so we need to keep track of the field being accessed.
- tinst = tinst->is_aryptr()->with_field_offset(t->is_aryptr()->field_offset().get());
+ tinst = tinst->as_aryptr()->with_field_offset(t->as_aryptr()->field_offset().get());
// Keep array properties (not flat/null-free)
- tinst = tinst->is_aryptr()->update_properties(t->is_aryptr());
+ tinst = tinst->as_aryptr()->update_properties(t->as_aryptr());
if (tinst == nullptr) {
return false; // Skip dead path with inconsistent properties
}
@@ -4412,7 +4412,7 @@ bool ConnectionGraph::split_AddP(Node *addp, Node *base) {
// for the instance type. Note: C++ will not remove it since the call
// has side effect.
int alias_idx = _compile->get_alias_index(tinst);
- if (igvn->type(addp)->isa_oopptr()) {
+ if (igvn->type(addp)->is_oopptr()) {
igvn->set_type(addp, tinst);
} else {
// Captured stores should remain raw memory stores
@@ -4585,8 +4585,8 @@ Node* ConnectionGraph::step_through_mergemem(MergeMemNode *mmem, int alias_idx,
// means an array I have not precisely typed yet. Do not do any
// alias stuff with it any time soon.
if (toop->base() != Type::AnyPtr &&
- !(toop->isa_instptr() &&
- toop->is_instptr()->instance_klass()->is_java_lang_Object() &&
+ !(toop->is_instptr() &&
+ toop->as_instptr()->instance_klass()->is_java_lang_Object() &&
toop->offset() == Type::OffsetBot)) {
mem = mmem->memory_at(alias_idx);
// Update input if it is progress over what we have now
@@ -4662,7 +4662,7 @@ void ConnectionGraph::move_inst_mem(Node* n, Unique_Node_List& orig_phi
"Following memory nodes should have new memory input or be on the same memory slice");
} else if (use->is_Phi()) {
// Phi nodes should be split and moved already.
- tp = use->as_Phi()->in_adr_type()->isa_ptr();
+ tp = use->as_Phi()->in_adr_type();
assert(tp != nullptr, "ptr type");
int idx = C->get_alias_index(tp);
assert(idx == alias_idx, "Following Phi nodes should be on the same memory slice");
@@ -4698,8 +4698,8 @@ bool ConnectionGraph::flat_access_aliases_with(Node* flat_access, const TypeOopP
}
if (ptn->is_JavaObject()) {
Node* jobj_base = get_map(ptn->idx());
- if (jobj_base == nullptr || !_igvn->type(jobj_base)->is_oopptr()->same_instance_as(toop)) {
- assert(!_igvn->type(base)->is_oopptr()->same_instance_as(toop), "should not alias");
+ if (jobj_base == nullptr || !_igvn->type(jobj_base)->as_oopptr()->same_instance_as(toop)) {
+ assert(!_igvn->type(base)->as_oopptr()->same_instance_as(toop), "should not alias");
return false;
}
return true;
@@ -4708,12 +4708,12 @@ bool ConnectionGraph::flat_access_aliases_with(Node* flat_access, const TypeOopP
for (EdgeIterator i(ptn); i.has_next(); i.next()) {
if (i.get()->is_JavaObject()) {
Node* jobj_base = get_map(i.get()->idx());
- if (jobj_base != nullptr && _igvn->type(jobj_base)->is_oopptr()->same_instance_as(toop)) {
+ if (jobj_base != nullptr && _igvn->type(jobj_base)->as_oopptr()->same_instance_as(toop)) {
return true;
}
}
}
- assert(!_igvn->type(base)->is_oopptr()->same_instance_as(toop), "should not alias");
+ assert(!_igvn->type(base)->as_oopptr()->same_instance_as(toop), "should not alias");
return false;
}
@@ -4742,13 +4742,13 @@ Node* ConnectionGraph::find_inst_mem(Node* orig_mem, int alias_idx, Unique_Node_
if (at == Type::TOP) {
break; // Dead
}
- assert (at->isa_ptr() != nullptr, "pointer type required.");
- int idx = C->get_alias_index(at->is_ptr());
+ assert(at->is_ptr(), "pointer type required.");
+ int idx = C->get_alias_index(at->as_ptr());
if (idx == alias_idx) {
break; // Found
}
- if (!is_instance && (at->isa_oopptr() == nullptr ||
- !at->is_oopptr()->is_known_instance())) {
+ if (!is_instance && (!at->is_oopptr() ||
+ !at->as_oopptr()->is_known_instance())) {
break; // Do not skip store to general memory slice.
}
result = result->in(MemNode::Memory);
@@ -4852,8 +4852,8 @@ Node* ConnectionGraph::find_inst_mem(Node* orig_mem, int alias_idx, Unique_Node_
}
const Type *at = igvn->type(adr);
if (at != Type::TOP) {
- assert(at->isa_ptr() != nullptr, "pointer type required.");
- int idx = C->get_alias_index(at->is_ptr());
+ assert(at->is_ptr(), "pointer type required.");
+ int idx = C->get_alias_index(at->as_ptr());
if (idx == alias_idx) {
// Assert in debug mode
assert(false, "Object is not scalar replaceable if a LoadStore node accesses its field");
@@ -4865,8 +4865,8 @@ Node* ConnectionGraph::find_inst_mem(Node* orig_mem, int alias_idx, Unique_Node_
Node* adr = result->in(3); // Memory edge corresponds to destination array
const Type *at = igvn->type(adr);
if (at != Type::TOP) {
- assert(at->isa_ptr() != nullptr, "pointer type required.");
- int idx = C->get_alias_index(at->is_ptr());
+ assert(at->is_ptr(), "pointer type required.");
+ int idx = C->get_alias_index(at->as_ptr());
if (idx == alias_idx) {
// Assert in debug mode
assert(false, "Object is not scalar replaceable if a StrInflatedCopy node accesses its field");
@@ -5165,17 +5165,17 @@ void ConnectionGraph::split_unique_types(GrowableArray& alloc_worklist,
// correct memory state otherwise.
_compile->get_alias_index(tinst->add_offset(oopDesc::mark_offset_in_bytes()));
_compile->get_alias_index(tinst->add_offset(oopDesc::klass_offset_in_bytes()));
- if (alloc->is_Allocate() && (t->isa_instptr() || t->isa_aryptr())) {
+ if (alloc->is_Allocate() && (t->is_instptr() || t->is_aryptr())) {
// Add a new NarrowMem projection for each existing NarrowMem projection with new adr type
InitializeNode* init = alloc->as_Allocate()->initialization();
assert(init != nullptr, "can't find Initialization node for this Allocate node");
auto process_narrow_proj = [&](NarrowMemProjNode* proj) {
const TypePtr* adr_type = proj->out_adr_type();
const TypePtr* new_adr_type = tinst->with_offset(adr_type->offset());
- if (adr_type->isa_aryptr()) {
+ if (adr_type->is_aryptr()) {
// In the case of a flat value type array, each field has its own slice so we need a
// NarrowMemProj for each field of the flat array elements
- new_adr_type = new_adr_type->is_aryptr()->with_field_offset(adr_type->is_aryptr()->field_offset().get());
+ new_adr_type = new_adr_type->as_aryptr()->with_field_offset(adr_type->as_aryptr()->field_offset().get());
}
if (adr_type != new_adr_type && !init->already_has_narrow_mem_proj_with_adr_type(new_adr_type)) {
// Do NOT remove the next line: ensure a new alias index is allocated for the instance type.
@@ -5288,20 +5288,20 @@ void ConnectionGraph::split_unique_types(GrowableArray& alloc_worklist,
const Type *tn_type = igvn->type(tn);
const TypeOopPtr *tn_t;
- if (tn_type->isa_narrowoop()) {
+ if (tn_type->is_narrowoop()) {
tn_t = tn_type->make_ptr()->isa_oopptr();
} else {
tn_t = tn_type->isa_oopptr();
}
if (tn_t != nullptr && tinst->maybe_java_subtype_of(tn_t)) {
- if (tn_t->isa_aryptr()) {
+ if (tn_t->is_aryptr()) {
// Keep array properties (not flat/null-free)
- tinst = tinst->is_aryptr()->update_properties(tn_t->is_aryptr());
+ tinst = tinst->as_aryptr()->update_properties(tn_t->as_aryptr());
if (tinst == nullptr) {
continue; // Skip dead path with inconsistent properties
}
}
- if (tn_type->isa_narrowoop()) {
+ if (tn_type->is_narrowoop()) {
tn_type = tinst->make_narrowoop();
} else {
tn_type = tinst;
@@ -5479,8 +5479,8 @@ void ConnectionGraph::split_unique_types(GrowableArray& alloc_worklist,
if (addr_t == Type::TOP) {
continue;
}
- assert (addr_t->isa_ptr() != nullptr, "pointer type required.");
- int alias_idx = _compile->get_alias_index(addr_t->is_ptr());
+ assert(addr_t->is_ptr(), "pointer type required.");
+ int alias_idx = _compile->get_alias_index(addr_t->as_ptr());
assert ((uint)alias_idx < new_index_end, "wrong alias index");
Node *mem = find_inst_mem(n->in(MemNode::Memory), alias_idx, orig_phis);
if (_compile->failing()) {
@@ -5569,8 +5569,8 @@ void ConnectionGraph::split_unique_types(GrowableArray& alloc_worklist,
while (mem->is_Mem()) {
const Type* at = igvn->type(mem->in(MemNode::Address));
if (at != Type::TOP) {
- assert (at->isa_ptr() != nullptr, "pointer type required.");
- uint idx = (uint)_compile->get_alias_index(at->is_ptr());
+ assert(at->is_ptr(), "pointer type required.");
+ uint idx = (uint)_compile->get_alias_index(at->as_ptr());
if (idx == i) {
if (cur == nullptr) {
cur = mem;
@@ -5601,7 +5601,7 @@ void ConnectionGraph::split_unique_types(GrowableArray& alloc_worklist,
}
// Find the rest of instances values
for (uint ni = new_index_start; ni < new_index_end; ni++) {
- const TypeOopPtr *tinst = _compile->get_adr_type(ni)->isa_oopptr();
+ const TypeOopPtr* tinst = _compile->get_adr_type(ni)->as_oopptr();
Node* result = step_through_mergemem(nmm, ni, tinst);
if (result == nmm->base_memory()) {
// Didn't find instance memory, search through general slice recursively.
diff --git a/src/hotspot/share/opto/generateOptoStub.cpp b/src/hotspot/share/opto/generateOptoStub.cpp
index 8a420bc1d85..122b530615a 100644
--- a/src/hotspot/share/opto/generateOptoStub.cpp
+++ b/src/hotspot/share/opto/generateOptoStub.cpp
@@ -115,7 +115,7 @@ void GraphKit::gen_stub(address C_function,
// extra argument. Not all calls need it, but it is cheap to add here.
for (uint pcnt = cnt; pcnt < parm_cnt; pcnt++, cnt++) {
const Type *f = jdomain->field_at(pcnt);
- if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) {
+ if (CCallingConventionRequiresIntsAsLongs && f->is_int()) {
fields[cnt++] = TypeLong::LONG;
fields[cnt] = Type::HALF; // Must add an additional half for a long.
} else {
@@ -138,13 +138,13 @@ void GraphKit::gen_stub(address C_function,
// Make a private copy of jrange->fields();
const Type **rfields = TypeTuple::fields(jrange->cnt() - TypeFunc::Parms);
// Fixup oop returns
- int retval_ptr = retval->isa_oop_ptr();
+ int retval_ptr = retval->is_oopptr();
if (retval_ptr) {
assert( pass_tls, "Oop must be returned thru TLS" );
// Fancy-jumps return address; others return void
rfields[TypeFunc::Parms] = is_fancy_jump ? TypeRawPtr::BOTTOM : Type::TOP;
- } else if (retval->isa_int()) { // Returning any integer subtype?
+ } else if (retval->is_int()) { // Returning any integer subtype?
// "Fatten" byte, char & short return types to 'int' to show that
// the native C code can return values with junk high order bits.
// We'll sign-extend it below later.
@@ -179,7 +179,7 @@ void GraphKit::gen_stub(address C_function,
call->set_req(TypeFunc::ReturnAdr, top());
for (; i < parm_cnt; i++) { // Regular input arguments.
const Type *f = jdomain->field_at(i);
- if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) {
+ if (CCallingConventionRequiresIntsAsLongs && f->is_int()) {
call->init_req(cnt++, _gvn.transform(new ConvI2LNode(map()->in(i))));
call->init_req(cnt++, top());
} else {
diff --git a/src/hotspot/share/opto/graphKit.cpp b/src/hotspot/share/opto/graphKit.cpp
index f4dbf16428b..ba5003a3edd 100644
--- a/src/hotspot/share/opto/graphKit.cpp
+++ b/src/hotspot/share/opto/graphKit.cpp
@@ -302,7 +302,7 @@ void GraphKit::add_exception_state(SafePointNode* ex_map) {
// No action needed.
return;
}
- assert(ex_type->isa_instptr(), "exception must be an instance");
+ assert(ex_type->is_instptr(), "exception must be an instance");
for (SafePointNode* e2 = _exceptions; e2 != nullptr; e2 = e2->next_exception()) {
const Type* ex_type2 = _gvn.type(saved_ex_oop(e2));
// We check sp also because call bytecodes can generate exceptions
@@ -1275,8 +1275,8 @@ Node* GraphKit::basic_plus_adr(Node* base, Node* ptr, Node* offset) {
// problem.
if (offset->is_Con()) {
const Type* t = offset->bottom_type();
- bool is_zero_int = t->isa_int() && t->is_int()->get_con() == 0;
- bool is_zero_long = t->isa_long() && t->is_long()->get_con() == 0;
+ bool is_zero_int = t->is_int() && t->as_int()->get_con() == 0;
+ bool is_zero_long = t->is_long() && t->as_long()->get_con() == 0;
assert(!is_zero_int && !is_zero_long,
"Unexpected zero offset - should have matched MakeConX(0)");
}
@@ -1330,7 +1330,7 @@ Node* GraphKit::load_array_length(Node* array) {
Node *r_adr = basic_plus_adr(array, arrayOopDesc::length_offset_in_bytes());
alen = _gvn.transform( new LoadRangeNode(nullptr, immutable_memory(), r_adr, TypeInt::POS));
} else {
- alen = array_ideal_length(alloc, _gvn.type(array)->is_oopptr(), false);
+ alen = array_ideal_length(alloc, _gvn.type(array)->as_oopptr(), false);
}
return alen;
}
@@ -1832,7 +1832,7 @@ Node* GraphKit::access_load(Node* adr, // actual address to load val at
}
SavedState old_state(this);
- C2AccessValuePtr addr(adr, adr->bottom_type()->is_ptr());
+ C2AccessValuePtr addr(adr, adr->bottom_type()->as_ptr());
C2ParseAccess access(this, decorators | C2_READ_ACCESS, bt, nullptr, addr);
Node* load;
if (access.is_raw()) {
@@ -1929,7 +1929,7 @@ void GraphKit::access_clone(Node* src, Node* dst, Node* size, bool is_array) {
//-------------------------array_element_address-------------------------
Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt,
const TypeInt* sizetype, Node* ctrl) {
- const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
+ const TypeAryPtr* arytype = _gvn.type(ary)->as_aryptr();
uint shift;
uint header;
if (arytype->is_flat() && arytype->klass_is_exact()) {
@@ -1989,7 +1989,7 @@ Node* GraphKit::cast_to_flat_array(Node* array, ciObjArrayKlass* array_klass, bo
}
assert(array_klass->element_klass()->is_value_klass(), "Must be");
- const TypeAryPtr* arytype = TypeOopPtr::make_from_klass(array_klass)->isa_aryptr();
+ const TypeAryPtr* arytype = TypeOopPtr::make_from_klass(array_klass)->as_aryptr();
if (exact) {
assert(arytype->klass_is_exact(), "inconsistency");
assert(arytype->is_flat(), "inconsistency");
@@ -2635,7 +2635,7 @@ Node* GraphKit::record_profile_for_speculation(Node* n, ciKlass* exact_kls, Prof
assert(ptr_kind != ProfileAlwaysNull, "impossible here");
const TypePtr* ptr = (ptr_kind != ProfileNeverNull && current_type->speculative_maybe_null()) ? TypePtr::BOTTOM : TypePtr::NOTNULL;
// record the new speculative type's depth
- speculative = xtype->cast_to_ptr_type(ptr->ptr())->is_ptr();
+ speculative = xtype->cast_to_ptr_type(ptr->ptr())->as_ptr();
speculative = speculative->with_inline_depth(jvms()->depth());
} else if (current_type->would_improve_ptr(ptr_kind)) {
// Profiling report that null was never seen so we can change the
@@ -2646,7 +2646,7 @@ Node* GraphKit::record_profile_for_speculation(Node* n, ciKlass* exact_kls, Prof
assert(ptr_kind == ProfileNeverNull, "nothing else is an improvement");
const TypePtr* ptr = TypePtr::NOTNULL;
if (speculative != nullptr) {
- speculative = speculative->cast_to_ptr_type(ptr->ptr())->is_ptr();
+ speculative = speculative->cast_to_ptr_type(ptr->ptr())->as_ptr();
} else {
speculative = ptr;
}
@@ -2758,7 +2758,7 @@ void GraphKit::record_profiled_parameters_for_speculation() {
return;
}
for (int i = 0, j = 0; i < method()->arg_size() ; i++) {
- if (_gvn.type(local(i))->isa_oopptr()) {
+ if (_gvn.type(local(i))->is_oopptr()) {
ProfilePtrKind ptr_kind = ProfileMaybeNull;
ciKlass* better_type = nullptr;
if (method()->parameter_profiled_type(j, better_type, ptr_kind)) {
@@ -2903,7 +2903,7 @@ Node* GraphKit::make_runtime_call(int flags,
} else if (flags & RC_NO_FP) {
call = new CallLeafNoFPNode(call_type, call_addr, call_name, out_adr_type, in_adr_type);
} else if (flags & RC_VECTOR){
- uint num_bits = call_type->range_sig()->field_at(TypeFunc::Parms)->is_vect()->length_in_bytes() * BitsPerByte;
+ uint num_bits = call_type->range_sig()->field_at(TypeFunc::Parms)->as_vect()->length_in_bytes() * BitsPerByte;
call = new CallLeafVectorNode(call_type, call_addr, call_name, out_adr_type, in_adr_type, num_bits);
} else if (flags & RC_PURE) {
assert(out_adr_type == nullptr, "pure call does not touch memory");
@@ -3078,12 +3078,12 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
return C->top();
}
- const TypeKlassPtr* klass_ptr_type = gvn.type(superklass)->is_klassptr();
+ const TypeKlassPtr* klass_ptr_type = gvn.type(superklass)->as_klassptr();
// For a direct pointer comparison, we need the refined array klass pointer
Node* vm_superklass = superklass;
- if (klass_ptr_type->isa_aryklassptr() && klass_ptr_type->klass_is_exact()) {
- assert(!klass_ptr_type->is_aryklassptr()->is_refined_type(), "Unexpected refined array klass pointer");
- vm_superklass = gvn.makecon(klass_ptr_type->is_aryklassptr()->cast_to_refined_array_klass_ptr());
+ if (klass_ptr_type->is_aryklassptr() && klass_ptr_type->klass_is_exact()) {
+ assert(!klass_ptr_type->as_aryklassptr()->is_refined_type(), "Unexpected refined array klass pointer");
+ vm_superklass = gvn.makecon(klass_ptr_type->as_aryklassptr()->cast_to_refined_array_klass_ptr());
}
// Fast check for identical types, perhaps identical constants.
@@ -3093,8 +3093,8 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
return C->top(); // false path is dead; no test needed.
if (gvn.type(superklass)->singleton()) {
- const TypeKlassPtr* superk = gvn.type(superklass)->is_klassptr();
- const TypeKlassPtr* subk = gvn.type(subklass)->is_klassptr();
+ const TypeKlassPtr* superk = gvn.type(superklass)->as_klassptr();
+ const TypeKlassPtr* subk = gvn.type(subklass)->as_klassptr();
// In the common case of an exact superklass, try to fold up the
// test before generating code. You may ask, why not just generate
@@ -3141,7 +3141,7 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
// First load the super-klass's check-offset
Node* p1 = gvn.transform(AddPNode::make_off_heap(superklass, gvn.MakeConX(in_bytes(Klass::super_check_offset_offset()))));
Node* m = C->immutable_memory();
- Node* chk_off = gvn.transform(new LoadINode(nullptr, m, p1, gvn.type(p1)->is_ptr(), TypeInt::INT, MemNode::unordered));
+ Node* chk_off = gvn.transform(new LoadINode(nullptr, m, p1, gvn.type(p1)->as_ptr(), TypeInt::INT, MemNode::unordered));
int cacheoff_con = in_bytes(Klass::secondary_super_cache_offset());
const TypeInt* chk_off_t = chk_off->Value(&gvn)->isa_int();
int chk_off_con = (chk_off_t != nullptr && chk_off_t->is_con()) ? chk_off_t->get_con() : cacheoff_con;
@@ -3168,9 +3168,9 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
// - it's a cache so, worse case, not reading the latest value
// wouldn't cause incorrect execution
if (might_be_cache && mem != nullptr) {
- kmem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(C->get_alias_index(gvn.type(p2)->is_ptr())) : mem;
+ kmem = mem->is_MergeMem() ? mem->as_MergeMem()->memory_at(C->get_alias_index(gvn.type(p2)->as_ptr())) : mem;
}
- Node* nkls = gvn.transform(LoadKlassNode::make(gvn, kmem, p2, gvn.type(p2)->is_ptr(), TypeInstKlassPtr::OBJECT_OR_NULL));
+ Node* nkls = gvn.transform(LoadKlassNode::make(gvn, kmem, p2, gvn.type(p2)->as_ptr(), TypeInstKlassPtr::OBJECT_OR_NULL));
// Compile speed common case: ARE a subtype and we canNOT fail
if (superklass == nkls) {
@@ -3193,7 +3193,7 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
total_prob += prob;
}
if (total_prob * 100. >= TypeProfileSubTypeCheckCommonThreshold) {
- const TypeKlassPtr* superk = gvn.type(superklass)->is_klassptr();
+ const TypeKlassPtr* superk = gvn.type(superklass)->as_klassptr();
for (int i = 0; profile.has_receiver(i); ++i) {
ciKlass* klass = profile.receiver(i);
const TypeKlassPtr* klass_t = TypeKlassPtr::make(klass);
@@ -3201,9 +3201,9 @@ Node* Phase::gen_subtype_check(Node* subklass, Node* superklass, Node** ctrl, No
if (result != Compile::SSC_always_true && result != Compile::SSC_always_false) {
continue;
}
- if (klass_t->isa_aryklassptr()) {
+ if (klass_t->is_aryklassptr()) {
// For a direct pointer comparison, we need the refined array klass pointer
- klass_t = klass_t->is_aryklassptr()->cast_to_refined_array_klass_ptr();
+ klass_t = klass_t->as_aryklassptr()->cast_to_refined_array_klass_ptr();
}
float prob = profile.receiver_prob(i);
ConNode* klass_node = gvn.makecon(klass_t);
@@ -3306,7 +3306,7 @@ Node* GraphKit::gen_subtype_check(Node* obj_or_subklass, Node* superklass) {
MergeMemNode* mem = merged_memory();
Node* ctrl = control();
Node* subklass = obj_or_subklass;
- if (!sub_t->isa_klassptr()) {
+ if (!sub_t->is_klassptr()) {
subklass = load_object_klass(obj_or_subklass);
}
@@ -3339,15 +3339,15 @@ Node* GraphKit::type_check_receiver(Node* receiver, ciKlass* klass,
return fail;
}
const TypeKlassPtr* tklass = TypeKlassPtr::make(klass, Type::trust_interfaces);
- if (tklass->isa_aryklassptr()) {
+ if (tklass->is_aryklassptr()) {
// For a direct pointer comparison, we need the refined array klass pointer
- tklass = tklass->is_aryklassptr()->cast_to_refined_array_klass_ptr();
+ tklass = tklass->as_aryklassptr()->cast_to_refined_array_klass_ptr();
}
Node* recv_klass = load_object_klass(receiver);
fail = type_check(recv_klass, tklass, prob);
if (!stopped()) {
- const TypeOopPtr* receiver_type = _gvn.type(receiver)->isa_oopptr();
+ const TypeOopPtr* receiver_type = _gvn.type(receiver)->as_oopptr();
const TypeOopPtr* recv_xtype = tklass->as_exact_instance_type();
assert(recv_xtype->klass_is_exact(), "");
@@ -3442,7 +3442,7 @@ void GraphKit::guard_klass_is_initialized(Node* klass) {
int init_state_off = in_bytes(InstanceKlass::init_state_offset());
Node* adr = basic_plus_adr(top(), klass, init_state_off);
Node* init_state = LoadNode::make(_gvn, nullptr, immutable_memory(), adr,
- adr->bottom_type()->is_ptr(), TypeInt::BYTE,
+ adr->bottom_type()->as_ptr(), TypeInt::BYTE,
T_BYTE, MemNode::acquire);
init_state = _gvn.transform(init_state);
@@ -3463,7 +3463,7 @@ void GraphKit::guard_klass_being_initialized(Node* klass) {
int init_state_off = in_bytes(InstanceKlass::init_state_offset());
Node* adr = off_heap_plus_addr(klass, init_state_off);
Node* init_state = LoadNode::make(_gvn, nullptr, immutable_memory(), adr,
- adr->bottom_type()->is_ptr(), TypeInt::BYTE,
+ adr->bottom_type()->as_ptr(), TypeInt::BYTE,
T_BYTE, MemNode::acquire);
init_state = _gvn.transform(init_state);
@@ -3482,7 +3482,7 @@ void GraphKit::guard_init_thread(Node* klass) {
Node* adr = off_heap_plus_addr(klass, init_thread_off);
Node* init_thread = LoadNode::make(_gvn, nullptr, immutable_memory(), adr,
- adr->bottom_type()->is_ptr(), TypePtr::NOTNULL,
+ adr->bottom_type()->as_ptr(), TypePtr::NOTNULL,
T_ADDRESS, MemNode::unordered);
init_thread = _gvn.transform(init_thread);
@@ -3683,7 +3683,7 @@ Node* GraphKit::gen_instanceof(Node* obj, Node* superklass, bool safe_for_replac
// Do we know the type check always succeed?
bool known_statically = false;
if (improved_klass_ptr_type->singleton()) {
- const TypeKlassPtr* subk = _gvn.type(obj)->is_oopptr()->as_klass_type();
+ const TypeKlassPtr* subk = _gvn.type(obj)->as_oopptr()->as_klass_type();
if (subk != nullptr && subk->is_loaded()) {
int static_res = C->static_subtype_check(improved_klass_ptr_type, subk);
known_statically = (static_res == Compile::SSC_always_true || static_res == Compile::SSC_always_false);
@@ -3691,7 +3691,7 @@ Node* GraphKit::gen_instanceof(Node* obj, Node* superklass, bool safe_for_replac
}
if (!known_statically) {
- const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();
+ const TypeOopPtr* obj_type = _gvn.type(obj)->as_oopptr();
// We may not have profiling here or it may not help us. If we
// have a speculative type use it to perform an exact cast.
ciKlass* spec_obj_type = obj_type->speculative_type();
@@ -3752,7 +3752,7 @@ Node* GraphKit::gen_checkcast(Node* obj, Node* superklass, Node** failure_contro
assert(new_cast_failure_map == nullptr || failure_control != nullptr,
"failure_control must be set when new_failure_map is used");
kill_dead_locals(); // Benefit all the uncommon traps
- const TypeKlassPtr* klass_ptr_type = _gvn.type(superklass)->is_klassptr();
+ const TypeKlassPtr* klass_ptr_type = _gvn.type(superklass)->as_klassptr();
const Type* obj_type = _gvn.type(obj);
const TypeKlassPtr* improved_klass_ptr_type = klass_ptr_type->try_improve();
@@ -3768,8 +3768,8 @@ Node* GraphKit::gen_checkcast(Node* obj, Node* superklass, Node** failure_contro
// for example, in some objArray manipulations, such as a[i]=a[j].)
if (improved_klass_ptr_type->singleton()) {
const TypeKlassPtr* kptr = nullptr;
- if (obj_type->isa_oop_ptr()) {
- kptr = obj_type->is_oopptr()->as_klass_type();
+ if (obj_type->is_oopptr()) {
+ kptr = obj_type->as_oopptr()->as_klass_type();
} else if (obj->is_ValueType()) {
ciValueKlass* vk = obj_type->value_klass();
kptr = TypeInstKlassPtr::make(TypePtr::NotNull, vk, Type::Offset(0));
@@ -3800,7 +3800,7 @@ Node* GraphKit::gen_checkcast(Node* obj, Node* superklass, Node** failure_contro
obj = null_check(obj);
}
// It needs a null check because a null will *pass* the cast check.
- if (obj_type->isa_oopptr() != nullptr && !obj_type->is_oopptr()->maybe_null()) {
+ if (obj_type->is_oopptr() && !obj_type->as_oopptr()->maybe_null()) {
bool is_aastore = (java_bc() == Bytecodes::_aastore);
Deoptimization::DeoptReason reason = is_aastore ?
Deoptimization::Reason_array_check : Deoptimization::Reason_class_check;
@@ -3874,7 +3874,7 @@ Node* GraphKit::gen_checkcast(Node* obj, Node* superklass, Node** failure_contro
// (for example obtained during profiling) to the type of the superklass and then do a
// dynamic check that the type of the object is what we expect. To work correctly
// for checkcast and aastore the type of superklass should be exact.
- const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();
+ const TypeOopPtr* obj_type = _gvn.type(obj)->as_oopptr();
// We may not have profiling here or it may not help us. If we have
// a speculative type use it to perform an exact cast.
ciKlass* spec_obj_type = obj_type->speculative_type();
@@ -4103,7 +4103,7 @@ Node* GraphKit::value_array_null_guard(Node* ary, Node* val, int nargs) {
record_for_igvn(region);
if (_gvn.type(val) == TypePtr::NULL_PTR) {
// Since we were just successfully storing null, the array can't be null free.
- const TypeAryPtr* ary_t = _gvn.type(ary)->is_aryptr();
+ const TypeAryPtr* ary_t = _gvn.type(ary)->as_aryptr();
ary_t = ary_t->cast_to_not_null_free();
Node* cast = _gvn.transform(new CheckCastPPNode(control(), ary, ary_t));
replace_in_map(ary, cast);
@@ -4293,7 +4293,7 @@ Node* GraphKit::get_layout_helper(Node* klass_node, jint& constant_value) {
}
const TypeAryKlassPtr* aryklass_t = klass_t->isa_aryklassptr();
- if (aryklass_t != nullptr && aryklass_t->elem()->isa_klassptr() != nullptr && aryklass_t->is_not_flat()) {
+ if (aryklass_t != nullptr && aryklass_t->elem()->is_klassptr() && aryklass_t->is_not_flat()) {
// If we know that the array cannot be flat, then the layout_helper value is known
constant_value = Klass::array_layout_helper(T_OBJECT);
return nullptr;
@@ -4366,7 +4366,7 @@ Node* GraphKit::set_output_for_allocation(AllocateNode* alloc,
set_memory(_gvn.transform(new NarrowMemProjNode(init, C->get_adr_type(mark_idx))), mark_idx);
int klass_idx = C->get_alias_index(oop_type->add_offset(oopDesc::klass_offset_in_bytes()));
set_memory(_gvn.transform(new NarrowMemProjNode(init, C->get_adr_type(klass_idx))), klass_idx);
- if (oop_type->isa_aryptr()) {
+ if (oop_type->is_aryptr()) {
// Initially all flat array accesses share a single slice
// but that changes after parsing. Prepare the memory graph so
// it can optimize flat array accesses properly once they
@@ -4379,8 +4379,8 @@ Node* GraphKit::set_output_for_allocation(AllocateNode* alloc,
C->set_flat_accesses();
}
hook_memory_on_init(*this, elemidx, minit_in, _gvn.transform(new NarrowMemProjNode(init, alias_adr_type)));
- } else if (oop_type->isa_instptr()) {
- ciInstanceKlass* ik = oop_type->is_instptr()->instance_klass();
+ } else if (oop_type->is_instptr()) {
+ ciInstanceKlass* ik = oop_type->as_instptr()->instance_klass();
for (int i = 0, len = ik->nof_nonstatic_fields(); i < len; i++) {
ciField* field = ik->nonstatic_field_at(i);
if (field->offset_in_bytes() >= TrackedInitializationLimit * HeapWordSize)
@@ -4671,7 +4671,7 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn);
}
- const TypeKlassPtr* ary_klass = _gvn.type(klass_node)->isa_klassptr();
+ const TypeKlassPtr* ary_klass = _gvn.type(klass_node)->as_klassptr();
const TypeOopPtr* ary_type = ary_klass->as_exact_instance_type();
Node* raw_init_value = nullptr;
@@ -4693,8 +4693,8 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
}
Node* valid_length_test = _gvn.intcon(1);
- if (ary_type->isa_aryptr()) {
- jint max = ary_type->is_aryptr()->max_array_length();
+ if (ary_type->is_aryptr()) {
+ jint max = ary_type->as_aryptr()->max_array_length();
Node* valid_length_cmp = _gvn.transform(new CmpUNode(length, intcon(max)));
valid_length_test = _gvn.transform(new BoolNode(valid_length_cmp, BoolTest::le));
}
@@ -4712,9 +4712,9 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
// (This happens via a non-constant argument to inline_native_newArray.)
// In any case, the value of klass_node provides the desired array type.
const TypeInt* length_type = _gvn.find_int_type(length);
- if (ary_type->isa_aryptr() && length_type != nullptr) {
+ if (ary_type->is_aryptr() && length_type != nullptr) {
// Try to get a better type than POS for the size
- ary_type = ary_type->is_aryptr()->cast_to_size(length_type);
+ ary_type = ary_type->as_aryptr()->cast_to_size(length_type);
}
Node* javaoop = set_output_for_allocation(alloc, ary_type, deoptimize_on_exception);
@@ -5042,7 +5042,7 @@ Node* GraphKit::make_constant_from_field(ciField* field, Node* obj) {
}
ciInstance* holder = nullptr;
if (!field->is_static()) {
- ciObject* const_oop = obj->bottom_type()->is_oopptr()->const_oop();
+ ciObject* const_oop = obj->bottom_type()->as_oopptr()->const_oop();
if (const_oop != nullptr && const_oop->is_instance()) {
holder = const_oop->as_instance();
}
@@ -5064,7 +5064,7 @@ Node* GraphKit::make_constant_from_field(ciField* field, Node* obj) {
Node* GraphKit::maybe_narrow_object_type(Node* obj, ciKlass* type, bool maybe_larval) {
const Type* obj_type = obj->bottom_type();
const TypeOopPtr* sig_type = TypeOopPtr::make_from_klass(type);
- if (obj_type->isa_oopptr() && sig_type->is_loaded() && !obj_type->higher_equal(sig_type)) {
+ if (obj_type->is_oopptr() && sig_type->is_loaded() && !obj_type->higher_equal(sig_type)) {
const Type* narrow_obj_type = obj_type->filter_speculative(sig_type); // keep speculative part
Node* casted_obj = gvn().transform(new CheckCastPPNode(control(), obj, narrow_obj_type));
obj = casted_obj;
diff --git a/src/hotspot/share/opto/graphKit.hpp b/src/hotspot/share/opto/graphKit.hpp
index 9e26adaf852..8404e011d2f 100644
--- a/src/hotspot/share/opto/graphKit.hpp
+++ b/src/hotspot/share/opto/graphKit.hpp
@@ -538,15 +538,15 @@ class GraphKit : public Phase {
// Access unaliased memory
Node* memory(uint alias_idx);
Node* memory(const TypePtr *tp) { return memory(C->get_alias_index(tp)); }
- Node* memory(Node* adr) { return memory(_gvn.type(adr)->is_ptr()); }
+ Node* memory(Node* adr) { return memory(_gvn.type(adr)->as_ptr()); }
// Access immutable memory
Node* immutable_memory() { return C->immutable_memory(); }
// Set unaliased memory
void set_memory(Node* c, uint alias_idx) { merged_memory()->set_memory_at(alias_idx, c); }
- void set_memory(Node* c, const TypePtr *tp) { set_memory(c,C->get_alias_index(tp)); }
- void set_memory(Node* c, Node* adr) { set_memory(c,_gvn.type(adr)->is_ptr()); }
+ void set_memory(Node* c, const TypePtr* tp) { set_memory(c, C->get_alias_index(tp)); }
+ void set_memory(Node* c, Node* adr) { set_memory(c, _gvn.type(adr)->as_ptr()); }
// Get the entire memory state (probably a MergeMemNode), and reset it
// (The resetting prevents somebody from using the dangling Node pointer.)
diff --git a/src/hotspot/share/opto/idealGraphPrinter.cpp b/src/hotspot/share/opto/idealGraphPrinter.cpp
index 827c710669b..41bdc296b0e 100644
--- a/src/hotspot/share/opto/idealGraphPrinter.cpp
+++ b/src/hotspot/share/opto/idealGraphPrinter.cpp
@@ -700,12 +700,10 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
stringStream s2(buffer, sizeof(buffer) - 1);
node->dump_spec(&s2);
- if (t != nullptr && (t->isa_instptr() || t->isa_instklassptr())) {
- const TypeInstPtr *toop = t->isa_instptr();
- const TypeInstKlassPtr *tkls = t->isa_instklassptr();
- if (toop) {
+ if (t != nullptr && (t->is_instptr() || t->is_instklassptr())) {
+ if (t->is_instptr()) {
s2.print(" Oop:");
- } else if (tkls) {
+ } else {
s2.print(" Klass:");
}
t->dump_on(&s2);
@@ -729,8 +727,8 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
print_prop(short_name, "F");
} else if ((node->is_Con() && node->is_Type()) || node->is_Proj()) {
- if (t->base() == Type::Int && t->is_int()->is_con()) {
- const TypeInt *typeInt = t->is_int();
+ if (t->base() == Type::Int && t->as_int()->is_con()) {
+ const TypeInt* typeInt = t->as_int();
assert(typeInt->is_con(), "must be constant");
jint value = typeInt->get_con();
@@ -743,8 +741,8 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
}
} else if (t == Type::TOP) {
print_prop(short_name, "^");
- } else if (t->base() == Type::Long && t->is_long()->is_con()) {
- const TypeLong *typeLong = t->is_long();
+ } else if (t->base() == Type::Long && t->as_long()->is_con()) {
+ const TypeLong* typeLong = t->as_long();
assert(typeLong->is_con(), "must be constant");
jlong value = typeLong->get_con();
@@ -756,7 +754,7 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
print_prop(short_name, "L");
}
} else if (t->base() == Type::KlassPtr || t->base() == Type::InstKlassPtr || t->base() == Type::AryKlassPtr) {
- const TypeKlassPtr *typeKlass = t->is_klassptr();
+ const TypeKlassPtr* typeKlass = t->as_klassptr();
print_prop(short_name, "CP");
} else if (t->base() == Type::Control) {
print_prop(short_name, "C");
@@ -767,7 +765,7 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
} else if (t->base() == Type::Return_Address) {
print_prop(short_name, "RA");
} else if (t->base() == Type::AnyPtr) {
- if (t->is_ptr()->ptr() == TypePtr::Null) {
+ if (t->as_ptr()->ptr() == TypePtr::Null) {
print_prop(short_name, "Null");
} else {
print_prop(short_name, "P");
@@ -776,7 +774,7 @@ void IdealGraphPrinter::visit_node(Node* n, bool edges) {
print_prop(short_name, "RP");
} else if (t->base() == Type::AryPtr) {
print_prop(short_name, "AP");
- } else if (t->base() == Type::NarrowOop && t->is_narrowoop() == TypeNarrowOop::NULL_PTR) {
+ } else if (t->base() == Type::NarrowOop && t->as_narrowoop() == TypeNarrowOop::NULL_PTR) {
print_prop(short_name, "Null");
}
}
@@ -933,7 +931,7 @@ ciField* IdealGraphPrinter::find_source_field_of_array_access(const Node* node,
}
do {
- if (const TypePtr* in = node->in_adr_type(); in != nullptr && in->isa_aryptr()) {
+ if (const TypePtr* in = node->in_adr_type(); in != nullptr && in->is_aryptr()) {
// Only process array accesses. Pattern match to find actual field source access.
node = get_load_node(node);
if (node != nullptr) {
diff --git a/src/hotspot/share/opto/idealKit.cpp b/src/hotspot/share/opto/idealKit.cpp
index 02d3aa0fda7..1227503548e 100644
--- a/src/hotspot/share/opto/idealKit.cpp
+++ b/src/hotspot/share/opto/idealKit.cpp
@@ -71,11 +71,11 @@ void IdealKit::if_then(Node* left, BoolTest::mask relop,
Node* right, float prob, float cnt, bool push_new_state) {
assert((state() & (BlockS|LoopS|IfThenS|ElseS)), "bad state for new If");
Node* bol;
- if (left->bottom_type()->isa_ptr() == nullptr) {
- if (left->bottom_type()->isa_int() != nullptr) {
+ if (!left->bottom_type()->is_ptr()) {
+ if (left->bottom_type()->is_int()) {
bol = Bool(CmpI(left, right), relop);
} else {
- assert(left->bottom_type()->isa_long() != nullptr, "what else?");
+ assert(left->bottom_type()->is_long(), "what else?");
bol = Bool(CmpL(left, right), relop);
}
} else {
diff --git a/src/hotspot/share/opto/ifnode.cpp b/src/hotspot/share/opto/ifnode.cpp
index a9a6cc0af19..345c59fa239 100644
--- a/src/hotspot/share/opto/ifnode.cpp
+++ b/src/hotspot/share/opto/ifnode.cpp
@@ -781,7 +781,7 @@ const TypeInteger* IfNode::filtered_integer_type(PhaseGVN* gvn, Node* val, Node*
const TypeInt* IfNode::filtered_int_type(PhaseGVN* gvn, Node* val, Node* if_proj) {
const TypeInteger* t = filtered_integer_type(gvn, val, if_proj, T_INT);
- return t == nullptr ? nullptr : t->is_int();
+ return t == nullptr ? nullptr : t->as_int();
}
//------------------------------fold_compares----------------------------
@@ -1561,7 +1561,7 @@ void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGV
Node_Stack stack(2);
assert(r->Opcode() == Op_LoadRange, "unexpected range check");
- const TypeInt* array_size = igvn->type(r)->is_int();
+ const TypeInt* array_size = igvn->type(r)->as_int();
stack.push(l, 0);
@@ -1574,7 +1574,7 @@ void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGV
Node* use = n->raw_out(i);
if (stack.size() == 1) {
if (use->Opcode() == Op_ConvI2L) {
- const TypeLong* bounds = use->as_Type()->type()->is_long();
+ const TypeLong* bounds = use->as_Type()->type()->as_long();
if (bounds->_lo <= array_size->_lo && bounds->_hi >= array_size->_hi &&
(bounds->_lo != array_size->_lo || bounds->_hi != array_size->_hi)) {
stack.set_index(i+1);
@@ -1614,8 +1614,8 @@ void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGV
}
}
}
- } else if (use->in(0) == nullptr && (igvn->type(use)->isa_long() ||
- igvn->type(use)->isa_ptr())) {
+ } else if (use->in(0) == nullptr && (igvn->type(use)->is_long() ||
+ igvn->type(use)->is_ptr())) {
stack.set_index(i+1);
stack.push(use, 0);
break;
@@ -2263,7 +2263,7 @@ static int subsuming_bool_test_encode(Node* node) {
// If the test is constant & we match, then we are the input Control
Node* IfProjNode::Identity(PhaseGVN* phase) {
// Can only optimize if cannot go the other way
- const TypeTuple *t = phase->type(in(0))->is_tuple();
+ const TypeTuple* t = phase->type(in(0))->as_tuple();
if (t == TypeTuple::IFNEITHER || (always_taken(t) &&
// During parsing (GVN) we don't remove dead code aggressively.
// Cut off dead branch and let PhaseRemoveUseless take care of it.
diff --git a/src/hotspot/share/opto/intrinsicnode.cpp b/src/hotspot/share/opto/intrinsicnode.cpp
index c0d8b9b0a53..4bca423da26 100644
--- a/src/hotspot/share/opto/intrinsicnode.cpp
+++ b/src/hotspot/share/opto/intrinsicnode.cpp
@@ -125,8 +125,8 @@ SignumFNode* SignumFNode::make(PhaseGVN& gvn, Node* in) {
Node* CompressBitsNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* src = in(1);
Node* mask = in(2);
- if (bottom_type()->isa_int()) {
- if (mask->Opcode() == Op_LShiftI && phase->type(mask->in(1))->isa_int() && phase->type(mask->in(1))->is_int()->is_con()) {
+ if (bottom_type()->is_int()) {
+ if (mask->Opcode() == Op_LShiftI && phase->type(mask->in(1))->is_int() && phase->type(mask->in(1))->as_int()->is_con()) {
// compress(x, 1 << n) == (x >> n & 1)
if (phase->type(mask->in(1))->higher_equal(TypeInt::ONE)) {
Node* rshift = phase->transform(new RShiftINode(in(1), mask->in(2)));
@@ -143,8 +143,8 @@ Node* CompressBitsNode::Ideal(PhaseGVN* phase, bool can_reshape) {
return new AndINode(compr, src->in(1));
}
} else {
- assert(bottom_type()->isa_long(), "");
- if (mask->Opcode() == Op_LShiftL && phase->type(mask->in(1))->isa_long() && phase->type(mask->in(1))->is_long()->is_con()) {
+ assert(bottom_type()->is_long(), "");
+ if (mask->Opcode() == Op_LShiftL && phase->type(mask->in(1))->is_long() && phase->type(mask->in(1))->as_long()->is_con()) {
// compress(x, 1 << n) == (x >> n & 1)
if (phase->type(mask->in(1))->higher_equal(TypeLong::ONE)) {
Node* rshift = phase->transform(new RShiftLNode(in(1), mask->in(2)));
@@ -183,8 +183,8 @@ Node* CompressBitsNode::Identity(PhaseGVN* phase) {
Node* ExpandBitsNode::Ideal(PhaseGVN* phase, bool can_reshape) {
Node* src = in(1);
Node* mask = in(2);
- if (bottom_type()->isa_int()) {
- if (mask->Opcode() == Op_LShiftI && phase->type(mask->in(1))->isa_int() && phase->type(mask->in(1))->is_int()->is_con()) {
+ if (bottom_type()->is_int()) {
+ if (mask->Opcode() == Op_LShiftI && phase->type(mask->in(1))->is_int() && phase->type(mask->in(1))->as_int()->is_con()) {
// expand(x, 1 << n) == (x & 1) << n
if (phase->type(mask->in(1))->higher_equal(TypeInt::ONE)) {
Node* andnode = phase->transform(new AndINode(in(1), phase->makecon(TypeInt::ONE)));
@@ -200,8 +200,8 @@ Node* ExpandBitsNode::Ideal(PhaseGVN* phase, bool can_reshape) {
return new AndINode(src->in(1), mask);
}
} else {
- assert(bottom_type()->isa_long(), "");
- if (mask->Opcode() == Op_LShiftL && phase->type(mask->in(1))->isa_long() && phase->type(mask->in(1))->is_long()->is_con()) {
+ assert(bottom_type()->is_long(), "");
+ if (mask->Opcode() == Op_LShiftL && phase->type(mask->in(1))->is_long() && phase->type(mask->in(1))->as_long()->is_con()) {
// expand(x, 1 << n) == (x & 1) << n
if (phase->type(mask->in(1))->higher_equal(TypeLong::ONE)) {
Node* andnode = phase->transform(new AndLNode(in(1), phase->makecon(TypeLong::ONE)));
@@ -314,10 +314,10 @@ const Type* CompressBitsNode::Value(PhaseGVN* phase) const {
BasicType bt = bottom_type()->basic_type();
if (bt == T_INT) {
- return RangeInference::infer_compress_bits(t1->is_int(), t2->is_int());
+ return RangeInference::infer_compress_bits(t1->as_int(), t2->as_int());
} else {
assert(bt == T_LONG, "unexpected BasicType %s", type2name(bt));
- return RangeInference::infer_compress_bits(t1->is_long(), t2->is_long());
+ return RangeInference::infer_compress_bits(t1->as_long(), t2->as_long());
}
}
@@ -341,8 +341,8 @@ const Type* ExpandBitsNode::Value(PhaseGVN* phase) const {
}
BasicType bt = bottom_type()->basic_type();
- const TypeInteger* src_type = t1->is_integer(bt);
- const TypeInteger* mask_type = t2->is_integer(bt);
+ const TypeInteger* src_type = t1->as_integer(bt);
+ const TypeInteger* mask_type = t2->as_integer(bt);
int w = bt == T_INT ? 32 : 64;
// Constant fold if both src and mask are constants.
diff --git a/src/hotspot/share/opto/lcm.cpp b/src/hotspot/share/opto/lcm.cpp
index 1de1c6ec0a0..083bb5d3cb6 100644
--- a/src/hotspot/share/opto/lcm.cpp
+++ b/src/hotspot/share/opto/lcm.cpp
@@ -47,7 +47,7 @@ static bool accesses_heap_base_zone(Node *val) {
if (val->as_Mach()->ideal_Opcode() == Op_DecodeN) {
// This assumes all Decodes with TypePtr::NotNull are matched to nodes that
// decode null to point to the heap base (Decode_NN).
- if (val->bottom_type()->is_oopptr()->ptr() == TypePtr::NotNull) {
+ if (val->bottom_type()->as_oopptr()->ptr() == TypePtr::NotNull) {
return true;
}
}
@@ -262,7 +262,7 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
continue; // Not an memory op; skip it
}
if (val == base ||
- (val == index && val->bottom_type()->isa_narrowoop())) {
+ (val == index && val->bottom_type()->is_narrowoop())) {
break; // Found it
} else {
continue; // Skip it
@@ -293,7 +293,7 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
if (base == nullptr || base == NodeSentinel) {
// Narrow oop address doesn't have base, only index.
// Give up if offset is beyond page size or if heap base is not protected.
- if (val->bottom_type()->isa_narrowoop() &&
+ if (val->bottom_type()->is_narrowoop() &&
(MacroAssembler::needs_explicit_null_check(offset) ||
!CompressedOops::use_implicit_null_checks()))
continue;
@@ -305,7 +305,7 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
tptr = base->get_ptr_type();
} else {
// only regular oops are expected here
- tptr = base->bottom_type()->is_ptr();
+ tptr = base->bottom_type()->as_ptr();
}
// Give up if offset is not a compile-time constant.
if (offset == Type::OffsetBot || tptr->offset() == Type::OffsetBot)
diff --git a/src/hotspot/share/opto/library_call.cpp b/src/hotspot/share/opto/library_call.cpp
index 9853363238c..9e1f1e41572 100644
--- a/src/hotspot/share/opto/library_call.cpp
+++ b/src/hotspot/share/opto/library_call.cpp
@@ -1038,9 +1038,9 @@ Node* LibraryCallKit::current_thread_helper(Node*& tls_output, ByteSize handle_o
Node* thread_obj_handle
= (is_immutable
- ? LoadNode::make(_gvn, nullptr, immutable_memory(), p, p->bottom_type()->is_ptr(),
+ ? LoadNode::make(_gvn, nullptr, immutable_memory(), p, p->bottom_type()->as_ptr(),
TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered)
- : make_load(nullptr, p, p->bottom_type()->is_ptr(), T_ADDRESS, MemNode::unordered));
+ : make_load(nullptr, p, p->bottom_type()->as_ptr(), T_ADDRESS, MemNode::unordered));
thread_obj_handle = _gvn.transform(thread_obj_handle);
DecoratorSet decorators = IN_NATIVE;
@@ -1230,7 +1230,7 @@ bool LibraryCallKit::inline_preconditions_checkIndex(BasicType bt) {
}
// length is now known positive, add a cast node to make this explicit
- jlong upper_bound = _gvn.type(length)->is_integer(bt)->hi_as_long();
+ jlong upper_bound = _gvn.type(length)->as_integer(bt)->hi_as_long();
Node* casted_length = ConstraintCastNode::make_cast_for_basic_type(
control(), length, TypeInteger::make(0, upper_bound, Type::WidenMax, bt),
ConstraintCastNode::DependencyType::FloatingNarrowing, bt);
@@ -1632,7 +1632,7 @@ bool LibraryCallKit::inline_string_toBytesU() {
bool aligned = (arrayOopDesc::base_offset_in_bytes(T_BYTE) % HeapWordSize == 0);
// If true, then check if src array address is aligned to HeapWordSize
if (aligned) {
- const TypeInt* toffset = gvn().type(offset)->is_int();
+ const TypeInt* toffset = gvn().type(offset)->as_int();
aligned = toffset->is_con() && ((arrayOopDesc::base_offset_in_bytes(T_CHAR) +
toffset->get_con() * type2aelembytes(T_CHAR)) % HeapWordSize == 0);
}
@@ -1711,8 +1711,8 @@ bool LibraryCallKit::inline_string_getCharsU() {
Node* dst_start = array_element_address(dst, dst_begin, T_CHAR);
// Check if array addresses are aligned to HeapWordSize
- const TypeInt* tsrc = gvn().type(src_begin)->is_int();
- const TypeInt* tdst = gvn().type(dst_begin)->is_int();
+ const TypeInt* tsrc = gvn().type(src_begin)->as_int();
+ const TypeInt* tdst = gvn().type(dst_begin)->as_int();
bool aligned = tsrc->is_con() && ((arrayOopDesc::base_offset_in_bytes(T_BYTE) + tsrc->get_con() * type2aelembytes(T_BYTE)) % HeapWordSize == 0) &&
tdst->is_con() && ((arrayOopDesc::base_offset_in_bytes(T_CHAR) + tdst->get_con() * type2aelembytes(T_CHAR)) % HeapWordSize == 0);
@@ -2162,7 +2162,7 @@ LibraryCallKit::classify_unsafe_addr(Node* &base, Node* &offset, BasicType type)
return Type::RawPtr;
} else if (base_type->base() == Type::RawPtr) {
return Type::RawPtr;
- } else if (base_type->isa_oopptr()) {
+ } else if (base_type->is_oopptr()) {
// Base is never null => always a heap address.
if (!TypePtr::NULL_PTR->higher_equal(base_type)) {
return Type::OopPtr;
@@ -2365,10 +2365,10 @@ const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_
const TypeOopPtr* result = nullptr;
// See if it is a narrow oop array.
- if (adr_type->isa_aryptr()) {
+ if (adr_type->is_aryptr()) {
if (adr_type->offset() >= refArrayOopDesc::base_offset_in_bytes()) {
- const TypeOopPtr* elem_type = adr_type->is_aryptr()->elem()->make_oopptr();
- null_free = adr_type->is_aryptr()->is_null_free();
+ const TypeOopPtr* elem_type = adr_type->as_aryptr()->elem()->make_oopptr();
+ null_free = adr_type->as_aryptr()->is_null_free();
if (elem_type != nullptr && elem_type->is_loaded()) {
// Sharpen the value type.
result = elem_type;
@@ -2382,7 +2382,7 @@ const TypeOopPtr* LibraryCallKit::sharpen_unsafe_type(Compile::AliasType* alias_
// Sharpen the value type.
result = TypeOopPtr::make_from_klass(sharpened_klass);
if (null_free) {
- result = result->join_speculative(TypePtr::NOTNULL)->is_oopptr();
+ result = result->join_speculative(TypePtr::NOTNULL)->as_oopptr();
}
}
if (result != nullptr) {
@@ -2579,8 +2579,8 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
bool mismatched = false;
BasicType bt = T_ILLEGAL;
ciField* field = nullptr;
- if (adr_type->isa_instptr()) {
- const TypeInstPtr* instptr = adr_type->is_instptr();
+ if (adr_type->is_instptr()) {
+ const TypeInstPtr* instptr = adr_type->as_instptr();
ciInstanceKlass* k = instptr->instance_klass();
int off = instptr->offset();
if (instptr->const_oop() != nullptr &&
@@ -2608,10 +2608,10 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
if (bt != T_ILLEGAL) {
assert(alias_type->adr_type()->is_oopptr(), "should be on-heap access");
- if (bt == T_BYTE && adr_type->isa_aryptr()) {
+ if (bt == T_BYTE && adr_type->is_aryptr()) {
// Alias type doesn't differentiate between byte[] and boolean[]).
// Use address type to get the element type.
- bt = adr_type->is_aryptr()->elem()->array_element_basic_type();
+ bt = adr_type->as_aryptr()->elem()->array_element_basic_type();
}
if (is_reference_type(bt, true)) {
// accessing an array field with getReference is not a mismatch
@@ -2622,7 +2622,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
return false;
}
mismatched = (bt != type);
- } else if (alias_type->adr_type()->isa_oopptr()) {
+ } else if (alias_type->adr_type()->is_oopptr()) {
mismatched = true; // conservatively mark all "wide" on-heap accesses as mismatched
}
@@ -2763,14 +2763,14 @@ bool LibraryCallKit::inline_unsafe_flat_access(bool is_store, AccessKind kind) {
Node* ptr;
bool immutable_memory = false;
DecoratorSet decorators = C2_UNSAFE_ACCESS | IN_HEAP | MO_UNORDERED;
- if (base_type->isa_instptr()) {
+ if (base_type->is_instptr()) {
const TypeLong* offset_type = _gvn.type(offset)->isa_long();
if (offset_type == nullptr || !offset_type->is_con()) {
// Offset into a non-array should be a constant
decorators |= C2_MISMATCHED;
} else {
int offset_con = checked_cast(offset_type->get_con());
- ciInstanceKlass* base_klass = base_type->is_instptr()->instance_klass();
+ ciInstanceKlass* base_klass = base_type->as_instptr()->instance_klass();
ciField* field = base_klass->get_non_flat_field_by_offset(offset_con);
if (field == nullptr) {
assert(!base_klass->is_final(), "non-existence field at offset %d of class %s", offset_con, base_klass->name()->as_utf8());
@@ -2793,11 +2793,11 @@ bool LibraryCallKit::inline_unsafe_flat_access(bool is_store, AccessKind kind) {
base = base->as_ValueType()->buffer(this, true);
}
ptr = basic_plus_adr(base, ConvL2X(offset));
- } else if (base_type->isa_aryptr()) {
+ } else if (base_type->is_aryptr()) {
decorators |= IS_ARRAY;
if (!layout.is_flat()) {
- if (!base_type->is_aryptr()->is_not_flat()) {
- const TypeAryPtr* array_type = base_type->is_aryptr()->cast_to_not_flat();
+ if (!base_type->as_aryptr()->is_not_flat()) {
+ const TypeAryPtr* array_type = base_type->as_aryptr()->cast_to_not_flat();
// TODO 8388444 This should be a CheckCastPP, can we add a test?
Node* new_base = _gvn.transform(new CastPPNode(control(), base, array_type, ConstraintCastNode::DependencyType::NonFloatingNarrowing));
replace_in_map(base, new_base);
@@ -2825,7 +2825,7 @@ bool LibraryCallKit::inline_unsafe_flat_access(bool is_store, AccessKind kind) {
replace_in_map(base, new_base);
base = new_base;
ptr = basic_plus_adr(base, ConvL2X(offset));
- const TypeAryPtr* ptr_type = _gvn.type(ptr)->is_aryptr();
+ const TypeAryPtr* ptr_type = _gvn.type(ptr)->as_aryptr();
if (ptr_type->field_offset().get() != 0) {
// TODO 8388444 This should be a CheckCastPP, can we add a test?
ptr = _gvn.transform(new CastPPNode(control(), ptr, ptr_type->with_field_offset(0), ConstraintCastNode::DependencyType::NonFloatingNarrowing));
@@ -2856,7 +2856,7 @@ bool LibraryCallKit::inline_unsafe_flat_access(bool is_store, AccessKind kind) {
assert(value_type == TypePtr::NULL_PTR || value_type->value_klass() == value_klass,
"value is of type %s while value klass is %s", value_type->value_klass()->name()->as_utf8(), value_klass->name()->as_utf8());
if (!layout.is_flat()) {
- const TypePtr* ptr_type = (decorators & C2_MISMATCHED) != 0 ? TypeRawPtr::BOTTOM : _gvn.type(ptr)->is_ptr();
+ const TypePtr* ptr_type = (decorators & C2_MISMATCHED) != 0 ? TypeRawPtr::BOTTOM : _gvn.type(ptr)->as_ptr();
access_store_at(base, ptr, ptr_type, value, value_type, T_OBJECT, decorators);
} else {
bool atomic = layout.is_atomic_flat();
@@ -2872,7 +2872,7 @@ bool LibraryCallKit::inline_unsafe_flat_access(bool is_store, AccessKind kind) {
decorators |= (C2_CONTROL_DEPENDENT_LOAD | C2_UNKNOWN_CONTROL_LOAD);
ValueTypeNode* result;
if (!layout.is_flat()) {
- const TypePtr* ptr_type = (decorators & C2_MISMATCHED) != 0 ? TypeRawPtr::BOTTOM : _gvn.type(ptr)->is_ptr();
+ const TypePtr* ptr_type = (decorators & C2_MISMATCHED) != 0 ? TypeRawPtr::BOTTOM : _gvn.type(ptr)->as_ptr();
Node* oop = access_load_at(base, ptr, ptr_type, Type::get_const_type(value_klass), T_OBJECT, decorators);
result = ValueTypeNode::make_from_oop(this, oop, value_klass);
} else {
@@ -3046,7 +3046,7 @@ bool LibraryCallKit::inline_unsafe_load_store(const BasicType type, const LoadSt
Compile::AliasType* alias_type = C->alias_type(adr_type);
BasicType bt = alias_type->basic_type();
if (bt != T_ILLEGAL) {
- if (adr_type->isa_aryptr() && adr_type->is_flat()) {
+ if (adr_type->is_aryptr() && adr_type->is_flat()) {
// mismatched access to a flat array element:
// type=T_OBJECT doesn't make sense (and breaks Compile::adjust_flat_array_access_aliases()).
// Some other type may need to be supported so this may need to be relaxed.
@@ -3432,15 +3432,15 @@ bool LibraryCallKit::inline_native_vthread_start_transition(address funcAddr, co
Node* thread = ideal.thread();
Node* jt_addr = off_heap_plus_addr(thread, in_bytes(JavaThread::is_in_vthread_transition_offset()));
Node* vt_addr = basic_plus_adr(vt_oop, java_lang_Thread::is_in_vthread_transition_offset());
- access_store_at(nullptr, jt_addr, _gvn.type(jt_addr)->is_ptr(), ideal.ConI(1), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
- access_store_at(nullptr, vt_addr, _gvn.type(vt_addr)->is_ptr(), ideal.ConI(1), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
+ access_store_at(nullptr, jt_addr, _gvn.type(jt_addr)->as_ptr(), ideal.ConI(1), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
+ access_store_at(nullptr, vt_addr, _gvn.type(vt_addr)->as_ptr(), ideal.ConI(1), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
insert_mem_bar(Op_MemBarStoreLoad);
ideal.sync_kit(this);
Node* global_disable_addr = makecon(TypeRawPtr::make((address)MountUnmountDisabler::global_vthread_transition_disable_count_address()));
Node* global_disable = ideal.load(ideal.ctrl(), global_disable_addr, TypeInt::INT, T_INT, Compile::AliasIdxRaw, true /*require_atomic_access*/);
Node* vt_disable_addr = basic_plus_adr(vt_oop, java_lang_Thread::vthread_transition_disable_count_offset());
- const TypePtr* vt_disable_addr_t = _gvn.type(vt_disable_addr)->is_ptr();
+ const TypePtr* vt_disable_addr_t = _gvn.type(vt_disable_addr)->as_ptr();
Node* vt_disable = ideal.load(ideal.ctrl(), vt_disable_addr, TypeInt::INT, T_INT, C->get_alias_index(vt_disable_addr_t), true /*require_atomic_access*/);
Node* disabled = _gvn.transform(new AddINode(global_disable, vt_disable));
@@ -3476,8 +3476,8 @@ bool LibraryCallKit::inline_native_vthread_end_transition(address funcAddr, cons
Node* vt_addr = basic_plus_adr(vt_oop, java_lang_Thread::is_in_vthread_transition_offset());
sync_kit(ideal);
- access_store_at(nullptr, jt_addr, _gvn.type(jt_addr)->is_ptr(), ideal.ConI(0), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
- access_store_at(nullptr, vt_addr, _gvn.type(vt_addr)->is_ptr(), ideal.ConI(0), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
+ access_store_at(nullptr, jt_addr, _gvn.type(jt_addr)->as_ptr(), ideal.ConI(0), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
+ access_store_at(nullptr, vt_addr, _gvn.type(vt_addr)->as_ptr(), ideal.ConI(0), TypeInt::BOOL, T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
ideal.sync_kit(this);
} ideal.end_if();
@@ -3499,7 +3499,7 @@ bool LibraryCallKit::inline_native_notify_jvmti_sync() {
Node* thread = ideal.thread();
Node* arg = argument(0); // argument for notification
Node* addr = off_heap_plus_addr(thread, in_bytes(JavaThread::is_disable_suspend_offset()));
- const TypePtr *addr_type = _gvn.type(addr)->isa_ptr();
+ const TypePtr* addr_type = _gvn.type(addr)->as_ptr();
sync_kit(ideal);
access_store_at(nullptr, addr, addr_type, arg, _gvn.type(arg), T_BOOLEAN, IN_NATIVE | MO_UNORDERED);
@@ -3741,7 +3741,7 @@ bool LibraryCallKit::inline_native_getEventWriter() {
// Load the raw epoch value from the threadObj.
Node* threadObj_epoch_offset = basic_plus_adr(threadObj, java_lang_Thread::jfr_epoch_offset());
Node* threadObj_epoch_raw = access_load_at(threadObj, threadObj_epoch_offset,
- _gvn.type(threadObj_epoch_offset)->isa_ptr(),
+ _gvn.type(threadObj_epoch_offset)->as_ptr(),
TypeInt::CHAR, T_CHAR,
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
@@ -3761,7 +3761,7 @@ bool LibraryCallKit::inline_native_getEventWriter() {
// Load the raw epoch value from the vthread.
Node* vthread_epoch_offset = basic_plus_adr(vthread, java_lang_Thread::jfr_epoch_offset());
- Node* vthread_epoch_raw = access_load_at(vthread, vthread_epoch_offset, _gvn.type(vthread_epoch_offset)->is_ptr(),
+ Node* vthread_epoch_raw = access_load_at(vthread, vthread_epoch_offset, _gvn.type(vthread_epoch_offset)->as_ptr(),
TypeInt::CHAR, T_CHAR,
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
@@ -4008,7 +4008,7 @@ void LibraryCallKit::extend_setCurrentThread(Node* jt, Node* thread) {
// Load the raw epoch value from the vthread.
Node* epoch_offset = basic_plus_adr(thread, java_lang_Thread::jfr_epoch_offset());
- Node* epoch_raw = access_load_at(thread, epoch_offset, _gvn.type(epoch_offset)->is_ptr(), TypeInt::CHAR, T_CHAR,
+ Node* epoch_raw = access_load_at(thread, epoch_offset, _gvn.type(epoch_offset)->as_ptr(), TypeInt::CHAR, T_CHAR,
IN_HEAP | MO_UNORDERED | C2_MISMATCHED | C2_CONTROL_DEPENDENT_LOAD);
// Mask off the excluded information from the epoch.
@@ -4113,7 +4113,7 @@ bool LibraryCallKit::inline_native_try_update_epoch() {
const int jfr_epoch_field_offset = field->offset_in_bytes();
Node* oop_epoch_field_offset = basic_plus_adr(oop, jfr_epoch_field_offset);
- const TypePtr* adr_type = _gvn.type(oop_epoch_field_offset)->isa_ptr();
+ const TypePtr* adr_type = _gvn.type(oop_epoch_field_offset)->as_ptr();
const int alias_idx = C->get_alias_index(adr_type);
BasicType bt = field->layout_type();
const Type * oop_epoch_field_type = Type::get_const_basic_type(bt);
@@ -4226,8 +4226,8 @@ bool LibraryCallKit::inline_native_setCurrentThread() {
Node* thread = _gvn.transform(new ThreadLocalNode());
Node* p = off_heap_plus_addr(thread, in_bytes(JavaThread::vthread_offset()));
Node* thread_obj_handle
- = make_load(nullptr, p, p->bottom_type()->is_ptr(), T_OBJECT, MemNode::unordered);
- const TypePtr *adr_type = _gvn.type(thread_obj_handle)->isa_ptr();
+ = make_load(nullptr, p, p->bottom_type()->as_ptr(), T_OBJECT, MemNode::unordered);
+ const TypePtr* adr_type = _gvn.type(thread_obj_handle)->as_ptr();
access_store_at(nullptr, thread_obj_handle, adr_type, arr, _gvn.type(arr), T_OBJECT, IN_NATIVE | MO_UNORDERED);
// Change the _monitor_owner_id of the JavaThread
@@ -4257,9 +4257,9 @@ Node* LibraryCallKit::scopedValueCache_helper() {
// We cannot use immutable_memory() because we might flip onto a
// different carrier thread, at which point we'll need to use that
// carrier thread's cache.
- // return _gvn.transform(LoadNode::make(_gvn, nullptr, immutable_memory(), p, p->bottom_type()->is_ptr(),
+ // return _gvn.transform(LoadNode::make(_gvn, nullptr, immutable_memory(), p, p->bottom_type()->as_ptr(),
// TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered));
- return make_load(nullptr, p, p->bottom_type()->is_ptr(), T_ADDRESS, MemNode::unordered);
+ return make_load(nullptr, p, p->bottom_type()->as_ptr(), T_ADDRESS, MemNode::unordered);
}
//------------------------inline_native_scopedValueCache------------------
@@ -4277,7 +4277,7 @@ bool LibraryCallKit::inline_native_setScopedValueCache() {
Node* cache_obj_handle = scopedValueCache_helper();
const Type* objects_type = scopedValueCache_type();
- const TypePtr *adr_type = _gvn.type(cache_obj_handle)->isa_ptr();
+ const TypePtr* adr_type = _gvn.type(cache_obj_handle)->as_ptr();
access_store_at(nullptr, cache_obj_handle, adr_type, arr, objects_type, T_OBJECT, IN_NATIVE | MO_UNORDERED);
return true;
@@ -4911,7 +4911,7 @@ bool LibraryCallKit::inline_newArray(bool null_free, bool atomic) {
}
}
Node* obj = new_array(makecon(array_klass_type), length, 0, nullptr, false, init_val);
- const TypeAryPtr* arytype = gvn().type(obj)->is_aryptr();
+ const TypeAryPtr* arytype = gvn().type(obj)->as_aryptr();
assert(arytype->is_null_free() == null_free, "inconsistency");
assert(arytype->is_not_null_free() == !null_free, "inconsistency");
set_result(obj);
@@ -4971,7 +4971,7 @@ bool LibraryCallKit::inline_getArrayProperties(ArrayPropertiesCheck check) {
Node* array_klass = load_object_klass(array);
int element_klass_offset = in_bytes(ObjArrayKlass::element_klass_offset());
Node* array_element_klass_addr = off_heap_plus_addr(array_klass, element_klass_offset);
- Node* array_element_klass = _gvn.transform(LoadKlassNode::make(_gvn, immutable_memory(), array_element_klass_addr, _gvn.type(array_klass)->is_klassptr()));
+ Node* array_element_klass = _gvn.transform(LoadKlassNode::make(_gvn, immutable_memory(), array_element_klass_addr, _gvn.type(array_klass)->as_klassptr()));
int klass_flags_offset = in_bytes(InstanceKlass::misc_flags_offset() + InstanceKlassFlags::flags_offset());
Node* array_element_klass_flags_addr = off_heap_plus_addr(array_element_klass, klass_flags_offset);
Node* array_element_klass_flags = make_load(control(), array_element_klass_flags_addr, TypeInt::INT, T_INT, MemNode::unordered);
@@ -5233,8 +5233,8 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) {
klass_node = null_check(klass_node);
- const TypeAryPtr* src_t = _gvn.type(original)->is_aryptr();
- const TypeKlassPtr* dest_klass_t = _gvn.type(klass_node)->is_klassptr();
+ const TypeAryPtr* src_t = _gvn.type(original)->as_aryptr();
+ const TypeKlassPtr* dest_klass_t = _gvn.type(klass_node)->as_klassptr();
Node* bailout_ctrl;
if (should_bail_out_on_non_ref_arrays(src_t, dest_klass_t)) {
@@ -5309,12 +5309,12 @@ bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) {
// check can be optimized if we know something on the type of
// the input array from type speculation.
if (_gvn.type(klass_node)->singleton()) {
- const TypeKlassPtr* subk = _gvn.type(load_object_klass(original))->is_klassptr();
- const TypeKlassPtr* superk = _gvn.type(klass_node)->is_klassptr();
+ const TypeKlassPtr* subk = _gvn.type(load_object_klass(original))->as_klassptr();
+ const TypeKlassPtr* superk = _gvn.type(klass_node)->as_klassptr();
int test = C->static_subtype_check(superk, subk);
if (test != Compile::SSC_always_true && test != Compile::SSC_always_false) {
- const TypeOopPtr* t_original = _gvn.type(original)->is_oopptr();
+ const TypeOopPtr* t_original = _gvn.type(original)->as_oopptr();
if (t_original->speculative_type() != nullptr) {
original = maybe_cast_profiled_obj(original, t_original->speculative_type(), true);
}
@@ -5396,7 +5396,7 @@ bool LibraryCallKit::should_bail_out_on_non_ref_arrays(const TypeAryPtr* src_typ
// We could have abstract flat value class arrays whose layout we don't know. Bail out.
const bool can_src_be_abstract_flat_value_class_array = src_maybe_flat && !src_type->elem()->is_valueklassptr();
const bool can_dest_be_abstract_flat_value_class_array = dest_maybe_flat &&
- !dest_ary_klass_type->elem()->is_instklassptr()->instance_klass()->is_value_klass();
+ !dest_ary_klass_type->elem()->as_instklassptr()->instance_klass()->is_value_klass();
if (can_src_be_abstract_flat_value_class_array || can_dest_be_abstract_flat_value_class_array) {
return true;
}
@@ -5411,7 +5411,7 @@ bool LibraryCallKit::should_bail_out_on_non_ref_arrays(const TypeAryPtr* src_typ
}
const bool can_src_be_flat_with_oops = src_maybe_flat && src_type->elem()->value_klass()->contains_oops();
- const bool can_dest_be_flat_with_oops = dest_maybe_flat && dest_ary_klass_type->elem()->is_instklassptr()->instance_klass()->as_value_klass()->contains_oops();
+ const bool can_dest_be_flat_with_oops = dest_maybe_flat && dest_ary_klass_type->elem()->as_instklassptr()->instance_klass()->as_value_klass()->contains_oops();
if (can_src_be_flat_with_oops || can_dest_be_flat_with_oops) {
return true;
}
@@ -5778,7 +5778,7 @@ IfNode* LibraryCallKit::hashcode_fast_path_if_from_identity_hash_code_call(Phase
if (!node->is_Con()) return false;
TypeNode* con = node->as_Type();
assert(con->type()->is_intptr_t(), "");
- return con->type()->is_intptr_t()->is_con(in_bytes(n));
+ return con->type()->as_intptr_t()->is_con(in_bytes(n));
};
assert(call->in(TypeFunc::Control) != nullptr, "");
@@ -5810,8 +5810,7 @@ IfNode* LibraryCallKit::hashcode_fast_path_if_from_identity_hash_code_call(Phase
LoadNode* load_offset = cmp_i->in(1)->as_Load();
if (!cmp_i->in(2)->is_ConI()) continue;
ConINode* zero_i = cmp_i->in(2)->as_ConI();
- assert(zero_i->type()->is_int() != nullptr, "");
- if (!zero_i->type()->is_int()->is_con(0)) continue;
+ if (!zero_i->type()->as_int()->is_con(0)) continue;
assert(load_offset->in(2) != nullptr, "");
if (!load_offset->in(2)->is_AddP()) continue;
@@ -5833,7 +5832,7 @@ IfNode* LibraryCallKit::hashcode_fast_path_if_from_identity_hash_code_call(Phase
assert(members_addr_add->in(AddPNode::Address) != nullptr, "");
assert(members_addr_add->in(AddPNode::Offset) != nullptr, "");
if (!members_addr_add->in(AddPNode::Base)->is_top()) continue;
- if (!phase->type(members_addr_add->in(AddPNode::Address))->isa_instklassptr()) continue;
+ if (!phase->type(members_addr_add->in(AddPNode::Address))->is_instklassptr()) continue;
if (!is_con_offset(members_addr_add->in(AddPNode::Offset), ValueKlass::adr_members_offset())) continue;
return iff;
@@ -5996,7 +5995,7 @@ bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) {
C->set_has_split_ifs(true); // Has chance for split-if optimization
result = phi;
- assert(result->bottom_type()->isa_long(), "must be");
+ assert(result->bottom_type()->is_long(), "must be");
break;
}
@@ -6037,7 +6036,7 @@ bool LibraryCallKit::inline_fp_conversions(vmIntrinsics::ID id) {
C->set_has_split_ifs(true); // Has chance for split-if optimization
result = phi;
- assert(result->bottom_type()->isa_int(), "must be");
+ assert(result->bottom_type()->is_int(), "must be");
break;
}
@@ -6133,9 +6132,9 @@ bool LibraryCallKit::inline_unsafe_copyMemory() {
// Adjust memory effects of the runtime call based on input values.
if (!has_wide_mem(_gvn, src_addr, src_base) &&
!has_wide_mem(_gvn, dst_addr, dst_base)) {
- dst_type = _gvn.type(dst_addr)->is_ptr(); // narrow out memory
+ dst_type = _gvn.type(dst_addr)->as_ptr(); // narrow out memory
- const TypePtr* src_type = _gvn.type(src_addr)->is_ptr();
+ const TypePtr* src_type = _gvn.type(src_addr)->as_ptr();
if (C->get_alias_index(src_type) == C->get_alias_index(dst_type)) {
flags |= RC_NARROW_MEM; // narrow in memory
}
@@ -6187,7 +6186,7 @@ bool LibraryCallKit::inline_unsafe_setMemory() {
// Adjust memory effects of the runtime call based on input values.
if (!has_wide_mem(_gvn, dst_addr, dst_base)) {
- dst_type = _gvn.type(dst_addr)->is_ptr(); // narrow out memory
+ dst_type = _gvn.type(dst_addr)->as_ptr(); // narrow out memory
flags |= RC_NARROW_MEM; // narrow in memory
}
@@ -6221,7 +6220,7 @@ void LibraryCallKit::copy_to_clone(Node* obj, Node* alloc_obj, Node* obj_size, b
// Object.clone() invocation), initialize the array within the allocation.
// This is needed because some GCs (e.g. ZGC) might fall back in this case
// to a runtime clone call that assumes fully initialized source arrays.
- (!is_array || obj->get_ptr_type()->isa_aryptr() != nullptr)) {
+ (!is_array || obj->get_ptr_type()->is_aryptr())) {
// We will be completely responsible for initializing this object -
// mark Initialize node as complete.
alloc = AllocateNode::Ideal_allocation(alloc_obj);
@@ -6285,7 +6284,7 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) {
obj = null_check_receiver();
if (stopped()) return true;
- const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();
+ const TypeOopPtr* obj_type = _gvn.type(obj)->as_oopptr();
if (obj_type->is_valueklassptr()) {
// If the object to clone is a value type, we can simply return it (i.e. a nop) since value types have
// no identity. But we first need to check whether the value class is actually implementing the Cloneable
@@ -6325,8 +6324,8 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) {
ciInstanceKlass* spec_ik = obj_type->speculative_type()->as_instance_klass();
if (spec_ik->nof_nonstatic_fields() <= ArrayCopyLoadStoreMaxElem &&
!spec_ik->has_injected_fields()) {
- if (!obj_type->isa_instptr() ||
- obj_type->is_instptr()->instance_klass()->has_subklass()) {
+ if (!obj_type->is_instptr() ||
+ obj_type->as_instptr()->instance_klass()->has_subklass()) {
obj = maybe_cast_profiled_obj(obj, obj_type->speculative_type(), false);
}
}
@@ -6552,7 +6551,7 @@ SafePointNode* LibraryCallKit::create_safepoint_with_state_before_array_allocati
sfpt->init_req(i, alloc->in(i));
}
int adjustment = 1;
- const TypeAryKlassPtr* ary_klass_ptr = alloc->in(AllocateNode::KlassNode)->bottom_type()->is_aryklassptr();
+ const TypeAryKlassPtr* ary_klass_ptr = alloc->in(AllocateNode::KlassNode)->bottom_type()->as_aryklassptr();
if (ary_klass_ptr->is_null_free()) {
// A null-free, tightly coupled array allocation can only come from LibraryCallKit::inline_newArray which
// also requires the componentType and initVal on stack for re-execution.
@@ -6569,7 +6568,7 @@ SafePointNode* LibraryCallKit::create_safepoint_with_state_before_array_allocati
// Re-create and push the initVal.
Node* init_val = alloc->in(AllocateNode::InitValue);
if (init_val == nullptr) {
- init_val = ValueTypeNode::make_all_zero(_gvn, ary_klass_ptr->elem()->is_instklassptr()->instance_klass()->as_value_klass());
+ init_val = ValueTypeNode::make_all_zero(_gvn, ary_klass_ptr->elem()->as_instklassptr()->instance_klass()->as_value_klass());
} else if (UseCompressedOops) {
init_val = _gvn.transform(new DecodeNNode(init_val, init_val->bottom_type()->make_ptr()));
}
@@ -6661,9 +6660,9 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
// Update memory as done in GraphKit::set_output_for_allocation()
const TypeInt* length_type = _gvn.find_int_type(alloc->in(AllocateNode::ALength));
- const TypeOopPtr* ary_type = _gvn.type(alloc->in(AllocateNode::KlassNode))->is_klassptr()->as_exact_instance_type();
- if (ary_type->isa_aryptr() && length_type != nullptr) {
- ary_type = ary_type->is_aryptr()->cast_to_size(length_type);
+ const TypeOopPtr* ary_type = _gvn.type(alloc->in(AllocateNode::KlassNode))->as_klassptr()->as_exact_instance_type();
+ if (ary_type->is_aryptr() && length_type != nullptr) {
+ ary_type = ary_type->as_aryptr()->cast_to_size(length_type);
}
const TypePtr* telemref = ary_type->add_offset(Type::OffsetBot);
int elemidx = C->get_alias_index(telemref);
@@ -7002,8 +7001,8 @@ bool LibraryCallKit::inline_arraycopy() {
}
if (has_src && has_dest && can_emit_guards) {
- BasicType src_elem = top_src->isa_aryptr()->elem()->array_element_basic_type();
- BasicType dest_elem = top_dest->isa_aryptr()->elem()->array_element_basic_type();
+ BasicType src_elem = top_src->elem()->array_element_basic_type();
+ BasicType dest_elem = top_dest->elem()->array_element_basic_type();
if (is_reference_type(src_elem, true)) src_elem = T_OBJECT;
if (is_reference_type(dest_elem, true)) dest_elem = T_OBJECT;
@@ -7110,11 +7109,11 @@ bool LibraryCallKit::inline_arraycopy() {
Node* src_klass = load_object_klass(src);
Node* adr_prop_src = basic_plus_adr(top(), src_klass, in_bytes(ArrayKlass::properties_offset()));
Node* prop_src = _gvn.transform(LoadNode::make(_gvn, control(), immutable_memory(), adr_prop_src,
- _gvn.type(adr_prop_src)->is_ptr(), TypeInt::INT, T_INT,
+ _gvn.type(adr_prop_src)->as_ptr(), TypeInt::INT, T_INT,
MemNode::unordered));
Node* adr_prop_dest = basic_plus_adr(top(), refined_dest_klass, in_bytes(ArrayKlass::properties_offset()));
Node* prop_dest = _gvn.transform(LoadNode::make(_gvn, control(), immutable_memory(), adr_prop_dest,
- _gvn.type(adr_prop_dest)->is_ptr(), TypeInt::INT, T_INT,
+ _gvn.type(adr_prop_dest)->as_ptr(), TypeInt::INT, T_INT,
MemNode::unordered));
const ArrayProperties props_null_restricted = ArrayProperties::Default().with_null_restricted();
@@ -7685,7 +7684,7 @@ bool LibraryCallKit::inline_vectorizedMismatch() {
BasicType elem_bt = T_ILLEGAL;
- const TypeInt* scale_t = _gvn.type(scale)->is_int();
+ const TypeInt* scale_t = _gvn.type(scale)->as_int();
if (scale_t->is_con()) {
switch (scale_t->get_con()) {
case 0: elem_bt = T_BYTE; break;
@@ -7721,8 +7720,8 @@ bool LibraryCallKit::inline_vectorizedMismatch() {
if (!stopped()) {
Node* casted_length = _gvn.transform(new CastIINode(control(), length, TypeInt::make(0, inline_limit, Type::WidenMin)));
- const TypePtr* obja_adr_t = _gvn.type(obja_adr)->isa_ptr();
- const TypePtr* objb_adr_t = _gvn.type(objb_adr)->isa_ptr();
+ const TypePtr* obja_adr_t = _gvn.type(obja_adr)->as_ptr();
+ const TypePtr* objb_adr_t = _gvn.type(objb_adr)->as_ptr();
Node* obja_adr_mem = memory(C->get_alias_index(obja_adr_t));
Node* objb_adr_mem = memory(C->get_alias_index(objb_adr_t));
@@ -7784,7 +7783,7 @@ bool LibraryCallKit::inline_vectorizedHashCode() {
return false; // failed input validation
}
- const TypeInt* basic_type_t = _gvn.type(basic_type)->is_int();
+ const TypeInt* basic_type_t = _gvn.type(basic_type)->as_int();
if (!basic_type_t->is_con()) {
return false; // Only intrinsify if mode argument is constant
}
@@ -8180,7 +8179,7 @@ bool LibraryCallKit::inline_reference_clear0(bool is_phantom) {
DecoratorSet decorators = IN_HEAP | AS_NO_KEEPALIVE;
decorators |= (is_phantom ? ON_PHANTOM_OOP_REF : ON_WEAK_OOP_REF);
Node* referent_field_addr = basic_plus_adr(reference_obj, java_lang_ref_Reference::referent_offset());
- const TypePtr* referent_field_addr_type = _gvn.type(referent_field_addr)->isa_ptr();
+ const TypePtr* referent_field_addr_type = _gvn.type(referent_field_addr)->as_ptr();
const Type* val_type = TypeOopPtr::make_from_klass(env()->Object_klass());
Node* referent = access_load_at(reference_obj,
@@ -10309,7 +10308,7 @@ Node* LibraryCallKit::unbox_fp16_value(const TypeInstPtr* float16_box_type, ciFi
set_control(null_ctl);
return nullptr;
}
- assert(not_null_box->bottom_type()->is_instptr()->maybe_null() == false, "");
+ assert(not_null_box->bottom_type()->as_instptr()->maybe_null() == false, "");
const TypePtr* adr_type = C->alias_type(field)->adr_type();
Node* adr = basic_plus_adr(not_null_box, field->offset_in_bytes());
return access_load_at(not_null_box, adr, adr_type, TypeInt::SHORT, T_SHORT, IN_HEAP);
@@ -10324,7 +10323,7 @@ Node* LibraryCallKit::box_fp16_value(const TypeInstPtr* float16_box_type, ciFiel
Node* box = new_instance(klass_node);
Node* value_field = basic_plus_adr(box, field->offset_in_bytes());
- const TypePtr* value_adr_type = value_field->bottom_type()->is_ptr();
+ const TypePtr* value_adr_type = value_field->bottom_type()->as_ptr();
Node* field_store = _gvn.transform(access_store_at(box,
value_field,
diff --git a/src/hotspot/share/opto/loopPredicate.cpp b/src/hotspot/share/opto/loopPredicate.cpp
index 537e2ef9705..b7a5789f644 100644
--- a/src/hotspot/share/opto/loopPredicate.cpp
+++ b/src/hotspot/share/opto/loopPredicate.cpp
@@ -620,7 +620,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset
predString->print("- %d) ", stride);
}
// Check if (limit - stride) may overflow
- const TypeInt* limit_type = _igvn.type(limit)->isa_int();
+ const TypeInt* limit_type = _igvn.type(limit)->as_int();
jint limit_lo = limit_type->_lo;
jint limit_hi = limit_type->_hi;
if ((stride > 0 && (java_subtract(limit_lo, stride) < limit_lo)) ||
@@ -687,7 +687,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(Node* ctrl, const int scale, Node* offset
}
}
// Check if (max_idx_expr + offset) may overflow
- const TypeInt* offset_type = _igvn.type(offset)->isa_int();
+ const TypeInt* offset_type = _igvn.type(offset)->as_int();
jint lo = java_add(idx_type->_lo, offset_type->_lo);
jint hi = java_add(idx_type->_hi, offset_type->_hi);
if (overflow || (lo > hi) ||
@@ -763,7 +763,7 @@ bool PhaseIdealLoop::loop_predication_should_follow_branches(IdealLoopTree* loop
if (head->is_CountedLoop()) {
CountedLoopNode* cl = head->as_CountedLoop();
if (cl->phi() != nullptr) {
- const TypeInt* t = _igvn.type(cl->phi())->is_int();
+ const TypeInt* t = _igvn.type(cl->phi())->as_int();
float worst_case_trip_cnt = ((float)t->_hi - t->_lo) / ABS((float)cl->stride_con());
if (worst_case_trip_cnt < loop_trip_cnt) {
loop_trip_cnt = worst_case_trip_cnt;
@@ -1034,7 +1034,7 @@ bool PhaseIdealLoop::loop_predication_impl_helper(IdealLoopTree* loop, const IfP
Node* idx = cmp->in(1);
assert(!invar.is_invariant(idx), "index is variant");
Node* range = cmp->in(2);
- assert(range->Opcode() == Op_LoadRange || iff->is_RangeCheck() || _igvn.type(range)->is_int()->_lo >= 0, "must be");
+ assert(range->Opcode() == Op_LoadRange || iff->is_RangeCheck() || _igvn.type(range)->as_int()->_lo >= 0, "must be");
assert(invar.is_invariant(range), "range must be invariant");
int scale = 1;
Node* offset = zero;
diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp
index b1180e93cea..a993bf806d4 100644
--- a/src/hotspot/share/opto/loopTransform.cpp
+++ b/src/hotspot/share/opto/loopTransform.cpp
@@ -178,8 +178,8 @@ void IdealLoopTree::compute_trip_count(PhaseIdealLoop* phase, BasicType loop_bt)
Node* limit_n = cl->limit();
if (init_n != nullptr && limit_n != nullptr) {
jlong stride_con = cl->stride_con();
- const TypeInteger* init_type = phase->_igvn.type(init_n)->is_integer(loop_bt);
- const TypeInteger* limit_type = phase->_igvn.type(limit_n)->is_integer(loop_bt);
+ const TypeInteger* init_type = phase->_igvn.type(init_n)->as_integer(loop_bt);
+ const TypeInteger* limit_type = phase->_igvn.type(limit_n)->as_integer(loop_bt);
// compute trip count
// It used to be computed as:
@@ -215,8 +215,8 @@ void IdealLoopTree::compute_trip_count(PhaseIdealLoop* phase, BasicType loop_bt)
#ifdef ASSERT
if (loop_bt == T_INT) {
// Use longs to avoid integer overflow.
- jlong init_con = (stride_con > 0) ? init_type->is_int()->_lo : init_type->is_int()->_hi;
- jlong limit_con = (stride_con > 0) ? limit_type->is_int()->_hi : limit_type->is_int()->_lo;
+ jlong init_con = (stride_con > 0) ? init_type->as_int()->_lo : init_type->as_int()->_hi;
+ jlong limit_con = (stride_con > 0) ? limit_type->as_int()->_hi : limit_type->as_int()->_lo;
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
jlong trip_count = (limit_con - init_con + stride_m) / stride_con;
// The loop body is always executed at least once even if init >= limit (for stride_con > 0) or
@@ -445,7 +445,7 @@ Node* IdealLoopTree::reassociate_add_sub_cmp(Node* n1, int inv1_idx, int inv2_id
neg_inv2 = !neg_inv2;
}
- bool is_int = n2->bottom_type()->isa_int() != nullptr;
+ bool is_int = n2->bottom_type()->is_int();
Node* inv1_c = phase->get_ctrl(inv1);
Node* n_inv1;
if (neg_inv1) {
@@ -1283,7 +1283,7 @@ bool IdealLoopTree::policy_unroll(PhaseIdealLoop *phase) {
Node* phi = cl->phi();
if (phi != nullptr) {
assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi.");
- const TypeInt* iv_type = phase->_igvn.type(phi)->is_int();
+ const TypeInt* iv_type = phase->_igvn.type(phi)->as_int();
int next_stride = stride_con * 2; // stride after this unroll
if (next_stride > 0) {
if (iv_type->_lo > max_jint - next_stride || // overflow
@@ -1301,7 +1301,7 @@ bool IdealLoopTree::policy_unroll(PhaseIdealLoop *phase) {
// After unroll limit will be adjusted: new_limit = limit-stride.
// Bailout if adjustment overflow.
- const TypeInt* limit_type = phase->_igvn.type(limit_n)->is_int();
+ const TypeInt* limit_type = phase->_igvn.type(limit_n)->as_int();
if ((stride_con > 0 && ((min_jint + stride_con) > limit_type->_hi)) ||
(stride_con < 0 && ((max_jint + stride_con) < limit_type->_lo)))
return false; // overflow
@@ -1338,7 +1338,7 @@ bool IdealLoopTree::policy_unroll(PhaseIdealLoop *phase) {
case Op_VectorCastF2X:
case Op_PopCountVI:
case Op_PopCountVL: {
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
body_size += Matcher::vector_op_pre_select_sz_estimate(n->Opcode(), vt->element_basic_type(), vt->length());
} break;
case Op_StrComp:
@@ -2296,7 +2296,7 @@ void PhaseIdealLoop::do_unroll(IdealLoopTree* loop, Node_List& old_new, bo
assert(opaq != nullptr && opaq->in(1) == limit, "sanity");
// Verify that policy_unroll result is still valid.
- const TypeInt* limit_type = _igvn.type(limit)->is_int();
+ const TypeInt* limit_type = _igvn.type(limit)->as_int();
assert((stride_con > 0 && ((min_jint + stride_con) <= limit_type->_hi)) ||
(stride_con < 0 && ((max_jint + stride_con) >= limit_type->_lo)),
"sanity");
@@ -2542,8 +2542,8 @@ Node* PhaseIdealLoop::adjust_limit(bool is_positive_stride, Node* scale, Node* o
// holds true in the main-loop. Stride, scale, offset and limit are all loop
// invariant. Further, stride and scale are constants (offset and limit often are).
void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* offset, Node* low_limit, Node* upper_limit, Node* pre_ctrl, Node** pre_limit, Node** main_limit) {
- assert(_igvn.type(offset)->isa_long() != nullptr && _igvn.type(low_limit)->isa_long() != nullptr &&
- _igvn.type(upper_limit)->isa_long() != nullptr, "arguments should be long values");
+ assert(_igvn.type(offset)->is_long() && _igvn.type(low_limit)->is_long() &&
+ _igvn.type(upper_limit)->is_long(), "arguments should be long values");
// For a positive stride, we need to reduce the main-loop limit and
// increase the pre-loop limit. This is reversed for a negative stride.
@@ -2623,11 +2623,11 @@ void PhaseIdealLoop::add_constraint(jlong stride_con, jlong scale_con, Node* off
// See grammar specification in PhaseIdealLoop::is_scaled_iv_plus_offset().
bool PhaseIdealLoop::is_iv(Node* exp, Node* iv, BasicType bt) {
exp = exp->uncast();
- if (exp == iv && iv->bottom_type()->isa_integer(bt)) {
+ if (exp == iv && iv->bottom_type()->is_integer(bt)) {
return true;
}
- if (bt == T_LONG && iv->bottom_type()->isa_int() && exp->Opcode() == Op_ConvI2L && exp->in(1)->uncast() == iv) {
+ if (bt == T_LONG && iv->bottom_type()->is_int() && exp->Opcode() == Op_ConvI2L && exp->in(1)->uncast() == iv) {
return true;
}
return false;
@@ -2660,7 +2660,7 @@ bool PhaseIdealLoop::is_scaled_iv(Node* exp, Node* iv, BasicType bt, jlong* p_sc
}
return true;
}
- if (bt == T_LONG && iv->bottom_type()->isa_int() && exp->Opcode() == Op_ConvI2L) {
+ if (bt == T_LONG && iv->bottom_type()->is_int() && exp->Opcode() == Op_ConvI2L) {
// Risk for short scaling: avoid long range-check transformations, because
// the current implementation (transform_long_range_checks) does not protect
// against overflow.
@@ -3437,7 +3437,7 @@ void PhaseIdealLoop::do_range_check(IdealLoopTree* loop) {
_igvn.replace_input_of(main_bol, 1, main_cmp);
}
assert(main_limit == cl->limit() || get_ctrl(main_limit) == new_limit_ctrl, "wrong control for added limit");
- const TypeInt* orig_limit_t = _igvn.type(orig_limit)->is_int();
+ const TypeInt* orig_limit_t = _igvn.type(orig_limit)->as_int();
bool upward = cl->stride_con() > 0;
// The new loop limit is <= (for an upward loop) >= (for a downward loop) than the orig limit.
// The expression that computes the new limit may be too complicated and the computed type of the new limit
@@ -3677,8 +3677,8 @@ bool IdealLoopTree::do_remove_empty_loop(PhaseIdealLoop *phase) {
bool needs_guard = !cl->is_main_loop() && !cl->is_post_loop();
if (needs_guard) {
// Skip guard if values not overlap.
- const TypeInt* init_t = phase->_igvn.type(cl->init_trip())->is_int();
- const TypeInt* limit_t = phase->_igvn.type(cl->limit())->is_int();
+ const TypeInt* init_t = phase->_igvn.type(cl->init_trip())->as_int();
+ const TypeInt* limit_t = phase->_igvn.type(cl->limit())->as_int();
int stride_con = cl->stride_con();
if (stride_con > 0) {
needs_guard = (init_t->_hi >= limit_t->_lo);
@@ -4188,7 +4188,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
Node* value = n->in(MemNode::ValueIn);
if (!lpt->is_invariant(value)) {
msg = "variant store value";
- } else if (!_igvn.type(n->in(MemNode::Address))->isa_aryptr()) {
+ } else if (!_igvn.type(n->in(MemNode::Address))->is_aryptr()) {
msg = "not array address";
}
store = n;
@@ -4237,7 +4237,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
// Make sure there is an appropriate fill routine
BasicType t = msg == nullptr ?
- store->out_adr_type()->isa_aryptr()->elem()->array_element_basic_type() : T_VOID;
+ store->out_adr_type()->as_aryptr()->elem()->array_element_basic_type() : T_VOID;
const char* fill_name;
if (msg == nullptr &&
StubRoutines::select_fill_function(t, false, fill_name) == nullptr) {
@@ -4484,7 +4484,7 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
#endif
}
- BasicType t = store->out_adr_type()->isa_aryptr()->elem()->array_element_basic_type();
+ BasicType t = store->out_adr_type()->as_aryptr()->elem()->array_element_basic_type();
bool aligned = false;
if (offset != nullptr && head->init_trip()->is_Con()) {
int element_size = type2aelembytes(t);
diff --git a/src/hotspot/share/opto/loopnode.cpp b/src/hotspot/share/opto/loopnode.cpp
index 2869e1dde0f..b1e42a8e105 100644
--- a/src/hotspot/share/opto/loopnode.cpp
+++ b/src/hotspot/share/opto/loopnode.cpp
@@ -686,7 +686,7 @@ SafePointNode* PhaseIdealLoop::find_safepoint(Node* back_control, const Node* he
// code that relies on mm. Clear that extra state here.
if (mms.alias_idx() != Compile::AliasIdxBot &&
(loop != get_loop(ctrl_or_self(mms.memory())) ||
- (mms.adr_type()->isa_oop_ptr() && mms.adr_type()->is_known_instance()))) {
+ (mms.adr_type()->is_oopptr() && mms.adr_type()->is_known_instance()))) {
mm->set_memory_at(mms.alias_idx(), mem->as_MergeMem()->base_memory());
}
}
@@ -860,8 +860,8 @@ bool PhaseIdealLoop::create_loop_nest(IdealLoopTree* loop, Node_List& old_
// Take what we know about the number of iterations of the long counted loop into account when computing the limit of
// the inner loop.
Node* init = head->init_trip();
- const TypeInteger* lo = _igvn.type(init)->is_integer(bt);
- const TypeInteger* hi = _igvn.type(limit)->is_integer(bt);
+ const TypeInteger* lo = _igvn.type(init)->as_integer(bt);
+ const TypeInteger* hi = _igvn.type(limit)->as_integer(bt);
if (stride_con < 0) {
swap(lo, hi);
}
@@ -1282,7 +1282,7 @@ bool PhaseIdealLoop::try_make_short_running_loop(IdealLoopTree* loop, jint strid
// transformation happens by the time the counted loop is created (in a subsequent pass of loop opts), C2 knows
// enough about the loop's limit that it doesn't try to add loop limit check predicates.
const Predicates predicates(entry_control);
- const TypeLong* new_limit_t = new_limit->Value(&_igvn)->is_long();
+ const TypeLong* new_limit_t = new_limit->Value(&_igvn)->as_long();
new_limit = ConstraintCastNode::make_cast_for_basic_type(predicates.entry(), new_limit,
TypeLong::make(0, new_limit_t->_hi, new_limit_t->_widen),
ConstraintCastNode::DependencyType::NonFloatingNonNarrowing, bt);
@@ -3013,7 +3013,7 @@ bool CountedLoopConverter::stress_long_counted_loop() {
}
Node* in_clone = old_new[in->_idx];
if (in_clone == nullptr) {
- assert(igvn->type(in)->isa_int(), "");
+ assert(igvn->type(in)->is_int(), "");
in_clone = new ConvI2LNode(in);
igvn->register_new_node_with_optimizer(in_clone);
_phase->set_subtree_ctrl(in_clone, false);
@@ -3100,7 +3100,7 @@ bool CountedLoopConverter::is_counted_loop() {
// Check iv is not overflowing
Node* init_trip = _structure.phi()->in(LoopNode::EntryControl);
- const TypeInteger* init_t = igvn->type(init_trip)->is_integer(_iv_bt);
+ const TypeInteger* init_t = igvn->type(init_trip)->as_integer(_iv_bt);
if (is_iv_overflowing(init_t, stride_con, _structure.iv_incr().phi_incr(), _structure.exit_test().mask())) {
return false;
}
@@ -3298,7 +3298,7 @@ bool CountedLoopConverter::is_counted_loop() {
// there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii)
// again and can skip the predicate.
- const TypeInteger* limit_t = igvn->type(_structure.limit())->is_integer(_iv_bt);
+ const TypeInteger* limit_t = igvn->type(_structure.limit())->as_integer(_iv_bt);
StrideOverflowState stride_overflow_state = check_stride_overflow(_structure.final_limit_correction(), limit_t, _iv_bt);
Node* init_control = _head->in(LoopNode::EntryControl);
@@ -3435,7 +3435,7 @@ bool CountedLoopConverter::is_iv_overflowing(const TypeInteger* init_t, jlong st
bool CountedLoopConverter::LoopStructure::is_infinite_loop() const {
PhaseIterGVN& igvn = _phase->igvn();
- const TypeInteger* limit_t = igvn.type(limit())->is_integer(_iv_bt);
+ const TypeInteger* limit_t = igvn.type(limit())->as_integer(_iv_bt);
if (_truncated_increment.outer_trunc() != nullptr) {
// When there is a truncation, we must be sure that after the truncation
@@ -3455,7 +3455,7 @@ bool CountedLoopConverter::LoopStructure::is_infinite_loop() const {
// If the array is longer then this is an endless loop
// - No transformation can be done.
- const TypeInteger* incr_t = igvn.type(_iv_incr.incr())->is_integer(_iv_bt);
+ const TypeInteger* incr_t = igvn.type(_iv_incr.incr())->as_integer(_iv_bt);
if (limit_t->hi_as_long() > incr_t->hi_as_long()) {
// if the limit can have a higher value than the increment (before the phi)
return true;
@@ -3892,7 +3892,7 @@ void LoopNode::verify_strip_mined(int expect_skeleton) const {
Node* inner_out = sfpt->in(0);
CountedLoopEndNode* cle = inner_out->in(0)->as_CountedLoopEnd();
assert(cle == inner->loopexit_or_null(), "mismatch");
- bool has_skeleton = outer_le->in(1)->bottom_type()->singleton() && outer_le->in(1)->bottom_type()->is_int()->get_con() == 0;
+ bool has_skeleton = outer_le->in(1)->bottom_type()->singleton() && outer_le->in(1)->bottom_type()->as_int()->get_con() == 0;
if (has_skeleton) {
assert(expect_skeleton == 1 || expect_skeleton == -1, "unexpected skeleton node");
assert(outer->outcnt() == 2, "only control nodes");
@@ -3970,7 +3970,7 @@ void CountedLoopNode::dump_spec(outputStream *st) const {
//=============================================================================
jlong BaseCountedLoopEndNode::stride_con() const {
- return stride()->bottom_type()->is_integer(bt())->get_con_as_long(bt());
+ return stride()->bottom_type()->as_integer(bt())->get_con_as_long(bt());
}
@@ -3993,14 +3993,14 @@ const Type* LoopLimitNode::Value(PhaseGVN* phase) const {
if (limit_t == Type::TOP) return Type::TOP;
if (stride_t == Type::TOP) return Type::TOP;
- int stride_con = stride_t->is_int()->get_con();
+ int stride_con = stride_t->as_int()->get_con();
if (stride_con == 1)
return bottom_type(); // Identity
- if (init_t->is_int()->is_con() && limit_t->is_int()->is_con()) {
+ if (init_t->as_int()->is_con() && limit_t->as_int()->is_con()) {
// Use jlongs to avoid integer overflow.
- jlong init_con = init_t->is_int()->get_con();
- jlong limit_con = limit_t->is_int()->get_con();
+ jlong init_con = init_t->as_int()->get_con();
+ jlong limit_con = limit_t->as_int()->get_con();
int stride_m = stride_con - (stride_con > 0 ? 1 : -1);
jlong trip_count = (limit_con - init_con + stride_m)/stride_con;
jlong final_con = init_con + stride_con*trip_count;
@@ -4032,7 +4032,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
phase->type(in(Stride)) == Type::TOP)
return nullptr; // Dead
- int stride_con = phase->type(in(Stride))->is_int()->get_con();
+ int stride_con = phase->type(in(Stride))->as_int()->get_con();
if (stride_con == 1)
return nullptr; // Identity
@@ -4043,8 +4043,8 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
return nullptr;
}
- const TypeInt* init_t = phase->type(in(Init) )->is_int();
- const TypeInt* limit_t = phase->type(in(Limit))->is_int();
+ const TypeInt* init_t = phase->type(in(Init) )->as_int();
+ const TypeInt* limit_t = phase->type(in(Limit))->as_int();
jlong stride_p;
jlong lim, ini;
julong max;
@@ -4108,7 +4108,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) {
//------------------------------Identity---------------------------------------
// If stride == 1 return limit node.
Node* LoopLimitNode::Identity(PhaseGVN* phase) {
- int stride_con = phase->type(in(Stride))->is_int()->get_con();
+ int stride_con = phase->type(in(Stride))->as_int()->get_con();
if (stride_con == 1 || stride_con == -1)
return in(Limit);
return this;
@@ -4139,7 +4139,7 @@ void CountedLoopConverter::TruncatedIncrement::build(Node* expr) {
n1->in(2)->is_Con()) {
// Unsigned truncation.
// Pattern: ((i+1) & mask)
- jint mask = n1->in(2)->bottom_type()->is_int()->get_con();
+ jint mask = n1->in(2)->bottom_type()->as_int()->get_con();
switch (mask) {
case 0x7fff: // Unsigned 15-bit truncation. For historical reasons.
t1 = n1;
@@ -4153,7 +4153,7 @@ void CountedLoopConverter::TruncatedIncrement::build(Node* expr) {
n1->in(1)->Opcode() == Op_LShiftI &&
n1->in(2) == n1->in(1)->in(2) &&
n1->in(2)->is_Con()) {
- jint shift = n1->in(2)->bottom_type()->is_int()->get_con();
+ jint shift = n1->in(2)->bottom_type()->as_int()->get_con();
// %%% This check should match any shift in [1..31].
if (shift == 16 || shift == 8) {
t1 = n1;
@@ -4552,7 +4552,7 @@ void OuterStripMinedLoopNode::adjust_strip_mined_loop(PhaseIterGVN* igvn) {
return;
}
jlong short_scaled_iters = LoopStripMiningIterShortLoop * ABS(stride);
- const TypeInt* inner_iv_t = igvn->type(inner_iv_phi)->is_int();
+ const TypeInt* inner_iv_t = igvn->type(inner_iv_phi)->as_int();
jlong iter_estimate = (jlong)inner_iv_t->_hi - (jlong)inner_iv_t->_lo;
assert(iter_estimate > 0, "broken");
if (iter_estimate <= short_scaled_iters) {
@@ -4830,7 +4830,7 @@ Node *OuterStripMinedLoopEndNode::Ideal(PhaseGVN *phase, bool can_reshape) {
// } while ( i < 10)
//
const TypeInt* CountedLoopConverter::filtered_type(Node* n, Node* n_ctrl) {
- assert(n && n->bottom_type()->is_int(), "must be int");
+ assert(n != nullptr && n->bottom_type()->is_int(), "must be int");
const TypeInt* filtered_t = nullptr;
if (!n->is_Phi()) {
assert(n_ctrl != nullptr || n_ctrl == _phase->C->top(), "valid control");
@@ -4850,7 +4850,7 @@ const TypeInt* CountedLoopConverter::filtered_type(Node* n, Node* n_ctrl) {
if (filtered_t == nullptr) {
filtered_t = val_t;
} else {
- filtered_t = filtered_t->meet(val_t)->is_int();
+ filtered_t = filtered_t->meet(val_t)->as_int();
}
} else {
// We found no constriant, so we have to assume that this path
@@ -4863,9 +4863,9 @@ const TypeInt* CountedLoopConverter::filtered_type(Node* n, Node* n_ctrl) {
// The filtered type may be worse than what we already know
// about n, so take the intersection.
- const TypeInt* n_t = _phase->igvn().type(n)->is_int();
+ const TypeInt* n_t = _phase->igvn().type(n)->as_int();
if (filtered_t != nullptr) {
- n_t = n_t->join(filtered_t)->is_int();
+ n_t = n_t->join(filtered_t)->as_int();
}
return n_t;
}
@@ -4877,7 +4877,7 @@ const TypeInt* CountedLoopConverter::filtered_type(Node* n, Node* n_ctrl) {
// as if we returned TypeInt::INT.
const TypeInt* CountedLoopConverter::filtered_type_from_dominators(Node* val, Node* use_ctrl) {
if (val->is_Con()) {
- return val->bottom_type()->is_int();
+ return val->bottom_type()->as_int();
}
uint if_limit = 10; // Max number of dominating if's visited
const TypeInt* rtn_t = nullptr;
@@ -4896,7 +4896,7 @@ const TypeInt* CountedLoopConverter::filtered_type_from_dominators(Node* val, No
rtn_t = if_t;
} else {
const Type* join_t = rtn_t->join(if_t);
- if (!join_t->isa_int()) {
+ if (!join_t->is_int()) {
// We may have encountered multiple if conditions, that have no
// overlap, and produce an empty/top type. Returning nullptr
// is conservative, it means we do not constrain the type, which
@@ -4904,7 +4904,7 @@ const TypeInt* CountedLoopConverter::filtered_type_from_dominators(Node* val, No
assert(join_t->empty(), "top");
return nullptr;
}
- rtn_t = join_t->is_int();
+ rtn_t = join_t->as_int();
}
}
}
@@ -8176,8 +8176,8 @@ void PhaseIdealLoop::build_loop_late_post_work(Node *n, bool pinned) {
}
}
// Don't extend live ranges of raw oops
- if (least != early && n->is_ConstraintCast() && n->in(1)->bottom_type()->isa_rawptr() &&
- !n->bottom_type()->isa_rawptr()) {
+ if (least != early && n->is_ConstraintCast() && n->in(1)->bottom_type()->is_rawptr() &&
+ !n->bottom_type()->is_rawptr()) {
least = early;
}
diff --git a/src/hotspot/share/opto/loopopts.cpp b/src/hotspot/share/opto/loopopts.cpp
index 3ec8e6f26e5..0116b2be67d 100644
--- a/src/hotspot/share/opto/loopopts.cpp
+++ b/src/hotspot/share/opto/loopopts.cpp
@@ -1886,8 +1886,8 @@ bool PhaseIdealLoop::safe_for_if_replacement(const Node* dom) const {
// computation per usage to allow it to sink out of the loop.
void PhaseIdealLoop::try_sink_out_of_loop(Node* n) {
bool is_raw_to_oop_cast = n->is_ConstraintCast() &&
- n->in(1)->bottom_type()->isa_rawptr() &&
- !n->bottom_type()->isa_rawptr();
+ n->in(1)->bottom_type()->is_rawptr() &&
+ !n->bottom_type()->is_rawptr();
if (has_ctrl(n) &&
!n->is_Phi() &&
@@ -3072,7 +3072,7 @@ int PhaseIdealLoop::stride_of_possible_iv(Node* iff) {
}
}
if (add2 != nullptr) {
- const TypeInt* add2t = _igvn.type(add2)->is_int();
+ const TypeInt* add2t = _igvn.type(add2)->as_int();
if (add2t->is_con()) {
return add2t->get_con();
}
@@ -3380,7 +3380,7 @@ IfNode* PhaseIdealLoop::insert_cmpi_loop_exit(IfNode* if_cmpu, IdealLoopTree* lo
// -3 >=u -2
// is false.
Node* limit = cmpu->in(2);
- const TypeInt* type_limit = _igvn.type(limit)->is_int();
+ const TypeInt* type_limit = _igvn.type(limit)->as_int();
if (type_limit->_lo < 0) {
return nullptr;
}
diff --git a/src/hotspot/share/opto/machnode.cpp b/src/hotspot/share/opto/machnode.cpp
index e4fc97f33d3..550650da97b 100644
--- a/src/hotspot/share/opto/machnode.cpp
+++ b/src/hotspot/share/opto/machnode.cpp
@@ -296,8 +296,8 @@ const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_ty
// See if it adds up to a base + offset.
if (index != nullptr) {
const Type* t_index = index->bottom_type();
- if (t_index->isa_narrowoop() || t_index->isa_narrowklass()) { // EncodeN, LoadN, LoadConN, LoadNKlass,
- // EncodeNKlass, LoadConNklass.
+ if (t_index->is_narrowoop() || t_index->is_narrowklass()) { // EncodeN, LoadN, LoadConN, LoadNKlass,
+ // EncodeNKlass, LoadConNklass.
// Memory references through narrow oops have a
// funny base so grab the type from the index:
// [R12 + narrow_oop_reg<<3 + offset]
@@ -327,8 +327,8 @@ const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_ty
if (t_disp != nullptr) {
offset = Type::OffsetBot;
const Type* t_base = base->bottom_type();
- if (t_base->isa_intptr_t()) {
- const TypeX *t_offset = t_base->is_intptr_t();
+ if (t_base->is_intptr_t()) {
+ const TypeX* t_offset = t_base->as_intptr_t();
if( t_offset->is_con() ) {
offset = t_offset->get_con();
}
@@ -430,7 +430,7 @@ const TypePtr* MachNode::compute_adr_type_from_inputs() const {
#ifdef ASSERT
if (base != nullptr && base->is_Mach() && base->as_Mach()->ideal_Opcode() == Op_VerifyVectorAlignment) {
// For VerifyVectorAlignment we just pass the type through
- return base->bottom_type()->is_ptr();
+ return base->bottom_type()->as_ptr();
}
#endif
@@ -457,16 +457,16 @@ const TypePtr* MachNode::compute_adr_type_from_inputs() const {
if (base == NodeSentinel) return TypePtr::BOTTOM;
const Type* t = base->bottom_type();
- if (t->isa_narrowoop() && CompressedOops::shift() == 0) {
+ if (t->is_narrowoop() && CompressedOops::shift() == 0) {
// 32-bit unscaled narrow oop can be the base of any address expression
t = t->make_ptr();
}
- if (t->isa_narrowklass() && CompressedKlassPointers::shift() == 0) {
+ if (t->is_narrowklass() && CompressedKlassPointers::shift() == 0) {
// 32-bit unscaled narrow oop can be the base of any address expression
t = t->make_ptr();
}
- if (t->isa_intptr_t() &&
+ if (t->is_intptr_t() &&
#if !defined(AARCH64) && !defined(RISCV)
// AArch64 and RISC-V support the addressing mode:
// [base, 0], in which [base] is converted from a long value
@@ -490,7 +490,7 @@ const TypePtr* MachNode::compute_adr_type_from_inputs() const {
}
assert(tp->base() != Type::AnyPtr, "not a bare pointer");
- if (tp->isa_aryptr()) {
+ if (tp->is_aryptr()) {
// In the case of a flat value type array, each field has its
// own slice so we need to extract the field being accessed from
// the address computation
@@ -500,10 +500,10 @@ const TypePtr* MachNode::compute_adr_type_from_inputs() const {
const MachOper* oper = memory_inputs(base, index);
if (oper != (MachOper*)-1) {
offset = oper->constant_disp();
- return tp->is_aryptr()->add_field_offset_and_offset(offset)->add_offset(Type::OffsetBot);
+ return tp->as_aryptr()->add_field_offset_and_offset(offset)->add_offset(Type::OffsetBot);
}
}
- return tp->is_aryptr()->add_field_offset_and_offset(offset);
+ return tp->as_aryptr()->add_field_offset_and_offset(offset);
}
return tp->add_offset(offset);
@@ -725,7 +725,7 @@ const Type *MachProjNode::bottom_type() const {
// Try the normal mechanism first
const Type *t = in(0)->bottom_type();
if( t->base() == Type::Tuple ) {
- const TypeTuple *tt = t->is_tuple();
+ const TypeTuple* tt = t->as_tuple();
if (_con < tt->cnt())
return tt->field_at(_con);
}
@@ -903,7 +903,7 @@ bool MachCallNode::return_value_is_used() const {
bool MachCallNode::returns_pointer() const {
const TypeTuple *r = tf()->range_sig();
return (r->cnt() > TypeFunc::Parms &&
- r->field_at(TypeFunc::Parms)->isa_ptr());
+ r->field_at(TypeFunc::Parms)->is_ptr());
}
bool MachCallNode::returns_scalarized() const {
diff --git a/src/hotspot/share/opto/machnode.hpp b/src/hotspot/share/opto/machnode.hpp
index 4414b8c8a9a..4b10a4a39af 100644
--- a/src/hotspot/share/opto/machnode.hpp
+++ b/src/hotspot/share/opto/machnode.hpp
@@ -355,8 +355,8 @@ class MachNode : public Node {
const Type* res = _opnds[0]->type();
// The type system around pointers is complex, do not rely on operand type then
assert(res != nullptr, "must be not null");
- assert(is_MachTemp() || res->isa_ptr() == nullptr, "must not be a pointer");
- assert(is_MachTemp() || res->isa_narrowoop() == nullptr, "must not be a narrow oop");
+ assert(is_MachTemp() || !res->is_ptr(), "must not be a pointer");
+ assert(is_MachTemp() || !res->is_narrowoop(), "must not be a narrow oop");
return res;
}
diff --git a/src/hotspot/share/opto/macro.cpp b/src/hotspot/share/opto/macro.cpp
index 3be18a8ace4..191ec7637c6 100644
--- a/src/hotspot/share/opto/macro.cpp
+++ b/src/hotspot/share/opto/macro.cpp
@@ -129,7 +129,7 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
Node *orig_mem = mem;
Node *alloc_mem = alloc->as_Allocate()->proj_out_or_null(TypeFunc::Memory, /*io_use:*/false);
assert(alloc_mem != nullptr, "Allocation without a memory projection.");
- const TypeOopPtr *tinst = phase->C->get_adr_type(alias_idx)->isa_oopptr();
+ const TypeOopPtr* tinst = phase->C->get_adr_type(alias_idx)->as_oopptr();
while (true) {
if (mem == alloc_mem || mem == start_mem ) {
return mem; // hit one of our sentinels
@@ -172,9 +172,9 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
const TypePtr* atype = mem->as_Store()->out_adr_type();
int adr_idx = phase->C->get_alias_index(atype);
if (adr_idx == alias_idx) {
- assert(atype->isa_oopptr(), "address type must be oopptr");
+ assert(atype->is_oopptr(), "address type must be oopptr");
int adr_offset = atype->flat_offset();
- uint adr_iid = atype->is_oopptr()->instance_id();
+ uint adr_iid = atype->as_oopptr()->instance_id();
// Array elements references have the same alias_idx
// but different offset and different instance_id.
if (adr_offset == offset && adr_iid == alloc->_idx) {
@@ -210,7 +210,7 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
mem->Opcode() == Op_StrCompressedCopy, "sanity");
adr = mem->in(3); // Destination array
}
- const TypePtr* atype = adr->bottom_type()->is_ptr();
+ const TypePtr* atype = adr->bottom_type()->as_ptr();
int adr_idx = phase->C->get_alias_index(atype);
if (adr_idx == alias_idx) {
DEBUG_ONLY(mem->dump();)
@@ -220,7 +220,7 @@ static Node *scan_mem_chain(Node *mem, int alias_idx, int offset, Node *start_me
mem = mem->in(MemNode::Memory);
} else if (mem->Opcode() == Op_StrInflatedCopy) {
Node* adr = mem->in(3); // Destination array
- const TypePtr* atype = adr->bottom_type()->is_ptr();
+ const TypePtr* atype = adr->bottom_type()->as_ptr();
int adr_idx = phase->C->get_alias_index(atype);
if (adr_idx == alias_idx) {
DEBUG_ONLY(mem->dump();)
@@ -298,9 +298,9 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
if (ac->is_clonebasic()) {
assert(ac->in(ArrayCopyNode::Src) != ac->in(ArrayCopyNode::Dest), "clone source equals destination");
adr = _igvn.transform(AddPNode::make_with_base(base, _igvn.MakeConX(offset)));
- adr_type = _igvn.type(base)->is_ptr();
- if (adr_type->isa_aryptr()) {
- adr_type = adr_type->is_aryptr()->add_field_offset_and_offset(offset);
+ adr_type = _igvn.type(base)->as_ptr();
+ if (adr_type->is_aryptr()) {
+ adr_type = adr_type->as_aryptr()->add_field_offset_and_offset(offset);
} else {
adr_type = adr_type->add_offset(offset);
}
@@ -313,18 +313,18 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
uint shift = exact_log2(type2aelembytes(bt));
Node* src_pos = ac->in(ArrayCopyNode::SrcPos);
Node* dest_pos = ac->in(ArrayCopyNode::DestPos);
- const TypeInt* src_pos_t = _igvn.type(src_pos)->is_int();
- const TypeInt* dest_pos_t = _igvn.type(dest_pos)->is_int();
+ const TypeInt* src_pos_t = _igvn.type(src_pos)->as_int();
+ const TypeInt* dest_pos_t = _igvn.type(dest_pos)->as_int();
- adr_type = _igvn.type(base)->is_aryptr();
+ adr_type = _igvn.type(base)->as_aryptr();
if (((const TypeAryPtr*)adr_type)->is_flat()) {
shift = ((const TypeAryPtr*)adr_type)->flat_log_elem_size();
}
if (src_pos_t->is_con() && dest_pos_t->is_con()) {
intptr_t off = ((src_pos_t->get_con() - dest_pos_t->get_con()) << shift) + offset;
adr = _igvn.transform(AddPNode::make_with_base(base, base, _igvn.MakeConX(off)));
- adr_type = _igvn.type(adr)->is_aryptr();
- assert(adr_type == _igvn.type(base)->is_aryptr()->add_field_offset_and_offset(off), "incorrect address type");
+ adr_type = _igvn.type(adr)->as_aryptr();
+ assert(adr_type == _igvn.type(base)->as_aryptr()->add_field_offset_and_offset(off), "incorrect address type");
if (ac->in(ArrayCopyNode::Src) == ac->in(ArrayCopyNode::Dest)) {
// Don't emit a new load from src if src == dst but try to get the value from memory instead
return value_from_mem(ac, ctl, ft, ftype, (const TypeAryPtr*)adr_type, alloc);
@@ -346,7 +346,7 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
// In the case of a flat value type array, each field has its
// own slice so we need to extract the field being accessed from
// the address computation
- adr_type = ((TypeAryPtr*)adr_type)->add_field_offset_and_offset(offset)->add_offset(Type::OffsetBot)->is_aryptr();
+ adr_type = ((TypeAryPtr*)adr_type)->add_field_offset_and_offset(offset)->add_offset(Type::OffsetBot)->as_aryptr();
adr = _igvn.transform(new CastPPNode(ctl, adr, adr_type));
}
}
@@ -366,7 +366,7 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
return make_arraycopy_load(ac, offset, ac->control(), ac->memory(), ft, ftype, alloc);
}
- if (ftype->isa_narrowoop()) {
+ if (ftype->is_narrowoop()) {
// PhaseMacroExpand::scalar_replacement adds DecodeN nodes
res = _igvn.transform(new EncodePNode(res, ftype));
}
@@ -531,7 +531,7 @@ Node* PhaseMacroExpand::value_from_alloc(BasicType ft, const TypeOopPtr* adr_t,
}
if (ft == T_NARROWOOP) {
- assert(init_value->bottom_type()->isa_ptr(), "must be a pointer");
+ assert(init_value->bottom_type()->is_ptr(), "must be a pointer");
init_value = transform_later(new EncodePNode(init_value, init_value->bottom_type()->make_narrowoop()));
}
@@ -722,7 +722,7 @@ Node* PhaseMacroExpand::value_type_from_mem(ciValueKlass* vk, const TypeAryPtr*
if (field_value == nullptr || force_scalarization_failure) {
report_failure(field_offset_in_element, field_value != nullptr);
return nullptr;
- } else if (ft->isa_narrowoop()) {
+ } else if (ft->is_narrowoop()) {
assert(UseCompressedOops, "unexpected narrow oop");
if (field_value->is_EncodeP()) {
field_value = field_value->in(1);
@@ -766,7 +766,7 @@ bool PhaseMacroExpand::can_eliminate_allocation(PhaseIterGVN* igvn, AllocateNode
} else if (!res_type->klass_is_exact()) {
NOT_PRODUCT(fail_eliminate = "Not an exact type.";)
can_eliminate = false;
- } else if (res_type->isa_aryptr()) {
+ } else if (res_type->is_aryptr()) {
int length = alloc->in(AllocateNode::ALength)->find_int_con(-1);
if (length < 0) {
NOT_PRODUCT(fail_eliminate = "Array's size is not constant";)
@@ -781,7 +781,7 @@ bool PhaseMacroExpand::can_eliminate_allocation(PhaseIterGVN* igvn, AllocateNode
Node* use = res->fast_out(j);
if (use->is_AddP()) {
- const TypePtr* addp_type = igvn->type(use)->is_ptr();
+ const TypePtr* addp_type = igvn->type(use)->as_ptr();
int offset = addp_type->offset();
if (offset == Type::OffsetTop || offset == Type::OffsetBot) {
@@ -812,7 +812,7 @@ bool PhaseMacroExpand::can_eliminate_allocation(PhaseIterGVN* igvn, AllocateNode
use->in(ArrayCopyNode::Src)->get_ptr_type()->is_flat() &&
!use->in(ArrayCopyNode::Src)
->get_ptr_type()
- ->isa_aryptr()
+ ->as_aryptr()
->elem()
->value_klass()
->is_naturally_atomic(
@@ -1012,7 +1012,7 @@ void PhaseMacroExpand::undo_previous_scalarizations(Node_List& sa
#endif
void PhaseMacroExpand::process_field_value_at_safepoint(const Type* field_type, Node* field_val, SafePointNode* sfpt, Unique_Node_List* value_worklist) {
- if (UseCompressedOops && field_type->isa_narrowoop()) {
+ if (UseCompressedOops && field_type->is_narrowoop()) {
// Enable "DecodeN(EncodeP(Allocate)) --> Allocate" transformation
// to be able scalar replace the allocation.
if (field_val->is_EncodeP()) {
@@ -1093,7 +1093,7 @@ bool PhaseMacroExpand::add_array_elems_to_safepoint(AllocateNode* alloc, const T
// 'offset_minus_header' refers to the offset of the payload of 'iklass' inside 'base' minus the
// payload offset of 'iklass'. If 'base' is of type 'iklass' then 'offset_minus_header' == 0.
bool PhaseMacroExpand::add_inst_fields_to_safepoint(ciInstanceKlass* iklass, AllocateNode* alloc, Node* base, int offset_minus_header, SafePointNode* sfpt, Unique_Node_List* value_worklist) {
- const TypeInstPtr* base_type = _igvn.type(base)->is_instptr();
+ const TypeInstPtr* base_type = _igvn.type(base)->as_instptr();
auto report_failure = [&](int offset, bool is_forced_failure) {
#ifndef PRODUCT
if (PrintEliminateAllocations) {
@@ -1160,7 +1160,7 @@ bool PhaseMacroExpand::add_inst_fields_to_safepoint(ciInstanceKlass* iklass, All
field_type = Type::get_const_basic_type(basic_elem_type);
}
- const TypeInstPtr* field_addr_type = base_type->add_offset(offset)->isa_instptr();
+ const TypeInstPtr* field_addr_type = base_type->add_offset(offset)->as_instptr();
Node* field_val = value_from_mem(sfpt, sfpt->control(), basic_elem_type, field_type, field_addr_type, alloc);
bool force_scalarization_failure = StressEliminateAllocations &&
(C->stress().random() % StressEliminateAllocationsMean == 0);
@@ -1194,9 +1194,9 @@ SafePointScalarObjectNode* PhaseMacroExpand::create_scalarized_object_descriptio
if (res != nullptr) { // Could be null when there are no users
res_type = _igvn.type(res)->isa_oopptr();
- if (res_type->isa_instptr()) {
+ if (res_type->is_instptr()) {
// find the fields of the class which will be needed for safepoint debug information
- iklass = res_type->is_instptr()->instance_klass();
+ iklass = res_type->as_instptr()->instance_klass();
nfields = iklass->nof_nonstatic_fields();
} else {
// find the array's elements which will be needed for safepoint debug information
@@ -1226,7 +1226,7 @@ SafePointScalarObjectNode* PhaseMacroExpand::create_scalarized_object_descriptio
bool success;
if (iklass == nullptr) {
- success = add_array_elems_to_safepoint(alloc, res_type->is_aryptr(), sfpt, value_worklist);
+ success = add_array_elems_to_safepoint(alloc, res_type->as_aryptr(), sfpt, value_worklist);
} else {
success = add_inst_fields_to_safepoint(iklass, alloc, res, 0, sfpt, value_worklist);
}
@@ -1387,7 +1387,7 @@ void PhaseMacroExpand::process_users_of_allocation(CallNode *alloc, bool value_t
_igvn.rehash_node_delayed(use);
use->as_ValueType()->set_oop(_igvn, _igvn.zerocon(T_OBJECT));
use->as_ValueType()->set_is_buffered(_igvn, false);
- const TypeOopPtr* toop = _igvn.type(use)->is_oopptr()->cast_to_instance_id(TypeOopPtr::InstanceBot);
+ const TypeOopPtr* toop = _igvn.type(use)->as_oopptr()->cast_to_instance_id(TypeOopPtr::InstanceBot);
_igvn.set_type(use, toop);
use->as_ValueType()->set_type(toop);
// Process users
@@ -1505,12 +1505,12 @@ bool PhaseMacroExpand::eliminate_allocate_node(AllocateNode *alloc) {
return false;
}
Node* klass = alloc->in(AllocateNode::KlassNode);
- const TypeKlassPtr* tklass = _igvn.type(klass)->is_klassptr();
+ const TypeKlassPtr* tklass = _igvn.type(klass)->as_klassptr();
// Attempt to eliminate value type buffer allocations
// regardless of usage and escape/replaceable status.
- bool value_type_alloc = tklass->isa_instklassptr() &&
- tklass->is_instklassptr()->instance_klass()->is_value_klass();
+ bool value_type_alloc = tklass->is_instklassptr() &&
+ tklass->as_instklassptr()->instance_klass()->is_value_klass();
if (!alloc->_is_non_escaping && !value_type_alloc) {
return false;
}
@@ -1518,8 +1518,8 @@ bool PhaseMacroExpand::eliminate_allocate_node(AllocateNode *alloc) {
// regardless scalar replaceable status.
Node* res = alloc->result_cast();
bool boxing_alloc = (res == nullptr) && C->eliminate_boxing() &&
- tklass->isa_instklassptr() &&
- tklass->is_instklassptr()->instance_klass()->is_box_klass();
+ tklass->is_instklassptr() &&
+ tklass->as_instklassptr()->instance_klass()->is_box_klass();
if (!alloc->_is_scalar_replaceable && !boxing_alloc && !value_type_alloc) {
return false;
}
@@ -1621,7 +1621,7 @@ bool PhaseMacroExpand::eliminate_boxing_node(CallStaticJavaNode* call) {
Node* PhaseMacroExpand::make_load_raw(Node* ctl, Node* mem, Node* base, int offset, const Type* value_type, BasicType bt) {
Node* adr = off_heap_plus_addr(base, offset);
- const TypePtr* adr_type = adr->bottom_type()->is_ptr();
+ const TypePtr* adr_type = adr->bottom_type()->as_ptr();
Node* value = LoadNode::make(_igvn, ctl, mem, adr, adr_type, value_type, bt, MemNode::unordered);
transform_later(value);
return value;
@@ -2196,8 +2196,8 @@ Node* PhaseMacroExpand::initialize_object(AllocateNode* alloc,
rawmem = make_store_raw(control, rawmem, object, arrayOopDesc::length_offset_in_bytes(), length, T_INT);
// conservatively small header size:
header_size = arrayOopDesc::base_offset_in_bytes(T_BYTE);
- if (_igvn.type(klass_node)->isa_aryklassptr()) { // we know the exact header size in most cases:
- BasicType elem = _igvn.type(klass_node)->is_klassptr()->as_exact_instance_type()->isa_aryptr()->elem()->array_element_basic_type();
+ if (_igvn.type(klass_node)->is_aryklassptr()) { // we know the exact header size in most cases:
+ BasicType elem = _igvn.type(klass_node)->as_klassptr()->as_exact_instance_type()->as_aryptr()->elem()->array_element_basic_type();
if (is_reference_type(elem, true)) {
elem = T_OBJECT;
}
@@ -2411,7 +2411,7 @@ void PhaseMacroExpand::expand_allocate_array(AllocateArrayNode *alloc) {
const TypeFunc* slow_call_type;
address slow_call_address; // Address of slow call
if (init != nullptr && init->is_complete_with_arraycopy() &&
- ary_klass_t && ary_klass_t->elem()->isa_klassptr() == nullptr) {
+ ary_klass_t && !ary_klass_t->elem()->is_klassptr()) {
// Don't zero type array during slow allocation in VM since
// it will be initialized later by arraycopy in compiled code.
slow_call_address = OptoRuntime::new_array_nozero_Java();
@@ -3028,7 +3028,7 @@ void PhaseMacroExpand::expand_subtypecheck_node(SubTypeCheckNode *check) {
Node* ctrl = iff->in(0);
Node* subklass = nullptr;
- if (_igvn.type(obj_or_subklass)->isa_klassptr()) {
+ if (_igvn.type(obj_or_subklass)->is_klassptr()) {
subklass = obj_or_subklass;
} else {
Node* k_adr = basic_plus_adr(obj_or_subklass, oopDesc::klass_offset_in_bytes());
@@ -3065,7 +3065,7 @@ void PhaseMacroExpand::expand_subtypecheck_node(SubTypeCheckNode *check) {
// }
void PhaseMacroExpand::expand_flatarraycheck_node(FlatArrayCheckNode* check) {
assert(UseArrayFlattening, "Should not be called if flat arrays are not enabled");
- bool use_mark_word = _igvn.type(check->in(FlatArrayCheckNode::ArrayOrKlass))->isa_oopptr() != nullptr;
+ bool use_mark_word = _igvn.type(check->in(FlatArrayCheckNode::ArrayOrKlass))->is_oopptr();
Unique_Node_List outputs;
for (DUIterator_Fast imax, i = check->fast_outs(imax); i < imax; i++) {
@@ -3090,7 +3090,7 @@ void PhaseMacroExpand::expand_flatarraycheck_node(FlatArrayCheckNode* check) {
assert(t != nullptr, "Mixing array and klass inputs");
assert(!t->is_flat() && !t->is_not_flat(), "Should have been optimized out");
Node* mark_adr = basic_plus_adr(ary, oopDesc::mark_offset_in_bytes());
- Node* mark_load = _igvn.transform(LoadNode::make(_igvn, nullptr, mem, mark_adr, mark_adr->bottom_type()->is_ptr(), TypeX_X, TypeX_X->basic_type(), MemNode::unordered));
+ Node* mark_load = _igvn.transform(LoadNode::make(_igvn, nullptr, mem, mark_adr, mark_adr->bottom_type()->as_ptr(), TypeX_X, TypeX_X->basic_type(), MemNode::unordered));
mark = _igvn.transform(new OrXNode(mark, mark_load));
}
assert(!mark->is_Con(), "Should have been optimized out");
@@ -3122,17 +3122,17 @@ void PhaseMacroExpand::expand_flatarraycheck_node(FlatArrayCheckNode* check) {
for (uint i = FlatArrayCheckNode::ArrayOrKlass; i < check->req(); ++i) {
Node* array_or_klass = check->in(i);
Node* klass = nullptr;
- const TypePtr* t = _igvn.type(array_or_klass)->is_ptr();
+ const TypePtr* t = _igvn.type(array_or_klass)->as_ptr();
assert(!t->is_flat() && !t->is_not_flat(), "Should have been optimized out");
- if (t->isa_oopptr() != nullptr) {
+ if (t->is_oopptr()) {
Node* klass_adr = basic_plus_adr(array_or_klass, oopDesc::klass_offset_in_bytes());
klass = transform_later(LoadKlassNode::make(_igvn, C->immutable_memory(), klass_adr, TypeInstPtr::KLASS, TypeInstKlassPtr::OBJECT));
} else {
- assert(t->isa_klassptr(), "Unexpected input type");
+ assert(t->is_klassptr(), "Unexpected input type");
klass = array_or_klass;
}
Node* lh_addr = basic_plus_adr(top(), klass, in_bytes(Klass::layout_helper_offset()));
- Node* lh_val = _igvn.transform(LoadNode::make(_igvn, nullptr, C->immutable_memory(), lh_addr, lh_addr->bottom_type()->is_ptr(), TypeInt::INT, T_INT, MemNode::unordered));
+ Node* lh_val = _igvn.transform(LoadNode::make(_igvn, nullptr, C->immutable_memory(), lh_addr, lh_addr->bottom_type()->as_ptr(), TypeInt::INT, T_INT, MemNode::unordered));
lhs = _igvn.transform(new OrINode(lhs, lh_val));
}
Node* masked = transform_later(new AndINode(lhs, intcon(Klass::_lh_array_tag_flat_value_bit_inplace)));
diff --git a/src/hotspot/share/opto/macroArrayCopy.cpp b/src/hotspot/share/opto/macroArrayCopy.cpp
index 72cc6bccc80..c0820fe22ff 100644
--- a/src/hotspot/share/opto/macroArrayCopy.cpp
+++ b/src/hotspot/share/opto/macroArrayCopy.cpp
@@ -60,7 +60,7 @@ void PhaseMacroExpand::insert_mem_bar(Node** ctrl, Node** mem, int opcode, int a
Node* PhaseMacroExpand::array_element_address(Node* ary, Node* idx, BasicType elembt, bool raw_base) {
uint shift = exact_log2(type2aelembytes(elembt));
const TypeAryPtr* array_type = _igvn.type(ary)->isa_aryptr();
- if (array_type != nullptr && array_type->is_aryptr()->is_flat()) {
+ if (array_type != nullptr && array_type->is_flat()) {
// Use T_FLAT_ELEMENT to get proper alignment with COH when fetching the array element address.
elembt = T_FLAT_ELEMENT;
}
@@ -875,7 +875,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode*
// insert a wide membar now that it's being expanded: a load that uses the input memory state of the ArrayCopy
// could then become anti dependent on the membar when it was not anti dependent on the ArrayCopy leading to a
// broken graph.
- mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr());
+ mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->as_ptr());
}
insert_mem_bar(ctrl, &out_mem, Op_MemBarCPUOrder, mem_bar_alias_idx);
}
@@ -891,7 +891,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode*
_igvn.replace_node(_callprojs->fallthrough_catchproj, *ctrl);
#ifdef ASSERT
- const TypeOopPtr* dest_t = _igvn.type(orig_dest)->is_oopptr();
+ const TypeOopPtr* dest_t = _igvn.type(orig_dest)->as_oopptr();
if (dest_t->is_known_instance()) {
ArrayCopyNode* ac = nullptr;
assert(ArrayCopyNode::may_modify(dest_t, (*ctrl)->in(0)->as_MemBar(), &_igvn, ac), "dependency on arraycopy lost");
@@ -1020,7 +1020,7 @@ void PhaseMacroExpand::generate_clear_array(Node* ctrl, MergeMemNode* merge_mem,
assert(raw_val == nullptr, "val may not be null");
mem = StoreNode::make(_igvn, ctrl, mem, p1, adr_type, intcon(0), T_INT, MemNode::unordered);
} else {
- assert(_igvn.type(val)->isa_narrowoop(), "should be narrow oop");
+ assert(_igvn.type(val)->is_narrowoop(), "should be narrow oop");
mem = new StoreNNode(ctrl, mem, p1, adr_type, val, MemNode::unordered);
}
mem = transform_later(mem);
@@ -1072,8 +1072,8 @@ bool PhaseMacroExpand::generate_block_arraycopy(Node** ctrl, MergeMemNode** mem,
((src_off ^ dest_off) & (BytesPerLong-1)) == 0) {
Node* sptr = basic_plus_adr(src, src_off);
Node* dptr = basic_plus_adr(dest, dest_off, raw_base);
- const TypePtr* s_adr_type = _igvn.type(sptr)->is_ptr();
- assert(s_adr_type->isa_aryptr(), "impossible slice");
+ const TypePtr* s_adr_type = _igvn.type(sptr)->as_ptr();
+ assert(s_adr_type->is_aryptr(), "impossible slice");
uint s_alias_idx = C->get_alias_index(s_adr_type);
uint d_alias_idx = C->get_alias_index(adr_type);
bool is_mismatched = (basic_elem_type != T_INT);
@@ -1193,7 +1193,7 @@ Node* PhaseMacroExpand::generate_checkcast_arraycopy(Node** ctrl, MergeMemNode**
// super_check_offset, for the desired klass.
int sco_offset = in_bytes(Klass::super_check_offset_offset());
Node* p3 = off_heap_plus_addr(dest_elem_klass, sco_offset);
- Node* n3 = new LoadINode(nullptr, *mem /*memory(p3)*/, p3, _igvn.type(p3)->is_ptr(), TypeInt::INT, MemNode::unordered);
+ Node* n3 = new LoadINode(nullptr, *mem /*memory(p3)*/, p3, _igvn.type(p3)->as_ptr(), TypeInt::INT, MemNode::unordered);
Node* check_offset = ConvI2X(transform_later(n3));
Node* check_value = dest_elem_klass;
@@ -1302,7 +1302,7 @@ const TypePtr* PhaseMacroExpand::adjust_for_flat_array(const TypeAryPtr* top_des
Node*& dest_length) {
assert(UseArrayFlattening, "Should not be called if flat arrays are not enabled");
#ifdef ASSERT
- assert(top_dest->elem()->make_ptr()->is_instptr()->is_valueklassptr(), "must be concrete value klass");
+ assert(top_dest->elem()->make_ptr()->as_instptr()->is_valueklassptr(), "must be concrete value klass");
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
bool needs_barriers = top_dest->elem()->value_klass()->contains_oops() &&
bs->array_copy_requires_gc_barriers(dest_length != nullptr, T_OBJECT, false, false, BarrierSetC2::Optimization);
@@ -1400,14 +1400,14 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
// on all slices to prevent writes into the source from floating below the arraycopy.
int mem_bar_alias_idx = Compile::AliasIdxBot;
if (ac->_dest_type != TypeOopPtr::BOTTOM) {
- mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr());
+ mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->as_ptr());
}
insert_mem_bar(&ctrl, &mem, Op_MemBarCPUOrder, mem_bar_alias_idx);
adr_type = adjust_for_flat_array(top_dest, src_offset, dest_offset, length, dest_elem, dest_length);
} else {
- adr_type = dest_type->is_oopptr()->add_offset(Type::OffsetBot);
+ adr_type = dest_type->as_oopptr()->add_offset(Type::OffsetBot);
if (ac->_dest_type != TypeOopPtr::BOTTOM) {
- adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
+ adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->as_ptr();
}
}
merge_mem = MergeMemNode::make(mem);
@@ -1540,7 +1540,7 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
// on all slices to prevent writes into the source from floating below the arraycopy.
int mem_bar_alias_idx = Compile::AliasIdxBot;
if (ac->_dest_type != TypeOopPtr::BOTTOM) {
- mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr());
+ mem_bar_alias_idx = C->get_alias_index(ac->_dest_type->add_offset(Type::OffsetBot)->as_ptr());
}
insert_mem_bar(&ctrl, &mem, Op_MemBarCPUOrder, mem_bar_alias_idx);
}
@@ -1608,7 +1608,7 @@ void PhaseMacroExpand::expand_arraycopy_node(ArrayCopyNode *ac) {
if (flat_and_same_nullness) {
adr_type = adjust_for_flat_array(top_dest, src_offset, dest_offset, length, dest_elem, dest_length);
} else if (ac->_dest_type != TypeOopPtr::BOTTOM) {
- adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->is_ptr();
+ adr_type = ac->_dest_type->add_offset(Type::OffsetBot)->as_ptr();
} else {
adr_type = TypeAryPtr::get_array_body_type(dest_elem);
}
diff --git a/src/hotspot/share/opto/matcher.cpp b/src/hotspot/share/opto/matcher.cpp
index 463ae32e134..2f3d0a3a711 100644
--- a/src/hotspot/share/opto/matcher.cpp
+++ b/src/hotspot/share/opto/matcher.cpp
@@ -1239,8 +1239,8 @@ MachNode* Matcher::match_sfpt(SafePointNode* sfpt) {
for (uint i = 0; i < static_java_call->req(); i++) {
if (i == TypeFunc::Parms) {
// Remove the trap request input edge.
- assert(static_java_call->in(i)->bottom_type()->isa_int() &&
- static_java_call->in(i)->bottom_type()->is_int()->is_con(), "incorrect trap request input");
+ assert(static_java_call->in(i)->bottom_type()->is_int() &&
+ static_java_call->in(i)->bottom_type()->as_int()->is_con(), "incorrect trap request input");
} else {
mn->add_req(static_java_call->in(i));
}
@@ -1381,7 +1381,7 @@ MachNode* Matcher::match_sfpt(SafePointNode* sfpt) {
continue; // Avoid Halves
}
// Handle case where arguments are in vector registers.
- if(call->in(TypeFunc::Parms + i)->bottom_type()->isa_vect()) {
+ if (call->in(TypeFunc::Parms + i)->bottom_type()->is_vect()) {
OptoReg::Name reg_fst = OptoReg::as_OptoReg(first);
OptoReg::Name reg_snd = OptoReg::as_OptoReg(second);
assert (reg_fst <= reg_snd, "fst=%d snd=%d", reg_fst, reg_snd);
@@ -2561,7 +2561,7 @@ void Matcher::collect_null_checks( Node *proj, Node *orig_proj ) {
_null_check_tests.push(proj);
Node* val = cmp->in(1);
#ifdef _LP64
- if (val->bottom_type()->isa_narrowoop() &&
+ if (val->bottom_type()->is_narrowoop() &&
!Matcher::narrow_oop_use_complex_address()) {
//
// Look for DecodeN node which should be pinned to orig_proj.
@@ -2657,19 +2657,19 @@ const RegMask* Matcher::regmask_for_ideal_register(uint ideal_reg, Node* ret) {
Node* spill;
switch (ideal_reg) {
- case Op_RegN: spill = new LoadNNode(nullptr, mem, fp, atp, t->is_narrowoop(), mo); break;
- case Op_RegI: spill = new LoadINode(nullptr, mem, fp, atp, t->is_int(), mo); break;
- case Op_RegP: spill = new LoadPNode(nullptr, mem, fp, atp, t->is_ptr(), mo); break;
+ case Op_RegN: spill = new LoadNNode(nullptr, mem, fp, atp, t->as_narrowoop(), mo); break;
+ case Op_RegI: spill = new LoadINode(nullptr, mem, fp, atp, t->as_int(), mo); break;
+ case Op_RegP: spill = new LoadPNode(nullptr, mem, fp, atp, t->as_ptr(), mo); break;
case Op_RegF: spill = new LoadFNode(nullptr, mem, fp, atp, t, mo); break;
case Op_RegD: spill = new LoadDNode(nullptr, mem, fp, atp, t, mo); break;
- case Op_RegL: spill = new LoadLNode(nullptr, mem, fp, atp, t->is_long(), mo); break;
+ case Op_RegL: spill = new LoadLNode(nullptr, mem, fp, atp, t->as_long(), mo); break;
case Op_VecA: // fall-through
case Op_VecS: // fall-through
case Op_VecD: // fall-through
case Op_VecX: // fall-through
case Op_VecY: // fall-through
- case Op_VecZ: spill = new LoadVectorNode(nullptr, mem, fp, atp, t->is_vect()); break;
+ case Op_VecZ: spill = new LoadVectorNode(nullptr, mem, fp, atp, t->as_vect()); break;
case Op_RegVectMask: return Matcher::predicate_reg_mask();
default: ShouldNotReachHere();
@@ -2680,7 +2680,7 @@ const RegMask* Matcher::regmask_for_ideal_register(uint ideal_reg, Node* ret) {
return nullptr;
}
// Handle generic vector operand case
- if (Matcher::supports_generic_vector_operands && t->isa_vect()) {
+ if (Matcher::supports_generic_vector_operands && t->is_vect()) {
specialize_mach_node(mspill);
}
return &mspill->out_RegMask();
@@ -2728,7 +2728,7 @@ MachOper* Matcher::specialize_vector_operand(MachNode* m, uint opnd_idx) {
}
}
}
- assert(def->bottom_type()->isa_vect(), "not a vector");
+ assert(def->bottom_type()->is_vect(), "not a vector");
uint ideal_vreg = def->bottom_type()->ideal_reg();
return Matcher::pd_specialize_generic_vector_operand(m->_opnds[opnd_idx], ideal_vreg, false /*is_temp*/);
}
@@ -2772,36 +2772,36 @@ void Matcher::specialize_generic_vector_operands() {
}
uint Matcher::vector_length(const Node* n) {
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
return vt->length();
}
uint Matcher::vector_length(const MachNode* use, const MachOper* opnd) {
int def_idx = use->operand_index(opnd);
Node* def = use->in(def_idx);
- return def->bottom_type()->is_vect()->length();
+ return def->bottom_type()->as_vect()->length();
}
uint Matcher::vector_length_in_bytes(const Node* n) {
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
return vt->length_in_bytes();
}
uint Matcher::vector_length_in_bytes(const MachNode* use, const MachOper* opnd) {
uint def_idx = use->operand_index(opnd);
Node* def = use->in(def_idx);
- return def->bottom_type()->is_vect()->length_in_bytes();
+ return def->bottom_type()->as_vect()->length_in_bytes();
}
BasicType Matcher::vector_element_basic_type(const Node* n) {
- const TypeVect* vt = n->bottom_type()->is_vect();
+ const TypeVect* vt = n->bottom_type()->as_vect();
return vt->element_basic_type();
}
BasicType Matcher::vector_element_basic_type(const MachNode* use, const MachOper* opnd) {
int def_idx = use->operand_index(opnd);
Node* def = use->in(def_idx);
- return def->bottom_type()->is_vect()->element_basic_type();
+ return def->bottom_type()->as_vect()->element_basic_type();
}
bool Matcher::is_non_long_integral_vector(const Node* n) {
@@ -2963,8 +2963,8 @@ bool Matcher::branches_to_uncommon_trap(const Node *n) {
if (call &&
call->entry_point() == OptoRuntime::uncommon_trap_blob()->entry_point()) {
const Type* trtype = call->in(TypeFunc::Parms)->bottom_type();
- if (trtype->isa_int() && trtype->is_int()->is_con()) {
- jint tr_con = trtype->is_int()->get_con();
+ if (trtype->is_int() && trtype->as_int()->is_con()) {
+ jint tr_con = trtype->as_int()->get_con();
Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(tr_con);
Deoptimization::DeoptAction action = Deoptimization::trap_request_action(tr_con);
assert((int)reason < (int)BitsPerInt, "recode bit map");
diff --git a/src/hotspot/share/opto/memnode.cpp b/src/hotspot/share/opto/memnode.cpp
index 0f4259d3e5e..0770dae3a6e 100644
--- a/src/hotspot/share/opto/memnode.cpp
+++ b/src/hotspot/share/opto/memnode.cpp
@@ -309,8 +309,8 @@ Node* MemNode::optimize_simple_memory_chain(Node* mchain, const TypeOopPtr* t_oo
result = proj_in->in(TypeFunc::Memory);
} else if (is_strict_final_load) {
Node* klass = alloc->in(AllocateNode::KlassNode);
- const TypeKlassPtr* tklass = phase->type(klass)->is_klassptr();
- if (tklass->klass_is_exact() && !tklass->exact_klass()->is_subclass_of(t_oop->is_instptr()->instance_klass())) {
+ const TypeKlassPtr* tklass = phase->type(klass)->as_klassptr();
+ if (tklass->klass_is_exact() && !tklass->exact_klass()->is_subclass_of(t_oop->as_instptr()->instance_klass())) {
// Allocation of an unrelated type, must be another object
result = proj_in->in(TypeFunc::Memory);
} else if (base_local != nullptr && (base_local->is_Parm() || base_local->in(0) != alloc)) {
@@ -384,9 +384,9 @@ static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem, const T
bool consistent = adr_check == nullptr || adr_check->empty() ||
phase->C->must_alias(adr_check, alias_idx );
// Sometimes dead array references collapse to a[-1], a[-2], or a[-3]
- if( !consistent && adr_check != nullptr && !adr_check->empty() &&
- tp->isa_aryptr() && tp->offset() == Type::OffsetBot &&
- adr_check->isa_aryptr() && adr_check->offset() != Type::OffsetBot &&
+ if (!consistent && adr_check != nullptr && !adr_check->empty() &&
+ tp->is_aryptr() && tp->offset() == Type::OffsetBot &&
+ adr_check->is_aryptr() && adr_check->offset() != Type::OffsetBot &&
( adr_check->offset() == arrayOopDesc::length_offset_in_bytes() ||
adr_check->offset() == oopDesc::klass_offset_in_bytes() ||
adr_check->offset() == oopDesc::mark_offset_in_bytes() ) ) {
@@ -412,8 +412,8 @@ static Node *step_through_mergemem(PhaseGVN *phase, MergeMemNode *mmem, const T
const TypeOopPtr *toop = tp->isa_oopptr();
if (tp->base() != Type::AnyPtr &&
!(toop &&
- toop->isa_instptr() &&
- toop->is_instptr()->instance_klass()->is_java_lang_Object() &&
+ toop->is_instptr() &&
+ toop->as_instptr()->instance_klass()->is_java_lang_Object() &&
toop->offset() == Type::OffsetBot)) {
// IGVN _delay_transform may be set to true and if that is the case and mmem
// is already a registered node then the validation inside transform will
@@ -513,15 +513,15 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
// Weird access to null+offset, either is a dead unsafe access that cannot be proved to be so, or
// should be folded later
if (t_adr->base() == Type::AnyPtr) {
- assert(t_adr->is_ptr()->ptr() == TypePtr::Null, "must be null");
+ assert(t_adr->as_ptr()->ptr() == TypePtr::Null, "must be null");
return NodeSentinel; // caller will return null
}
// Do NOT remove or optimize the next lines: ensure a new alias index
// is allocated for an oop pointer type before Escape Analysis.
// Note: C++ will not remove it since the call has side effect.
- if (t_adr->isa_oopptr()) {
- int alias_idx = phase->C->get_alias_index(t_adr->is_ptr());
+ if (t_adr->is_oopptr()) {
+ int alias_idx = phase->C->get_alias_index(t_adr->as_ptr());
}
// Avoid independent memory operations
@@ -537,7 +537,7 @@ Node *MemNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
if (mem->is_MergeMem()) {
MergeMemNode* mmem = mem->as_MergeMem();
- const TypePtr *tp = t_adr->is_ptr();
+ const TypePtr* tp = t_adr->as_ptr();
mem = step_through_mergemem(phase, mmem, tp, in_adr_type(), tty);
}
@@ -683,7 +683,7 @@ bool MemNode::detect_ptr_independence(Node* p1, AllocateNode* a1,
// TypePtr::NULL_PTR, so we exclude that case.
const Type* p1_type = p1->bottom_type();
const Type* p2_type = p2->bottom_type();
- if (p1_type != p2_type && p1_type->isa_oopptr() && p2_type->isa_oopptr() &&
+ if (p1_type != p2_type && p1_type->is_oopptr() && p2_type->is_oopptr() &&
(!p1_type->maybe_null() || !p2_type->maybe_null()) &&
p1_type->join(p2_type)->empty()) {
return true;
@@ -731,7 +731,7 @@ Node* LoadNode::find_previous_arraycopy(PhaseValues* phase, Node* ld_alloc, Node
jlong header = arrayOopDesc::base_offset_in_bytes(ary_elem);
jlong elemsize = type2aelembytes(ary_elem);
- const TypeX* ld_offs_t = phase->type(ld_offs)->isa_intptr_t();
+ const TypeX* ld_offs_t = phase->type(ld_offs)->as_intptr_t();
const TypeInt* sizetype = ary_t->size();
if (ld_offs_t->_lo >= header && ld_offs_t->_hi < (sizetype->_lo * elemsize + header)) {
@@ -756,7 +756,7 @@ Node* LoadNode::find_previous_arraycopy(PhaseValues* phase, Node* ld_alloc, Node
Node* dest = ac->in(ArrayCopyNode::Dest);
if (dest == ld_base) {
- const TypeX* ld_offs_t = phase->type(ld_offs)->isa_intptr_t();
+ const TypeX* ld_offs_t = phase->type(ld_offs)->as_intptr_t();
assert(!ld_offs_t->empty(), "dead reference should be checked already");
// Take into account vector or unsafe access size
jlong ld_size_in_bytes = (jlong)memory_size();
@@ -876,7 +876,7 @@ const TypePtr* MemNode::calculate_adr_type(const Type* t, const TypePtr* cross_c
// The type of the address must be contained in the adr_type,
// disregarding "null"-ness.
// (We make an exception for TypeRawPtr::BOTTOM, which is a bit bucket.)
- const TypePtr* tp_notnull = tp->join(TypePtr::NOTNULL)->is_ptr();
+ const TypePtr* tp_notnull = tp->join(TypePtr::NOTNULL)->as_ptr();
assert(cross_check->meet(tp_notnull) == cross_check->remove_speculative(),
"real address must not escape from expected memory type");
}
@@ -1133,31 +1133,31 @@ bool LoadNode::is_immutable_value(Node* adr) {
Node* LoadNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, const Type* rt, BasicType bt, MemOrd mo,
ControlDependency control_dependency, bool require_atomic_access, bool unaligned, bool mismatched, bool unsafe, uint8_t barrier_data) {
Compile* C = gvn.C;
- assert(adr->is_top() || C->get_alias_index(gvn.type(adr)->is_ptr(), true) == C->get_alias_index(adr_type, true), "adr and adr_type must agree");
+ assert(adr->is_top() || C->get_alias_index(gvn.type(adr)->as_ptr(), true) == C->get_alias_index(adr_type, true), "adr and adr_type must agree");
// sanity check the alias category against the created node type
- assert(!(adr_type->isa_oopptr() &&
+ assert(!(adr_type->is_oopptr() &&
adr_type->offset() == oopDesc::klass_offset_in_bytes()),
"use LoadKlassNode instead");
- assert(!(adr_type->isa_aryptr() &&
+ assert(!(adr_type->is_aryptr() &&
adr_type->offset() == arrayOopDesc::length_offset_in_bytes()),
"use LoadRangeNode instead");
// Check control edge of raw loads
assert( ctl != nullptr || C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
// oop will be recorded in oop map if load crosses safepoint
- rt->isa_oopptr() || is_immutable_value(adr),
+ rt->is_oopptr() || is_immutable_value(adr),
"raw memory operations should have control edge");
LoadNode* load = nullptr;
switch (bt) {
- case T_BOOLEAN: load = new LoadUBNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_BYTE: load = new LoadBNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_INT: load = new LoadINode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_CHAR: load = new LoadUSNode(ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_SHORT: load = new LoadSNode (ctl, mem, adr, adr_type, rt->is_int(), mo, control_dependency); break;
- case T_LONG: load = new LoadLNode (ctl, mem, adr, adr_type, rt->is_long(), mo, control_dependency, require_atomic_access); break;
+ case T_BOOLEAN: load = new LoadUBNode(ctl, mem, adr, adr_type, rt->as_int(), mo, control_dependency); break;
+ case T_BYTE: load = new LoadBNode (ctl, mem, adr, adr_type, rt->as_int(), mo, control_dependency); break;
+ case T_INT: load = new LoadINode (ctl, mem, adr, adr_type, rt->as_int(), mo, control_dependency); break;
+ case T_CHAR: load = new LoadUSNode(ctl, mem, adr, adr_type, rt->as_int(), mo, control_dependency); break;
+ case T_SHORT: load = new LoadSNode (ctl, mem, adr, adr_type, rt->as_int(), mo, control_dependency); break;
+ case T_LONG: load = new LoadLNode (ctl, mem, adr, adr_type, rt->as_long(), mo, control_dependency, require_atomic_access); break;
case T_FLOAT: load = new LoadFNode (ctl, mem, adr, adr_type, rt, mo, control_dependency); break;
case T_DOUBLE: load = new LoadDNode (ctl, mem, adr, adr_type, rt, mo, control_dependency, require_atomic_access); break;
- case T_ADDRESS: load = new LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency); break;
+ case T_ADDRESS: load = new LoadPNode (ctl, mem, adr, adr_type, rt->as_ptr(), mo, control_dependency); break;
case T_ARRAY:
case T_OBJECT:
case T_NARROWOOP:
@@ -1168,7 +1168,7 @@ Node* LoadNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypeP
#endif
{
assert(!adr->bottom_type()->is_ptr_to_narrowoop() && !adr->bottom_type()->is_ptr_to_narrowklass(), "should have got back a narrow oop");
- load = new LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr(), mo, control_dependency);
+ load = new LoadPNode(ctl, mem, adr, adr_type, rt->as_ptr(), mo, control_dependency);
}
break;
default:
@@ -1204,8 +1204,8 @@ static bool skip_through_membars(Compile::AliasType* atp, const TypeInstPtr* tp,
if ((atp != nullptr) && (atp->index() >= Compile::AliasIdxRaw)) {
bool non_volatile = (atp->field() != nullptr) && !atp->field()->is_volatile();
bool is_stable_ary = FoldStableValues &&
- (tp != nullptr) && (tp->isa_aryptr() != nullptr) &&
- tp->isa_aryptr()->is_stable();
+ (tp != nullptr) && tp->is_aryptr() &&
+ tp->as_aryptr()->is_stable();
return (eliminate_boxing && non_volatile) || is_stable_ary || tp->is_valueklassptr();
}
@@ -1259,8 +1259,8 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const {
addp->set_req(AddPNode::Base, src);
addp->set_req(AddPNode::Address, src);
- const TypeAryPtr* ary_t = phase->type(in(MemNode::Address))->isa_aryptr();
- BasicType ary_elem = ary_t->isa_aryptr()->elem()->array_element_basic_type();
+ const TypeAryPtr* ary_t = phase->type(in(MemNode::Address))->as_aryptr();
+ BasicType ary_elem = ary_t->elem()->array_element_basic_type();
if (is_reference_type(ary_elem, true)) ary_elem = T_OBJECT;
uint shift = ary_t->is_flat() ? ary_t->flat_log_elem_size() : exact_log2(type2aelembytes(ary_elem));
@@ -1276,7 +1276,7 @@ Node* LoadNode::can_see_arraycopy_value(Node* st, PhaseGVN* phase) const {
}
addp = phase->transform(addp);
#ifdef ASSERT
- const TypePtr* adr_type = phase->type(addp)->is_ptr();
+ const TypePtr* adr_type = phase->type(addp)->as_ptr();
ld->_adr_type = adr_type;
#endif
ld->set_req(MemNode::Address, addp);
@@ -1497,7 +1497,7 @@ Node* MemNode::can_see_stored_value(Node* st, PhaseValues* phase) const {
}
} else {
// TODO: materialize all-zero vector constant
- assert(!isa_Load() || as_Load()->type()->isa_vect(), "");
+ assert(!is_Load() || as_Load()->type()->is_vect(), "");
}
}
@@ -1583,7 +1583,7 @@ Node* LoadNode::Identity(PhaseGVN* phase) {
return this;
}
- if (phase->type(value)->isa_ptr() && phase->type(this)->isa_narrowoop()) {
+ if (phase->type(value)->is_ptr() && phase->type(this)->is_narrowoop()) {
return this;
}
// (This works even when value is a Con, but LoadNode::Value
@@ -1602,7 +1602,7 @@ Node* LoadNode::Identity(PhaseGVN* phase) {
// instance's field to avoid infinite generation of phis in a loop.
Node *region = mem->in(0);
if (is_instance_field_load_with_local_phi(region)) {
- const TypeOopPtr *addr_t = in(Address)->bottom_type()->isa_oopptr();
+ const TypeOopPtr* addr_t = in(Address)->bottom_type()->as_oopptr();
int this_index = phase->C->get_alias_index(addr_t);
int this_offset = addr_t->offset();
int this_iid = addr_t->instance_id();
@@ -1647,7 +1647,7 @@ Node* LoadNode::convert_to_unsigned_load(PhaseGVN& gvn) {
return gvn.C->top();
}
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
- mem_t->is_ptr(), rt, bt, _mo, _control_dependency,
+ mem_t->as_ptr(), rt, bt, _mo, _control_dependency,
false /*require_atomic_access*/, is_unaligned_access(), is_mismatched_access());
}
@@ -1671,7 +1671,7 @@ Node* LoadNode::convert_to_signed_load(PhaseGVN& gvn) {
return gvn.C->top();
}
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
- mem_t->is_ptr(), rt, bt, _mo, _control_dependency,
+ mem_t->as_ptr(), rt, bt, _mo, _control_dependency,
false /*require_atomic_access*/, is_unaligned_access(), is_mismatched_access());
}
@@ -1679,8 +1679,7 @@ Node* LoadNode::convert_to_reinterpret_load(PhaseGVN& gvn, const Type* rt) {
BasicType bt = rt->basic_type();
assert(has_reinterpret_variant(rt), "no reinterpret variant: %s %s", Name(), type2name(bt));
bool is_mismatched = is_mismatched_access();
- const TypeRawPtr* raw_type = gvn.type(in(MemNode::Memory))->isa_rawptr();
- if (raw_type == nullptr) {
+ if (!gvn.type(in(MemNode::Memory))->is_rawptr()) {
is_mismatched = true; // conservatively match all non-raw accesses as mismatched
}
const int op = Opcode();
@@ -1691,7 +1690,7 @@ Node* LoadNode::convert_to_reinterpret_load(PhaseGVN& gvn, const Type* rt) {
return gvn.C->top();
}
return LoadNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
- mem_t->is_ptr(), rt, bt, _mo, _control_dependency,
+ mem_t->as_ptr(), rt, bt, _mo, _control_dependency,
require_atomic_access, is_unaligned_access(), is_mismatched);
}
@@ -1706,11 +1705,10 @@ Node* StoreNode::convert_to_reinterpret_store(PhaseGVN& gvn, Node* val, const Ty
return gvn.C->top();
}
StoreNode* st = StoreNode::make(gvn, in(MemNode::Control), in(MemNode::Memory), in(MemNode::Address),
- mem_t->is_ptr(), val, bt, _mo, require_atomic_access);
+ mem_t->as_ptr(), val, bt, _mo, require_atomic_access);
bool is_mismatched = is_mismatched_access();
- const TypeRawPtr* raw_type = gvn.type(in(MemNode::Memory))->isa_rawptr();
- if (raw_type == nullptr) {
+ if (!gvn.type(in(MemNode::Memory))->is_rawptr()) {
is_mismatched = true; // conservatively match all non-raw accesses as mismatched
}
if (is_mismatched) {
@@ -2146,13 +2144,13 @@ Node* LoadNode::Ideal_load_common(PhaseGVN* phase, bool can_reshape) {
Node* ctrl = in(MemNode::Control);
Node* address = in(MemNode::Address);
- bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) &&
- phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes());
+ bool addr_mark = (phase->type(address)->is_oopptr() || phase->type(address)->is_narrowoop()) &&
+ phase->type(address)->as_ptr()->offset() == oopDesc::mark_offset_in_bytes();
// Skip up past a SafePoint control. Cannot do this for Stores because
// pointer stores & cardmarks must stay on the same side of a SafePoint.
- if( ctrl != nullptr && ctrl->Opcode() == Op_SafePoint &&
- phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw &&
+ if (ctrl != nullptr && ctrl->Opcode() == Op_SafePoint &&
+ phase->C->get_alias_index(phase->type(address)->as_ptr()) != Compile::AliasIdxRaw &&
!addr_mark &&
(depends_only_on_test() || has_unknown_control_dependency())) {
ctrl = ctrl->in(0);
@@ -2163,7 +2161,7 @@ Node* LoadNode::Ideal_load_common(PhaseGVN* phase, bool can_reshape) {
intptr_t ignore = 0;
Node* base = AddPNode::Ideal_base_and_offset(address, phase, ignore);
if (base != nullptr &&
- phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw) {
+ phase->C->get_alias_index(phase->type(address)->as_ptr()) != Compile::AliasIdxRaw) {
// Check for useless control edge in some common special cases
if (in(MemNode::Control) != nullptr
// TODO 8350865 Can we re-enable this?
@@ -2212,7 +2210,7 @@ Node* LoadNode::Ideal_load_common(PhaseGVN* phase, bool can_reshape) {
// Is there a dominating load that loads the same value? Leave
// anything that is not a load of a field/array element (like
// barriers etc.) alone
- if (in(0) != nullptr && !in_adr_type()->isa_rawptr() && can_reshape) {
+ if (in(0) != nullptr && !in_adr_type()->is_rawptr() && can_reshape) {
for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) {
Node* use = mem->fast_out(i);
if (use != this &&
@@ -2280,10 +2278,10 @@ LoadNode::load_array_final_field(const TypeKlassPtr *tkls,
tkls->offset() != in_bytes(Klass::prototype_header_offset()),
"must not happen");
- if (tkls->isa_instklassptr() && tkls->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
+ if (tkls->is_instklassptr() && tkls->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
// The field is InstanceKlass::_access_flags. Return its (constant) value.
assert(Opcode() == Op_LoadUS, "must load an unsigned short from _access_flags");
- ciInstanceKlass* iklass = tkls->is_instklassptr()->instance_klass();
+ ciInstanceKlass* iklass = tkls->as_instklassptr()->instance_klass();
return TypeInt::make(iklass->access_flags());
}
if (tkls->offset() == in_bytes(Klass::misc_flags_offset())) {
@@ -2321,7 +2319,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// If load can see a previous constant store, use that.
Node* value = can_see_stored_value_through_membars(mem, phase);
if (value != nullptr && value->is_Con()) {
- if (phase->type(value)->isa_ptr() && _type->isa_narrowoop()) {
+ if (phase->type(value)->is_ptr() && _type->is_narrowoop()) {
return phase->type(value)->make_narrowoop();
} else {
assert(value->bottom_type()->higher_equal(_type), "sanity");
@@ -2329,8 +2327,8 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
}
}
// Try to guess loaded type from pointer type
- if (tp->isa_aryptr()) {
- const TypeAryPtr* ary = tp->is_aryptr();
+ if (tp->is_aryptr()) {
+ const TypeAryPtr* ary = tp->as_aryptr();
const Type* t = ary->elem();
// Determine whether the reference is beyond the header or not, by comparing
@@ -2372,8 +2370,8 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// In fact, that could have been the original type of p1, and p1 could have
// had an original form like p1:(AddP x x (LShiftL quux 3)), where the
// expression (LShiftL quux 3) independently optimized to the constant 8.
- if ((t->isa_int() == nullptr) && (t->isa_long() == nullptr)
- && (_type->isa_vect() == nullptr)
+ if (!t->is_int() && !t->is_long()
+ && !_type->is_vect()
&& ary->is_not_flat()
&& Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
// t might actually be lower than _type, if _type is a unique
@@ -2406,22 +2404,22 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
}
}
} else if (tp->base() == Type::InstPtr) {
- assert( off != Type::OffsetBot ||
- // arrays can be cast to Objects
- !tp->isa_instptr() ||
- tp->is_instptr()->instance_klass()->is_java_lang_Object() ||
- // Default value load
- tp->is_instptr()->instance_klass() == ciEnv::current()->Class_klass() ||
- // unsafe field access may not have a constant offset
- is_unsafe_access(),
- "Field accesses must be precise" );
+ assert(off != Type::OffsetBot ||
+ // arrays can be cast to Objects
+ !tp->is_instptr() ||
+ tp->as_instptr()->instance_klass()->is_java_lang_Object() ||
+ // Default value load
+ tp->as_instptr()->instance_klass() == ciEnv::current()->Class_klass() ||
+ // unsafe field access may not have a constant offset
+ is_unsafe_access(),
+ "Field accesses must be precise");
// For oop loads, we expect the _type to be precise.
- const TypeInstPtr* tinst = tp->is_instptr();
+ const TypeInstPtr* tinst = tp->as_instptr();
BasicType bt = value_basic_type();
// Fold the field map loads only when stable folding is enabled
- if (FoldStableValues && tinst != nullptr) {
+ if (FoldStableValues) {
ciInstanceKlass* ik = tinst->instance_klass();
int offset = tinst->offset();
if (ik == phase->C->env()->Class_klass()) {
@@ -2444,9 +2442,9 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
}
} else if (tp->base() == Type::KlassPtr || tp->base() == Type::InstKlassPtr || tp->base() == Type::AryKlassPtr) {
assert(off != Type::OffsetBot ||
- !tp->isa_instklassptr() ||
+ !tp->is_instklassptr() ||
// arrays can be cast to Objects
- tp->isa_instklassptr()->instance_klass()->is_java_lang_Object() ||
+ tp->as_instklassptr()->instance_klass()->is_java_lang_Object() ||
// also allow array-loading from the primary supertype
// array during subtype checks
Opcode() == Op_LoadKlass,
@@ -2489,10 +2487,10 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
}
if (klass->is_obj_array_klass() && tkls->offset() == in_bytes(ObjArrayKlass::next_refined_array_klass_offset())) {
// Fold loads from LibraryCallKit::load_default_refined_array_klass
- return tkls->is_aryklassptr()->cast_to_refined_array_klass_ptr();
+ return tkls->as_aryklassptr()->cast_to_refined_array_klass_ptr();
}
if (klass->is_array_klass() && tkls->offset() == in_bytes(ObjArrayKlass::properties_offset())) {
- assert(klass->is_type_array_klass() || tkls->is_aryklassptr()->is_refined_type(), "Must be a refined array klass pointer");
+ assert(klass->is_type_array_klass() || tkls->as_aryklassptr()->is_refined_type(), "Must be a refined array klass pointer");
return TypeInt::make((jint)klass->as_array_klass()->properties().value());
}
if (klass->is_flat_array_klass() && tkls->offset() == in_bytes(FlatArrayKlass::layout_kind_offset())) {
@@ -2527,13 +2525,13 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// than or equal to its super depth are correct.
if (tkls->is_loaded()) {
ciKlass* klass = nullptr;
- if (tkls->isa_instklassptr()) {
- klass = tkls->is_instklassptr()->instance_klass();
+ if (tkls->is_instklassptr()) {
+ klass = tkls->as_instklassptr()->instance_klass();
} else {
int dims;
- const Type* inner = tkls->is_aryklassptr()->base_element_type(dims);
- if (inner->isa_instklassptr()) {
- klass = inner->is_instklassptr()->instance_klass();
+ const Type* inner = tkls->as_aryklassptr()->base_element_type(dims);
+ if (inner->is_instklassptr()) {
+ klass = inner->as_instklassptr()->instance_klass();
klass = ciObjArrayKlass::make(klass, dims);
}
}
@@ -2556,8 +2554,8 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// we can give the layout_helper a positive interval type.
// This will help short-circuit some reflective code.
if (tkls->offset() == in_bytes(Klass::layout_helper_offset()) &&
- tkls->isa_instklassptr() && // not directly typed as an array
- !tkls->is_instklassptr()->might_be_an_array() // not the supertype of all T[] (java.lang.Object) or has an interface that is not Serializable or Cloneable
+ tkls->is_instklassptr() && // not directly typed as an array
+ !tkls->as_instklassptr()->might_be_an_array() // not the supertype of all T[] (java.lang.Object) or has an interface that is not Serializable or Cloneable
) {
assert(Opcode() == Op_LoadI, "must load an int from _layout_helper");
jint min_size = Klass::instance_layout_helper(oopDesc::header_size(), false);
@@ -2575,7 +2573,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// 3. Load has no matching store, i.e. the input is the initial memory state
const TypeOopPtr* tinst = tp->isa_oopptr();
bool is_not_header = (tinst != nullptr) && tinst->is_known_instance_field();
- bool is_not_vect = (_type->isa_vect() == nullptr);
+ bool is_not_vect = !_type->is_vect();
if (is_not_header && is_not_vect) {
Node* mem = in(MemNode::Memory);
if (mem->is_Parm() && mem->in(0)->is_Start()) {
@@ -2584,7 +2582,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
// Scalar replacement assumes that arrays are zero-initialized, which is not true for null-free arrays.
// ConnectionGraph::split_unique_types will re-wire the memory of loads from such arrays around the allocation.
// TestArrays::test6 and test152 and TestBasicFunctionality::test20 are affected by this.
- if (tp->isa_aryptr() && tp->is_aryptr()->is_flat() && tp->is_aryptr()->is_null_free()) {
+ if (tp->is_aryptr() && tp->as_aryptr()->is_flat() && tp->as_aryptr()->is_null_free()) {
intptr_t offset = 0;
Node* base = AddPNode::Ideal_base_and_offset(adr, phase, offset);
AllocateNode* alloc = AllocateNode::Ideal_allocation(base);
@@ -2759,7 +2757,7 @@ const Type* LoadSNode::Value(PhaseGVN* phase) const {
Node* LoadNNode::Ideal(PhaseGVN* phase, bool can_reshape) {
// Can see the corresponding value, may need to add an EncodeP
Node* value = can_see_stored_value_through_membars(in(Memory), phase);
- if (value != nullptr && phase->type(value)->isa_ptr() && type()->isa_narrowoop()) {
+ if (value != nullptr && phase->type(value)->is_ptr() && type()->is_narrowoop()) {
return new EncodePNode(value, type());
}
@@ -2796,7 +2794,7 @@ const Type* LoadNode::klass_value_common(PhaseGVN* phase) const {
Node *adr = in(MemNode::Address);
const Type *t2 = phase->type( adr );
if (t2 == Type::TOP) return Type::TOP;
- const TypePtr *tp = t2->is_ptr();
+ const TypePtr* tp = t2->as_ptr();
if (TypePtr::is_top(tp->ptr()) || tp->ptr() == TypePtr::Null) return Type::TOP;
// Return a more precise klass, if possible
@@ -2841,7 +2839,7 @@ const Type* LoadNode::klass_value_common(PhaseGVN* phase) const {
const TypeAryPtr* tary = tp->isa_aryptr();
if (tary != nullptr &&
tary->offset() == oopDesc::klass_offset_in_bytes()) {
- return tary->as_klass_type(true)->is_aryklassptr();
+ return tary->as_klass_type(true)->as_aryklassptr();
}
// Check for loading klass from an array klass
@@ -2849,7 +2847,7 @@ const Type* LoadNode::klass_value_common(PhaseGVN* phase) const {
if (tkls != nullptr && !StressReflectiveCode) {
if (!tkls->is_loaded())
return _type; // Bail out if not loaded
- if (tkls->isa_aryklassptr() && tkls->is_aryklassptr()->elem()->isa_klassptr() &&
+ if (tkls->is_aryklassptr() && tkls->as_aryklassptr()->elem()->is_klassptr() &&
tkls->offset() == in_bytes(ObjArrayKlass::element_klass_offset())) {
// // Always returning precise element type is incorrect,
// // e.g., element type could be object and array may contain strings
@@ -2857,18 +2855,18 @@ const Type* LoadNode::klass_value_common(PhaseGVN* phase) const {
// The array's TypeKlassPtr was declared 'precise' or 'not precise'
// according to the element type's subclassing.
- return tkls->is_aryklassptr()->elem()->isa_klassptr()->cast_to_exactness(tkls->klass_is_exact());
+ return tkls->as_aryklassptr()->elem()->as_klassptr()->cast_to_exactness(tkls->klass_is_exact());
}
- if (tkls->isa_aryklassptr() != nullptr && tkls->klass_is_exact() &&
+ if (tkls->is_aryklassptr() && tkls->klass_is_exact() &&
!tkls->exact_klass()->is_type_array_klass() &&
tkls->offset() == in_bytes(Klass::super_offset())) {
// We are loading the super klass of a refined array klass, return the non-refined klass pointer
- assert(tkls->is_aryklassptr()->is_refined_type(), "Must be a refined array klass pointer");
- return tkls->is_aryklassptr()->with_offset(0)->cast_to_non_refined();
+ assert(tkls->as_aryklassptr()->is_refined_type(), "Must be a refined array klass pointer");
+ return tkls->as_aryklassptr()->with_offset(0)->cast_to_non_refined();
}
- if (tkls->isa_instklassptr() != nullptr && tkls->klass_is_exact() &&
+ if (tkls->is_instklassptr() && tkls->klass_is_exact() &&
tkls->offset() == in_bytes(Klass::super_offset())) {
- ciKlass* sup = tkls->is_instklassptr()->instance_klass()->super();
+ ciKlass* sup = tkls->as_instklassptr()->instance_klass()->super();
// The field is Klass::_super. Return its (constant) value.
// (Folds up the 2nd indirection in aClassConstant.getSuperClass().)
return sup ? TypeKlassPtr::make(sup, Type::trust_interfaces) : TypePtr::NULL_PTR;
@@ -2934,7 +2932,7 @@ Node* LoadNode::find_known_klass(PhaseGVN* phase) const {
// constant, it was obtained via load_klass which returns the refined type
// and '.java_mirror.as_klass' should return the Java type instead.
- if (toop->isa_instptr() && toop->is_instptr()->instance_klass() == phase->C->env()->Class_klass()
+ if (toop->is_instptr() && toop->as_instptr()->instance_klass() == phase->C->env()->Class_klass()
&& offset == java_lang_Class::klass_offset()) {
if (base->is_Load()) {
Node* base2 = base->in(MemNode::Address);
@@ -2942,12 +2940,12 @@ Node* LoadNode::find_known_klass(PhaseGVN* phase) const {
Node* adr2 = base2->in(MemNode::Address);
const TypeKlassPtr* tkls = phase->type(adr2)->isa_klassptr();
if (tkls != nullptr && !tkls->empty()
- && ((tkls->isa_instklassptr() && !tkls->is_instklassptr()->might_be_an_array()))
+ && (tkls->is_instklassptr() && !tkls->as_instklassptr()->might_be_an_array())
&& adr2->is_AddP()) {
int mirror_field = in_bytes(Klass::java_mirror_offset());
if (tkls->offset() == mirror_field) {
#ifdef ASSERT
- const TypeKlassPtr* tkls2 = phase->type(adr2->in(AddPNode::Address))->is_klassptr();
+ const TypeKlassPtr* tkls2 = phase->type(adr2->in(AddPNode::Address))->as_klassptr();
assert(tkls2->offset() == 0, "not a load of java_mirror");
#endif
assert(adr2->in(AddPNode::Base)->is_top(), "not an off heap load");
@@ -2977,7 +2975,7 @@ LoadNode* LoadNode::clone_pinned() const {
// need to pin it.
LoadNode* LoadNode::pin_node_under_control_impl() const {
const TypePtr* adr_type = this->in_adr_type();
- if (adr_type != nullptr && adr_type->isa_aryptr()) {
+ if (adr_type != nullptr && adr_type->is_aryptr()) {
// Only array accesses have dependencies on their control input
return clone_pinned();
}
@@ -2998,7 +2996,7 @@ Node* LoadNKlassNode::Ideal(PhaseGVN* phase, bool can_reshape) {
if (k != nullptr) {
const Type* t = phase->type(k);
if (t != Type::TOP) {
- assert(t->isa_klassptr(), "must be a klass pointer");
+ assert(t->is_klassptr(), "must be a klass pointer");
return new EncodePKlassNode(k, t->make_narrowklass());
}
}
@@ -3021,7 +3019,7 @@ const Type* LoadNKlassNode::Value(PhaseGVN* phase) const {
Node* LoadNKlassNode::Identity(PhaseGVN* phase) {
Node* x = klass_identity_common(phase);
const Type* t = phase->type(x);
- if (t == Type::TOP || t->isa_narrowklass()) { return x; }
+ if (t == Type::TOP || t->is_narrowklass()) { return x; }
return this;
}
@@ -3033,7 +3031,7 @@ const Type* LoadRangeNode::Value(PhaseGVN* phase) const {
Node *adr = in(MemNode::Address);
const Type *t2 = phase->type( adr );
if( t2 == Type::TOP ) return Type::TOP;
- const TypePtr *tp = t2->is_ptr();
+ const TypePtr* tp = t2->as_ptr();
if (TypePtr::is_top(tp->ptr())) return Type::TOP;
const TypeAryPtr *tap = tp->isa_aryptr();
if( !tap ) return _type;
@@ -3112,7 +3110,7 @@ Node* LoadRangeNode::Identity(PhaseGVN* phase) {
StoreNode* StoreNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const TypePtr* adr_type, Node* val, BasicType bt, MemOrd mo, bool require_atomic_access) {
assert((mo == unordered || mo == release), "unexpected");
Compile* C = gvn.C;
- assert(adr_type == nullptr || adr->is_top() || C->get_alias_index(gvn.type(adr)->is_ptr()) == C->get_alias_index(adr_type), "adr and adr_type must agree");
+ assert(adr_type == nullptr || adr->is_top() || C->get_alias_index(gvn.type(adr)->as_ptr()) == C->get_alias_index(adr_type), "adr and adr_type must agree");
assert(C->get_alias_index(adr_type) != Compile::AliasIdxRaw ||
ctl != nullptr, "raw memory operations should have control edge");
@@ -3134,7 +3132,7 @@ StoreNode* StoreNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const
val = gvn.transform(new EncodePNode(val, val->bottom_type()->make_narrowoop()));
return new StoreNNode(ctl, mem, adr, adr_type, val, mo);
} else if (adr->bottom_type()->is_ptr_to_narrowklass() ||
- (val->bottom_type()->isa_klassptr() && adr->bottom_type()->isa_rawptr())) {
+ (val->bottom_type()->is_klassptr() && adr->bottom_type()->is_rawptr())) {
val = gvn.transform(new EncodePKlassNode(val, val->bottom_type()->make_narrowklass()));
return new StoreNKlassNode(ctl, mem, adr, adr_type, val, mo);
}
@@ -3480,8 +3478,7 @@ bool MergePrimitiveStores::is_con_RShift(const Node* n, Node const*& base_out, j
return shift_out >= 0;
}
- if (phase->type(n)->isa_int() != nullptr ||
- phase->type(n)->isa_long() != nullptr) {
+ if (phase->type(n)->is_int() || phase->type(n)->is_long()) {
// (base >> 0)
base_out = n;
shift_out = 0;
@@ -3699,7 +3696,7 @@ Node* MergePrimitiveStores::make_merged_input_value(const Node_Listtype(merged_input_value)->isa_long() != nullptr && new_memory_size <= 4) {
+ if (_phase->type(merged_input_value)->is_long() && new_memory_size <= 4) {
// Example:
//
// long base = ...;
@@ -3709,8 +3706,8 @@ Node* MergePrimitiveStores::make_merged_input_value(const Node_Listtransform(new ConvL2INode(merged_input_value));
}
- assert((_phase->type(merged_input_value)->isa_int() != nullptr && new_memory_size <= 4) ||
- (_phase->type(merged_input_value)->isa_long() != nullptr && new_memory_size == 8),
+ assert((_phase->type(merged_input_value)->is_int() && new_memory_size <= 4) ||
+ (_phase->type(merged_input_value)->is_long() && new_memory_size == 8),
"merged_input_value is either int or long, and new_memory_size is small enough");
if (_value_order == ValueOrder::Reverse) {
@@ -4581,7 +4578,7 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest,
Node* adr = make_address(dest, phase->MakeConX(offset), raw_base, phase);
const TypePtr* atp = TypeRawPtr::BOTTOM;
if (val != nullptr) {
- assert(phase->type(val)->isa_narrowoop(), "should be narrow oop");
+ assert(phase->type(val)->is_narrowoop(), "should be narrow oop");
mem = new StoreNNode(ctl, mem, adr, atp, val, MemNode::unordered);
} else {
assert(raw_val == nullptr, "val may not be null");
@@ -4653,7 +4650,7 @@ Node* ClearArrayNode::clear_memory(Node* ctl, Node* mem, Node* dest,
Node* adr = make_address(dest, phase->MakeConX(done_offset), raw_base, phase);
const TypePtr* atp = TypeRawPtr::BOTTOM;
if (val != nullptr) {
- assert(phase->type(val)->isa_narrowoop(), "should be narrow oop");
+ assert(phase->type(val)->is_narrowoop(), "should be narrow oop");
mem = new StoreNNode(ctl, mem, adr, atp, val, MemNode::unordered);
} else {
assert(raw_val == nullptr, "val may not be null");
@@ -5589,8 +5586,8 @@ InitializeNode::coalesce_subword_stores(intptr_t header_size,
jlong con = 0;
switch (type) {
- case T_INT: con = val->is_int()->get_con(); break;
- case T_LONG: con = val->is_long()->get_con(); break;
+ case T_INT: con = val->as_int()->get_con(); break;
+ case T_LONG: con = val->as_long()->get_con(); break;
case T_FLOAT: con = jint_cast(val->getf()); break;
case T_DOUBLE: con = jlong_cast(val->getd()); break;
default: continue; //skip (odd store type)
@@ -5626,7 +5623,7 @@ InitializeNode::coalesce_subword_stores(intptr_t header_size,
assert(get_store_offset(st, phase) == st_off, "must be");
assert(in(i-1) == zmem, "must be");
DEBUG_ONLY(const Type* tcon = phase->type(st->in(MemNode::ValueIn)));
- assert(con == tcon->is_int()->get_con(), "must be");
+ assert(con == tcon->as_int()->get_con(), "must be");
// Undo the effects of the previous loop trip, which swallowed st:
intcon[0] = 0; // undo store_constant()
set_req(i-1, st); // undo set_req(i, zmem)
@@ -5950,7 +5947,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
assert(alloc != nullptr, "must be present");
if (alloc != nullptr && alloc->Opcode() == Op_Allocate) {
Node* klass_node = alloc->in(AllocateNode::KlassNode);
- ciKlass* k = phase->type(klass_node)->is_instklassptr()->instance_klass();
+ ciKlass* k = phase->type(klass_node)->as_instklassptr()->instance_klass();
if (zeroes_done == k->layout_helper())
zeroes_done = size_limit;
}
diff --git a/src/hotspot/share/opto/memnode.hpp b/src/hotspot/share/opto/memnode.hpp
index 36e78361c1f..0bceebfe253 100644
--- a/src/hotspot/share/opto/memnode.hpp
+++ b/src/hotspot/share/opto/memnode.hpp
@@ -1163,7 +1163,7 @@ class ClearArrayNode: public Node {
public:
ClearArrayNode( Node *ctrl, Node *arymem, Node *word_cnt, Node *base, Node* val, bool is_large)
: Node(ctrl, arymem, word_cnt, base, val), _is_large(is_large),
- _requires_word_fill(val->bottom_type()->isa_long() && (!val->bottom_type()->is_long()->is_con() || val->bottom_type()->is_long()->get_con() != 0)) {
+ _requires_word_fill(val->bottom_type()->is_long() && (!val->bottom_type()->as_long()->is_con() || val->bottom_type()->as_long()->get_con() != 0)) {
init_class_id(Class_ClearArray);
}
virtual int Opcode() const;
diff --git a/src/hotspot/share/opto/movenode.cpp b/src/hotspot/share/opto/movenode.cpp
index 68a79b5dbc3..00eb6dc6c3f 100644
--- a/src/hotspot/share/opto/movenode.cpp
+++ b/src/hotspot/share/opto/movenode.cpp
@@ -186,12 +186,12 @@ const Type* CMoveNode::Value(PhaseGVN* phase) const {
// from the inputs we do not need to specify it here.
CMoveNode* CMoveNode::make(Node* bol, Node* false_value, Node* true_value, const Type* t) {
switch (t->basic_type()) {
- case T_INT: return new CMoveINode(bol, false_value, true_value, t->is_int());
+ case T_INT: return new CMoveINode(bol, false_value, true_value, t->as_int());
case T_FLOAT: return new CMoveFNode(bol, false_value, true_value, t);
case T_DOUBLE: return new CMoveDNode(bol, false_value, true_value, t);
- case T_LONG: return new CMoveLNode(bol, false_value, true_value, t->is_long());
- case T_OBJECT: return new CMovePNode(bol, false_value, true_value, t->is_oopptr());
- case T_ADDRESS: return new CMovePNode(bol, false_value, true_value, t->is_ptr());
+ case T_LONG: return new CMoveLNode(bol, false_value, true_value, t->as_long());
+ case T_OBJECT: return new CMovePNode(bol, false_value, true_value, t->as_oopptr());
+ case T_ADDRESS: return new CMovePNode(bol, false_value, true_value, t->as_ptr());
case T_NARROWOOP: return new CMoveNNode(bol, false_value, true_value, t);
default:
ShouldNotReachHere();
@@ -485,7 +485,7 @@ Node* MoveNode::Identity(PhaseGVN* phase) {
const Type* MoveL2DNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeLong *tl = t->is_long();
+ const TypeLong* tl = t->as_long();
if( !tl->is_con() ) return bottom_type();
JavaValue v;
v.set_jlong(tl->get_con());
@@ -504,7 +504,7 @@ Node* MoveL2DNode::Identity(PhaseGVN* phase) {
const Type* MoveI2FNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
- const TypeInt *ti = t->is_int();
+ const TypeInt* ti = t->as_int();
if( !ti->is_con() ) return bottom_type();
JavaValue v;
v.set_jint(ti->get_con());
@@ -524,7 +524,7 @@ const Type* MoveF2INode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::FLOAT ) return TypeInt::INT;
- const TypeF *tf = t->is_float_constant();
+ const TypeF* tf = t->as_float_constant();
JavaValue v;
v.set_jfloat(tf->getf());
return TypeInt::make( v.get_jint() );
@@ -543,7 +543,7 @@ const Type* MoveD2LNode::Value(PhaseGVN* phase) const {
const Type *t = phase->type( in(1) );
if( t == Type::TOP ) return Type::TOP;
if( t == Type::DOUBLE ) return TypeLong::LONG;
- const TypeD *td = t->is_double_constant();
+ const TypeD* td = t->as_double_constant();
JavaValue v;
v.set_jdouble(td->getd());
return TypeLong::make( v.get_jlong() );
diff --git a/src/hotspot/share/opto/mulnode.cpp b/src/hotspot/share/opto/mulnode.cpp
index 7e13b38624c..6cd4b06458b 100644
--- a/src/hotspot/share/opto/mulnode.cpp
+++ b/src/hotspot/share/opto/mulnode.cpp
@@ -454,7 +454,7 @@ const Type* IntegerTypeMultiplication::create_type(jlong lo, jlong hi) co
// Compute the product type of two integer ranges into this node.
const Type* MulINode::mul_ring(const Type* type_left, const Type* type_right) const {
- const IntegerTypeMultiplication integer_multiplication(type_left->is_int(), type_right->is_int());
+ const IntegerTypeMultiplication integer_multiplication(type_left->as_int(), type_right->as_int());
return integer_multiplication.compute();
}
@@ -465,7 +465,7 @@ bool MulINode::does_overflow(const TypeInt* type_left, const TypeInt* type_right
// Compute the product type of two long ranges into this node.
const Type* MulLNode::mul_ring(const Type* type_left, const Type* type_right) const {
- const IntegerTypeMultiplication integer_multiplication(type_left->is_long(), type_right->is_long());
+ const IntegerTypeMultiplication integer_multiplication(type_left->as_long(), type_right->as_long());
return integer_multiplication.compute();
}
@@ -660,7 +660,7 @@ const Type* MulHiValue(const Type *t1, const Type *t2, const Type *bot) {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type* AndINode::mul_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_and(t1->is_int(), t2->is_int());
+ return RangeInference::infer_and(t1->as_int(), t2->as_int());
}
static bool AndIL_is_zero_element_under_mask(const PhaseGVN* phase, const Node* expr, const Node* mask, BasicType bt);
@@ -683,8 +683,8 @@ Node* AndINode::Identity(PhaseGVN* phase) {
return in(1);
}
- const TypeInt* t1 = phase->type(in(1))->is_int();
- const TypeInt* t2 = phase->type(in(2))->is_int();
+ const TypeInt* t1 = phase->type(in(1))->as_int();
+ const TypeInt* t2 = phase->type(in(2))->as_int();
if ((~t1->_bits._ones & ~t2->_bits._zeros) == 0) {
// All bits that might be 0 in in1 are known to be 0 in in2
@@ -778,7 +778,7 @@ Node *AndINode::Ideal(PhaseGVN *phase, bool can_reshape) {
// This also type-checks the inputs for sanity. Guaranteed never to
// be passed a TOP or BOTTOM type, these are filtered out by pre-check.
const Type* AndLNode::mul_ring(const Type* t1, const Type* t2) const {
- return RangeInference::infer_and(t1->is_long(), t2->is_long());
+ return RangeInference::infer_and(t1->as_long(), t2->as_long());
}
const Type* AndLNode::Value(PhaseGVN* phase) const {
@@ -799,8 +799,8 @@ Node* AndLNode::Identity(PhaseGVN* phase) {
return in(1);
}
- const TypeLong* t1 = phase->type(in(1))->is_long();
- const TypeLong* t2 = phase->type(in(2))->is_long();
+ const TypeLong* t1 = phase->type(in(1))->as_long();
+ const TypeLong* t2 = phase->type(in(2))->as_long();
if ((~t1->_bits._ones & ~t2->_bits._zeros) == 0) {
// All bits that might be 0 in in1 are known to be 0 in in2
@@ -867,7 +867,7 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
}
// Search for GraphKit::mark_word_test patterns and fold the test if the result is statically known
- if (in1->is_Load() && phase->type(in1)->isa_long()) {
+ if (in1->is_Load() && phase->type(in1)->is_long()) {
const TypePtr* adr_t = phase->type(in1->in(MemNode::Address))->isa_ptr();
if (adr_t != nullptr && adr_t->offset() == oopDesc::mark_offset_in_bytes()) {
if (mask == markWord::value_type_pattern) {
@@ -1156,9 +1156,9 @@ Node* LShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) {
}
uint64_t known_ones;
if (bt == T_INT) {
- known_ones = mask_t->is_int()->_bits._ones;
+ known_ones = mask_t->as_int()->_bits._ones;
} else {
- known_ones = mask_t->is_long()->_bits._ones;
+ known_ones = mask_t->as_long()->_bits._ones;
}
if ((known_ones & bits_mask) == bits_mask) {
return LShiftNode::make(add1->in(3 - i), in(2), bt);
@@ -1206,13 +1206,13 @@ const Type* LShiftNode::ValueIL(PhaseGVN* phase, BasicType bt) const {
return TypeInteger::bottom(bt);
}
- const TypeInteger* r1 = t1->is_integer(bt); // Handy access
+ const TypeInteger* r1 = t1->as_integer(bt); // Handy access
// Since the shift semantics in Java take into account only the bottom five
// bits for ints and the bottom six bits for longs, we can further constrain
// the range of values of the shift amount by ANDing with the right mask based
// on whether the type is int or long.
const TypeInt* mask = TypeInt::make(bits_per_java_integer(bt) - 1);
- const TypeInt* r2 = RangeInference::infer_and(t2->is_int(), mask);
+ const TypeInt* r2 = RangeInference::infer_and(t2->as_int(), mask);
if (!r2->is_con()) {
return TypeInteger::bottom(bt);
@@ -1230,17 +1230,17 @@ const Type* LShiftNode::ValueIL(PhaseGVN* phase, BasicType bt) const {
#ifdef ASSERT
if (bt == T_INT) {
jlong lo = r1->lo_as_long(), hi = r1->hi_as_long();
- jint lo_int = r1->is_int()->_lo, hi_int = r1->is_int()->_hi;
+ jint lo_int = r1->as_int()->_lo, hi_int = r1->as_int()->_hi;
assert((java_shift_right(java_shift_left(lo, shift, bt), shift, bt) == lo) == (((lo_int << shift) >> shift) == lo_int), "inconsistent");
assert((java_shift_right(java_shift_left(hi, shift, bt), shift, bt) == hi) == (((hi_int << shift) >> shift) == hi_int), "inconsistent");
}
#endif
if (bt == T_INT) {
- return RangeInference::infer_lshift(r1->is_int(), shift);
+ return RangeInference::infer_lshift(r1->as_int(), shift);
}
- return RangeInference::infer_lshift(r1->is_long(), shift);
+ return RangeInference::infer_lshift(r1->as_long(), shift);
}
return TypeInteger::make(java_shift_left(r1->get_con_as_long(bt), shift, bt), bt);
@@ -1330,8 +1330,7 @@ Node* RShiftINode::Identity(PhaseGVN* phase) {
Node* RShiftNode::IdealIL(PhaseGVN* phase, bool can_reshape, BasicType bt) {
// Inputs may be TOP if they are dead.
- const TypeInteger* t1 = phase->type(in(1))->isa_integer(bt);
- if (t1 == nullptr) {
+ if (!phase->type(in(1))->is_integer(bt)) {
return NodeSentinel; // Left input is an integer
}
@@ -1439,8 +1438,8 @@ const Type* RShiftNode::ValueIL(PhaseGVN* phase, BasicType bt) const {
return TypeInteger::bottom(bt);
}
- const TypeInteger* r1 = t1->isa_integer(bt);
- const TypeInt* r2 = t2->isa_int();
+ const TypeInteger* r1 = t1->as_integer(bt);
+ const TypeInt* r2 = t2->as_int();
// If the shift is a constant, just shift the bounds of the type.
// For example, if the shift is 31/63, we just propagate sign bits.
@@ -1648,9 +1647,9 @@ Node* URShiftINode::Ideal(PhaseGVN* phase, bool can_reshape) {
if ( in1_op == Op_RShiftI ) {
Node *in11 = shr->in(1);
Node *in12 = shr->in(2);
- const TypeInt *t11 = phase->type(in11)->isa_int();
- const TypeInt *t12 = phase->type(in12)->isa_int();
- if ( t11 && t2 && t2->is_con(31) && t12 && t12->is_con() ) {
+ bool in11_is_int = phase->type(in11)->is_int();
+ const TypeInt* t12 = phase->type(in12)->isa_int();
+ if (in11_is_int && t2 != nullptr && t2->is_con(31) && t12 != nullptr && t12->is_con()) {
return new URShiftINode(in11, phase->intcon(31));
}
}
@@ -1680,8 +1679,8 @@ const Type* URShiftINode::Value(PhaseGVN* phase) const {
if (t2 == TypeInt::INT)
return TypeInt::INT;
- const TypeInt *r1 = t1->is_int(); // Handy access
- const TypeInt *r2 = t2->is_int(); // Handy access
+ const TypeInt* r1 = t1->as_int(); // Handy access
+ const TypeInt* r2 = t2->as_int(); // Handy access
if (r2->is_con()) {
uint shift = r2->get_con();
@@ -1719,12 +1718,12 @@ const Type* URShiftINode::Value(PhaseGVN* phase) const {
//
// else if( t1->base() == Type::InstPtr ) {
//
- // const TypeInstPtr *o = t1->is_instptr();
+ // const TypeInstPtr* o = t1->as_instptr();
// if( t1->singleton() )
// return TypeInt::make( ((uint32_t)o->const_oop() + o->_offset) >> shift );
// }
// else if( t1->base() == Type::KlassPtr ) {
- // const TypeKlassPtr *o = t1->is_klassptr();
+ // const TypeKlassPtr* o = t1->as_klassptr();
// if( t1->singleton() )
// return TypeInt::make( ((uint32_t)o->const_oop() + o->_offset) >> shift );
// }
@@ -1809,9 +1808,9 @@ Node* URShiftLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
if ( shr->Opcode() == Op_RShiftL ) {
Node *in11 = shr->in(1);
Node *in12 = shr->in(2);
- const TypeLong *t11 = phase->type(in11)->isa_long();
- const TypeInt *t12 = phase->type(in12)->isa_int();
- if ( t11 && t2 && t2->is_con(63) && t12 && t12->is_con() ) {
+ bool in11_is_long = phase->type(in11)->is_long();
+ const TypeInt* t12 = phase->type(in12)->isa_int();
+ if (in11_is_long && t2 != nullptr && t2->is_con(63) && t12 != nullptr && t12->is_con()) {
return new URShiftLNode(in11, phase->intcon(63));
}
}
@@ -1841,8 +1840,8 @@ const Type* URShiftLNode::Value(PhaseGVN* phase) const {
if (t2 == TypeInt::INT)
return TypeLong::LONG;
- const TypeLong *r1 = t1->is_long(); // Handy access
- const TypeInt *r2 = t2->is_int (); // Handy access
+ const TypeLong* r1 = t1->as_long(); // Handy access
+ const TypeInt* r2 = t2->as_int(); // Handy access
if (r2->is_con()) {
uint shift = r2->get_con();
@@ -1976,8 +1975,8 @@ Node* RotateLeftNode::Identity(PhaseGVN* phase) {
return this;
}
uint count;
- assert(t1->isa_int() || t1->isa_long(), "Unexpected type");
- uint num_bits = t1->isa_int() ? BitsPerJavaInteger : BitsPerJavaLong;
+ assert(t1->is_int() || t1->is_long(), "Unexpected type");
+ uint num_bits = t1->is_int() ? BitsPerJavaInteger : BitsPerJavaLong;
if (mask_shift_amount(phase, this, num_bits, count) && count == 0) {
// Rotate by a multiple of 32/64 does nothing
return in(1);
@@ -1993,9 +1992,9 @@ const Type* RotateLeftNode::Value(PhaseGVN* phase) const {
return Type::TOP;
}
- if (t1->isa_int()) {
- const TypeInt* r1 = t1->is_int();
- const TypeInt* r2 = t2->is_int();
+ if (t1->is_int()) {
+ const TypeInt* r1 = t1->as_int();
+ const TypeInt* r2 = t2->as_int();
// Left input is ZERO ==> the result is ZERO.
if (r1 == TypeInt::ZERO) {
@@ -2012,9 +2011,9 @@ const Type* RotateLeftNode::Value(PhaseGVN* phase) const {
}
return TypeInt::INT;
} else {
- assert(t1->isa_long(), "Type must be a long");
- const TypeLong* r1 = t1->is_long();
- const TypeInt* r2 = t2->is_int();
+ assert(t1->is_long(), "Type must be a long");
+ const TypeLong* r1 = t1->as_long();
+ const TypeInt* r2 = t2->as_int();
// Left input is ZERO ==> the result is ZERO.
if (r1 == TypeLong::ZERO) {
@@ -2036,13 +2035,13 @@ const Type* RotateLeftNode::Value(PhaseGVN* phase) const {
Node* RotateLeftNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const Type* t1 = phase->type(in(1));
const Type* t2 = phase->type(in(2));
- if (t2->isa_int() && t2->is_int()->is_con()) {
- if (t1->isa_int()) {
- int lshift = t2->is_int()->get_con() & 31;
+ if (t2->is_int() && t2->as_int()->is_con()) {
+ if (t1->is_int()) {
+ int lshift = t2->as_int()->get_con() & 31;
return new RotateRightNode(in(1), phase->intcon(32 - (lshift & 31)), TypeInt::INT);
} else if (t1 != Type::TOP) {
- assert(t1->isa_long(), "Type must be a long");
- int lshift = t2->is_int()->get_con() & 63;
+ assert(t1->is_long(), "Type must be a long");
+ int lshift = t2->as_int()->get_con() & 63;
return new RotateRightNode(in(1), phase->intcon(64 - (lshift & 63)), TypeLong::LONG);
}
}
@@ -2055,8 +2054,8 @@ Node* RotateRightNode::Identity(PhaseGVN* phase) {
return this;
}
uint count;
- assert(t1->isa_int() || t1->isa_long(), "Unexpected type");
- uint num_bits = t1->isa_int() ? BitsPerJavaInteger : BitsPerJavaLong;
+ assert(t1->is_int() || t1->is_long(), "Unexpected type");
+ uint num_bits = t1->is_int() ? BitsPerJavaInteger : BitsPerJavaLong;
if (mask_shift_amount(phase, this, num_bits, count) && count == 0) {
// Rotate by a multiple of 32/64 does nothing
return in(1);
@@ -2072,9 +2071,9 @@ const Type* RotateRightNode::Value(PhaseGVN* phase) const {
return Type::TOP;
}
- if (t1->isa_int()) {
- const TypeInt* r1 = t1->is_int();
- const TypeInt* r2 = t2->is_int();
+ if (t1->is_int()) {
+ const TypeInt* r1 = t1->as_int();
+ const TypeInt* r2 = t2->as_int();
// Left input is ZERO ==> the result is ZERO.
if (r1 == TypeInt::ZERO) {
@@ -2091,9 +2090,8 @@ const Type* RotateRightNode::Value(PhaseGVN* phase) const {
}
return TypeInt::INT;
} else {
- assert(t1->isa_long(), "Type must be a long");
- const TypeLong* r1 = t1->is_long();
- const TypeInt* r2 = t2->is_int();
+ const TypeLong* r1 = t1->as_long();
+ const TypeInt* r2 = t2->as_int();
// Left input is ZERO ==> the result is ZERO.
if (r1 == TypeLong::ZERO) {
return TypeLong::ZERO;
diff --git a/src/hotspot/share/opto/multnode.cpp b/src/hotspot/share/opto/multnode.cpp
index 29bb6cd8b79..5aad0b2e7ad 100644
--- a/src/hotspot/share/opto/multnode.cpp
+++ b/src/hotspot/share/opto/multnode.cpp
@@ -130,7 +130,7 @@ const Type* ProjNode::proj_type(const Type* t) const {
if (t == Type::BOTTOM) {
return Type::BOTTOM;
}
- t = t->is_tuple()->field_at(_con);
+ t = t->as_tuple()->field_at(_con);
CallStaticJavaNode* call = in(0)->isa_CallStaticJava();
if (call != nullptr && call->is_boxing_method()) {
// The result of autoboxing is always non-null on normal path.
@@ -179,7 +179,7 @@ void ProjNode::check_con() const {
if (_con == SCMemProjNode::SCMEMPROJCON ) return;
const Type* t = n->bottom_type();
if (t == Type::TOP) return; // multi is dead
- assert(_con < t->is_tuple()->cnt(), "ProjNode::_con must be in range");
+ assert(_con < t->as_tuple()->cnt(), "ProjNode::_con must be in range");
}
//------------------------------Identity---------------------------------------
diff --git a/src/hotspot/share/opto/narrowptrnode.cpp b/src/hotspot/share/opto/narrowptrnode.cpp
index 8fd944b3d87..72dbad8f492 100644
--- a/src/hotspot/share/opto/narrowptrnode.cpp
+++ b/src/hotspot/share/opto/narrowptrnode.cpp
@@ -41,7 +41,7 @@ const Type* DecodeNNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) return Type::TOP;
if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR;
- assert(t->isa_narrowoop(), "only narrowoop here");
+ assert(t->is_narrowoop(), "only narrowoop here");
return t->make_ptr();
}
@@ -61,7 +61,7 @@ const Type* EncodePNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) return Type::TOP;
if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR;
- assert(t->isa_oop_ptr(), "only oopptr here");
+ assert(t->is_oopptr(), "only oopptr here");
return t->make_narrowoop();
}
@@ -82,7 +82,7 @@ const Type* DecodeNKlassNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) return Type::TOP;
assert(t != TypeNarrowKlass::NULL_PTR, "null klass?");
- assert(t->isa_narrowklass(), "only narrow klass ptr here");
+ assert(t->is_narrowklass(), "only narrow klass ptr here");
return t->make_ptr();
}
@@ -102,7 +102,7 @@ const Type* EncodePKlassNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) return Type::TOP;
assert (t != TypePtr::NULL_PTR, "null klass?");
- assert(t->isa_klassptr(), "only klass ptr here");
+ assert(t->is_klassptr(), "only klass ptr here");
return t->make_narrowklass();
}
diff --git a/src/hotspot/share/opto/node.cpp b/src/hotspot/share/opto/node.cpp
index 6da3e2b4df8..a6fcb67d314 100644
--- a/src/hotspot/share/opto/node.cpp
+++ b/src/hotspot/share/opto/node.cpp
@@ -1673,13 +1673,13 @@ const TypeInteger* Node::find_integer_type(BasicType bt) const {
// Returns the constant if it is a pointer ConstNode
intptr_t Node::get_ptr() const {
assert( Opcode() == Op_ConP, "" );
- return ((ConPNode*)this)->type()->is_ptr()->get_con();
+ return ((ConPNode*)this)->type()->as_ptr()->get_con();
}
// Get a narrow oop constant from a ConNNode.
intptr_t Node::get_narrowcon() const {
assert( Opcode() == Op_ConN, "" );
- return ((ConNNode*)this)->type()->is_narrowoop()->get_con();
+ return ((ConNNode*)this)->type()->as_narrowoop()->get_con();
}
// Get a long constant from a ConNode.
@@ -1713,21 +1713,21 @@ const TypePtr* Node::get_ptr_type() const {
// Returns the constant if it is a double ConstNode
jdouble Node::getd() const {
assert( Opcode() == Op_ConD, "" );
- return ((ConDNode*)this)->type()->is_double_constant()->getd();
+ return ((ConDNode*)this)->type()->as_double_constant()->getd();
}
// Get a float constant from a ConstNode.
// Returns the constant if it is a float ConstNode
jfloat Node::getf() const {
assert( Opcode() == Op_ConF, "" );
- return ((ConFNode*)this)->type()->is_float_constant()->getf();
+ return ((ConFNode*)this)->type()->as_float_constant()->getf();
}
// Get a half float constant from a ConstNode.
// Returns the constant if it is a float ConstNode
jshort Node::geth() const {
assert( Opcode() == Op_ConH, "" );
- return ((ConHNode*)this)->type()->is_half_float_constant()->geth();
+ return ((ConHNode*)this)->type()->as_half_float_constant()->geth();
}
#ifndef PRODUCT
@@ -2709,12 +2709,10 @@ void Node::dump(const char* suffix, bool mark, outputStream* st, DumpConfig* dc)
const Type *t = bottom_type();
- if (t != nullptr && (t->isa_instptr() || t->isa_instklassptr())) {
- const TypeInstPtr *toop = t->isa_instptr();
- const TypeInstKlassPtr *tkls = t->isa_instklassptr();
- if (toop) {
+ if (t != nullptr && (t->is_instptr() || t->is_instklassptr())) {
+ if (t->is_instptr()) {
st->print(" Oop:");
- } else if (tkls) {
+ } else {
st->print(" Klass:");
}
t->dump_on(st);
@@ -2723,12 +2721,12 @@ void Node::dump(const char* suffix, bool mark, outputStream* st, DumpConfig* dc)
MemNode::dump_adr_type(out_adr_type(), st);
} else if (Verbose || WizardMode) {
st->print(" Type:");
- if (t) {
+ if (t != nullptr) {
t->dump_on(st);
} else {
st->print("no type");
}
- } else if (t->isa_vect() && this->is_MachSpillCopy()) {
+ } else if (t->is_vect() && this->is_MachSpillCopy()) {
// Dump MachSpillcopy vector type.
t->dump_on(st);
}
diff --git a/src/hotspot/share/opto/output.cpp b/src/hotspot/share/opto/output.cpp
index f30d647fab5..dd096db4346 100644
--- a/src/hotspot/share/opto/output.cpp
+++ b/src/hotspot/share/opto/output.cpp
@@ -799,7 +799,7 @@ void PhaseOutput::FillLocArray( int idx, MachSafePointNode* sfpt, Node *local,
ObjectValue* sv = sv_for_node_id(objs, spobj->_idx);
if (sv == nullptr) {
- ciKlass* cik = t->is_oopptr()->exact_klass();
+ ciKlass* cik = t->as_oopptr()->exact_klass();
assert(cik->is_instance_klass() ||
cik->is_array_klass(), "Not supported allocation.");
uint first_ind = spobj->first_index(sfpt->jvms());
@@ -810,7 +810,7 @@ void PhaseOutput::FillLocArray( int idx, MachSafePointNode* sfpt, Node *local,
Node* null_marker_node = sfpt->in(first_ind++);
assert(null_marker_node != nullptr, "null_marker node not found");
if (!null_marker_node->is_top()) {
- const TypeInt* null_marker_type = null_marker_node->bottom_type()->is_int();
+ const TypeInt* null_marker_type = null_marker_node->bottom_type()->as_int();
if (null_marker_node->is_Con()) {
properties = new ConstantIntValue(null_marker_type->get_con());
} else {
@@ -820,7 +820,7 @@ void PhaseOutput::FillLocArray( int idx, MachSafePointNode* sfpt, Node *local,
}
}
if (cik->is_array_klass() && !cik->is_type_array_klass()) {
- properties = new ConstantIntValue(array_description_value(t->is_aryptr()));
+ properties = new ConstantIntValue(array_description_value(t->as_aryptr()));
}
sv = new ObjectValue(spobj->_idx,
new ConstantOopWriteValue(cik->java_mirror()->constant_encoding()), true, properties);
@@ -949,35 +949,35 @@ void PhaseOutput::FillLocArray( int idx, MachSafePointNode* sfpt, Node *local,
break;
case Type::AryPtr:
case Type::InstPtr: // fall through
- array->append(new ConstantOopWriteValue(t->isa_oopptr()->const_oop()->constant_encoding()));
+ array->append(new ConstantOopWriteValue(t->as_oopptr()->const_oop()->constant_encoding()));
break;
case Type::NarrowOop:
if (t == TypeNarrowOop::NULL_PTR) {
array->append(new ConstantOopWriteValue(nullptr));
} else {
- array->append(new ConstantOopWriteValue(t->make_ptr()->isa_oopptr()->const_oop()->constant_encoding()));
+ array->append(new ConstantOopWriteValue(t->make_ptr()->as_oopptr()->const_oop()->constant_encoding()));
}
break;
case Type::Int:
- array->append(new ConstantIntValue(t->is_int()->get_con()));
+ array->append(new ConstantIntValue(t->as_int()->get_con()));
break;
case Type::RawPtr:
// A return address (T_ADDRESS).
- assert((intptr_t)t->is_ptr()->get_con() < (intptr_t)0x10000, "must be a valid BCI");
+ assert((intptr_t)t->as_ptr()->get_con() < (intptr_t)0x10000, "must be a valid BCI");
#ifdef _LP64
// Must be restored to the full-width 64-bit stack slot.
- array->append(new ConstantLongValue(t->is_ptr()->get_con()));
+ array->append(new ConstantLongValue(t->as_ptr()->get_con()));
#else
- array->append(new ConstantIntValue(t->is_ptr()->get_con()));
+ array->append(new ConstantIntValue(t->as_ptr()->get_con()));
#endif
break;
case Type::FloatCon: {
- float f = t->is_float_constant()->getf();
+ float f = t->as_float_constant()->getf();
array->append(new ConstantIntValue(jint_cast(f)));
break;
}
case Type::DoubleCon: {
- jdouble d = t->is_double_constant()->getd();
+ jdouble d = t->as_double_constant()->getd();
#ifdef _LP64
array->append(new ConstantIntValue((jint)0));
array->append(new ConstantDoubleValue(d));
@@ -997,7 +997,7 @@ void PhaseOutput::FillLocArray( int idx, MachSafePointNode* sfpt, Node *local,
break;
}
case Type::Long: {
- jlong d = t->is_long()->get_con();
+ jlong d = t->as_long()->get_con();
#ifdef _LP64
array->append(new ConstantIntValue((jint)0));
array->append(new ConstantLongValue(d));
@@ -1157,13 +1157,13 @@ void PhaseOutput::Process_OopMap_Node(MachNode *mach, int current_offset) {
scval = PhaseOutput::sv_for_node_id(objs, spobj->_idx);
if (scval == nullptr) {
const Type *t = spobj->bottom_type();
- ciKlass* cik = t->is_oopptr()->exact_klass();
+ ciKlass* cik = t->as_oopptr()->exact_klass();
assert(cik->is_instance_klass() ||
cik->is_array_klass(), "Not supported allocation.");
assert(!cik->is_value_klass(), "Synchronization on value object?");
ScopeValue* properties = nullptr;
if (cik->is_array_klass() && !cik->is_type_array_klass()) {
- properties = new ConstantIntValue(array_description_value(t->is_aryptr()));
+ properties = new ConstantIntValue(array_description_value(t->as_aryptr()));
}
ObjectValue* sv = new ObjectValue(spobj->_idx,
new ConstantOopWriteValue(cik->java_mirror()->constant_encoding()), true, properties);
@@ -1216,7 +1216,7 @@ void PhaseOutput::Process_OopMap_Node(MachNode *mach, int current_offset) {
}
} else {
const TypePtr *tp = obj_node->get_ptr_type();
- scval = new ConstantOopWriteValue(tp->is_oopptr()->const_oop()->constant_encoding());
+ scval = new ConstantOopWriteValue(tp->as_oopptr()->const_oop()->constant_encoding());
}
OptoReg::Name box_reg = BoxLockNode::reg(box_node);
@@ -3061,8 +3061,8 @@ void Scheduling::ComputeRegisterAntidependencies(Block *b) {
// Add precedence edge from following safepoint to use of derived pointer
for (uint k = 1; k < m->req(); k++) {
const Type *t = m->in(k)->bottom_type();
- if (t->isa_oop_ptr() &&
- t->is_ptr()->offset() != 0) {
+ if (t->is_oopptr() &&
+ t->as_ptr()->offset() != 0) {
need_safept_prec = true;
break;
}
diff --git a/src/hotspot/share/opto/parse1.cpp b/src/hotspot/share/opto/parse1.cpp
index eb7849e8dad..94b579854ed 100644
--- a/src/hotspot/share/opto/parse1.cpp
+++ b/src/hotspot/share/opto/parse1.cpp
@@ -181,7 +181,7 @@ Node* Parse::check_interpreter_type(Node* l, ciType* ci_type, SafePointNode* &ba
// are still in effect.
if (unwrapped_ci_type->is_klass()) {
// TypeFlow asserted a specific object type. Value must have that type.
- assert(_gvn.type(l) == TypePtr::NULL_PTR || _gvn.type(l)->isa_oopptr(), "must be an oop");
+ assert(_gvn.type(l) == TypePtr::NULL_PTR || _gvn.type(l)->is_oopptr(), "must be an oop");
if (ci_type->is_null_free()) {
// Check value types for null here to prevent checkcast from adding an
// exception state before the bytecode entry (use 'bad_type_ctrl' instead).
@@ -306,7 +306,7 @@ void Parse::load_interpreter_state(Node* osr_buf) {
const Type *type = osr_block->local_type_at(index);
- if (type->isa_oopptr() != nullptr) {
+ if (type->is_oopptr()) {
// 6403625: Verify that the interpreter oopMap thinks that the oop is live
// else we might load a stale oop if the MethodLiveness disagrees with the
@@ -391,12 +391,12 @@ void Parse::load_interpreter_state(Node* osr_buf) {
// value and the expected type is a constant.
continue;
}
- if (StressReachabilityFences && type->isa_oopptr() != nullptr) {
+ if (StressReachabilityFences && type->is_oopptr()) {
// Keep all oop locals alive until the method returns as if there are
// reachability fences for them at the end of the method.
Node* loc = local(index);
if (!loc->is_ValueType() && loc->bottom_type() != TypePtr::NULL_PTR) {
- assert(loc->bottom_type()->isa_oopptr() != nullptr, "%s", Type::str(loc->bottom_type()));
+ assert(loc->bottom_type()->is_oopptr(), "%s", Type::str(loc->bottom_type()));
_stress_rf_hook->add_req(loc);
}
}
@@ -408,12 +408,12 @@ void Parse::load_interpreter_state(Node* osr_buf) {
break;
}
const Type *type = osr_block->local_type_at(index);
- if (StressReachabilityFences && type->isa_oopptr() != nullptr) {
+ if (StressReachabilityFences && type->is_oopptr()) {
// Keep all oops on stack alive until the method returns as if there are
// reachability fences for them at the end of the method.
Node* stk = stack(index);
if (!stk->is_ValueType() && stk->bottom_type() != TypePtr::NULL_PTR) {
- assert(stk->bottom_type()->isa_oopptr() != nullptr, "%s", Type::str(stk->bottom_type()));
+ assert(stk->bottom_type()->is_oopptr(), "%s", Type::str(stk->bottom_type()));
_stress_rf_hook->add_req(stk);
}
}
@@ -855,7 +855,7 @@ void Parse::build_exits() {
// Add a return value to the exit state. (Do not push it yet.)
if (tf()->range_sig()->cnt() > TypeFunc::Parms) {
const Type* ret_type = tf()->range_sig()->field_at(TypeFunc::Parms);
- if (ret_type->isa_int()) {
+ if (ret_type->is_int()) {
BasicType ret_bt = method()->return_type()->basic_type();
if (ret_bt == T_BOOLEAN ||
ret_bt == T_CHAR ||
@@ -1153,7 +1153,7 @@ void Parse::do_exits() {
C->record_method_not_compilable("Can't determine return type.");
return;
}
- if (ret_type->isa_int()) {
+ if (ret_type->is_int()) {
BasicType ret_bt = method()->return_type()->basic_type();
ret_phi = mask_int_value(ret_phi, ret_bt, &_gvn);
}
@@ -1461,7 +1461,7 @@ void Parse::do_method_entry() {
// constructor to satisfy the memory model for strict fields.
if (Arguments::is_valhalla_enabled() && method()->intrinsic_id() == vmIntrinsics::_Object_init) {
Node* receiver_obj = local(0);
- const TypeInstPtr* receiver_type = _gvn.type(receiver_obj)->isa_instptr();
+ const TypeInstPtr* receiver_type = _gvn.type(receiver_obj)->as_instptr();
// If there's no exact type, check if the declared type has no implementors and add a dependency
const TypeKlassPtr* klass_ptr = receiver_type->as_klass_type(/* try_for_exact= */ true);
ciType* klass = klass_ptr->klass_is_exact() ? klass_ptr->exact_klass() : nullptr;
@@ -1498,7 +1498,7 @@ void Parse::do_method_entry() {
for (int idx = 0; idx < max_locals; idx++) {
Node* loc = local(idx);
if (!loc->is_ValueType() &&
- loc->bottom_type()->isa_oopptr() != nullptr &&
+ loc->bottom_type()->is_oopptr() &&
!is_auto_boxed_primitive(loc)) { // ignore auto-boxed primitives
_stress_rf_hook->add_req(loc);
}
@@ -1576,7 +1576,7 @@ void Parse::do_method_entry() {
Node* vt = ValueTypeNode::make_from_oop(this, parm, t->value_klass());
replace_in_map(parm, vt);
}
- } else if (UseTypeSpeculation && (i == (arg_size - 1)) && depth() == 1 && method()->is_varargs() && t->isa_aryptr()) {
+ } else if (UseTypeSpeculation && (i == (arg_size - 1)) && depth() == 1 && method()->is_varargs() && t->is_aryptr()) {
// Speculate on varargs Object array being the default array refined type. The assumption is
// that a vararg method test(Object... o) is often called as test(o1, o2, o3). javac will
// translate the call so that the caller will create a new default array of Object, put o1,
@@ -1584,7 +1584,7 @@ void Parse::do_method_entry() {
// the method we are parsing is the top-level method of the compilation unit. Otherwise, if
// it is truly called according to our assumption, we must know the exact type of the
// argument because the allocation happens inside the compilation unit.
- const TypePtr* spec_type = (t->speculative() != nullptr) ? t->speculative() : t->remove_speculative()->is_aryptr();
+ const TypePtr* spec_type = (t->speculative() != nullptr) ? t->speculative() : t->remove_speculative()->as_aryptr();
ciSignature* method_signature = method()->signature();
ciType* parm_citype = method_signature->type_at(method_signature->count() - 1);
if (!parm_citype->is_obj_array_klass()) {
@@ -1598,8 +1598,8 @@ void Parse::do_method_entry() {
continue;
}
- const TypePtr* improved_type = TypeOopPtr::make(TypePtr::BotPTR, Type::Offset::bottom, TypeOopPtr::InstanceBot, improved_spec_type->is_ptr());
- improved_type = improved_type->join_speculative(t)->is_ptr();
+ const TypePtr* improved_type = TypeOopPtr::make(TypePtr::BotPTR, Type::Offset::bottom, TypeOopPtr::InstanceBot, improved_spec_type->as_ptr());
+ improved_type = improved_type->join_speculative(t)->as_ptr();
if (improved_type != t) {
Node* cast = _gvn.transform(new CheckCastPPNode(control(), parm, improved_type, ConstraintCastNode::DependencyType::NonFloatingNarrowing));
replace_in_map(parm, cast);
@@ -2505,7 +2505,7 @@ int Parse::Block::add_new_path() {
// unsound, as we may replace a Phi which has a narrower Type with one of its input which has a
// wider Type.
Node* Parse::maybe_narrow_phi_input(Node* ctrl, Node* n, const Type* phi_type) {
- if (phi_type->isa_oopptr() != nullptr && !_gvn.type(n)->higher_equal(phi_type)) {
+ if (phi_type->is_oopptr() && !_gvn.type(n)->higher_equal(phi_type)) {
n = new CheckCastPPNode(ctrl, n, phi_type, ConstraintCastNode::DependencyType::NonFloatingNarrowing);
n = _gvn.transform(n);
}
@@ -2631,7 +2631,7 @@ PhiNode *Parse::ensure_memory_phi(int idx, bool nocreate) {
// class need finalization.
void Parse::call_register_finalizer() {
Node* receiver = local(0);
- assert(receiver != nullptr && receiver->bottom_type()->isa_instptr() != nullptr,
+ assert(receiver != nullptr && receiver->bottom_type()->is_instptr(),
"must have non-null instance type");
const TypeInstPtr *tinst = receiver->bottom_type()->isa_instptr();
@@ -2756,7 +2756,7 @@ void Parse::return_current(Node* value) {
// Insert reachability fences for all oop arguments at the end of the method.
for (uint i = 1; i < _stress_rf_hook->req(); i++) {
Node* referent = _stress_rf_hook->in(i);
- assert(referent->bottom_type()->isa_oopptr(), "%s", Type::str(referent->bottom_type()));
+ assert(referent->bottom_type()->is_oopptr(), "%s", Type::str(referent->bottom_type()));
insert_reachability_fence(referent);
}
}
diff --git a/src/hotspot/share/opto/parse2.cpp b/src/hotspot/share/opto/parse2.cpp
index 82f902a389a..0d06f32f073 100644
--- a/src/hotspot/share/opto/parse2.cpp
+++ b/src/hotspot/share/opto/parse2.cpp
@@ -84,7 +84,7 @@ void Parse::array_load(BasicType bt) {
// Handle value type arrays
const TypeOopPtr* element_ptr = elemtype->make_oopptr();
- const TypeAryPtr* array_type = _gvn.type(array)->is_aryptr();
+ const TypeAryPtr* array_type = _gvn.type(array)->as_aryptr();
if (!array_type->is_not_flat()) {
// Cannot statically determine if array is a flat array, emit runtime check
@@ -99,7 +99,7 @@ void Parse::array_load(BasicType bt) {
if (!array_type->is_flat()) {
assert(array_type->is_flat() || control()->in(0)->as_If()->is_flat_array_check(&_gvn), "Should be found");
// Loading from a non-flat array, casting array to not flat.
- const TypeAryPtr* ary_type = _gvn.type(prep_array)->is_aryptr();
+ const TypeAryPtr* ary_type = _gvn.type(prep_array)->as_aryptr();
ary_type = ary_type->cast_to_not_flat();
Node* not_flat_ary = _gvn.transform(new CheckCastPPNode(control(), prep_array, ary_type));
Node* adr = get_ptr_to_array_element(not_flat_ary, array_index, bt, ary_type->size(), control());
@@ -198,7 +198,7 @@ Node* Parse::load_from_unknown_flat_array(Node* array, Node* array_index, const
insert_mem_bar_volatile(Op_MemBarCPUOrder, C->get_alias_index(TypeAryPtr::INLINES));
// Keep track of the information that the value type is in flat arrays
- const Type* unknown_value = element_ptr->is_instptr()->cast_to_flat_in_array();
+ const Type* unknown_value = element_ptr->as_instptr()->cast_to_flat_in_array();
return _gvn.transform(new CheckCastPPNode(control(), buffer, unknown_value));
}
@@ -209,7 +209,7 @@ void Parse::array_store(BasicType bt) {
if (stopped()) return; // guaranteed null or range check
Node* adr = get_ptr_to_array_element(prep_array, /* index */peek(0+type2size[bt]), bt,
- _gvn.type(prep_array)->is_aryptr()->size(), control());
+ _gvn.type(prep_array)->as_aryptr()->size(), control());
Node* stored_value_casted = nullptr;
if (bt == T_OBJECT) {
@@ -222,7 +222,7 @@ void Parse::array_store(BasicType bt) {
Node* const array_index = pop(); // Index in the array
Node* array = pop(); // The array itself
- const TypeAryPtr* array_type = _gvn.type(array)->is_aryptr();
+ const TypeAryPtr* array_type = _gvn.type(array)->as_aryptr();
const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(bt);
if (elemtype == TypeInt::BOOL) {
@@ -233,7 +233,7 @@ void Parse::array_store(BasicType bt) {
// Based on the value to be stored, try to determine if the array is not null-free and/or not flat.
// This is only legal for non-null stores because the array_store_check always passes for null, even
// if the array is null-free. Null stores are handled in GraphKit::value_array_null_guard().
- bool not_value = !stored_value_casted_type->maybe_null() && !stored_value_casted_type->is_oopptr()->can_be_value_type();
+ bool not_value = !stored_value_casted_type->maybe_null() && !stored_value_casted_type->as_oopptr()->can_be_value_type();
bool not_null_free = not_value;
bool not_flat = not_value || ( stored_value_casted_type->is_valueklassptr() &&
!stored_value_casted_type->value_klass()->maybe_flat_in_array());
@@ -260,7 +260,7 @@ void Parse::array_store(BasicType bt) {
if (!array_type->is_not_flat()) {
// Array might be a flat array, emit runtime checks (for null, a simple value_array_null_guard is sufficient).
- assert(UseArrayFlattening && !not_flat && elemtype->is_oopptr()->can_be_value_type() &&
+ assert(UseArrayFlattening && !not_flat && elemtype->as_oopptr()->can_be_value_type() &&
(!array_type->klass_is_exact() || array_type->is_flat()), "array can't be a flat array");
// If by chance (or using layout disabling flags), only the nullable version is flattenable
// we could avoid this test in the else branch thereunder (the "Flat array" block) and do it
@@ -271,7 +271,7 @@ void Parse::array_store(BasicType bt) {
// only apply with extra (experimental) flags which makes the optimization not worth.
array = value_array_null_guard(array, stored_value_casted, 3);
// Reload array type which could have been updated by value_array_null_guard().
- array_type = _gvn.type(array)->is_aryptr();
+ array_type = _gvn.type(array)->as_aryptr();
IdealKit ideal(this);
ideal.if_then(flat_array_test(array, /* flat = */ false)); {
// Non-flat array
@@ -328,7 +328,7 @@ void Parse::array_store(BasicType bt) {
return;
} else if (!array_type->is_not_null_free()) {
// Array is not flat but may be null free
- assert(elemtype->is_oopptr()->can_be_value_type(), "array can't be null-free");
+ assert(elemtype->as_oopptr()->can_be_value_type(), "array can't be null-free");
array = value_array_null_guard(array, stored_value_casted, 3);
}
}
@@ -374,14 +374,14 @@ Node* Parse::prepare_array_addressing(BasicType type, int vals, const Type*& ele
// Compile-time detect of null-exception?
if (stopped()) return top();
- const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
+ const TypeAryPtr* arytype = _gvn.type(ary)->as_aryptr();
const TypeInt* sizetype = arytype->size();
elemtype = arytype->elem();
if (UseUniqueSubclasses) {
const Type* el = elemtype->make_ptr();
- if (el && el->isa_instptr()) {
- const TypeInstPtr* toop = el->is_instptr();
+ if (el != nullptr && el->is_instptr()) {
+ const TypeInstPtr* toop = el->as_instptr();
if (toop->instance_klass()->unique_concrete_subklass()) {
// If we load from "AbstractClass[]" we must see "ConcreteSubClass".
const Type* subklass = Type::get_const_type(toop->instance_klass());
@@ -427,7 +427,7 @@ Node* Parse::get_ptr_to_array_element(Node* array, Node* idx, BasicType elembt,
// Check if we need a range check for an array access. This is the case if the index is either negative or if it could
// be greater or equal the smallest possible array size (i.e. out-of-bounds).
bool Parse::needs_range_check(const TypeInt* size_type, const Node* index) const {
- const TypeInt* index_type = _gvn.type(index)->is_int();
+ const TypeInt* index_type = _gvn.type(index)->as_int();
return index_type->_hi >= size_type->_lo || index_type->_lo < 0;
}
@@ -537,7 +537,7 @@ Node* Parse::cast_to_speculative_array_type(Node* const array, const TypeAryPtr*
uncommon_trap_exact(reason, Deoptimization::Action_maybe_recompile);
}
replace_in_map(array, casted_array);
- array_type = _gvn.type(casted_array)->is_aryptr();
+ array_type = _gvn.type(casted_array)->as_aryptr();
element_type = array_type->elem();
return casted_array;
}
@@ -565,7 +565,7 @@ Node* Parse::speculate_non_null_free_array(Node* const array, const TypeAryPtr*&
bool null_free_array = true;
Deoptimization::DeoptReason reason = Deoptimization::Reason_none;
if (array_type->speculative() != nullptr &&
- array_type->speculative()->is_aryptr()->is_not_null_free() &&
+ array_type->speculative()->as_aryptr()->is_not_null_free() &&
!too_many_traps_or_recompiles(Deoptimization::Reason_speculate_class_check)) {
null_free_array = false;
reason = Deoptimization::Reason_speculate_class_check;
@@ -586,7 +586,7 @@ Node* Parse::speculate_non_null_free_array(Node* const array, const TypeAryPtr*&
assert(!stopped(), "null-free array should have been caught earlier");
Node* casted_array = _gvn.transform(new CheckCastPPNode(control(), array, array_type->cast_to_not_null_free()));
replace_in_map(array, casted_array);
- array_type = _gvn.type(casted_array)->is_aryptr();
+ array_type = _gvn.type(casted_array)->as_aryptr();
return casted_array;
}
return array;
@@ -598,7 +598,7 @@ Node* Parse::speculate_non_flat_array(Node* const array, const TypeAryPtr* const
bool flat_array = true;
Deoptimization::DeoptReason reason = Deoptimization::Reason_none;
if (array_type->speculative() != nullptr &&
- array_type->speculative()->is_aryptr()->is_not_flat() &&
+ array_type->speculative()->as_aryptr()->is_not_flat() &&
!too_many_traps_or_recompiles(Deoptimization::Reason_speculate_class_check)) {
flat_array = false;
reason = Deoptimization::Reason_speculate_class_check;
@@ -2501,7 +2501,7 @@ IfNode* Parse::acmp_fast_path_if_from_substitutable_call(PhaseGVN* phase, CallSt
if (!node->is_Con()) return false;
TypeNode* con = node->as_Type();
assert(con->type()->is_intptr_t(), "");
- return con->type()->is_intptr_t()->is_con(in_bytes(n));
+ return con->type()->as_intptr_t()->is_con(in_bytes(n));
};
assert(call->in(TypeFunc::Control) != nullptr, "");
@@ -2529,8 +2529,7 @@ IfNode* Parse::acmp_fast_path_if_from_substitutable_call(PhaseGVN* phase, CallSt
LoadNode* load_offset = cmp_i->in(1)->as_Load();
if (!cmp_i->in(2)->is_ConI()) return nullptr;
ConINode* zero_i = cmp_i->in(2)->as_ConI();
- assert(zero_i->type()->is_int() != nullptr, "");
- if (!zero_i->type()->is_int()->is_con(0)) return nullptr;
+ if (!zero_i->type()->as_int()->is_con(0)) return nullptr;
assert(load_offset->in(2) != nullptr, "");
if (!load_offset->in(2)->is_AddP()) return nullptr;
@@ -2552,7 +2551,7 @@ IfNode* Parse::acmp_fast_path_if_from_substitutable_call(PhaseGVN* phase, CallSt
assert(members_addr_add->in(AddPNode::Address) != nullptr, "");
assert(members_addr_add->in(AddPNode::Offset) != nullptr, "");
if (!members_addr_add->in(AddPNode::Base)->is_top()) return nullptr;
- if (!phase->type(members_addr_add->in(AddPNode::Address))->isa_instklassptr()) return nullptr;
+ if (!phase->type(members_addr_add->in(AddPNode::Address))->is_instklassptr()) return nullptr;
if (!is_con_offset(members_addr_add->in(AddPNode::Offset), ValueKlass::adr_members_offset())) return nullptr;
return iff;
@@ -2709,8 +2708,8 @@ static Node* extract_obj_from_klass_load(PhaseGVN* gvn, Node* n) {
Node* obj = AddPNode::Ideal_base_and_offset(adr, gvn, off);
if (obj == nullptr || off != oopDesc::klass_offset_in_bytes()) // loading oopDesc::_klass?
return nullptr;
- const TypePtr* tp = gvn->type(obj)->is_ptr();
- if (tp == nullptr || !(tp->isa_instptr() || tp->isa_aryptr())) // is obj a Java object ptr?
+ const TypePtr* tp = gvn->type(obj)->as_ptr();
+ if (!(tp->is_instptr() || tp->is_aryptr())) // is obj a Java object ptr?
return nullptr;
return obj;
@@ -2731,7 +2730,7 @@ static bool match_type_check(PhaseGVN& gvn,
// Look for opportunities to sharpen the type of a node whose klass is compared with a constant klass.
// The constant klass being tested against can come from many bytecode instructions (implicitly or explicitly),
// and also from profile data used by speculative casts.
- if (btest == BoolTest::eq && tcon->isa_klassptr()) {
+ if (btest == BoolTest::eq && tcon->is_klassptr()) {
// Found:
// Bool(CmpP(LoadKlass(obj._klass), ConP(Foo.klass)), [eq])
// or the narrowOop equivalent.
@@ -2742,7 +2741,7 @@ static bool match_type_check(PhaseGVN& gvn,
// These patterns with nullable klasses arise from example from
// load_array_klass_from_mirror.
if (*obj == nullptr) { return false; }
- (*cast_type) = tcon->isa_klassptr()->as_exact_instance_type();
+ (*cast_type) = tcon->as_klassptr()->as_exact_instance_type();
return true; // found
}
@@ -2769,7 +2768,7 @@ static bool match_type_check(PhaseGVN& gvn,
// Bool [btest]
// |
//
- if (tcon->isa_int() && val->is_Phi() && val->in(0)->as_Region()->is_diamond()) {
+ if (tcon->is_int() && val->is_Phi() && val->in(0)->as_Region()->is_diamond()) {
RegionNode* diamond = val->in(0)->as_Region();
IfNode* if1 = diamond->in(1)->in(0)->as_If();
BoolNode* b1 = if1->in(1)->isa_Bool();
@@ -2785,15 +2784,15 @@ static bool match_type_check(PhaseGVN& gvn,
// gen_instanceof() emits 1 on success and 0 on failure.
// Check whether current comparison selects the success value.
const Type* success_tval = gvn.type(val->in(success_idx));
- assert(success_tval->isa_int(), "not an int: %s", Type::str(success_tval));
+ assert(success_tval->is_int(), "not an int: %s", Type::str(success_tval));
if ((btest == BoolTest::eq && tcon == success_tval) ||
(btest == BoolTest::ne && tcon->join(success_tval)->empty())) {
SubTypeCheckNode* sub = b1->in(1)->as_SubTypeCheck();
Node* obj_or_subklass = sub->in(SubTypeCheckNode::ObjOrSubKlass);
Node* superklass = sub->in(SubTypeCheckNode::SuperKlass);
- if (gvn.type(obj_or_subklass)->isa_oopptr()) {
- const TypeKlassPtr* klass_ptr_type = gvn.type(superklass)->is_klassptr();
+ if (gvn.type(obj_or_subklass)->is_oopptr()) {
+ const TypeKlassPtr* klass_ptr_type = gvn.type(superklass)->as_klassptr();
const TypeKlassPtr* improved_klass_ptr_type = klass_ptr_type->try_improve();
(*obj) = obj_or_subklass;
@@ -2834,7 +2833,7 @@ void Parse::sharpen_type_after_if(BoolTest::mask btest,
_gvn.set_type_bottom(ccast);
record_for_igvn(ccast);
if (tboth->is_valueklassptr()) {
- ccast = ValueTypeNode::make_from_oop(this, ccast, tboth->isa_oopptr()->exact_klass(true)->as_value_klass());
+ ccast = ValueTypeNode::make_from_oop(this, ccast, tboth->as_oopptr()->exact_klass(true)->as_value_klass());
}
// Here's the payoff.
replace_in_map(obj, ccast);
@@ -2862,7 +2861,7 @@ void Parse::sharpen_type_after_if(BoolTest::mask btest,
{
const Type* tboth = tcon->join_speculative(tval);
if (tboth == tval) break; // Nothing to gain.
- if (tcon->isa_int()) {
+ if (tcon->is_int()) {
ccast = new CastIINode(control(), val, tboth);
} else if (tcon == TypePtr::NULL_PTR) {
// Cast to null, but keep the pointer identity temporarily live.
@@ -2933,7 +2932,7 @@ Node* Parse::optimize_cmp_with_klass(Node* c) {
if (load_klass->in(2)->is_AddP()) {
Node* addp = load_klass->in(2);
Node* obj = addp->in(AddPNode::Address);
- const TypeOopPtr* obj_type = _gvn.type(obj)->is_oopptr();
+ const TypeOopPtr* obj_type = _gvn.type(obj)->as_oopptr();
if (obj_type->speculative_type_not_null() != nullptr) {
ciKlass* k = obj_type->speculative_type();
inc_sp(2);
diff --git a/src/hotspot/share/opto/parse3.cpp b/src/hotspot/share/opto/parse3.cpp
index 7284be3720f..70d2984e3a6 100644
--- a/src/hotspot/share/opto/parse3.cpp
+++ b/src/hotspot/share/opto/parse3.cpp
@@ -183,7 +183,7 @@ void Parse::do_get_xxx(Node* obj, ciField* field) {
if (con->is_null_object()) {
type = TypePtr::NULL_PTR;
} else {
- type = TypeOopPtr::make_from_constant(con)->isa_oopptr();
+ type = TypeOopPtr::make_from_constant(con);
}
assert(type != nullptr, "field singleton type must be consistent");
} else {
@@ -408,7 +408,7 @@ Node* Parse::expand_multianewarray(ciArrayKlass* array_klass, Node* *lengths, in
guarantee(length_con >= 0, "non-constant multianewarray");
ciArrayKlass* array_klass_1 = array_klass->as_obj_array_klass()->element_klass()->as_array_klass();
const TypePtr* adr_type = TypeAryPtr::OOPS;
- const TypeOopPtr* elemtype = _gvn.type(array)->is_aryptr()->elem()->make_oopptr();
+ const TypeOopPtr* elemtype = _gvn.type(array)->as_aryptr()->elem()->make_oopptr();
const intptr_t header = arrayOopDesc::base_offset_in_bytes(T_OBJECT);
for (jint i = 0; i < length_con; i++) {
Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs);
@@ -534,12 +534,12 @@ void Parse::do_multianewarray() {
const Type* type = TypeOopPtr::make_from_klass_raw(array_klass, Type::trust_interfaces);
// Improve the type: We know it's not null, exact, and of a given length.
- type = type->is_ptr()->cast_to_ptr_type(TypePtr::NotNull);
- type = type->is_aryptr()->cast_to_exactness(true);
+ type = type->as_ptr()->cast_to_ptr_type(TypePtr::NotNull);
+ type = type->as_aryptr()->cast_to_exactness(true);
const TypeInt* ltype = _gvn.find_int_type(length[0]);
if (ltype != nullptr)
- type = type->is_aryptr()->cast_to_size(ltype);
+ type = type->as_aryptr()->cast_to_size(ltype);
// We cannot sharpen the nested sub-arrays, since the top level is mutable.
diff --git a/src/hotspot/share/opto/parseHelper.cpp b/src/hotspot/share/opto/parseHelper.cpp
index ef161d758d1..e718266cc4b 100644
--- a/src/hotspot/share/opto/parseHelper.cpp
+++ b/src/hotspot/share/opto/parseHelper.cpp
@@ -160,7 +160,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
// This cutout lets us avoid the uncommon_trap(Reason_array_check)
// below, which turns into a performance liability if the
// gen_checkcast folds up completely.
- if (_gvn.type(ary)->is_aryptr()->is_null_free()) {
+ if (_gvn.type(ary)->as_aryptr()->is_null_free()) {
null_check(obj);
}
return obj;
@@ -169,7 +169,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
// Extract the array klass type
Node* array_klass = load_object_klass(ary);
// Get the array klass
- const TypeKlassPtr* tak = _gvn.type(array_klass)->is_klassptr();
+ const TypeKlassPtr* tak = _gvn.type(array_klass)->as_klassptr();
// The type of array_klass is usually INexact array-of-oop. Heroically
// cast array_klass to EXACT array and uncommon-trap if the cast fails.
@@ -178,13 +178,13 @@ Node* Parse::array_store_check(const Type*& elemtype) {
if (MonomorphicArrayCheck && !tak->klass_is_exact()) {
// Make a constant out of the inexact array klass
const TypeAryKlassPtr* extak = nullptr;
- const TypeOopPtr* ary_t = _gvn.type(ary)->is_oopptr();
+ const TypeOopPtr* ary_t = _gvn.type(ary)->as_oopptr();
ciKlass* ary_spec = ary_t->speculative_type();
Deoptimization::DeoptReason reason = Deoptimization::Reason_none;
// Try to cast the array to an exact type from profile data. First
// check the speculative type.
if (ary_spec != nullptr && !too_many_traps(Deoptimization::Reason_speculate_class_check)) {
- extak = TypeKlassPtr::make(ary_spec)->is_aryklassptr();
+ extak = TypeKlassPtr::make(ary_spec)->as_aryklassptr();
reason = Deoptimization::Reason_speculate_class_check;
} else if (UseArrayLoadStoreProfile) {
// No speculative type: check profile data at this bci.
@@ -197,10 +197,10 @@ Node* Parse::array_store_check(const Type*& elemtype) {
bool null_free_array = true;
method()->array_access_profiled_type(bci(), array_type, element_type, element_ptr, flat_array, null_free_array);
if (array_type != nullptr) {
- extak = TypeKlassPtr::make(array_type)->is_aryklassptr();
+ extak = TypeKlassPtr::make(array_type)->as_aryklassptr();
}
}
- } else if (!too_many_traps(Deoptimization::Reason_array_check) && tak->isa_aryklassptr()) {
+ } else if (!too_many_traps(Deoptimization::Reason_array_check) && tak->is_aryklassptr()) {
// If the compiler has determined that the type of array 'ary' (represented
// by 'array_klass') is java/lang/Object, the compiler must not assume that
// the array 'ary' is monomorphic.
@@ -219,7 +219,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
// 'array_klass' to be ObjArrayKlass, which can result in invalid memory accesses.
//
// See issue JDK-8057622 for details.
- extak = tak->cast_to_exactness(true)->is_aryklassptr();
+ extak = tak->cast_to_exactness(true)->as_aryklassptr();
reason = Deoptimization::Reason_array_check;
}
if (extak != nullptr && extak->exact_klass(true) != nullptr) {
@@ -242,7 +242,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
Node* cast = _gvn.transform(new CheckCastPPNode(control(), ary, extak->as_exact_instance_type()));
replace_in_map(ary, cast);
ary = cast;
- elemtype = _gvn.type(ary)->is_aryptr()->elem();
+ elemtype = _gvn.type(ary)->as_aryptr()->elem();
CompileLog* log = C->log();
if (log != nullptr) {
@@ -261,7 +261,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
Node* a_e_klass = _gvn.transform(LoadKlassNode::make(_gvn, immutable_memory(), p2, tak));
// If we statically know that this is a value type array, use precise element klass for checkcast
- const TypeAryPtr* arytype = _gvn.type(ary)->is_aryptr();
+ const TypeAryPtr* arytype = _gvn.type(ary)->as_aryptr();
const TypePtr* elem_ptr = elemtype->make_ptr();
bool null_free = arytype->is_null_free();
if (elem_ptr->is_valueklassptr()) {
@@ -285,7 +285,7 @@ Node* Parse::array_store_check(const Type*& elemtype) {
// merged or hidden behind super types. Therefore, an inexact null-free array always represents some kind of
// value type array - either of an abstract value class or Object.
if (null_free) {
- ciKlass* klass = elem_ptr->is_instptr()->instance_klass();
+ ciKlass* klass = elem_ptr->as_instptr()->instance_klass();
if (klass->exact_klass()) {
assert(elem_ptr->is_valueklassptr() || arytype->is_autobox_cache(), "elements must be value type or autobox cache");
} else {
diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp
index e7d5791f3fd..b734674435b 100644
--- a/src/hotspot/share/opto/phaseX.cpp
+++ b/src/hotspot/share/opto/phaseX.cpp
@@ -535,13 +535,13 @@ int PhaseRenumberLive::update_embedded_ids(Node* n) {
}
const Type* type = _new_type_array.fast_lookup(n->_idx);
- if (type != nullptr && type->isa_oopptr() && type->is_oopptr()->is_known_instance()) {
+ if (type != nullptr && type->is_oopptr() && type->as_oopptr()->is_known_instance()) {
if (!_is_pass_finished) {
return -1; // delay
}
- int old_idx = type->is_oopptr()->instance_id();
+ int old_idx = type->as_oopptr()->instance_id();
int new_idx = new_index(old_idx);
- const Type* new_type = type->is_oopptr()->with_instance_id(new_idx);
+ const Type* new_type = type->as_oopptr()->with_instance_id(new_idx);
_new_type_array.map(n->_idx, new_type);
no_of_updates++;
}
@@ -605,8 +605,8 @@ ConNode* PhaseValues::makecon(const Type* t) {
switch (t->base()) { // fast paths
case Type::Half:
case Type::Top: return (ConNode*) C->top();
- case Type::Int: return intcon( t->is_int()->get_con() );
- case Type::Long: return longcon( t->is_long()->get_con() );
+ case Type::Int: return intcon(t->as_int()->get_con());
+ case Type::Long: return longcon(t->as_long()->get_con());
default: break;
}
if (t->is_zero_type())
@@ -1076,8 +1076,8 @@ bool PhaseIterGVN::needs_deep_revisit(const Node* n) const {
if (n->Opcode() == Op_CmpP) {
const Type* t1 = type_or_null(n->in(1));
const Type* t2 = type_or_null(n->in(2));
- return t1 != nullptr && t1->isa_oopptr() &&
- t2 != nullptr && t2->isa_oopptr();
+ return t1 != nullptr && t1->is_oopptr() &&
+ t2 != nullptr && t2->is_oopptr();
}
// IfNode::Ideal() -> search_identical() walks up the CFG dominator tree.
// RangeCheckNode::Ideal() scans up to ~999 nodes up the chain.
@@ -1247,8 +1247,8 @@ void PhaseIterGVN::optimize(bool deep) {
static bool klass_bottom_type_invalidated(const Node* n, const Type* new_type) {
// Concurrent class loading can invalidate a klass bottom type.
const Type* bt = n->bottom_type();
- return (bt->isa_klassptr() != nullptr ||
- bt->isa_narrowklass() != nullptr) &&
+ return (bt->is_klassptr() ||
+ bt->is_narrowklass()) &&
!new_type->higher_equal_speculative(bt);
}
@@ -1337,9 +1337,9 @@ void PhaseIterGVN::verify_Value_for(const Node* n, const Type* tnew, bool strict
}
// Exception (1)
// Integer "widen" changes, but range is the same.
- if (told->isa_integer(tnew->basic_type()) != nullptr) { // both either int or long
- const TypeInteger* t0 = told->is_integer(tnew->basic_type());
- const TypeInteger* t1 = tnew->is_integer(tnew->basic_type());
+ if (told->is_integer(tnew->basic_type())) { // both either int or long
+ const TypeInteger* t0 = told->as_integer(tnew->basic_type());
+ const TypeInteger* t1 = tnew->as_integer(tnew->basic_type());
if (t0->lo_as_long() == t1->lo_as_long() &&
t0->hi_as_long() == t1->hi_as_long()) {
return; // ignore integer widen
@@ -1355,7 +1355,7 @@ void PhaseIterGVN::verify_Value_for(const Node* n, const Type* tnew, bool strict
}
// Exception (3)
// CmpPNode performs deep traversals if it compares oopptr. CmpP is not notified for changes far away.
- if (!strict && n->Opcode() == Op_CmpP && type(n->in(1))->isa_oopptr() && type(n->in(2))->isa_oopptr()) {
+ if (!strict && n->Opcode() == Op_CmpP && type(n->in(1))->is_oopptr() && type(n->in(2))->is_oopptr()) {
// SubNode::Value
// CmpPNode::sub
// MemNode::detect_ptr_independence
@@ -2901,11 +2901,11 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_
}
}
}
- if (use_op == Op_LoadP && use->bottom_type()->isa_rawptr()) {
+ if (use_op == Op_LoadP && use->bottom_type()->is_rawptr()) {
for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
Node* u = use->fast_out(i2);
const Type* ut = u->bottom_type();
- if (u->Opcode() == Op_LoadP && ut->isa_instptr()) {
+ if (u->Opcode() == Op_LoadP && ut->is_instptr()) {
worklist.push(u);
}
}
@@ -3185,8 +3185,8 @@ void PhaseCCP::verify_type(Node* n, const Type* tnew, const Type* told) {
tty->print("tnew = "); tnew->dump(); tty->cr();
fatal("Not monotonic");
}
- assert(!told->isa_int() || !tnew->isa_int() || told->is_int()->_widen <= tnew->is_int()->_widen, "widen increases");
- assert(!told->isa_long() || !tnew->isa_long() || told->is_long()->_widen <= tnew->is_long()->_widen, "widen increases");
+ assert(!told->is_int() || !tnew->is_int() || told->as_int()->_widen <= tnew->as_int()->_widen, "widen increases");
+ assert(!told->is_long() || !tnew->is_long() || told->as_long()->_widen <= tnew->as_long()->_widen, "widen increases");
}
#endif //ASSERT
@@ -3289,7 +3289,7 @@ bool PhaseCCP::needs_revisit(Node* n) const {
return true;
}
// CmpPNode performs deep traversals if it compares oopptr. CmpP is not notified for changes far away.
- if (n->Opcode() == Op_CmpP && type(n->in(1))->isa_oopptr() && type(n->in(2))->isa_oopptr()) {
+ if (n->Opcode() == Op_CmpP && type(n->in(1))->is_oopptr() && type(n->in(2))->is_oopptr()) {
return true;
}
return false;
@@ -3497,11 +3497,11 @@ void PhaseCCP::push_cast(Unique_Node_List& worklist, const Node* use) {
// Loading the java mirror from a Klass requires two loads and the type of the mirror load depends on the type of 'n'.
// See LoadNode::Value().
void PhaseCCP::push_loadp(Unique_Node_List& worklist, const Node* use) const {
- if (use->Opcode() == Op_LoadP && use->bottom_type()->isa_rawptr()) {
+ if (use->Opcode() == Op_LoadP && use->bottom_type()->is_rawptr()) {
for (DUIterator_Fast imax, i = use->fast_outs(imax); i < imax; i++) {
Node* loadp = use->fast_out(i);
const Type* ut = loadp->bottom_type();
- if (loadp->Opcode() == Op_LoadP && ut->isa_instptr() && ut != type(loadp)) {
+ if (loadp->Opcode() == Op_LoadP && ut->is_instptr() && ut != type(loadp)) {
worklist.push(loadp);
}
}
diff --git a/src/hotspot/share/opto/reachability.hpp b/src/hotspot/share/opto/reachability.hpp
index ba435c8484f..d8a61b3b0dd 100644
--- a/src/hotspot/share/opto/reachability.hpp
+++ b/src/hotspot/share/opto/reachability.hpp
@@ -43,8 +43,8 @@ class ReachabilityFenceNode : public Node {
public:
ReachabilityFenceNode(Compile* C, Node* ctrl, Node* referent)
: Node(1) {
- assert(referent->bottom_type()->isa_oopptr() ||
- referent->bottom_type()->isa_narrowoop() != nullptr ||
+ assert(referent->bottom_type()->is_oopptr() ||
+ referent->bottom_type()->is_narrowoop() ||
referent->bottom_type() == TypePtr::NULL_PTR,
"%s", Type::str(referent->bottom_type()));
init_class_id(Class_ReachabilityFence);
diff --git a/src/hotspot/share/opto/split_if.cpp b/src/hotspot/share/opto/split_if.cpp
index 6fddf38bc13..ba03999fa76 100644
--- a/src/hotspot/share/opto/split_if.cpp
+++ b/src/hotspot/share/opto/split_if.cpp
@@ -141,7 +141,7 @@ bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) {
// operations on anti-dep loads as we do their killing stores.
if( n->is_Store() && n->in(MemNode::Memory)->in(0) == n->in(0) ) {
// Get store's memory slice
- int alias_idx = C->get_alias_index(_igvn.type(n->in(MemNode::Address))->is_ptr());
+ int alias_idx = C->get_alias_index(_igvn.type(n->in(MemNode::Address))->as_ptr());
// Get memory-phi anti-dep loads will be using
Node *memphi = n->in(MemNode::Memory);
@@ -150,7 +150,7 @@ bool PhaseIdealLoop::split_up( Node *n, Node *blk1, Node *blk2 ) {
// it will then "split-up".
for (DUIterator_Fast imax,i = memphi->fast_outs(imax); i < imax; i++) {
Node *load = memphi->fast_out(i);
- if( load->is_Load() && alias_idx == C->get_alias_index(_igvn.type(load->in(MemNode::Address))->is_ptr()) )
+ if (load->is_Load() && alias_idx == C->get_alias_index(_igvn.type(load->in(MemNode::Address))->as_ptr()))
set_ctrl(load,blk1);
}
}
diff --git a/src/hotspot/share/opto/stringopts.cpp b/src/hotspot/share/opto/stringopts.cpp
index 09c797714e4..fadc990a2e0 100644
--- a/src/hotspot/share/opto/stringopts.cpp
+++ b/src/hotspot/share/opto/stringopts.cpp
@@ -598,7 +598,7 @@ StringConcat* PhaseStringOpts::build_candidate(CallStaticJavaNode* call) {
// StringBuilder(int) case.
Node* parm = use->in(TypeFunc::Parms + 1);
assert(parm != nullptr, "must exist");
- const TypeInt* type = _gvn->type(parm)->is_int();
+ const TypeInt* type = _gvn->type(parm)->as_int();
if (type->_hi < 0) {
// Initial capacity argument is always negative in which case StringBuilder(int) throws
// a NegativeArraySizeException. Bail out from string opts.
@@ -1588,7 +1588,7 @@ void PhaseStringOpts::arraycopy(GraphKit& kit, IdealKit& ideal, Node* src_array,
bool aligned = (arrayOopDesc::base_offset_in_bytes(T_BYTE) % HeapWordSize == 0);
// If true, then check if dst array address is aligned to HeapWordSize
if (aligned) {
- const TypeInt* tdst = __ gvn().type(start)->is_int();
+ const TypeInt* tdst = __ gvn().type(start)->as_int();
aligned = tdst->is_con() && ((arrayOopDesc::base_offset_in_bytes(T_BYTE) +
tdst->get_con() * type2aelembytes(T_BYTE)) % HeapWordSize == 0);
}
@@ -1824,7 +1824,7 @@ Node* PhaseStringOpts::allocate_byte_array(GraphKit& kit, IdealKit* ideal, Node*
jbyte PhaseStringOpts::get_constant_coder(GraphKit& kit, Node* str) {
assert(str->is_Con(), "String must be constant");
- const TypeOopPtr* str_type = kit.gvn().type(str)->isa_oopptr();
+ const TypeOopPtr* str_type = kit.gvn().type(str)->as_oopptr();
ciInstance* str_instance = str_type->const_oop()->as_instance();
jbyte coder = str_instance->field_value_by_offset(java_lang_String::coder_offset()).as_byte();
assert(CompactStrings || (coder == java_lang_String::CODER_UTF16), "Strings must be UTF16 encoded");
@@ -1838,7 +1838,7 @@ int PhaseStringOpts::get_constant_length(GraphKit& kit, Node* str) {
ciTypeArray* PhaseStringOpts::get_constant_value(GraphKit& kit, Node* str) {
assert(str->is_Con(), "String must be constant");
- const TypeOopPtr* str_type = kit.gvn().type(str)->isa_oopptr();
+ const TypeOopPtr* str_type = kit.gvn().type(str)->as_oopptr();
ciInstance* str_instance = str_type->const_oop()->as_instance();
ciObject* src_array = str_instance->field_value_by_offset(java_lang_String::value_offset()).as_object();
return src_array->as_type_array();
@@ -1922,7 +1922,7 @@ void PhaseStringOpts::replace_string_concat(StringConcat* sc) {
case StringConcat::NegativeIntCheckMode: {
// Initial capacity argument might be negative in which case StringBuilder(int) throws
// a NegativeArraySizeException. Insert a runtime check with an uncommon trap.
- const TypeInt* type = kit.gvn().type(arg)->is_int();
+ const TypeInt* type = kit.gvn().type(arg)->as_int();
assert(type->_hi >= 0 && type->_lo < 0, "no runtime int check needed");
Node* p = __ Bool(__ CmpI(arg, kit.intcon(0)), BoolTest::ge);
IfNode* iff = kit.create_and_map_if(kit.control(), p, PROB_MIN, COUNT_UNKNOWN);
@@ -2031,7 +2031,7 @@ void PhaseStringOpts::replace_string_concat(StringConcat* sc) {
}
case StringConcat::CharMode: {
// one character only
- const TypeInt* t = kit.gvn().type(arg)->is_int();
+ const TypeInt* t = kit.gvn().type(arg)->as_int();
if (!coder_fixed && t->is_con()) {
// Constant char
if (t->get_con() <= 255) {
diff --git a/src/hotspot/share/opto/subnode.cpp b/src/hotspot/share/opto/subnode.cpp
index 16d9cec089e..1931e2a64cc 100644
--- a/src/hotspot/share/opto/subnode.cpp
+++ b/src/hotspot/share/opto/subnode.cpp
@@ -192,7 +192,7 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){
if( t2 == Type::TOP ) return nullptr;
// Convert "x-c0" into "x+ -c0".
if( t2->base() == Type::Int ){ // Might be bottom or top...
- const TypeInt *i = t2->is_int();
+ const TypeInt* i = t2->as_int();
if( i->is_con() )
return new AddINode(in1, phase->intcon(java_negate(i->get_con())));
}
@@ -214,11 +214,11 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){
if (op2 == Op_AddI
&& ok_to_convert(in2, in1)
&& in2->in(2)->Opcode() == Op_ConI) {
- jint c0 = phase->type(in2->in(2))->isa_int()->get_con();
+ jint c0 = phase->type(in2->in(2))->as_int()->get_con();
Node* in21 = in2->in(1);
if (in1->Opcode() == Op_ConI) {
// Match c1
- jint c1 = phase->type(in1)->isa_int()->get_con();
+ jint c1 = phase->type(in1)->as_int()->get_con();
Node* sub2 = phase->intcon(java_subtract(c1, c0));
return new SubINode(sub2, in21);
} else {
@@ -323,13 +323,13 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){
}
// Convert "0-(A>>31)" into "(A>>>31)"
- if ( op2 == Op_RShiftI ) {
- Node *in21 = in2->in(1);
- Node *in22 = in2->in(2);
- const TypeInt *zero = phase->type(in1)->isa_int();
- const TypeInt *t21 = phase->type(in21)->isa_int();
- const TypeInt *t22 = phase->type(in22)->isa_int();
- if ( t21 && t22 && zero == TypeInt::ZERO && t22->is_con(31) ) {
+ if (op2 == Op_RShiftI) {
+ Node* in21 = in2->in(1);
+ Node* in22 = in2->in(2);
+ const TypeInt* zero = phase->type(in1)->isa_int();
+ bool in21_is_int = phase->type(in21)->is_int();
+ const TypeInt* t22 = phase->type(in22)->isa_int();
+ if (in21_is_int && t22 != nullptr && zero == TypeInt::ZERO && t22->is_con(31)) {
return new URShiftINode(in21, in22);
}
}
@@ -339,8 +339,8 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){
// A subtract node computes the difference of its two inputs.
const Type* SubINode::sub(const Type* t1, const Type* t2) const {
- const TypeInt* range0 = t1->is_int();
- const TypeInt* range1 = t2->is_int();
+ const TypeInt* range0 = t1->as_int();
+ const TypeInt* range1 = t2->as_int();
jlong lo_sub = (jlong)range0->_lo - (jlong)range1->_hi;
jlong hi_sub = (jlong)range0->_hi - (jlong)range1->_lo;
@@ -409,11 +409,11 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if (op2 == Op_AddL
&& ok_to_convert(in2, in1)
&& in2->in(2)->Opcode() == Op_ConL) {
- jlong c0 = phase->type(in2->in(2))->isa_long()->get_con();
+ jlong c0 = phase->type(in2->in(2))->as_long()->get_con();
Node* in21 = in2->in(1);
if (in1->Opcode() == Op_ConL) {
// Match c1
- jlong c1 = phase->type(in1)->isa_long()->get_con();
+ jlong c1 = phase->type(in1)->as_long()->get_con();
Node* sub2 = phase->longcon(java_subtract(c1, c0));
return new SubLNode(sub2, in21);
} else {
@@ -510,13 +510,13 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
}
// Convert "0L-(A>>63)" into "(A>>>63)"
- if ( op2 == Op_RShiftL ) {
- Node *in21 = in2->in(1);
- Node *in22 = in2->in(2);
- const TypeLong *zero = phase->type(in1)->isa_long();
- const TypeLong *t21 = phase->type(in21)->isa_long();
- const TypeInt *t22 = phase->type(in22)->isa_int();
- if ( t21 && t22 && zero == TypeLong::ZERO && t22->is_con(63) ) {
+ if (op2 == Op_RShiftL) {
+ Node* in21 = in2->in(1);
+ Node* in22 = in2->in(2);
+ const TypeLong* zero = phase->type(in1)->isa_long();
+ bool in21_is_long = phase->type(in21)->is_long();
+ const TypeInt* t22 = phase->type(in22)->isa_int();
+ if (in21_is_long && t22 != nullptr && zero == TypeLong::ZERO && t22->is_con(63)) {
return new URShiftLNode(in21, in22);
}
}
@@ -527,8 +527,8 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
//------------------------------sub--------------------------------------------
// A subtract node differences it's two inputs.
const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const {
- const TypeLong *r0 = t1->is_long(); // Handy access
- const TypeLong *r1 = t2->is_long();
+ const TypeLong* r0 = t1->as_long(); // Handy access
+ const TypeLong* r1 = t2->as_long();
jlong lo = java_subtract(r0->_lo, r1->_hi);
jlong hi = java_subtract(r0->_hi, r1->_lo);
@@ -577,8 +577,8 @@ const Type* SubFPNode::Value(PhaseGVN* phase) const {
const Type* SubHFNode::sub(const Type* t1, const Type* t2) const {
// Half precision floating point subtraction follows the rules of IEEE 754
// applicable to other floating point types.
- if (t1->isa_half_float_constant() != nullptr &&
- t2->isa_half_float_constant() != nullptr) {
+ if (t1->is_half_float_constant() &&
+ t2->is_half_float_constant()) {
return TypeH::make(t1->getf() - t2->getf());
} else {
return Type::HALF_FLOAT;
@@ -694,8 +694,8 @@ CmpNode *CmpNode::make(Node *in1, Node *in2, BasicType bt, bool unsigned_comp) {
// Simplify a CmpI (compare 2 integers) node, based on local information.
// If both inputs are constants, compare them.
const Type *CmpINode::sub( const Type *t1, const Type *t2 ) const {
- const TypeInt *r0 = t1->is_int(); // Handy access
- const TypeInt *r1 = t2->is_int();
+ const TypeInt* r0 = t1->as_int(); // Handy access
+ const TypeInt* r1 = t2->as_int();
if( r0->_hi < r1->_lo ) // Range is always low?
return TypeInt::CC_LT;
@@ -761,8 +761,8 @@ const Type* CmpINode::Value(PhaseGVN* phase) const {
// Simplify a CmpU (compare 2 integers) node, based on local information.
// If both inputs are constants, compare them.
const Type* CmpUNode::sub(const Type* t1, const Type* t2) const {
- const TypeInt* r0 = t1->is_int();
- const TypeInt* r1 = t2->is_int();
+ const TypeInt* r0 = t1->as_int();
+ const TypeInt* r1 = t2->as_int();
// Check for special case in Hashtable::get - the hash index is
// mod'ed to the table size so the following range check is useless.
@@ -805,7 +805,7 @@ const Type* CmpUNode::Value(PhaseGVN* phase) const {
const Node* in2 = in(2);
const Type* t1 = phase->type(in1);
const Type* t2 = phase->type(in2);
- assert(t1->isa_int(), "CmpU has only Int type inputs");
+ assert(t1->is_int(), "CmpU has only Int type inputs");
if (t2 == TypeInt::INT) { // Compare to bottom?
return bottom_type();
}
@@ -832,8 +832,8 @@ const Type* CmpUNode::Value(PhaseGVN* phase) const {
// Skip cases when input types are top or bottom.
if ((t11 != Type::TOP) && (t11 != TypeInt::INT) &&
(t12 != Type::TOP) && (t12 != TypeInt::INT)) {
- const TypeInt *ti11 = t11->is_int();
- const TypeInt *ti12 = t12->is_int();
+ const TypeInt* ti11 = t11->as_int();
+ const TypeInt* ti12 = t12->as_int();
jlong lo_ti11_range = ti11->_lo;
jlong hi_ti11_range = ti11->_hi;
jlong lo_ti12_range = ti12->_lo;
@@ -860,8 +860,8 @@ const Type* CmpUNode::Value(PhaseGVN* phase) const {
int w = MAX2(ti11->_widen, ti12->_widen); // _widen does not matter here
const TypeInt* wrapped_range1 = TypeInt::make(min_jint, hi_wrapped_range, w);
const TypeInt* wrapped_range2 = TypeInt::make(lo_wrapped_range, max_jint, w);
- const TypeInt* cmp1 = sub(wrapped_range1, t2)->is_int();
- const TypeInt* cmp2 = sub(wrapped_range2, t2)->is_int();
+ const TypeInt* cmp1 = sub(wrapped_range1, t2)->as_int();
+ const TypeInt* cmp2 = sub(wrapped_range2, t2)->as_int();
// Compute union, so that cmp handles all possible results from the two cases
const Type* t_cmp = cmp1->meet(cmp2);
// Pick narrowest type, based on overflow computation and on immediate inputs
@@ -942,8 +942,8 @@ Node* CmpLNode::Ideal(PhaseGVN* phase, bool can_reshape) {
// Simplify a CmpL (compare 2 longs ) node, based on local information.
// If both inputs are constants, compare them.
const Type *CmpLNode::sub( const Type *t1, const Type *t2 ) const {
- const TypeLong *r0 = t1->is_long(); // Handy access
- const TypeLong *r1 = t2->is_long();
+ const TypeLong* r0 = t1->as_long(); // Handy access
+ const TypeLong* r1 = t2->as_long();
if( r0->_hi < r1->_lo ) // Range is always low?
return TypeInt::CC_LT;
@@ -970,8 +970,8 @@ const Type *CmpLNode::sub( const Type *t1, const Type *t2 ) const {
// Simplify a CmpUL (compare 2 unsigned longs) node, based on local information.
// If both inputs are constants, compare them.
const Type* CmpULNode::sub(const Type* t1, const Type* t2) const {
- const TypeLong* r0 = t1->is_long();
- const TypeLong* r1 = t2->is_long();
+ const TypeLong* r0 = t1->as_long();
+ const TypeLong* r1 = t2->as_long();
if (r0->_uhi < r1->_ulo) {
return TypeInt::CC_LT;
@@ -1000,8 +1000,8 @@ const Type* CmpULNode::sub(const Type* t1, const Type* t2) const {
// Simplify an CmpP (compare 2 pointers) node, based on local information.
// If both inputs are constants, compare them.
const Type *CmpPNode::sub( const Type *t1, const Type *t2 ) const {
- const TypePtr *r0 = t1->is_ptr(); // Handy access
- const TypePtr *r1 = t2->is_ptr();
+ const TypePtr* r0 = t1->as_ptr(); // Handy access
+ const TypePtr* r1 = t2->as_ptr();
// Undefined inputs makes for an undefined result
if (TypePtr::is_top(r0->_ptr) || TypePtr::is_top(r1->_ptr)) {
@@ -1085,7 +1085,7 @@ static inline Node* isa_java_mirror_load(PhaseGVN* phase, Node* n, bool& might_b
Node* adr = n->in(MemNode::Address);
// First load from OopHandle: ((OopHandle)mirror)->resolve(); may need barrier.
- if (adr->Opcode() != Op_LoadP || !phase->type(adr)->isa_rawptr()) return nullptr;
+ if (adr->Opcode() != Op_LoadP || !phase->type(adr)->is_rawptr()) return nullptr;
adr = adr->in(MemNode::Address);
intptr_t off = 0;
@@ -1093,7 +1093,7 @@ static inline Node* isa_java_mirror_load(PhaseGVN* phase, Node* n, bool& might_b
if (k == nullptr) return nullptr;
const TypeKlassPtr* tkp = phase->type(k)->isa_klassptr();
if (!tkp || off != in_bytes(Klass::java_mirror_offset())) return nullptr;
- might_be_an_array |= tkp->isa_aryklassptr() || tkp->is_instklassptr()->might_be_an_array();
+ might_be_an_array |= tkp->is_aryklassptr() || tkp->as_instklassptr()->might_be_an_array();
// We've found the klass node of a Java mirror load.
return k;
@@ -1288,7 +1288,7 @@ Node* CmpPNode::Ideal(PhaseGVN *phase, bool can_reshape) {
return nullptr;
} else {
// Special case for non-value arrays: They only have one (default) refined class, use it
- set_req_X(2, phase->makecon(t2->is_aryklassptr()->cast_to_refined_array_klass_ptr()), phase);
+ set_req_X(2, phase->makecon(t2->as_aryklassptr()->cast_to_refined_array_klass_ptr()), phase);
}
}
@@ -1301,9 +1301,9 @@ Node* CmpPNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const Type* CmpPNode::Value(PhaseGVN* phase) const {
const Type* res = CmpNode::Value(phase);
if (res == TypeInt::CC) {
- const TypeOopPtr* p0 = phase->type(in(1))->isa_oopptr();
- const TypeOopPtr* p1 = phase->type(in(2))->isa_oopptr();
- if (p0 != nullptr && p1 != nullptr) {
+ bool in0_is_oopptr = phase->type(in(1))->is_oopptr();
+ bool in1_is_oopptr = phase->type(in(2))->is_oopptr();
+ if (in0_is_oopptr && in1_is_oopptr) {
Node* in1 = in(1)->uncast();
Node* in2 = in(2)->uncast();
AllocateNode* alloc1 = AllocateNode::Ideal_allocation(in1);
@@ -1407,7 +1407,7 @@ Node *CmpDNode::Ideal(PhaseGVN *phase, bool can_reshape){
if( ConvertCmpD2CmpF &&
in(idx_f2d)->Opcode() == Op_ConvF2D &&
in(idx_con)->Opcode() == Op_ConD ) {
- const TypeD *t2 = in(idx_con)->bottom_type()->is_double_constant();
+ const TypeD* t2 = in(idx_con)->bottom_type()->as_double_constant();
double t2_value_as_double = t2->_d;
float t2_value_as_float = (float)t2_value_as_double;
if( t2_value_as_double == (double)t2_value_as_float ) {
@@ -1439,10 +1439,10 @@ const Type* FlatArrayCheckNode::Value(PhaseGVN* phase) const {
if (t == Type::TOP) {
return Type::TOP;
}
- if (t->is_ptr()->is_flat()) {
+ if (t->as_ptr()->is_flat()) {
// One of the input arrays is flat, check always passes
return TypeInt::CC_EQ;
- } else if (!t->is_ptr()->is_not_flat()) {
+ } else if (!t->as_ptr()->is_not_flat()) {
// One of the input arrays might be flat
all_not_flat = false;
}
@@ -1460,7 +1460,7 @@ Node* FlatArrayCheckNode::Ideal(PhaseGVN* phase, bool can_reshape) {
// Remove inputs that are known to be non-flat
for (uint i = ArrayOrKlass; i < req(); ++i) {
const Type* t = phase->type(in(i));
- if (t->isa_ptr() && t->is_ptr()->is_not_flat()) {
+ if (t->is_ptr() && t->as_ptr()->is_not_flat()) {
del_req(i--);
changed = true;
}
@@ -1474,7 +1474,7 @@ Node* FlatArrayCheckNode::Ideal(PhaseGVN* phase, bool can_reshape) {
const Type *BoolTest::cc2logical( const Type *CC ) const {
if( CC == Type::TOP ) return Type::TOP;
if( CC->base() != Type::Int ) return TypeInt::BOOL; // Bottom or worse
- const TypeInt *ti = CC->is_int();
+ const TypeInt* ti = CC->as_int();
if( ti->is_con() ) { // Only 1 kind of condition codes set?
// Match low order 2 bits
int tmp = ((ti->get_con()&3) == (_test&3)) ? 1 : 0;
@@ -1831,9 +1831,9 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
cmp1_op == Op_Conv2B &&
(_test._test == BoolTest::eq ||
_test._test == BoolTest::ne) ) {
- Node *ncmp = phase->transform(phase->type(c2b->in(1))->isa_int()
- ? (Node*)new CmpINode(c2b->in(1),cmp2)
- : (Node*)new CmpPNode(c2b->in(1),phase->makecon(TypePtr::NULL_PTR))
+ Node* ncmp = phase->transform(phase->type(c2b->in(1))->is_int()
+ ? (Node*)new CmpINode(c2b->in(1), cmp2)
+ : (Node*)new CmpPNode(c2b->in(1), phase->makecon(TypePtr::NULL_PTR))
);
return new BoolNode( ncmp, _test._test );
}
@@ -1854,12 +1854,12 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) {
cop == Op_CmpI &&
cmp1_op == Op_AddI &&
cmp1->in(2) != nullptr &&
- phase->type(cmp1->in(2))->isa_int() &&
- phase->type(cmp1->in(2))->is_int()->is_con() &&
+ phase->type(cmp1->in(2))->is_int() &&
+ phase->type(cmp1->in(2))->as_int()->is_con() &&
cmp2_type == TypeInt::ZERO &&
!is_counted_loop_cmp(cmp) // modifying the exit test of a counted loop messes the counted loop shape
) {
- const TypeInt* cmp1_in2 = phase->type(cmp1->in(2))->is_int();
+ const TypeInt* cmp1_in2 = phase->type(cmp1->in(2))->as_int();
Node *ncmp = phase->transform( new CmpINode(cmp1->in(1),phase->intcon(-cmp1_in2->_hi)));
return new BoolNode( ncmp, _test._test );
}
@@ -2107,12 +2107,12 @@ const Type* AbsNode::Value(PhaseGVN* phase) const {
switch (t1->base()) {
case Type::Int: {
- const TypeInt* ti = t1->is_int();
+ const TypeInt* ti = t1->as_int();
return integral_abs_value(ti);
}
case Type::Long: {
- const TypeLong* tl = t1->is_long();
+ const TypeLong* tl = t1->as_long();
return integral_abs_value(tl);
}
@@ -2132,8 +2132,8 @@ Node* AbsNode::Identity(PhaseGVN* phase) {
Node* in1 = in(1);
// No need to do abs for non-negative values
const Type* in_type = phase->type(in1);
- if ((in_type->isa_int() && in_type->is_int()->_lo >= 0) ||
- (in_type->isa_long() && in_type->is_long()->_lo >= 0)) {
+ if ((in_type->is_int() && in_type->as_int()->_lo >= 0) ||
+ (in_type->is_long() && in_type->as_long()->_lo >= 0)) {
return in1;
}
// Convert "abs(abs(x))" into "abs(x)"
@@ -2188,10 +2188,10 @@ static const Type* reverse_bytes(int opcode, const Type* con) {
switch (opcode) {
// It is valid in bytecode to load any int and pass it to a method that expects a smaller type (i.e., short, char).
// Let's cast the value to match the Java behavior.
- case Op_ReverseBytesS: return TypeInt::make(byteswap(static_cast(con->is_int()->get_con())));
- case Op_ReverseBytesUS: return TypeInt::make(byteswap(static_cast(con->is_int()->get_con())));
- case Op_ReverseBytesI: return TypeInt::make(byteswap(con->is_int()->get_con()));
- case Op_ReverseBytesL: return TypeLong::make(byteswap(con->is_long()->get_con()));
+ case Op_ReverseBytesS: return TypeInt::make(byteswap(static_cast(con->as_int()->get_con())));
+ case Op_ReverseBytesUS: return TypeInt::make(byteswap(static_cast(con->as_int()->get_con())));
+ case Op_ReverseBytesI: return TypeInt::make(byteswap(con->as_int()->get_con()));
+ case Op_ReverseBytesL: return TypeLong::make(byteswap(con->as_long()->get_con()));
default: ShouldNotReachHere();
}
}
@@ -2240,7 +2240,7 @@ static Node* simplify_involution(PhaseGVN* phase, Node* involution) {
// Operations on sub-int types might not be "real" involutions for values outside their type range,
// for example, a ReverseBytesS node with an input larger than short.
// Make sure not to drop potential truncations.
- if (type == nullptr || involution->bottom_type()->is_int()->contains(type)) {
+ if (type == nullptr || involution->bottom_type()->as_int()->contains(type)) {
return original;
}
}
diff --git a/src/hotspot/share/opto/subtypenode.cpp b/src/hotspot/share/opto/subtypenode.cpp
index 7adefe138e1..2c0ac038e2b 100644
--- a/src/hotspot/share/opto/subtypenode.cpp
+++ b/src/hotspot/share/opto/subtypenode.cpp
@@ -33,12 +33,12 @@
#include "opto/subtypenode.hpp"
const Type* SubTypeCheckNode::sub(const Type* sub_t, const Type* super_t) const {
- const TypeKlassPtr* super_klass_type = super_t->isa_klassptr();
+ const TypeKlassPtr* super_klass_type = super_t->as_klassptr();
assert(sub_t != Type::TOP && !TypePtr::NULL_PTR->higher_equal(sub_t), "should be not null");
- const TypeKlassPtr* sub_klass_type = sub_t->isa_klassptr() ? sub_t->is_klassptr() : sub_t->is_oopptr()->as_klass_type();
+ const TypeKlassPtr* sub_klass_type = sub_t->is_klassptr() ? sub_t->as_klassptr() : sub_t->as_oopptr()->as_klass_type();
// Oop can't be a subtype of abstract type that has no subclass.
- if (sub_t->isa_oopptr() && super_klass_type->isa_instklassptr() && super_klass_type->klass_is_exact()) {
+ if (sub_t->is_oopptr() && super_klass_type->is_instklassptr() && super_klass_type->klass_is_exact()) {
ciKlass* superklass = super_klass_type->exact_klass();
if (!superklass->is_interface() && superklass->is_abstract() &&
!superklass->as_instance_klass()->has_subklass()) {
@@ -62,7 +62,7 @@ const Type* SubTypeCheckNode::sub(const Type* sub_t, const Type* super_t) const
// array property for the super klass (all done in cast_to_exactness()) in order to check whether the sub klass is
// flat in array and the super klass is not flat in array. If that's the case, the classes must be unrelated.
const TypeKlassPtr* super_klass_type_for_flat_in_array = super_klass_type;
- if (super_klass_type->isa_instklassptr()) {
+ if (super_klass_type->is_instklassptr()) {
// Only relevant for TypeInstKlassPtr. TypeAryKlassPtr will always be not flat in array.
super_klass_type_for_flat_in_array = super_klass_type->cast_to_exactness(false);
}
@@ -79,7 +79,7 @@ const Type* SubTypeCheckNode::sub(const Type* sub_t, const Type* super_t) const
unrelated_classes = true;
}
if (unrelated_classes) {
- TypePtr::PTR jp = sub_t->is_ptr()->join_ptr(super_t->is_ptr()->_ptr);
+ TypePtr::PTR jp = sub_t->as_ptr()->join_ptr(super_t->as_ptr()->_ptr);
if (jp != TypePtr::Null && jp != TypePtr::BotPTR) {
return TypeInt::CC_GT;
}
@@ -112,8 +112,8 @@ Node *SubTypeCheckNode::Ideal(PhaseGVN* phase, bool can_reshape) {
const Type* sub_t = phase->type(obj_or_subklass);
const Type* super_t = phase->type(superklass);
- if (!super_t->isa_klassptr() ||
- (!sub_t->isa_klassptr() && !sub_t->isa_oopptr())) {
+ if (!super_t->is_klassptr() ||
+ (!sub_t->is_klassptr() && !sub_t->is_oopptr())) {
return nullptr;
}
@@ -154,13 +154,13 @@ Node *SubTypeCheckNode::Ideal(PhaseGVN* phase, bool can_reshape) {
#ifdef ASSERT
bool SubTypeCheckNode::is_oop(PhaseGVN* phase, Node* n) {
- const Type* t = phase->type(n);
- if (!t->isa_oopptr() && t != Type::TOP) {
- n->dump();
- t->dump(); tty->cr();
- return false;
- }
- return true;
+ const Type* t = phase->type(n);
+ if (!t->is_oopptr() && t != Type::TOP) {
+ n->dump();
+ t->dump(); tty->cr();
+ return false;
+ }
+ return true;
}
static Node* record_for_cleanup(Node* n, PhaseGVN* phase) {
@@ -202,8 +202,8 @@ bool SubTypeCheckNode::verify(PhaseGVN* phase) {
const Type* sub_t = phase->type(obj_or_subklass);
const Type* super_t = phase->type(superklass);
- const TypeKlassPtr* superk = super_t->isa_klassptr();
- const TypeKlassPtr* subk = sub_t->isa_klassptr() ? sub_t->is_klassptr() : sub_t->is_oopptr()->as_klass_type();
+ const TypeKlassPtr* superk = super_t->as_klassptr();
+ const TypeKlassPtr* subk = sub_t->is_klassptr() ? sub_t->as_klassptr() : sub_t->as_oopptr()->as_klass_type();
if (super_t->singleton() && subk != nullptr) {
if (obj_or_subklass->bottom_type() == Type::TOP) {
@@ -222,7 +222,7 @@ bool SubTypeCheckNode::verify(PhaseGVN* phase) {
}
case Compile::SSC_full_test: {
Node* p1 = phase->transform(AddPNode::make_off_heap(superklass, phase->MakeConX(in_bytes(Klass::super_check_offset_offset()))));
- Node* chk_off = phase->transform(new LoadINode(nullptr, C->immutable_memory(), p1, phase->type(p1)->is_ptr(), TypeInt::INT, MemNode::unordered));
+ Node* chk_off = phase->transform(new LoadINode(nullptr, C->immutable_memory(), p1, phase->type(p1)->as_ptr(), TypeInt::INT, MemNode::unordered));
record_for_cleanup(chk_off, phase);
int cacheoff_con = in_bytes(Klass::secondary_super_cache_offset());
@@ -234,7 +234,7 @@ bool SubTypeCheckNode::verify(PhaseGVN* phase) {
chk_off_X = phase->transform(new ConvI2LNode(chk_off_X));
#endif
Node* p2 = phase->transform(AddPNode::make_off_heap(subklass, chk_off_X));
- Node* nkls = phase->transform(LoadKlassNode::make(*phase, C->immutable_memory(), p2, phase->type(p2)->is_ptr(), TypeInstKlassPtr::OBJECT_OR_NULL));
+ Node* nkls = phase->transform(LoadKlassNode::make(*phase, C->immutable_memory(), p2, phase->type(p2)->as_ptr(), TypeInstKlassPtr::OBJECT_OR_NULL));
return verify_helper(phase, nkls, cached_t);
}
@@ -255,7 +255,7 @@ Node* SubTypeCheckNode::load_klass(PhaseGVN* phase) const {
Node* obj_or_subklass = in(ObjOrSubKlass);
const Type* sub_t = phase->type(obj_or_subklass);
Node* subklass = nullptr;
- if (sub_t->isa_oopptr()) {
+ if (sub_t->is_oopptr()) {
Node* adr = phase->transform(AddPNode::make_with_base(obj_or_subklass, phase->MakeConX(oopDesc::klass_offset_in_bytes())));
subklass = phase->transform(LoadKlassNode::make(*phase, phase->C->immutable_memory(), adr, TypeInstPtr::KLASS));
record_for_cleanup(subklass, phase);
diff --git a/src/hotspot/share/opto/superword.cpp b/src/hotspot/share/opto/superword.cpp
index 3cd36fcb1fa..9611b76f27d 100644
--- a/src/hotspot/share/opto/superword.cpp
+++ b/src/hotspot/share/opto/superword.cpp
@@ -2207,9 +2207,8 @@ bool SuperWord::is_vector_use(Node* use, int u_idx) const {
// in use pack have inputs of iv plus node index.
Node* use_in = u_pk->at(i)->in(u_idx);
if (!use_in->is_Add() || use_in->in(1) != n) return false;
- const TypeInt* offset_t = use_in->in(2)->bottom_type()->is_int();
- if (offset_t == nullptr || !offset_t->is_con() ||
- offset_t->get_con() != (jint) i) return false;
+ const TypeInt* offset_t = use_in->in(2)->bottom_type()->as_int();
+ if (!offset_t->is_con() || offset_t->get_con() != (jint) i) return false;
}
} else {
// check for scalar promotion
@@ -2493,7 +2492,7 @@ static bool can_subword_truncate(Node* in, const Type* type) {
}
// Vector nodes should not truncate.
- if (type->isa_vect() != nullptr || type->isa_pvectmask() != nullptr || in->is_Reduction()) {
+ if (type->is_vect() || type->is_pvectmask() || in->is_Reduction()) {
return false;
}
@@ -3052,7 +3051,7 @@ void VTransform::adjust_pre_loop_limit_to_align_main_loop_vectors() {
Node* invar_variable = s.variable();
jint invar_scale = s.scale().value();
TRACE_ALIGN_VECTOR_NODE(invar_variable);
- if (igvn().type(invar_variable)->isa_long()) {
+ if (igvn().type(invar_variable)->is_long()) {
// Computations are done % (vector width/element size) so it's
// safe to simply convert invar to an int and loose the upper 32
// bit half.
@@ -3088,13 +3087,13 @@ void VTransform::adjust_pre_loop_limit_to_align_main_loop_vectors() {
// bit half. The base could be ptr, long or int. We cast all
// to int.
Node* xbase = base;
- if (igvn().type(xbase)->isa_ptr()) {
+ if (igvn().type(xbase)->is_ptr()) {
// ptr -> int/long
xbase = new CastP2XNode(nullptr, xbase);
phase()->register_new_node(xbase, pre_ctrl);
TRACE_ALIGN_VECTOR_NODE(xbase);
}
- if (igvn().type(xbase)->isa_long()) {
+ if (igvn().type(xbase)->is_long()) {
// long -> int
xbase = new ConvL2INode(xbase);
phase()->register_new_node(xbase, pre_ctrl);
diff --git a/src/hotspot/share/opto/superwordVTransformBuilder.cpp b/src/hotspot/share/opto/superwordVTransformBuilder.cpp
index 4b185c0eb49..5afedbc76b1 100644
--- a/src/hotspot/share/opto/superwordVTransformBuilder.cpp
+++ b/src/hotspot/share/opto/superwordVTransformBuilder.cpp
@@ -322,7 +322,7 @@ VTransformNode* SuperWordVTransformBuilder::get_or_make_vtnode_vector_input_at_i
BasicType element_bt = p0->is_Convert() ? p0->in(1)->bottom_type()->basic_type() : _vloop_analyzer.types().velt_basic_type(p0);
if (index == 2 && VectorNode::is_scalar_rotate(p0) && element_bt == T_LONG) {
// Scalar rotate has int rotation value, but the scalar rotate expects longs.
- assert(same_input->bottom_type()->isa_int(), "scalar rotate expects int rotation");
+ assert(same_input->bottom_type()->is_int(), "scalar rotate expects int rotation");
VTransformNode* conv = new (_vtransform.arena()) VTransformConvI2LNode(_vtransform);
conv->init_req(1, same_input_vtn);
same_input_vtn = conv;
diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp
index 7fae3e0b6f1..1a71e0f442c 100644
--- a/src/hotspot/share/opto/type.cpp
+++ b/src/hotspot/share/opto/type.cpp
@@ -115,66 +115,66 @@ void Type::Offset::dump2(outputStream *st) const {
// Array which maps compiler types to Basic Types
const Type::TypeInfo Type::_type_info[Type::lastype] = {
- { T_ILLEGAL, "bad", false, Node::NotAMachineReg}, // Bad
- { T_ILLEGAL, "control", false, 0 }, // Control
- { T_VOID, "top", false, 0 }, // Top
- { T_INT, "int:", false, Op_RegI }, // Int
- { T_LONG, "long:", false, Op_RegL }, // Long
- { T_VOID, "half", false, 0 }, // Half
- { T_NARROWOOP, "narrowoop:", false, Op_RegN }, // NarrowOop
- { T_NARROWKLASS,"narrowklass:", false, Op_RegN }, // NarrowKlass
- { T_ILLEGAL, "tuple:", false, Node::NotAMachineReg}, // Tuple
- { T_ARRAY, "array:", false, Node::NotAMachineReg}, // Array
- { T_ARRAY, "interfaces:", false, Node::NotAMachineReg}, // Interfaces
+ { T_ILLEGAL, "bad", Node::NotAMachineReg}, // Bad
+ { T_ILLEGAL, "control", 0 }, // Control
+ { T_VOID, "top", 0 }, // Top
+ { T_INT, "int:", Op_RegI }, // Int
+ { T_LONG, "long:", Op_RegL }, // Long
+ { T_VOID, "half", 0 }, // Half
+ { T_NARROWOOP, "narrowoop:", Op_RegN }, // NarrowOop
+ { T_NARROWKLASS,"narrowklass:", Op_RegN }, // NarrowKlass
+ { T_ILLEGAL, "tuple:", Node::NotAMachineReg}, // Tuple
+ { T_ARRAY, "array:", Node::NotAMachineReg}, // Array
+ { T_ARRAY, "interfaces:", Node::NotAMachineReg}, // Interfaces
#if defined(PPC64)
- { T_ILLEGAL, "vectormask:", false, Op_RegVectMask }, // VectorMask.
- { T_ILLEGAL, "vectora:", false, Op_VecA }, // VectorA.
- { T_ILLEGAL, "vectors:", false, 0 }, // VectorS
- { T_ILLEGAL, "vectord:", false, Op_RegL }, // VectorD
- { T_ILLEGAL, "vectorx:", false, Op_VecX }, // VectorX
- { T_ILLEGAL, "vectory:", false, 0 }, // VectorY
- { T_ILLEGAL, "vectorz:", false, 0 }, // VectorZ
+ { T_ILLEGAL, "vectormask:", Op_RegVectMask }, // VectorMask.
+ { T_ILLEGAL, "vectora:", Op_VecA }, // VectorA.
+ { T_ILLEGAL, "vectors:", 0 }, // VectorS
+ { T_ILLEGAL, "vectord:", Op_RegL }, // VectorD
+ { T_ILLEGAL, "vectorx:", Op_VecX }, // VectorX
+ { T_ILLEGAL, "vectory:", 0 }, // VectorY
+ { T_ILLEGAL, "vectorz:", 0 }, // VectorZ
#elif defined(S390)
- { T_ILLEGAL, "vectormask:", false, Op_RegVectMask }, // VectorMask.
- { T_ILLEGAL, "vectora:", false, Op_VecA }, // VectorA.
- { T_ILLEGAL, "vectors:", false, 0 }, // VectorS
- { T_ILLEGAL, "vectord:", false, Op_RegL }, // VectorD
- { T_ILLEGAL, "vectorx:", false, Op_VecX }, // VectorX
- { T_ILLEGAL, "vectory:", false, 0 }, // VectorY
- { T_ILLEGAL, "vectorz:", false, 0 }, // VectorZ
+ { T_ILLEGAL, "vectormask:", Op_RegVectMask }, // VectorMask.
+ { T_ILLEGAL, "vectora:", Op_VecA }, // VectorA.
+ { T_ILLEGAL, "vectors:", 0 }, // VectorS
+ { T_ILLEGAL, "vectord:", Op_RegL }, // VectorD
+ { T_ILLEGAL, "vectorx:", Op_VecX }, // VectorX
+ { T_ILLEGAL, "vectory:", 0 }, // VectorY
+ { T_ILLEGAL, "vectorz:", 0 }, // VectorZ
#else // all other
- { T_ILLEGAL, "vectormask:", false, Op_RegVectMask }, // VectorMask.
- { T_ILLEGAL, "vectora:", false, Op_VecA }, // VectorA.
- { T_ILLEGAL, "vectors:", false, Op_VecS }, // VectorS
- { T_ILLEGAL, "vectord:", false, Op_VecD }, // VectorD
- { T_ILLEGAL, "vectorx:", false, Op_VecX }, // VectorX
- { T_ILLEGAL, "vectory:", false, Op_VecY }, // VectorY
- { T_ILLEGAL, "vectorz:", false, Op_VecZ }, // VectorZ
+ { T_ILLEGAL, "vectormask:", Op_RegVectMask }, // VectorMask.
+ { T_ILLEGAL, "vectora:", Op_VecA }, // VectorA.
+ { T_ILLEGAL, "vectors:", Op_VecS }, // VectorS
+ { T_ILLEGAL, "vectord:", Op_VecD }, // VectorD
+ { T_ILLEGAL, "vectorx:", Op_VecX }, // VectorX
+ { T_ILLEGAL, "vectory:", Op_VecY }, // VectorY
+ { T_ILLEGAL, "vectorz:", Op_VecZ }, // VectorZ
#endif
- { T_ADDRESS, "anyptr:", false, Op_RegP }, // AnyPtr
- { T_ADDRESS, "rawptr:", false, Op_RegP }, // RawPtr
- { T_OBJECT, "oop:", true, Op_RegP }, // OopPtr
- { T_OBJECT, "inst:", true, Op_RegP }, // InstPtr
- { T_OBJECT, "ary:", true, Op_RegP }, // AryPtr
- { T_METADATA, "metadata:", false, Op_RegP }, // MetadataPtr
- { T_METADATA, "klass:", false, Op_RegP }, // KlassPtr
- { T_METADATA, "instklass:", false, Op_RegP }, // InstKlassPtr
- { T_METADATA, "aryklass:", false, Op_RegP }, // AryKlassPtr
- { T_OBJECT, "func", false, 0 }, // Function
- { T_ILLEGAL, "abIO", false, 0 }, // Abio
- { T_ADDRESS, "return_address",false, Op_RegP }, // Return_Address
- { T_ILLEGAL, "memory", false, 0 }, // Memory
- { T_SHORT, "halffloat_top", false, Op_RegF }, // HalfFloatTop
- { T_SHORT, "hfcon:", false, Op_RegF }, // HalfFloatCon
- { T_SHORT, "short", false, Op_RegF }, // HalfFloatBot
- { T_FLOAT, "float_top", false, Op_RegF }, // FloatTop
- { T_FLOAT, "ftcon:", false, Op_RegF }, // FloatCon
- { T_FLOAT, "float", false, Op_RegF }, // FloatBot
- { T_DOUBLE, "double_top", false, Op_RegD }, // DoubleTop
- { T_DOUBLE, "dblcon:", false, Op_RegD }, // DoubleCon
- { T_DOUBLE, "double", false, Op_RegD }, // DoubleBot
- { T_ILLEGAL, "bottom", false, 0 } // Bottom
+ { T_ADDRESS, "anyptr:", Op_RegP }, // AnyPtr
+ { T_ADDRESS, "rawptr:", Op_RegP }, // RawPtr
+ { T_OBJECT, "oop:", Op_RegP }, // OopPtr
+ { T_OBJECT, "inst:", Op_RegP }, // InstPtr
+ { T_OBJECT, "ary:", Op_RegP }, // AryPtr
+ { T_METADATA, "metadata:", Op_RegP }, // MetadataPtr
+ { T_METADATA, "klass:", Op_RegP }, // KlassPtr
+ { T_METADATA, "instklass:", Op_RegP }, // InstKlassPtr
+ { T_METADATA, "aryklass:", Op_RegP }, // AryKlassPtr
+ { T_OBJECT, "func", 0 }, // Function
+ { T_ILLEGAL, "abIO", 0 }, // Abio
+ { T_ADDRESS, "return_address",Op_RegP }, // Return_Address
+ { T_ILLEGAL, "memory", 0 }, // Memory
+ { T_SHORT, "halffloat_top", Op_RegF }, // HalfFloatTop
+ { T_SHORT, "hfcon:", Op_RegF }, // HalfFloatCon
+ { T_SHORT, "short", Op_RegF }, // HalfFloatBot
+ { T_FLOAT, "float_top", Op_RegF }, // FloatTop
+ { T_FLOAT, "ftcon:", Op_RegF }, // FloatCon
+ { T_FLOAT, "float", Op_RegF }, // FloatBot
+ { T_DOUBLE, "double_top", Op_RegD }, // DoubleTop
+ { T_DOUBLE, "dblcon:", Op_RegD }, // DoubleCon
+ { T_DOUBLE, "double", Op_RegD }, // DoubleBot
+ { T_ILLEGAL, "bottom", 0 } // Bottom
};
// Map ideal registers (machine types) to ideal types
@@ -303,12 +303,12 @@ const Type* Type::make_from_constant(ciConstant constant, bool require_constant,
guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed");
con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
- con_type = con_type->is_aryptr()->cast_to_autobox_cache();
+ con_type = con_type->as_aryptr()->cast_to_autobox_cache();
}
if (stable_dimension > 0) {
assert(FoldStableValues, "sanity");
assert(!con_type->is_zero_type(), "default value for stable field");
- con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
+ con_type = con_type->as_aryptr()->cast_to_stable(true, stable_dimension);
}
}
if (is_narrow_oop) {
@@ -555,14 +555,14 @@ void Type::Initialize_shared(Compile* current) {
TypeInt::CC_LT = TypeInt::make(-1,-1, WidenMin); // == TypeInt::MINUS_1
TypeInt::CC_GT = TypeInt::make( 1, 1, WidenMin); // == TypeInt::ONE
TypeInt::CC_EQ = TypeInt::make( 0, 0, WidenMin); // == TypeInt::ZERO
- TypeInt::CC_NE = TypeInt::make_or_top(TypeIntPrototype{{-1, 1}, {1, max_juint}, {0, 1}}, WidenMin)->is_int();
+ TypeInt::CC_NE = TypeInt::make_or_top(TypeIntPrototype{{-1, 1}, {1, max_juint}, {0, 1}}, WidenMin)->as_int();
TypeInt::CC_LE = TypeInt::make(-1, 0, WidenMin);
TypeInt::CC_GE = TypeInt::make( 0, 1, WidenMin); // == TypeInt::BOOL
TypeInt::BYTE = TypeInt::make(-128, 127, WidenMin); // Bytes
TypeInt::UBYTE = TypeInt::make(0, 255, WidenMin); // Unsigned Bytes
TypeInt::CHAR = TypeInt::make(0, 65535, WidenMin); // Java chars
TypeInt::SHORT = TypeInt::make(-32768, 32767, WidenMin); // Java shorts
- TypeInt::NON_ZERO = TypeInt::make_or_top(TypeIntPrototype{{min_jint, max_jint}, {1, max_juint}, {0, 0}}, WidenMin)->is_int();
+ TypeInt::NON_ZERO = TypeInt::make_or_top(TypeIntPrototype{{min_jint, max_jint}, {1, max_juint}, {0, 0}}, WidenMin)->as_int();
TypeInt::POS = TypeInt::make(0, max_jint, WidenMin); // Non-neg values
TypeInt::POS1 = TypeInt::make(1, max_jint, WidenMin); // Positive values
TypeInt::INT = TypeInt::make(min_jint, max_jint, WidenMax); // 32-bit integers
@@ -581,7 +581,7 @@ void Type::Initialize_shared(Compile* current) {
TypeLong::MINUS_1 = TypeLong::make(-1); // -1
TypeLong::ZERO = TypeLong::make( 0); // 0
TypeLong::ONE = TypeLong::make( 1); // 1
- TypeLong::NON_ZERO = TypeLong::make_or_top(TypeIntPrototype{{min_jlong, max_jlong}, {1, max_julong}, {0, 0}}, WidenMin)->is_long();
+ TypeLong::NON_ZERO = TypeLong::make_or_top(TypeIntPrototype{{min_jlong, max_jlong}, {1, max_julong}, {0, 0}}, WidenMin)->as_long();
TypeLong::POS = TypeLong::make(0, max_jlong, WidenMin); // Non-neg values
TypeLong::LONG = TypeLong::make(min_jlong, max_jlong, WidenMax); // 64-bit integers
TypeLong::INT = TypeLong::make((jlong)min_jint, (jlong)max_jint,WidenMin);
@@ -1130,11 +1130,11 @@ void Type::check_fundamental_laws(const Type* t1, const Type* t2, VerifyMeetJoin
template
const Type* Type::meet_join_helper(F op, const Type* t1, const Type* t2, bool include_speculative) {
- if (t1->isa_narrowoop() && t2->isa_narrowoop()) {
+ if (t1->is_narrowoop() && t2->is_narrowoop()) {
const Type* result = meet_join_helper(op, t1->make_ptr(), t2->make_ptr(), include_speculative);
return result->make_narrowoop();
}
- if (t1->isa_narrowklass() && t2->isa_narrowklass()) {
+ if (t1->is_narrowklass() && t2->is_narrowklass()) {
const Type* result = meet_join_helper(op, t1->make_ptr(), t2->make_ptr(), include_speculative);
return result->make_narrowklass();
}
@@ -1333,7 +1333,7 @@ bool Type::has_memory() const {
Type::TYPES tx = base();
if (tx == Memory) return true;
if (tx == Tuple) {
- const TypeTuple *t = is_tuple();
+ const TypeTuple* t = as_tuple();
for (uint i=0; i < t->cnt(); i++) {
tx = t->field_at(i)->base();
if (tx == Memory) return true;
@@ -1463,7 +1463,7 @@ Type::Category Type::category() const {
// Recursive case. Return CatMixed if the tuple contains types of
// different categories (e.g. CallStaticJavaNode's type), or the specific
// category if all types are of the same category (e.g. IfNode's type).
- tuple = is_tuple();
+ tuple = as_tuple();
if (tuple->cnt() == 0) {
return Category::Undef;
} else {
@@ -1486,7 +1486,7 @@ bool Type::has_category(Type::Category cat) const {
return true;
}
if (category() == Category::Mixed) {
- const TypeTuple* tuple = is_tuple();
+ const TypeTuple* tuple = as_tuple();
for (uint i = 0; i < tuple->cnt(); i++) {
if (tuple->field_at(i)->has_category(cat)) {
return true;
@@ -1528,27 +1528,27 @@ void Type::verify_meet_join() {
case DoubleBot:
case DoubleCon:
case DoubleTop:
- return t2->isa_double() != nullptr;
+ return t2->is_double();
case FloatBot:
case FloatCon:
case FloatTop:
- return t2->isa_float() != nullptr;
+ return t2->is_float();
case HalfFloatBot:
case HalfFloatCon:
case HalfFloatTop:
- return t2->isa_half_float() != nullptr;
+ return t2->is_half_float();
case AnyPtr:
- return t2->isa_ptr() != nullptr;
+ return t2->is_ptr();
case OopPtr:
case InstPtr:
- return t2->isa_oopptr() != nullptr;
+ return t2->is_oopptr();
case AryPtr:
// When UseCompressedOops is false, not all AryPtr instances agree on whether their elems
// are compressed (e.g. TypeAryPtr::NARROWOOPS and TypeAryPtr::OOPS)
- return t2->isa_oopptr() != nullptr && UseCompressedOops;
+ return t2->is_oopptr() && UseCompressedOops;
case InstKlassPtr:
case AryKlassPtr:
- return t2->isa_klassptr() != nullptr;
+ return t2->is_klassptr();
case VectorA:
case VectorS:
case VectorD:
@@ -1697,7 +1697,7 @@ const Type* TypeH::xmeet(const Type* t) const {
case HalfFloatTop:
return this;
case HalfFloatCon:
- assert(_f != t->is_half_float_constant()->_f, "Equivalent instances should not appear here");
+ assert(_f != t->as_half_float_constant()->_f, "Equivalent instances should not appear here");
return Type::HALF_FLOAT;
case HalfFloatBot:
return t;
@@ -1712,7 +1712,7 @@ const Type* TypeH::xjoin(const Type* t) const {
case HalfFloatTop:
return t;
case HalfFloatCon:
- assert(_f != t->is_half_float_constant()->_f, "Equivalent instances should not appear here");
+ assert(_f != t->as_half_float_constant()->_f, "Equivalent instances should not appear here");
return Type::make(HalfFloatTop);
case HalfFloatBot:
return this;
@@ -1880,10 +1880,10 @@ const TypeInteger* TypeInteger::make(jlong con, BasicType bt) {
jlong TypeInteger::get_con_as_long(BasicType bt) const {
if (bt == T_INT) {
- return is_int()->get_con();
+ return as_int()->get_con();
}
assert(bt == T_LONG, "basic type not an int or long");
- return is_long()->get_con();
+ return as_long()->get_con();
}
const TypeInteger* TypeInteger::bottom(BasicType bt) {
@@ -1953,18 +1953,18 @@ TypeInt::TypeInt(const TypeIntPrototype& t, int widen)
const TypeInt* TypeInt::make(jint con) {
juint ucon = con;
return (new TypeInt(TypeIntPrototype{{con, con}, {ucon, ucon}, {~ucon, ucon}},
- WidenMin))->hashcons()->is_int();
+ WidenMin))->hashcons()->as_int();
}
const TypeInt* TypeInt::make(jint lo, jint hi, int widen) {
assert(lo <= hi, "must be legal bounds");
- return make_or_top(TypeIntPrototype{{lo, hi}, {0, max_juint}, {0, 0}}, widen)->is_int();
+ return make_or_top(TypeIntPrototype{{lo, hi}, {0, max_juint}, {0, 0}}, widen)->as_int();
}
const TypeInt* TypeInt::make_unsigned(juint ulo, juint uhi, int widen) {
assert(ulo <= uhi, "must be legal bounds");
// By creating the TypeInt with the full signed range and the given unsigned range, the signed bounds are inferred from the unsigned bounds.
- return make_or_top(TypeIntPrototype{{min_jint, max_jint}, {ulo, uhi}, {0, 0}}, widen)->is_int();
+ return make_or_top(TypeIntPrototype{{min_jint, max_jint}, {ulo, uhi}, {0, 0}}, widen)->as_int();
}
const Type* TypeInt::make_or_top(const TypeIntPrototype& t, int widen) {
@@ -1972,7 +1972,7 @@ const Type* TypeInt::make_or_top(const TypeIntPrototype& t, int wid
if (canonicalized_t.empty()) {
return Type::TOP;
}
- return (new TypeInt(canonicalized_t._data, widen))->hashcons()->is_int();
+ return (new TypeInt(canonicalized_t._data, widen))->hashcons()->as_int();
}
bool TypeInt::contains(jint i) const {
@@ -1996,14 +1996,14 @@ const Type* TypeInt::xmeet(const Type* t) const {
if (base() != Int || t->base() != Int) {
typerr(t);
}
- return TypeIntHelper::int_type_xmeet(this, t->is_int());
+ return TypeIntHelper::int_type_xmeet(this, t->as_int());
}
const Type* TypeInt::xjoin(const Type* t) const {
if (base() != Int || t->base() != Int) {
typerr(t);
}
- return TypeIntHelper::int_type_xjoin(this, t->is_int());
+ return TypeIntHelper::int_type_xjoin(this, t->as_int());
}
const Type* TypeInt::widen(const Type* old, const Type* limit) const {
@@ -2036,7 +2036,7 @@ const Type* TypeInt::filter_helper(const Type* kills, bool include_speculative)
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeInt::eq(const Type* t) const {
- const TypeInt* r = t->is_int();
+ const TypeInt* r = t->as_int();
return TypeIntHelper::int_type_is_equal(this, r) && _widen == r->_widen;
}
@@ -2086,18 +2086,18 @@ TypeLong::TypeLong(const TypeIntPrototype& t, int widen)
const TypeLong* TypeLong::make(jlong con) {
julong ucon = con;
return (new TypeLong(TypeIntPrototype{{con, con}, {ucon, ucon}, {~ucon, ucon}},
- WidenMin))->hashcons()->is_long();
+ WidenMin))->hashcons()->as_long();
}
const TypeLong* TypeLong::make(jlong lo, jlong hi, int widen) {
assert(lo <= hi, "must be legal bounds");
- return make_or_top(TypeIntPrototype{{lo, hi}, {0, max_julong}, {0, 0}}, widen)->is_long();
+ return make_or_top(TypeIntPrototype{{lo, hi}, {0, max_julong}, {0, 0}}, widen)->as_long();
}
const TypeLong* TypeLong::make_unsigned(julong ulo, julong uhi, int widen) {
assert(ulo <= uhi, "must be legal bounds");
// By creating the TypeLong with the full signed range and the given unsigned range, the signed bounds are inferred from the unsigned bounds.
- return make_or_top(TypeIntPrototype{{min_jlong, max_jlong}, {ulo, uhi}, {0, 0}}, widen)->is_long();
+ return make_or_top(TypeIntPrototype{{min_jlong, max_jlong}, {ulo, uhi}, {0, 0}}, widen)->as_long();
}
const Type* TypeLong::make_or_top(const TypeIntPrototype& t, int widen) {
@@ -2105,7 +2105,7 @@ const Type* TypeLong::make_or_top(const TypeIntPrototype& t, int
if (canonicalized_t.empty()) {
return Type::TOP;
}
- return (new TypeLong(canonicalized_t._data, widen))->hashcons()->is_long();
+ return (new TypeLong(canonicalized_t._data, widen))->hashcons()->as_long();
}
bool TypeLong::contains(jlong i) const {
@@ -2129,14 +2129,14 @@ const Type* TypeLong::xmeet(const Type* t) const {
if (base() != Long || t->base() != Long) {
typerr(t);
}
- return TypeIntHelper::int_type_xmeet(this, t->is_long());
+ return TypeIntHelper::int_type_xmeet(this, t->as_long());
}
const Type* TypeLong::xjoin(const Type* t) const {
if (base() != Long || t->base() != Long) {
typerr(t);
}
- return TypeIntHelper::int_type_xjoin(this, t->is_long());
+ return TypeIntHelper::int_type_xjoin(this, t->as_long());
}
const Type* TypeLong::widen(const Type* old, const Type* limit) const {
@@ -2169,7 +2169,7 @@ const Type* TypeLong::filter_helper(const Type* kills, bool include_speculative)
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeLong::eq(const Type* t) const {
- const TypeLong* r = t->is_long();
+ const TypeLong* r = t->as_long();
return TypeIntHelper::int_type_is_equal(this, r) && _widen == r->_widen;
}
@@ -2397,7 +2397,7 @@ const Type **TypeTuple::fields( uint arg_cnt ) {
//------------------------------meet-------------------------------------------
// Compute the MEET of two types. It returns a new Type object.
const Type* TypeTuple::xmeet(const Type* t) const {
- const TypeTuple* x = t->is_tuple();
+ const TypeTuple* x = t->as_tuple();
assert(_cnt == x->_cnt, "mismatched shape: %d != %d", _cnt, x->_cnt);
const Type** fields = static_cast(Compile::current()->type_arena()->AmallocWords(_cnt * sizeof(Type*)));
for (uint i = 0; i < _cnt; i++) {
@@ -2407,7 +2407,7 @@ const Type* TypeTuple::xmeet(const Type* t) const {
}
const Type* TypeTuple::xjoin(const Type* t) const {
- const TypeTuple* x = t->is_tuple();
+ const TypeTuple* x = t->as_tuple();
assert(_cnt == x->_cnt, "mismatched shape: %d != %d", _cnt, x->_cnt);
const Type** fields = static_cast(Compile::current()->type_arena()->AmallocWords(_cnt * sizeof(Type*)));
for (uint i = 0; i < _cnt; i++) {
@@ -2492,7 +2492,7 @@ inline const TypeInt* normalize_array_size(const TypeInt* size) {
//------------------------------make-------------------------------------------
const TypeAry* TypeAry::make(const Type* elem, const TypeInt* size, bool stable,
bool flat, bool not_flat, bool null_free, bool not_null_free, bool atomic) {
- if (UseCompressedOops && elem->isa_oopptr()) {
+ if (UseCompressedOops && elem->is_oopptr()) {
elem = elem->make_narrowoop();
}
size = normalize_array_size(size);
@@ -2674,7 +2674,7 @@ const TypeVect* TypeVect::makemask(BasicType elem_bt, uint length) {
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeVect::eq(const Type* t) const {
- const TypeVect* v = t->is_vect();
+ const TypeVect* v = t->as_vect();
return (element_basic_type() == v->element_basic_type()) && (length() == v->length());
}
@@ -2776,11 +2776,11 @@ intptr_t TypePtr::get_con() const {
// Compute the MEET of two types. It returns a new Type object.
const Type *TypePtr::xmeet(const Type *t) const {
const Type* res = xmeet_helper(t);
- if (res->isa_ptr() == nullptr) {
+ if (!res->is_ptr()) {
return res;
}
- const TypePtr* res_ptr = res->is_ptr();
+ const TypePtr* res_ptr = res->as_ptr();
if (res_ptr->speculative() != nullptr) {
// type->speculative() is null means that speculation is no better
// than type, i.e. type->speculative() == type. So there are 2
@@ -2803,7 +2803,7 @@ const Type* TypePtr::xmeet_helper(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
const TypePtr* speculative = xmeet_speculative(tp);
int depth = meet_inline_depth(tp->inline_depth());
return make(AnyPtr, meet_ptr(tp->ptr()), meet_offset(tp->offset()), speculative, depth);
@@ -2817,7 +2817,7 @@ const Type* TypePtr::xmeet_helper(const Type* t) const {
case InstKlassPtr:
case AryKlassPtr:
// Call in reverse direction, delegate to the subtypes to implement the meet
- return t->is_ptr()->xmeet(this);
+ return t->as_ptr()->xmeet(this);
default:
typerr(t);
}
@@ -2825,11 +2825,11 @@ const Type* TypePtr::xmeet_helper(const Type* t) const {
const Type* TypePtr::xjoin(const Type* t) const {
const Type* res = xjoin_helper(t);
- if (res->isa_ptr() == nullptr) {
+ if (!res->is_ptr()) {
return res;
}
- const TypePtr* res_ptr = res->is_ptr();
+ const TypePtr* res_ptr = res->as_ptr();
if (res_ptr->speculative() != nullptr) {
// type->speculative() is null means that speculation is no better
// than type, i.e. type->speculative() == type. So there are 2
@@ -2852,7 +2852,7 @@ const Type* TypePtr::xjoin_helper(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR ptr = offset == Offset::top ? TopPTR : join_ptr(tp->ptr());
const TypePtr* speculative = xjoin_speculative(tp);
@@ -2868,7 +2868,7 @@ const Type* TypePtr::xjoin_helper(const Type* t) const {
case InstKlassPtr:
case AryKlassPtr:
// Call in reverse direction
- return t->is_ptr()->xjoin(this);
+ return t->as_ptr()->xjoin(this);
default:
typerr(t);
}
@@ -2979,7 +2979,7 @@ const TypePtr* TypePtr::xmeet_speculative(const TypePtr* other) const {
other_spec = other;
}
- return this_spec->meet(other_spec)->is_ptr();
+ return this_spec->meet(other_spec)->as_ptr();
}
const TypePtr* TypePtr::xjoin_speculative(const TypePtr* other) const {
@@ -3002,7 +3002,7 @@ const TypePtr* TypePtr::xjoin_speculative(const TypePtr* other) const {
other_spec = other;
}
- return this_spec->join(other_spec)->is_ptr();
+ return this_spec->join(other_spec)->as_ptr();
}
/**
@@ -3055,22 +3055,22 @@ const TypePtr* TypePtr::add_offset_speculative(intptr_t offset) const {
if (_speculative == nullptr) {
return nullptr;
}
- return _speculative->add_offset(offset)->is_ptr();
+ return _speculative->add_offset(offset)->as_ptr();
}
const TypePtr* TypePtr::with_offset_speculative(intptr_t offset) const {
if (_speculative == nullptr) {
return nullptr;
}
- return _speculative->with_offset(offset)->is_ptr();
+ return _speculative->with_offset(offset)->as_ptr();
}
/**
* return exact klass from the speculative type if there's one
*/
ciKlass* TypePtr::speculative_type() const {
- if (_speculative != nullptr && _speculative->isa_oopptr()) {
- const TypeOopPtr* speculative = _speculative->join(this)->is_oopptr();
+ if (_speculative != nullptr && _speculative->is_oopptr()) {
+ const TypeOopPtr* speculative = _speculative->join(this)->as_oopptr();
if (speculative->klass_is_exact()) {
return speculative->exact_klass();
}
@@ -3083,7 +3083,7 @@ ciKlass* TypePtr::speculative_type() const {
*/
bool TypePtr::speculative_maybe_null() const {
if (_speculative != nullptr) {
- const TypePtr* speculative = _speculative->join(this)->is_ptr();
+ const TypePtr* speculative = _speculative->join(this)->as_ptr();
return speculative->maybe_null();
}
return true;
@@ -3091,7 +3091,7 @@ bool TypePtr::speculative_maybe_null() const {
bool TypePtr::speculative_always_null() const {
if (_speculative != nullptr) {
- const TypePtr* speculative = _speculative->join(this)->is_ptr();
+ const TypePtr* speculative = _speculative->join(this)->as_ptr();
return speculative == TypePtr::NULL_PTR;
}
return false;
@@ -3168,7 +3168,7 @@ bool TypePtr::would_improve_ptr(ProfilePtrKind ptr_kind) const {
if (speculative_always_null()) {
return false;
}
- if (ptr_kind == ProfileAlwaysNull && speculative() != nullptr && speculative()->isa_oopptr()) {
+ if (ptr_kind == ProfileAlwaysNull && speculative() != nullptr && speculative()->is_oopptr()) {
return false;
}
return true;
@@ -3317,7 +3317,7 @@ const Type* TypeRawPtr::xmeet(const Type* t) const {
case AnyPtr:
break;
case RawPtr: {
- PTR tptr = t->is_ptr()->ptr();
+ PTR tptr = t->as_ptr()->ptr();
PTR ptr = meet_ptr(tptr);
if (ptr == Constant) {
// Same constant cases have been handled in Type::xmeet(const Type*, const Type*)
@@ -3333,7 +3333,7 @@ const Type* TypeRawPtr::xmeet(const Type* t) const {
}
// Found an AnyPtr type vs self-RawPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
switch (tp->ptr()) {
case TypePtr::TopPTR: return this;
case TypePtr::BotPTR: return t;
@@ -3353,7 +3353,7 @@ const Type* TypeRawPtr::xjoin(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
PTR ptr = join_ptr(tp->ptr());
switch (tp->ptr()) {
case TopPTR:
@@ -3368,7 +3368,7 @@ const Type* TypeRawPtr::xjoin(const Type* t) const {
}
case RawPtr: {
- const TypeRawPtr* tp = t->is_rawptr();
+ const TypeRawPtr* tp = t->as_rawptr();
PTR ptr = join_ptr(tp->ptr());
// this->ptr() can only be Constant, NotNull, BotPTR
if (ptr != Constant) {
@@ -3750,9 +3750,9 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const TypeInterfaces* inter
_is_ptr_to_narrowklass = true;
} else if (klass() == nullptr) {
// Array with unknown body type
- assert(this->isa_aryptr(), "only arrays without klass");
+ assert(this->is_aryptr(), "only arrays without klass");
_is_ptr_to_narrowoop = UseCompressedOops;
- } else if (UseCompressedOops && this->isa_aryptr() && this->offset() != arrayOopDesc::length_offset_in_bytes()) {
+ } else if (UseCompressedOops && this->is_aryptr() && this->offset() != arrayOopDesc::length_offset_in_bytes()) {
if (klass()->is_flat_array_klass() && field_offset != Offset::top && field_offset != Offset::bottom) {
// Check if the field of the value type array element contains oops
ciValueKlass* vk = klass()->as_flat_array_klass()->element_klass()->as_value_klass();
@@ -3770,18 +3770,18 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, const TypeInterfaces* inter
_is_ptr_to_narrowoop = true;
}
} else if (klass()->is_instance_klass()) {
- if (this->isa_klassptr()) {
+ if (this->is_klassptr()) {
// Perm objects don't use compressed references
} else if (_offset == Offset::bottom || _offset == Offset::top) {
// unsafe access
_is_ptr_to_narrowoop = UseCompressedOops;
} else {
- assert(this->isa_instptr(), "must be an instance ptr.");
+ assert(this->is_instptr(), "must be an instance ptr.");
if (klass() == ciEnv::current()->Class_klass() &&
(this->offset() == java_lang_Class::klass_offset() ||
this->offset() == java_lang_Class::array_klass_offset())) {
// Special hidden fields from the Class.
- assert(this->isa_instptr(), "must be an instance ptr.");
+ assert(this->is_instptr(), "must be an instance ptr.");
_is_ptr_to_narrowoop = false;
} else if (klass() == ciEnv::current()->Class_klass() &&
this->offset() >= InstanceMirrorKlass::offset_of_static_fields()) {
@@ -3868,7 +3868,7 @@ const Type* TypeOopPtr::xmeet_helper(const Type *t) const {
switch (t->base()) { // switch on original type
case AnyPtr: {
// Found an AnyPtr type vs self-OopPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
const TypePtr* speculative = xmeet_speculative(tp);
@@ -3889,7 +3889,7 @@ const Type* TypeOopPtr::xmeet_helper(const Type *t) const {
}
case OopPtr: { // Meeting to other OopPtrs
- const TypeOopPtr *tp = t->is_oopptr();
+ const TypeOopPtr* tp = t->as_oopptr();
int instance_id = meet_instance_id(tp->instance_id());
const TypePtr* speculative = xmeet_speculative(tp);
int depth = meet_inline_depth(tp->inline_depth());
@@ -3898,7 +3898,7 @@ const Type* TypeOopPtr::xmeet_helper(const Type *t) const {
case InstPtr: // For these, flip the call around to cut down
case AryPtr:
- return t->is_oopptr()->xmeet_helper(this); // Call in reverse direction
+ return t->as_oopptr()->xmeet_helper(this); // Call in reverse direction
default:
typerr(t);
@@ -3912,7 +3912,7 @@ const Type* TypeOopPtr::xjoin_helper(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -3934,7 +3934,7 @@ const Type* TypeOopPtr::xjoin_helper(const Type* t) const {
}
case OopPtr: {
- const TypeOopPtr* tp = t->is_oopptr();
+ const TypeOopPtr* tp = t->as_oopptr();
const TypePtr* speculative = xjoin_speculative(tp);
int depth = join_inline_depth(tp->inline_depth());
@@ -3949,7 +3949,7 @@ const Type* TypeOopPtr::xjoin_helper(const Type* t) const {
case InstPtr:
case AryPtr:
- return t->is_oopptr()->xjoin_helper(this);
+ return t->as_oopptr()->xjoin_helper(this);
default:
typerr(t);
@@ -4008,7 +4008,7 @@ const TypeOopPtr* TypeOopPtr::make_from_klass_common(ciKlass *klass, bool klass_
atomic = array_klass->is_elem_atomic();
if (null_free) {
- etype = etype->join_speculative(NOTNULL)->is_oopptr();
+ etype = etype->join_speculative(NOTNULL)->as_oopptr();
}
} else {
const TypeOopPtr* exact_etype = etype;
@@ -4067,7 +4067,7 @@ const TypeOopPtr* TypeOopPtr::make_from_constant(ciObject* o, bool require_const
bool is_flat = o->as_array()->is_flat();
bool is_null_free = o->as_array()->is_null_free();
if (is_null_free) {
- etype = etype->join_speculative(TypePtr::NOTNULL)->is_oopptr();
+ etype = etype->join_speculative(TypePtr::NOTNULL)->as_oopptr();
}
bool is_atomic = o->as_array()->is_atomic();
const TypeAry* arr0 = TypeAry::make(etype, TypeInt::make(o->as_array()->length()), /* stable= */ false, /* flat= */ is_flat,
@@ -4445,7 +4445,7 @@ const Type* TypeInstPtr::xmeet_helper(const Type* t) const {
case OopPtr: { // Meeting to OopPtrs
// Found a OopPtr type vs self-InstPtr type
- const TypeOopPtr *tp = t->is_oopptr();
+ const TypeOopPtr* tp = t->as_oopptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
switch (tp->ptr()) {
@@ -4462,7 +4462,7 @@ const Type* TypeInstPtr::xmeet_helper(const Type* t) const {
case AnyPtr: { // Meeting to AnyPtrs
// Found an AnyPtr type vs self-InstPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
int instance_id = meet_instance_id(InstanceTop);
@@ -4487,7 +4487,7 @@ const Type* TypeInstPtr::xmeet_helper(const Type* t) const {
case InstPtr:
case AryPtr:
- return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->is_oopptr());
+ return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->as_oopptr());
} // End of switch
}
@@ -4499,7 +4499,7 @@ const Type* TypeInstPtr::xjoin_helper(const Type* t) const {
switch (t->base()) {
case AnyPtr:
case OopPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -4522,7 +4522,7 @@ const Type* TypeInstPtr::xjoin_helper(const Type* t) const {
case InstPtr:
case AryPtr:
- return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->is_oopptr());
+ return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->as_oopptr());
default:
typerr(t);
@@ -4542,7 +4542,7 @@ ciType* TypeInstPtr::java_mirror_type() const {
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeInstPtr::eq( const Type *t ) const {
- const TypeInstPtr *p = t->is_instptr();
+ const TypeInstPtr* p = t->as_instptr();
return
klass()->equals(p->klass()) &&
_flat_in_array == p->_flat_in_array &&
@@ -4694,7 +4694,7 @@ const TypeAryPtr* TypeAryPtr::NULLABLES;
//------------------------------make-------------------------------------------
const TypeAryPtr* TypeAryPtr::make(PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, Offset offset, Offset field_offset,
int instance_id, const TypePtr* speculative, int inline_depth) {
- assert(!(k == nullptr && ary->_elem->isa_int()),
+ assert(!(k == nullptr && ary->_elem->is_int()),
"integral arrays must be pre-equipped with a class");
if (!xk) xk = ary->ary_must_be_exact();
assert(instance_id <= 0 || xk, "instances are always exactly typed");
@@ -4709,7 +4709,7 @@ const TypeAryPtr* TypeAryPtr::make(PTR ptr, const TypeAry *ary, ciKlass* k, bool
const TypeAryPtr* TypeAryPtr::make(PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, Offset offset, Offset field_offset,
int instance_id, const TypePtr* speculative, int inline_depth,
bool is_autobox_cache) {
- assert(!(k == nullptr && ary->_elem->isa_int()),
+ assert(!(k == nullptr && ary->_elem->is_int()),
"integral arrays must be pre-equipped with a class");
assert( (ptr==Constant && o) || (ptr!=Constant && !o), "" );
if (!xk) xk = (o != nullptr) || ary->ary_must_be_exact();
@@ -4813,7 +4813,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_flat() const {
}
assert(!is_not_flat(), "inconsistency");
- return join_speculative(TypeAryPtr::INLINES)->is_aryptr();
+ return join_speculative(TypeAryPtr::INLINES)->as_aryptr();
}
const TypeAryPtr* TypeAryPtr::cast_to_not_flat() const {
@@ -4822,7 +4822,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_not_flat() const {
}
assert(!is_flat(), "inconsistency");
- return join_speculative(TypeAryPtr::REFERENCES)->is_aryptr();
+ return join_speculative(TypeAryPtr::REFERENCES)->as_aryptr();
}
const TypeAryPtr* TypeAryPtr::cast_to_null_free() const {
@@ -4831,7 +4831,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_null_free() const {
}
assert(!is_not_null_free(), "inconsistency");
- return join_speculative(TypeAryPtr::NULL_FREES)->is_aryptr();
+ return join_speculative(TypeAryPtr::NULL_FREES)->as_aryptr();
}
//-------------------------------cast_to_not_null_free-------------------------
@@ -4841,7 +4841,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_not_null_free() const {
}
assert(!is_null_free(), "inconsistency");
- return join_speculative(TypeAryPtr::NULLABLES)->is_aryptr();
+ return join_speculative(TypeAryPtr::NULLABLES)->as_aryptr();
}
//---------------------------------update_properties---------------------------
@@ -4886,9 +4886,9 @@ const TypeAryPtr* TypeAryPtr::cast_to_stable(bool stable, int stable_dimension)
const Type* elem = this->elem();
const TypePtr* elem_ptr = elem->make_ptr();
- if (stable_dimension > 1 && elem_ptr != nullptr && elem_ptr->isa_aryptr()) {
+ if (stable_dimension > 1 && elem_ptr != nullptr && elem_ptr->is_aryptr()) {
// If this is widened from a narrow oop, TypeAry::make will re-narrow it.
- elem = elem_ptr = elem_ptr->is_aryptr()->cast_to_stable(stable, stable_dimension - 1);
+ elem = elem_ptr = elem_ptr->as_aryptr()->cast_to_stable(stable, stable_dimension - 1);
}
const TypeAry* new_ary = TypeAry::make(elem, size(), stable, is_flat(), is_not_flat(), is_null_free(), is_not_null_free(), is_atomic());
@@ -4901,8 +4901,8 @@ int TypeAryPtr::stable_dimension() const {
if (!is_stable()) return 0;
int dim = 1;
const TypePtr* elem_ptr = elem()->make_ptr();
- if (elem_ptr != nullptr && elem_ptr->isa_aryptr())
- dim += elem_ptr->is_aryptr()->stable_dimension();
+ if (elem_ptr != nullptr && elem_ptr->is_aryptr())
+ dim += elem_ptr->as_aryptr()->stable_dimension();
return dim;
}
@@ -4912,7 +4912,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_autobox_cache() const {
const TypeOopPtr* etype = elem()->make_oopptr();
if (etype == nullptr) return this;
// The pointers in the autobox arrays are always non-null.
- etype = etype->cast_to_ptr_type(TypePtr::NotNull)->is_oopptr();
+ etype = etype->cast_to_ptr_type(TypePtr::NotNull)->as_oopptr();
const TypeAry* new_ary = TypeAry::make(etype, size(), is_stable(), is_flat(), is_not_flat(), is_null_free(), is_not_null_free(), is_atomic());
return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _field_offset, _instance_id, _speculative, _inline_depth, /*is_autobox_cache=*/true);
}
@@ -4920,7 +4920,7 @@ const TypeAryPtr* TypeAryPtr::cast_to_autobox_cache() const {
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeAryPtr::eq( const Type *t ) const {
- const TypeAryPtr *p = t->is_aryptr();
+ const TypeAryPtr* p = t->as_aryptr();
return
_ary == p->_ary && // Check array
TypeOopPtr::eq(p) &&// Check sub-parts
@@ -4958,7 +4958,7 @@ const Type* TypeAryPtr::xmeet_helper(const Type* t) const {
case OopPtr: { // Meeting to OopPtrs
// Found a OopPtr type vs self-AryPtr type
- const TypeOopPtr *tp = t->is_oopptr();
+ const TypeOopPtr* tp = t->as_oopptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
int depth = meet_inline_depth(tp->inline_depth());
@@ -4975,7 +4975,7 @@ const Type* TypeAryPtr::xmeet_helper(const Type* t) const {
case AnyPtr: { // Meeting two AnyPtrs
// Found an AnyPtr type vs self-AryPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
const TypePtr* speculative = xmeet_speculative(tp);
@@ -5000,7 +5000,7 @@ const Type* TypeAryPtr::xmeet_helper(const Type* t) const {
case AryPtr:
case InstPtr:
- return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->is_oopptr());
+ return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->as_oopptr());
}
}
@@ -5012,7 +5012,7 @@ const Type* TypeAryPtr::xjoin_helper(const Type* t) const {
switch (t->base()) {
case AnyPtr:
case OopPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -5035,7 +5035,7 @@ const Type* TypeAryPtr::xjoin_helper(const Type* t) const {
case InstPtr:
case AryPtr:
- return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->is_oopptr());
+ return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->as_oopptr());
default:
typerr(t);
@@ -5171,7 +5171,7 @@ const TypeAryPtr* TypeAryPtr::remove_speculative() const {
return this;
}
assert(_inline_depth == InlineDepthTop || _inline_depth == InlineDepthBottom, "non speculative type shouldn't have inline depth");
- return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, _field_offset, _instance_id, nullptr, _inline_depth, _is_autobox_cache);
+ return make(_ptr, _const_oop, _ary->remove_speculative()->as_ary(), _klass, _klass_is_exact, _offset, _field_offset, _instance_id, nullptr, _inline_depth, _is_autobox_cache);
}
const Type* TypeAryPtr::cleanup_speculative() const {
@@ -5191,11 +5191,11 @@ const TypePtr* TypeAryPtr::with_inline_depth(int depth) const {
if (!UseInlineDepthForSpeculativeTypes) {
return this;
}
- return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, _field_offset, _instance_id, _speculative, depth, _is_autobox_cache);
+ return make(_ptr, _const_oop, _ary->remove_speculative()->as_ary(), _klass, _klass_is_exact, _offset, _field_offset, _instance_id, _speculative, depth, _is_autobox_cache);
}
const TypeAryPtr* TypeAryPtr::with_field_offset(int offset) const {
- return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, Offset(offset), _instance_id, _speculative, _inline_depth, _is_autobox_cache);
+ return make(_ptr, _const_oop, _ary->remove_speculative()->as_ary(), _klass, _klass_is_exact, _offset, Offset(offset), _instance_id, _speculative, _inline_depth, _is_autobox_cache);
}
const TypePtr* TypeAryPtr::add_field_offset_and_offset(intptr_t offset) const {
@@ -5242,7 +5242,7 @@ int TypeAryPtr::flat_offset() const {
const TypePtr* TypeAryPtr::with_instance_id(int instance_id) const {
assert(is_known_instance(), "should be known");
- return make(_ptr, _const_oop, _ary->remove_speculative()->is_ary(), _klass, _klass_is_exact, _offset, _field_offset, instance_id, _speculative, _inline_depth);
+ return make(_ptr, _const_oop, _ary->remove_speculative()->as_ary(), _klass, _klass_is_exact, _offset, _field_offset, instance_id, _speculative, _inline_depth);
}
//=============================================================================
@@ -5278,15 +5278,15 @@ bool TypeNarrowPtr::eq( const Type *t ) const {
}
const Type *TypeNarrowPtr::filter_helper(const Type *kills, bool include_speculative) const {
- if (isa_same_narrowptr(kills)) {
- const Type* ft =_ptrtype->filter_helper(is_same_narrowptr(kills)->_ptrtype, include_speculative);
+ if (is_same_narrowptr(kills)) {
+ const Type* ft = _ptrtype->filter_helper(as_same_narrowptr(kills)->_ptrtype, include_speculative);
if (ft->empty())
return Type::TOP; // Canonical empty value
- if (ft->isa_ptr()) {
- return make_hash_same_narrowptr(ft->isa_ptr());
+ if (ft->is_ptr()) {
+ return make_hash_same_narrowptr(ft->as_ptr());
}
return ft;
- } else if (kills->isa_ptr()) {
+ } else if (kills->is_ptr()) {
const Type* ft = _ptrtype->join_helper(kills, include_speculative);
if (ft->empty())
return Type::TOP; // Canonical empty value
@@ -5311,11 +5311,11 @@ const TypeNarrowOop* TypeNarrowOop::make(const TypePtr* type) {
}
const TypeNarrowOop* TypeNarrowOop::remove_speculative() const {
- return make(_ptrtype->remove_speculative()->is_ptr());
+ return make(_ptrtype->remove_speculative()->as_ptr());
}
const Type* TypeNarrowOop::cleanup_speculative() const {
- return make(_ptrtype->cleanup_speculative()->is_ptr());
+ return make(_ptrtype->cleanup_speculative()->as_ptr());
}
#ifndef PRODUCT
@@ -5422,7 +5422,7 @@ const Type *TypeMetadataPtr::xmeet( const Type *t ) const {
case AnyPtr: {
// Found an AnyPtr type vs self-OopPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
switch (tp->ptr()) {
@@ -5440,7 +5440,7 @@ const Type *TypeMetadataPtr::xmeet( const Type *t ) const {
}
case MetadataPtr: {
- const TypeMetadataPtr *tp = t->is_metadataptr();
+ const TypeMetadataPtr* tp = t->as_metadataptr();
Offset offset = meet_offset(tp->offset());
PTR tptr = tp->ptr();
PTR ptr = meet_ptr(tptr);
@@ -5468,7 +5468,7 @@ const Type* TypeMetadataPtr::xjoin(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -5485,7 +5485,7 @@ const Type* TypeMetadataPtr::xjoin(const Type* t) const {
}
case MetadataPtr: {
- const TypeMetadataPtr* tp = t->is_metadataptr();
+ const TypeMetadataPtr* tp = t->as_metadataptr();
PTR ptr = join_ptr(tp->ptr());
Offset offset = join_offset(tp->offset());
if (offset == Offset::top) {
@@ -5551,13 +5551,13 @@ const TypeKlassPtr* TypeAryPtr::as_klass_type(bool try_for_exact) const {
if (elem->make_oopptr() != nullptr) {
is_refined = true;
elem = elem->make_oopptr()->as_klass_type(try_for_exact);
- if (elem->isa_aryklassptr()) {
- const TypeAryKlassPtr* elem_klass = elem->is_aryklassptr();
+ if (elem->is_aryklassptr()) {
+ const TypeAryKlassPtr* elem_klass = elem->as_aryklassptr();
if (elem_klass->is_refined_type()) {
elem = elem_klass->cast_to_non_refined();
}
} else {
- const TypeInstKlassPtr* elem_klass = elem->is_instklassptr();
+ const TypeInstKlassPtr* elem_klass = elem->as_instklassptr();
if (try_for_exact && !xk && elem_klass->klass_is_exact() &&
!elem_klass->exact_klass()->as_instance_klass()->can_be_value_klass()) {
xk = true;
@@ -5598,7 +5598,7 @@ ciKlass* TypeKlassPtr::exact_klass_helper() const {
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeKlassPtr::eq(const Type *t) const {
- const TypeKlassPtr *p = t->is_klassptr();
+ const TypeKlassPtr* p = t->as_klassptr();
return
_interfaces->eq(p->_interfaces) &&
TypePtr::eq(p);
@@ -5676,7 +5676,7 @@ const TypeInstKlassPtr *TypeInstKlassPtr::OBJECT;
const TypeInstKlassPtr *TypeInstKlassPtr::OBJECT_OR_NULL;
bool TypeInstKlassPtr::eq(const Type *t) const {
- const TypeInstKlassPtr* p = t->is_instklassptr();
+ const TypeInstKlassPtr* p = t->as_instklassptr();
return
klass()->equals(p->klass()) &&
_flat_in_array == p->_flat_in_array &&
@@ -5790,7 +5790,7 @@ const Type* TypeInstKlassPtr::xmeet(const Type* t) const {
case AnyPtr: { // Meeting to AnyPtrs
// Found an AnyPtr type vs self-KlassPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
switch (tp->ptr()) {
@@ -5810,7 +5810,7 @@ const Type* TypeInstKlassPtr::xmeet(const Type* t) const {
case InstKlassPtr:
case AryKlassPtr:
- return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->is_klassptr());
+ return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->as_klassptr());
} // End of switch
return this; // Return the double constant
@@ -5823,7 +5823,7 @@ const Type* TypeInstKlassPtr::xjoin(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -5841,7 +5841,7 @@ const Type* TypeInstKlassPtr::xjoin(const Type* t) const {
case InstKlassPtr:
case AryKlassPtr:
- return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->is_klassptr());
+ return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->as_klassptr());
default:
typerr(t);
@@ -5978,7 +5978,7 @@ const TypeAryKlassPtr* TypeAryKlassPtr::OBJECT_ARRAY; // Not-null object
const TypeAryKlassPtr* TypeAryKlassPtr::OBJECT_ARRAY_OR_NULL; // Maybe-null object array klass
bool TypeAryKlassPtr::can_be_value_array() const {
- return _elem->isa_instklassptr() && _elem->is_instklassptr()->_klass->can_be_value_klass();
+ return _elem->is_instklassptr() && _elem->as_instklassptr()->_klass->can_be_value_klass();
}
bool TypeInstPtr::can_be_value_array() const {
@@ -5986,13 +5986,13 @@ bool TypeInstPtr::can_be_value_array() const {
}
bool TypeAryPtr::can_be_value_array() const {
- return elem()->make_ptr() && elem()->make_ptr()->isa_instptr() && elem()->make_ptr()->is_instptr()->_klass->can_be_value_klass();
+ return elem()->make_ptr() && elem()->make_ptr()->is_instptr() && elem()->make_ptr()->as_instptr()->_klass->can_be_value_klass();
}
const TypeAryKlassPtr *TypeAryKlassPtr::make(PTR ptr, const Type* elem, ciKlass* k, Offset offset, bool not_flat, bool not_null_free, bool flat, bool null_free, bool atomic, bool refined_type) {
- if (ptr == TypePtr::Constant && elem->isa_klassptr() != nullptr) {
+ if (ptr == TypePtr::Constant && elem->is_klassptr()) {
// If an array klass ptr is a constant, its element is also a constant
- elem = elem->is_klassptr()->cast_to_exactness(true);
+ elem = elem->as_klassptr()->cast_to_exactness(true);
}
return (TypeAryKlassPtr*)(new TypeAryKlassPtr(ptr, elem, k, offset, not_flat, not_null_free, flat, null_free, atomic, refined_type))->hashcons();
}
@@ -6029,7 +6029,7 @@ const TypeAryKlassPtr* TypeAryKlassPtr::cast_to_non_refined() const {
assert(is_refined_type(), "must be a refined type");
PTR ptr = _ptr;
// There can be multiple refined array types corresponding to a single unrefined type
- if (ptr == NotNull && elem()->is_klassptr()->klass_is_exact()) {
+ if (ptr == NotNull && elem()->as_klassptr()->klass_is_exact()) {
ptr = Constant;
}
return make(ptr, elem(), nullptr, _offset, true, true, false, false, true, false);
@@ -6048,7 +6048,7 @@ const TypeAryKlassPtr* TypeAryKlassPtr::cast_to_refined_array_klass_ptr(bool ref
//------------------------------eq---------------------------------------------
// Structural equality check for Type representations
bool TypeAryKlassPtr::eq(const Type *t) const {
- const TypeAryKlassPtr *p = t->is_aryklassptr();
+ const TypeAryKlassPtr* p = t->as_aryklassptr();
return
_elem == p->_elem && // Check array
_flat == p->_flat &&
@@ -6072,17 +6072,13 @@ uint TypeAryKlassPtr::hash(void) const {
ciKlass* TypeAryPtr::compute_klass() const {
// Compute _klass based on element type.
ciKlass* k_ary = nullptr;
- const TypeInstPtr *tinst;
- const TypeAryPtr *tary;
const Type* el = elem();
- if (el->isa_narrowoop()) {
+ if (el->is_narrowoop()) {
el = el->make_ptr();
}
// Get element klass
- if ((tinst = el->isa_instptr()) != nullptr) {
- // Leave k_ary at nullptr.
- } else if ((tary = el->isa_aryptr()) != nullptr) {
+ if (el->is_instptr() || el->is_aryptr()) {
// Leave k_ary at nullptr.
} else if ((el->base() == Type::Top) ||
(el->base() == Type::Bottom)) {
@@ -6090,7 +6086,7 @@ ciKlass* TypeAryPtr::compute_klass() const {
// and object; Top occurs when doing join on Bottom.
// Leave k_ary at null.
} else {
- assert(!el->isa_int(), "integral arrays must be pre-equipped with a class");
+ assert(!el->is_int(), "integral arrays must be pre-equipped with a class");
// Compute array klass directly from basic type
k_ary = ciTypeArrayKlass::make(el->basic_type());
}
@@ -6126,8 +6122,8 @@ ciKlass* TypeAryPtr::klass() const {
// Is there a single ciKlass* that can represent that type?
ciKlass* TypeAryPtr::exact_klass_helper() const {
- if (_ary->_elem->make_ptr() && _ary->_elem->make_ptr()->isa_oopptr()) {
- ciKlass* k = _ary->_elem->make_ptr()->is_oopptr()->exact_klass_helper();
+ if (const TypePtr* ary_ptr = _ary->_elem->make_ptr(); ary_ptr != nullptr && ary_ptr->is_oopptr()) {
+ ciKlass* k = ary_ptr->as_oopptr()->exact_klass_helper();
if (k == nullptr) {
return nullptr;
}
@@ -6149,8 +6145,8 @@ ciKlass* TypeAryPtr::exact_klass_helper() const {
const Type* TypeAryPtr::base_element_type(int& dims) const {
const Type* elem = this->elem();
dims = 1;
- while (elem->make_ptr() && elem->make_ptr()->isa_aryptr()) {
- elem = elem->make_ptr()->is_aryptr()->elem();
+ while (elem->make_ptr() && elem->make_ptr()->is_aryptr()) {
+ elem = elem->make_ptr()->as_aryptr()->elem();
dims++;
}
return elem;
@@ -6178,8 +6174,7 @@ bool TypeAryKlassPtr::must_be_exact() const {
if (_elem == Type::BOTTOM || _elem == Type::TOP) {
return false;
}
- const TypeKlassPtr* elem = _elem->isa_klassptr();
- if (elem == nullptr) {
+ if (!_elem->is_klassptr()) {
// primitive arrays
return true;
}
@@ -6197,8 +6192,8 @@ const TypeAryKlassPtr* TypeAryKlassPtr::cast_to_exactness(bool klass_is_exact) c
return this;
}
const Type* elem = this->elem();
- if (elem->isa_klassptr() && !klass_is_exact) {
- elem = elem->is_klassptr()->cast_to_exactness(klass_is_exact);
+ if (elem->is_klassptr() && !klass_is_exact) {
+ elem = elem->as_klassptr()->cast_to_exactness(klass_is_exact);
}
if (klass_is_exact) {
@@ -6208,9 +6203,10 @@ const TypeAryKlassPtr* TypeAryKlassPtr::cast_to_exactness(bool klass_is_exact) c
} else {
// cast_to_exactness(false) means get the TypeAryKlassPtr representing all values that subtype
// this value
- bool not_value = !_elem->isa_instklassptr() || !_elem->is_instklassptr()->instance_klass()->can_be_value_klass();
+ const TypeInstKlassPtr* elem_inst_klass_ptr = _elem->isa_instklassptr();
+ bool not_value = elem_inst_klass_ptr == nullptr || !elem_inst_klass_ptr->instance_klass()->can_be_value_klass();
bool not_flat = !UseArrayFlattening || not_value ||
- (_elem->isa_instklassptr() && _elem->is_instklassptr()->instance_klass()->is_value_klass() && !_elem->is_instklassptr()->instance_klass()->maybe_flat_in_array());
+ (elem_inst_klass_ptr != nullptr && elem_inst_klass_ptr->instance_klass()->is_value_klass() && !elem_inst_klass_ptr->instance_klass()->maybe_flat_in_array());
bool not_null_free = not_value;
bool atomic = not_flat;
return make(NotNull, elem, nullptr, _offset, not_flat, not_null_free, false, false, atomic, false);
@@ -6224,16 +6220,16 @@ const TypeAryPtr* TypeAryKlassPtr::as_exact_instance_type(bool klass_change) con
ciKlass* k = klass();
bool xk = klass_is_exact();
const Type* el = nullptr;
- if (elem()->isa_klassptr()) {
- el = elem()->is_klassptr()->as_subtype_instance_type(false);
+ if (elem()->is_klassptr()) {
+ el = elem()->as_klassptr()->as_subtype_instance_type(false);
k = nullptr;
} else {
el = elem();
}
bool flat, not_flat, null_free, not_null_free, atomic;
if (_refined_type) {
- if (_null_free && el->isa_ptr()) {
- el = el->is_ptr()->join_speculative(TypePtr::NOTNULL);
+ if (_null_free && el->is_ptr()) {
+ el = el->as_ptr()->join_speculative(TypePtr::NOTNULL);
}
flat = is_flat();
not_flat = is_not_flat();
@@ -6248,11 +6244,11 @@ const TypeAryPtr* TypeAryKlassPtr::as_exact_instance_type(bool klass_change) con
// Only arrays of value classes can be null free. Otherwise, not_null_free == true. That is if the element type
// is not an instance class, or this instance class cannot be a value type, it's surely not null-restricted.
not_null_free = is_java_primitive(elem()->basic_type()) ||
- elem()->isa_aryklassptr() != nullptr ||
- (elem()->isa_instklassptr() != nullptr && !elem()->is_instklassptr()->can_be_value_type());
+ elem()->is_aryklassptr() ||
+ (elem()->is_instklassptr() && !elem()->as_instklassptr()->can_be_value_type());
bool array_can_be_flat;
- if (elem()->isa_instklassptr()) {
- FlatInArray elem_flat_in_array = elem()->is_instklassptr()->flat_in_array();
+ if (elem()->is_instklassptr()) {
+ FlatInArray elem_flat_in_array = elem()->as_instklassptr()->flat_in_array();
array_can_be_flat = elem_flat_in_array == MaybeFlat || elem_flat_in_array == Flat;
} else {
array_can_be_flat = elem() == Type::BOTTOM;
@@ -6281,7 +6277,7 @@ const Type* TypeAryKlassPtr::xmeet(const Type* t) const {
case AnyPtr: { // Meeting to AnyPtrs
// Found an AnyPtr type vs self-KlassPtr type
- const TypePtr *tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = meet_offset(tp->offset());
PTR ptr = meet_ptr(tp->ptr());
switch (tp->ptr()) {
@@ -6301,7 +6297,7 @@ const Type* TypeAryKlassPtr::xmeet(const Type* t) const {
case AryKlassPtr:
case InstKlassPtr:
- return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->is_klassptr());
+ return TypeJavaPtrMeetHelper::javaptr_type_xmeet(this, t->as_klassptr());
} // End of switch
return this; // Return the double constant
@@ -6314,7 +6310,7 @@ const Type* TypeAryKlassPtr::xjoin(const Type* t) const {
switch (t->base()) {
case AnyPtr: {
- const TypePtr* tp = t->is_ptr();
+ const TypePtr* tp = t->as_ptr();
Offset offset = join_offset(tp->offset());
PTR other_ptr = offset == Offset::top ? TopPTR : tp->ptr();
PTR ptr = join_ptr(other_ptr);
@@ -6332,7 +6328,7 @@ const Type* TypeAryKlassPtr::xjoin(const Type* t) const {
case InstKlassPtr:
case AryKlassPtr:
- return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->is_klassptr());
+ return TypeJavaPtrJoinHelper::javaptr_type_xjoin(this, t->as_klassptr());
default:
typerr(t);
@@ -6359,7 +6355,7 @@ template bool TypePtr::is_java_subtype_of_helper_for_array(
}
assert(this_one->is_array_type(other), "");
- const T1* other_ary = this_one->is_array_type(other);
+ const T1* other_ary = this_one->as_array_type(other);
bool other_top_or_bottom = (other_ary->base_element_type(dummy) == Type::TOP || other_ary->base_element_type(dummy) == Type::BOTTOM);
if (other_top_or_bottom) {
return false;
@@ -6371,7 +6367,7 @@ template bool TypePtr::is_java_subtype_of_helper_for_array(
if (other->is_null_free() && !this_one->is_null_free()) {
return false; // A nullable array can't be a subtype of a null-free array
}
- return this_one->is_reference_type(this_elem)->is_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
+ return this_one->as_reference_type(this_elem)->is_java_subtype_of_helper(this_one->as_reference_type(other_elem), this_exact, other_exact);
}
if (this_elem == nullptr && other_elem == nullptr) {
return this_one->klass()->is_subtype_of(other->klass());
@@ -6393,7 +6389,7 @@ template bool TypePtr::is_same_java_type_as_helper_for_arra
!this_one->is_loaded() || !other->is_loaded() || this_top_or_bottom) {
return false;
}
- const T1* other_ary = this_one->is_array_type(other);
+ const T1* other_ary = this_one->as_array_type(other);
bool other_top_or_bottom = (other_ary->base_element_type(dummy) == Type::TOP || other_ary->base_element_type(dummy) == Type::BOTTOM);
if (other_top_or_bottom) {
@@ -6403,7 +6399,7 @@ template bool TypePtr::is_same_java_type_as_helper_for_arra
const TypePtr* other_elem = other_ary->elem()->make_ptr();
const TypePtr* this_elem = this_one->elem()->make_ptr();
if (other_elem != nullptr && this_elem != nullptr) {
- return this_one->is_reference_type(this_elem)->is_same_java_type_as(this_one->is_reference_type(other_elem));
+ return this_one->as_reference_type(this_elem)->is_same_java_type_as(this_one->as_reference_type(other_elem));
}
if (other_elem == nullptr && this_elem == nullptr) {
return this_one->klass()->equals(other->klass());
@@ -6436,7 +6432,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_arr
assert(this_one->is_array_type(other), "");
- const T1* other_ary = this_one->is_array_type(other);
+ const T1* other_ary = this_one->as_array_type(other);
bool other_top_or_bottom = (other_ary->base_element_type(dummy) == Type::TOP || other_ary->base_element_type(dummy) == Type::BOTTOM);
if (other_top_or_bottom) {
return true;
@@ -6448,7 +6444,7 @@ template bool TypePtr::maybe_java_subtype_of_helper_for_arr
const TypePtr* this_elem = this_one->elem()->make_ptr();
const TypePtr* other_elem = other_ary->elem()->make_ptr();
if (other_elem != nullptr && this_elem != nullptr) {
- return this_one->is_reference_type(this_elem)->maybe_java_subtype_of_helper(this_one->is_reference_type(other_elem), this_exact, other_exact);
+ return this_one->as_reference_type(this_elem)->maybe_java_subtype_of_helper(this_one->as_reference_type(other_elem), this_exact, other_exact);
}
if (other_elem == nullptr && this_elem == nullptr) {
return this_one->klass()->is_subtype_of(other->klass());
@@ -6462,8 +6458,8 @@ bool TypeAryKlassPtr::maybe_java_subtype_of_helper(const TypeKlassPtr* other, bo
// Is there a single ciKlass* that can represent that type?
ciKlass* TypeAryKlassPtr::exact_klass_helper() const {
- if (elem()->isa_klassptr()) {
- ciKlass* k = elem()->is_klassptr()->exact_klass_helper();
+ if (elem()->is_klassptr()) {
+ ciKlass* k = elem()->as_klassptr()->exact_klass_helper();
if (k == nullptr) {
return nullptr;
}
@@ -6480,7 +6476,7 @@ ciKlass* TypeAryKlassPtr::klass() const {
return _klass;
}
ciKlass* k = nullptr;
- if (elem()->isa_klassptr()) {
+ if (elem()->is_klassptr()) {
// leave null
} else if ((elem()->base() == Type::Top) ||
(elem()->base() == Type::Bottom)) {
@@ -6514,8 +6510,8 @@ void TypeAryKlassPtr::dump2( Dict & d, uint depth, outputStream *st ) const {
const Type* TypeAryKlassPtr::base_element_type(int& dims) const {
const Type* elem = this->elem();
dims = 1;
- while (elem->isa_aryklassptr()) {
- elem = elem->is_aryklassptr()->elem();
+ while (elem->is_aryklassptr()) {
+ elem = elem->as_aryklassptr()->elem();
dims++;
}
return elem;
diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp
index ce4bf5bb38a..72c047c9f84 100644
--- a/src/hotspot/share/opto/type.hpp
+++ b/src/hotspot/share/opto/type.hpp
@@ -26,6 +26,7 @@
#define SHARE_OPTO_TYPE_HPP
#include "ci/ciValueKlass.hpp"
+#include "metaprogramming/dependentAlwaysFalse.hpp"
#include "opto/adlcVMDeps.hpp"
#include "opto/compile.hpp"
#include "opto/rangeinference.hpp"
@@ -180,7 +181,6 @@ class Type {
typedef struct {
BasicType basic_type;
const char* msg;
- bool isa_oop;
uint ideal_reg;
} TypeInfo;
@@ -303,59 +303,108 @@ class Type {
virtual float getf() const;
double getd() const;
- // This has the same semantics as std::dynamic_cast(this)
- template
- const TypeClass* try_cast() const;
-
- const TypeInt *is_int() const;
- const TypeInt *isa_int() const; // Returns null if not an Int
- const TypeInteger* is_integer(BasicType bt) const;
- const TypeInteger* isa_integer(BasicType bt) const;
- const TypeLong *is_long() const;
- const TypeLong *isa_long() const; // Returns null if not a Long
- const TypeD *isa_double() const; // Returns null if not a Double{Top,Con,Bot}
- const TypeD *is_double_constant() const; // Asserts it is a DoubleCon
- const TypeD *isa_double_constant() const; // Returns null if not a DoubleCon
- const TypeH *isa_half_float() const; // Returns null if not a HalfFloat{Top,Con,Bot}
- const TypeH *is_half_float_constant() const; // Asserts it is a HalfFloatCon
- const TypeH *isa_half_float_constant() const; // Returns null if not a HalfFloatCon
- const TypeF *isa_float() const; // Returns null if not a Float{Top,Con,Bot}
- const TypeF *is_float_constant() const; // Asserts it is a FloatCon
- const TypeF *isa_float_constant() const; // Returns null if not a FloatCon
- const TypeTuple *is_tuple() const; // Collection of fields, NOT a pointer
- const TypeAry *is_ary() const; // Array, NOT array pointer
- const TypeAry *isa_ary() const; // Returns null of not ary
- const TypeVect *is_vect() const; // Vector
- const TypeVect *isa_vect() const; // Returns null if not a Vector
- const TypePVectMask *is_pvectmask() const; // Predicate/Mask Vector
- const TypePVectMask *isa_pvectmask() const; // Returns null if not a Vector Predicate/Mask
- const TypePtr *is_ptr() const; // Asserts it is a ptr type
- const TypePtr *isa_ptr() const; // Returns null if not ptr type
- const TypeRawPtr *isa_rawptr() const; // NOT Java oop
- const TypeRawPtr *is_rawptr() const; // Asserts is rawptr
- const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer
- const TypeNarrowOop *isa_narrowoop() const; // Returns null if not oop ptr type
- const TypeNarrowKlass *is_narrowklass() const; // compressed klass pointer
- const TypeNarrowKlass *isa_narrowklass() const;// Returns null if not oop ptr type
- const TypeOopPtr *isa_oopptr() const; // Returns null if not oop ptr type
- const TypeOopPtr *is_oopptr() const; // Java-style GC'd pointer
- const TypeInstPtr *isa_instptr() const; // Returns null if not InstPtr
- const TypeInstPtr *is_instptr() const; // Instance
- const TypeAryPtr *isa_aryptr() const; // Returns null if not AryPtr
- const TypeAryPtr *is_aryptr() const; // Array oop
+private:
+ // Boilerplate to get nice error messages in as_XXX
+ template const T* as(bool (Type::*is_xxx)() const, const char* expected) const;
+public:
+ // Testing and casting:
+ // - is_* checks whether `this` is of the given kind.
+ // - isa_* checks whether `this` is of the given kind and casts. Returns nullptr in case of failure.
+ // - as_* asserts `this` is of the given kind and casts. Never returns nullptr.
+
+ [[nodiscard]] bool is_int() const;
+ [[nodiscard]] const TypeInt* isa_int() const;
+ [[nodiscard]] const TypeInt* as_int() const;
+
+ [[nodiscard]] bool is_long() const;
+ [[nodiscard]] const TypeLong* isa_long() const;
+ [[nodiscard]] const TypeLong* as_long() const;
+
+ // Either int or long. To use only with bt == T_INT || bt == T_LONG
+ [[nodiscard]] bool is_integer(BasicType bt) const;
+ [[nodiscard]] const TypeInteger* isa_integer(BasicType bt) const;
+ [[nodiscard]] const TypeInteger* as_integer(BasicType bt) const;
+
+ [[nodiscard]] bool is_double() const;
+
+ [[nodiscard]] bool is_double_constant() const;
+ [[nodiscard]] const TypeD* isa_double_constant() const;
+ [[nodiscard]] const TypeD* as_double_constant() const;
+
+ [[nodiscard]] bool is_half_float() const;
+
+ [[nodiscard]] bool is_half_float_constant() const;
+ [[nodiscard]] const TypeH* isa_half_float_constant() const;
+ [[nodiscard]] const TypeH* as_half_float_constant() const;
+
+ [[nodiscard]] bool is_float() const;
+
+ [[nodiscard]] bool is_float_constant() const;
+ [[nodiscard]] const TypeF* isa_float_constant() const;
+ [[nodiscard]] const TypeF* as_float_constant() const;
+
+ [[nodiscard]] bool is_tuple() const;
+ [[nodiscard]] const TypeTuple* as_tuple() const;
+
+ [[nodiscard]] bool is_ary() const;
+ [[nodiscard]] const TypeAry* isa_ary() const;
+ [[nodiscard]] const TypeAry* as_ary() const;
+
+ [[nodiscard]] bool is_vect() const;
+ [[nodiscard]] const TypeVect* isa_vect() const;
+ [[nodiscard]] const TypeVect* as_vect() const;
+
+ [[nodiscard]] bool is_pvectmask() const;
+ [[nodiscard]] const TypePVectMask* isa_pvectmask() const;
+ [[nodiscard]] const TypePVectMask* as_pvectmask() const;
+
+ [[nodiscard]] bool is_ptr() const;
+ [[nodiscard]] const TypePtr* isa_ptr() const;
+ [[nodiscard]] const TypePtr* as_ptr() const;
+
+ [[nodiscard]] bool is_rawptr() const;
+ [[nodiscard]] const TypeRawPtr* isa_rawptr() const;
+ [[nodiscard]] const TypeRawPtr* as_rawptr() const;
+
+ [[nodiscard]] bool is_narrowoop() const;
+ [[nodiscard]] const TypeNarrowOop* isa_narrowoop() const;
+ [[nodiscard]] const TypeNarrowOop* as_narrowoop() const;
+
+ [[nodiscard]] bool is_narrowklass() const;
+ [[nodiscard]] const TypeNarrowKlass* isa_narrowklass() const;
+ [[nodiscard]] const TypeNarrowKlass* as_narrowklass() const;
+
+ [[nodiscard]] bool is_oopptr() const;
+ [[nodiscard]] const TypeOopPtr* isa_oopptr() const;
+ [[nodiscard]] const TypeOopPtr* as_oopptr() const;
+
+ [[nodiscard]] bool is_instptr() const;
+ [[nodiscard]] const TypeInstPtr* isa_instptr() const;
+ [[nodiscard]] const TypeInstPtr* as_instptr() const;
+
+ [[nodiscard]] bool is_aryptr() const;
+ [[nodiscard]] const TypeAryPtr* isa_aryptr() const;
+ [[nodiscard]] const TypeAryPtr* as_aryptr() const;
+
+ [[nodiscard]] bool is_metadataptr() const;
+ [[nodiscard]] const TypeMetadataPtr* isa_metadataptr() const;
+ [[nodiscard]] const TypeMetadataPtr* as_metadataptr() const;
+
+ [[nodiscard]] bool is_klassptr() const;
+ [[nodiscard]] const TypeKlassPtr* isa_klassptr() const;
+ [[nodiscard]] const TypeKlassPtr* as_klassptr() const;
+
+ [[nodiscard]] bool is_instklassptr() const;
+ [[nodiscard]] const TypeInstKlassPtr* isa_instklassptr() const;
+ [[nodiscard]] const TypeInstKlassPtr* as_instklassptr() const;
+
+ [[nodiscard]] bool is_aryklassptr() const;
+ [[nodiscard]] const TypeAryKlassPtr* isa_aryklassptr() const;
+ [[nodiscard]] const TypeAryKlassPtr* as_aryklassptr() const;
template
const TypeClass* cast() const;
- const TypeMetadataPtr *isa_metadataptr() const; // Returns null if not oop ptr type
- const TypeMetadataPtr *is_metadataptr() const; // Java-style GC'd pointer
- const TypeKlassPtr *isa_klassptr() const; // Returns null if not KlassPtr
- const TypeKlassPtr *is_klassptr() const; // assert if not KlassPtr
- const TypeInstKlassPtr *isa_instklassptr() const; // Returns null if not IntKlassPtr
- const TypeInstKlassPtr *is_instklassptr() const; // assert if not IntKlassPtr
- const TypeAryKlassPtr *isa_aryklassptr() const; // Returns null if not AryKlassPtr
- const TypeAryKlassPtr *is_aryklassptr() const; // assert if not AryKlassPtr
-
virtual bool is_finite() const; // Has a finite value
virtual bool is_nan() const; // Is not a number (NaN)
@@ -471,7 +520,6 @@ class Type {
BasicType basic_type() const { return _type_info[_base].basic_type; }
uint ideal_reg() const { return _type_info[_base].ideal_reg; }
const char* msg() const { return _type_info[_base].msg; }
- bool isa_oop_ptr() const { return _type_info[_base].isa_oop; }
// Mapping from CI type system to compiler type:
static const Type* get_typeflow_type(ciType* type);
@@ -804,9 +852,9 @@ class TypeInt : public TypeInteger {
static const TypeInt* make(jint lo, jint hi, int widen);
static const TypeInt* make_unsigned(juint ulo, juint uhi, int widen);
static const Type* make_or_top(const TypeIntPrototype& t, int widen);
- static const TypeInt* make(const TypeIntPrototype& t, int widen) { return make_or_top(t, widen)->is_int(); }
+ static const TypeInt* make(const TypeIntPrototype& t, int widen) { return make_or_top(t, widen)->as_int(); }
static const TypeInt* make(const TypeIntMirror& t, int widen) {
- return (new TypeInt(TypeIntPrototype{{t._lo, t._hi}, {t._ulo, t._uhi}, t._bits}, widen))->hashcons()->is_int();
+ return (new TypeInt(TypeIntPrototype{{t._lo, t._hi}, {t._ulo, t._uhi}, t._bits}, widen))->hashcons()->as_int();
}
// Check for single integer
@@ -859,7 +907,7 @@ class TypeInt : public TypeInteger {
static const TypeInt* SYMINT; // symmetric range [-max_jint..max_jint]
static const TypeInt* TYPE_DOMAIN; // alias for TypeInt::INT
- static const TypeInt* as_self(const Type* t) { return t->is_int(); }
+ static const TypeInt* as_self(const Type* t) { return t->as_int(); }
#ifndef PRODUCT
virtual void dump2(Dict& d, uint depth, outputStream* st) const;
void dump_verbose() const;
@@ -895,9 +943,9 @@ class TypeLong : public TypeInteger {
static const TypeLong* make(jlong lo, jlong hi, int widen);
static const TypeLong* make_unsigned(julong ulo, julong uhi, int widen);
static const Type* make_or_top(const TypeIntPrototype& t, int widen);
- static const TypeLong* make(const TypeIntPrototype& t, int widen) { return make_or_top(t, widen)->is_long(); }
+ static const TypeLong* make(const TypeIntPrototype& t, int widen) { return make_or_top(t, widen)->as_long(); }
static const TypeLong* make(const TypeIntMirror& t, int widen) {
- return (new TypeLong(TypeIntPrototype{{t._lo, t._hi}, {t._ulo, t._uhi}, t._bits}, widen))->hashcons()->is_long();
+ return (new TypeLong(TypeIntPrototype{{t._lo, t._hi}, {t._ulo, t._uhi}, t._bits}, widen))->hashcons()->as_long();
}
// Check for single integer
@@ -939,7 +987,7 @@ class TypeLong : public TypeInteger {
static const TypeLong* TYPE_DOMAIN; // alias for TypeLong::LONG
// static convenience methods.
- static const TypeLong* as_self(const Type* t) { return t->is_long(); }
+ static const TypeLong* as_self(const Type* t) { return t->as_long(); }
#ifndef PRODUCT
virtual void dump2(Dict& d, uint, outputStream* st) const;// Specialized per-Type dumping
@@ -1435,7 +1483,7 @@ class TypeOopPtr : public TypePtr {
}
bool is_same_java_type_as(const TypePtr* other) const {
- return is_same_java_type_as_helper(other->is_oopptr());
+ return is_same_java_type_as_helper(other->as_oopptr());
}
virtual bool is_same_java_type_as_helper(const TypeOopPtr* other) const {
@@ -1540,16 +1588,20 @@ class TypeOopPtr : public TypePtr {
virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
#endif
private:
- const TypeOopPtr* is_reference_type(const Type* other) const {
- return other->isa_oopptr();
+ const TypeOopPtr* as_reference_type(const Type* other) const {
+ return other->as_oopptr();
}
- const TypeAryPtr* is_array_type(const TypeOopPtr* other) const {
- return other->isa_aryptr();
+ bool is_array_type(const TypeOopPtr* other) const {
+ return other->is_aryptr();
}
- const TypeInstPtr* is_instance_type(const TypeOopPtr* other) const {
- return other->isa_instptr();
+ const TypeAryPtr* as_array_type(const TypeOopPtr* other) const {
+ return other->as_aryptr();
+ }
+
+ bool is_instance_type(const TypeOopPtr* other) const {
+ return other->is_instptr();
}
};
@@ -1668,7 +1720,7 @@ class TypeInstPtr : public TypeOopPtr {
private:
virtual bool is_meet_same_type_as(const TypePtr* other) const {
- return _klass->equals(other->is_instptr()->_klass) && _interfaces->eq(other->is_instptr()->_interfaces);
+ return _klass->equals(other->as_instptr()->_klass) && _interfaces->eq(other->as_instptr()->_interfaces);
}
};
@@ -1918,7 +1970,7 @@ class TypeKlassPtr : public TypePtr {
return is_java_subtype_of_helper(other, klass_is_exact(), other->klass_is_exact());
}
bool is_same_java_type_as(const TypePtr* other) const {
- return is_same_java_type_as_helper(other->is_klassptr());
+ return is_same_java_type_as_helper(other->as_klassptr());
}
bool maybe_java_subtype_of(const TypeKlassPtr* other) const {
@@ -1962,16 +2014,20 @@ class TypeKlassPtr : public TypePtr {
};
private:
- const TypeKlassPtr* is_reference_type(const Type* other) const {
- return other->isa_klassptr();
+ const TypeKlassPtr* as_reference_type(const Type* other) const {
+ return other->as_klassptr();
+ }
+
+ bool is_array_type(const TypeKlassPtr* other) const {
+ return other->is_aryklassptr();
}
- const TypeAryKlassPtr* is_array_type(const TypeKlassPtr* other) const {
- return other->isa_aryklassptr();
+ const TypeAryKlassPtr* as_array_type(const TypeKlassPtr* other) const {
+ return other->as_aryklassptr();
}
- const TypeInstKlassPtr* is_instance_type(const TypeKlassPtr* other) const {
- return other->isa_instklassptr();
+ bool is_instance_type(const TypeKlassPtr* other) const {
+ return other->is_instklassptr();
}
};
@@ -2087,7 +2143,7 @@ class TypeAryKlassPtr : public TypeKlassPtr {
bool is_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const;
bool maybe_java_subtype_of_helper(const TypeKlassPtr* other, bool this_exact, bool other_exact) const;
- bool is_loaded() const { return (_elem->isa_klassptr() ? _elem->is_klassptr()->is_loaded() : true); }
+ bool is_loaded() const { return (_elem->is_klassptr() ? _elem->as_klassptr()->is_loaded() : true); }
static const TypeAryKlassPtr* make(PTR ptr, const Type* elem, ciKlass* k, Offset offset, bool not_flat, bool not_null_free, bool flat, bool null_free, bool atomic, bool refined_type);
static const TypeAryKlassPtr* make(ciKlass* klass, InterfaceHandling interface_handling);
@@ -2146,10 +2202,11 @@ class TypeNarrowPtr : public Type {
ptrtype->offset() == OffsetTop, "no real offsets");
}
- virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const = 0;
- virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const = 0;
- virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const = 0;
- virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const = 0;
+ virtual bool is_same_narrowptr(const Type* t) const = 0;
+ virtual const TypeNarrowPtr* isa_same_narrowptr(const Type* t) const = 0;
+ virtual const TypeNarrowPtr* as_same_narrowptr(const Type* t) const = 0;
+ virtual const TypeNarrowPtr* make_same_narrowptr(const TypePtr* t) const = 0;
+ virtual const TypeNarrowPtr* make_hash_same_narrowptr(const TypePtr* t) const = 0;
// Do not allow interface-vs.-noninterface joins to collapse to top.
virtual const Type *filter_helper(const Type *kills, bool include_speculative) const;
public:
@@ -2190,19 +2247,23 @@ class TypeNarrowOop : public TypeNarrowPtr {
TypeNarrowOop( const TypePtr* ptrtype): TypeNarrowPtr(NarrowOop, ptrtype) {
}
- virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const {
+ bool is_same_narrowptr(const Type* t) const override {
+ return t->is_narrowoop();
+ }
+
+ const TypeNarrowPtr* isa_same_narrowptr(const Type* t) const override {
return t->isa_narrowoop();
}
- virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const {
- return t->is_narrowoop();
+ const TypeNarrowPtr* as_same_narrowptr(const Type* t) const override {
+ return t->as_narrowoop();
}
- virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const {
+ const TypeNarrowPtr* make_same_narrowptr(const TypePtr* t) const override {
return new TypeNarrowOop(t);
}
- virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
+ const TypeNarrowPtr* make_hash_same_narrowptr(const TypePtr* t) const override {
return (const TypeNarrowPtr*)((new TypeNarrowOop(t))->hashcons());
}
@@ -2217,11 +2278,11 @@ class TypeNarrowOop : public TypeNarrowPtr {
static const TypeNarrowOop *BOTTOM;
static const TypeNarrowOop *NULL_PTR;
- virtual const TypeNarrowOop* remove_speculative() const;
- virtual const Type* cleanup_speculative() const;
+ const TypeNarrowOop* remove_speculative() const override;
+ const Type* cleanup_speculative() const override;
#ifndef PRODUCT
- virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
+ void dump2(Dict& d, uint depth, outputStream* st) const override;
#endif
};
@@ -2234,19 +2295,23 @@ class TypeNarrowKlass : public TypeNarrowPtr {
TypeNarrowKlass( const TypePtr* ptrtype): TypeNarrowPtr(NarrowKlass, ptrtype) {
}
- virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const {
+ bool is_same_narrowptr(const Type* t) const override {
+ return t->is_narrowklass();
+ }
+
+ const TypeNarrowPtr* isa_same_narrowptr(const Type* t) const override {
return t->isa_narrowklass();
}
- virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const {
- return t->is_narrowklass();
+ const TypeNarrowPtr* as_same_narrowptr(const Type* t) const override {
+ return t->as_narrowklass();
}
- virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const {
+ const TypeNarrowPtr* make_same_narrowptr(const TypePtr* t) const override {
return new TypeNarrowKlass(t);
}
- virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const {
+ const TypeNarrowPtr* make_hash_same_narrowptr(const TypePtr* t) const override {
return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons());
}
@@ -2257,7 +2322,7 @@ class TypeNarrowKlass : public TypeNarrowPtr {
static const TypeNarrowKlass *NULL_PTR;
#ifndef PRODUCT
- virtual void dump2( Dict &d, uint depth, outputStream *st ) const;
+ void dump2(Dict& d, uint depth, outputStream* st) const override;
#endif
};
@@ -2323,10 +2388,9 @@ class TypeFunc : public Type {
// Convenience common pre-built types.
};
-//------------------------------accessors--------------------------------------
inline bool Type::is_ptr_to_narrowoop() const {
#ifdef _LP64
- return (isa_oopptr() != nullptr && is_oopptr()->is_ptr_to_narrowoop_nv());
+ return is_oopptr() && as_oopptr()->is_ptr_to_narrowoop_nv();
#else
return false;
#endif
@@ -2334,7 +2398,7 @@ inline bool Type::is_ptr_to_narrowoop() const {
inline bool Type::is_ptr_to_narrowklass() const {
#ifdef _LP64
- return (isa_oopptr() != nullptr && is_oopptr()->is_ptr_to_narrowklass_nv());
+ return is_oopptr() && as_oopptr()->is_ptr_to_narrowklass_nv();
#else
return false;
#endif
@@ -2355,270 +2419,335 @@ inline double Type::getd() const {
return ((TypeD*)this)->_d;
}
-inline const TypeInteger *Type::is_integer(BasicType bt) const {
- assert((bt == T_INT && _base == Int) || (bt == T_LONG && _base == Long), "Not an Int");
- return (TypeInteger*)this;
+template
+const T* Type::as(bool (Type::*is_xxx)() const, const char* expected) const {
+#ifdef ASSERT
+ if (!(this->*is_xxx)()) {
+ stringStream ss;
+ dump_on(&ss);
+ assert((this->*is_xxx)(), "Not %s, got %s", expected, ss.as_string());
+ }
+#endif
+ return static_cast(this);
+}
+
+inline bool Type::is_int() const {
+ return _base == Int;
}
-inline const TypeInteger *Type::isa_integer(BasicType bt) const {
- return (((bt == T_INT && _base == Int) || (bt == T_LONG && _base == Long)) ? (TypeInteger*)this : nullptr);
+inline const TypeInt* Type::isa_int() const {
+ return is_int() ? static_cast(this) : nullptr;
}
-inline const TypeInt *Type::is_int() const {
- assert( _base == Int, "Not an Int" );
- return (TypeInt*)this;
+inline const TypeInt* Type::as_int() const {
+ return as(&Type::is_int, "an Int");
}
-inline const TypeInt *Type::isa_int() const {
- return ( _base == Int ? (TypeInt*)this : nullptr);
+inline bool Type::is_long() const {
+ return _base == Long;
}
-inline const TypeLong *Type::is_long() const {
- assert( _base == Long, "Not a Long" );
- return (TypeLong*)this;
+inline const TypeLong* Type::isa_long() const {
+ return is_long() ? static_cast(this) : nullptr;
}
-inline const TypeLong *Type::isa_long() const {
- return ( _base == Long ? (TypeLong*)this : nullptr);
+inline const TypeLong* Type::as_long() const {
+ return as(&Type::is_long, "a Long");
}
-inline const TypeH* Type::isa_half_float() const {
- return ((_base == HalfFloatTop ||
- _base == HalfFloatCon ||
- _base == HalfFloatBot) ? (TypeH*)this : nullptr);
+inline bool Type::is_integer(BasicType bt) const {
+ return (bt == T_INT && _base == Int) || (bt == T_LONG && _base == Long);
}
-inline const TypeH* Type::is_half_float_constant() const {
- assert( _base == HalfFloatCon, "Not a HalfFloat" );
- return (TypeH*)this;
+inline const TypeInteger* Type::isa_integer(BasicType bt) const {
+ return is_integer(bt) ? static_cast(this) : nullptr;
+}
+
+inline const TypeInteger* Type::as_integer(BasicType bt) const {
+ if (bt == T_INT) {
+ return as(&Type::is_int, "an Int");
+ }
+ return as(&Type::is_long, "a Long");
+}
+
+inline bool Type::is_half_float() const {
+ return _base == HalfFloatTop ||
+ _base == HalfFloatCon ||
+ _base == HalfFloatBot;
+}
+
+inline bool Type::is_half_float_constant() const {
+ return _base == HalfFloatCon;
}
inline const TypeH* Type::isa_half_float_constant() const {
- return (_base == HalfFloatCon ? (TypeH*)this : nullptr);
+ return is_half_float_constant() ? static_cast(this) : nullptr;
+}
+
+inline const TypeH* Type::as_half_float_constant() const {
+ return as(&Type::is_half_float_constant, "a HalfFloatCon");
+}
+
+inline bool Type::is_float() const {
+ return _base == FloatTop ||
+ _base == FloatCon ||
+ _base == FloatBot;
+}
+
+inline bool Type::is_float_constant() const {
+ return _base == FloatCon;
+}
+
+inline const TypeF* Type::isa_float_constant() const {
+ return is_float_constant() ? static_cast(this) : nullptr;
+}
+
+inline const TypeF* Type::as_float_constant() const {
+ return as(&Type::is_float_constant, "a FloatCon");
+}
+
+inline bool Type::is_double() const {
+ return _base == DoubleTop ||
+ _base == DoubleCon ||
+ _base == DoubleBot;
+}
+
+inline bool Type::is_double_constant() const {
+ return _base == DoubleCon;
+}
+
+inline const TypeD* Type::isa_double_constant() const {
+ return is_double_constant() ? static_cast(this) : nullptr;
+}
+
+inline const TypeD* Type::as_double_constant() const {
+ return as(&Type::is_double_constant, "a DoubleCon");
+}
+
+inline bool Type::is_tuple() const {
+ return _base == Tuple;
}
-inline const TypeF *Type::isa_float() const {
- return ((_base == FloatTop ||
- _base == FloatCon ||
- _base == FloatBot) ? (TypeF*)this : nullptr);
+inline const TypeTuple* Type::as_tuple() const {
+ return as(&Type::is_tuple, "a Tuple");
}
-inline const TypeF *Type::is_float_constant() const {
- assert( _base == FloatCon, "Not a Float" );
- return (TypeF*)this;
+inline bool Type::is_ary() const {
+ return _base == Array;
}
-inline const TypeF *Type::isa_float_constant() const {
- return ( _base == FloatCon ? (TypeF*)this : nullptr);
+inline const TypeAry* Type::isa_ary() const {
+ return is_ary() ? static_cast(this) : nullptr;
}
-inline const TypeD *Type::isa_double() const {
- return ((_base == DoubleTop ||
- _base == DoubleCon ||
- _base == DoubleBot) ? (TypeD*)this : nullptr);
+inline const TypeAry* Type::as_ary() const {
+ return as(&Type::is_ary, "an Array");
}
-inline const TypeD *Type::is_double_constant() const {
- assert( _base == DoubleCon, "Not a Double" );
- return (TypeD*)this;
+inline bool Type::is_vect() const {
+ return _base >= VectorMask && _base <= VectorZ;
}
-inline const TypeD *Type::isa_double_constant() const {
- return ( _base == DoubleCon ? (TypeD*)this : nullptr);
+inline const TypeVect* Type::isa_vect() const {
+ return is_vect() ? static_cast(this) : nullptr;
}
-inline const TypeTuple *Type::is_tuple() const {
- assert( _base == Tuple, "Not a Tuple" );
- return (TypeTuple*)this;
+inline const TypeVect* Type::as_vect() const {
+ return as(&Type::is_vect, "a Vector");
}
-inline const TypeAry *Type::is_ary() const {
- assert( _base == Array , "Not an Array" );
- return (TypeAry*)this;
+inline bool Type::is_pvectmask() const {
+ return _base == VectorMask;
}
-inline const TypeAry *Type::isa_ary() const {
- return ((_base == Array) ? (TypeAry*)this : nullptr);
+inline const TypePVectMask* Type::isa_pvectmask() const {
+ return is_pvectmask() ? static_cast(this) : nullptr;
}
-inline const TypePVectMask *Type::is_pvectmask() const {
- assert( _base == VectorMask, "Not a Vector Mask" );
- return (TypePVectMask*)this;
+inline const TypePVectMask* Type::as_pvectmask() const {
+ return as(&Type::is_pvectmask, "a Vector Mask");
}
-inline const TypePVectMask *Type::isa_pvectmask() const {
- return (_base == VectorMask) ? (TypePVectMask*)this : nullptr;
+inline bool Type::is_ptr() const {
+ // AnyPtr is the first Ptr and AryKlassPtr the last, with no non-ptrs between.
+ return _base >= AnyPtr && _base <= AryKlassPtr;
}
-inline const TypeVect *Type::is_vect() const {
- assert( _base >= VectorMask && _base <= VectorZ, "Not a Vector" );
- return (TypeVect*)this;
+inline const TypePtr* Type::isa_ptr() const {
+ return is_ptr() ? static_cast(this) : nullptr;
}
-inline const TypeVect *Type::isa_vect() const {
- return (_base >= VectorMask && _base <= VectorZ) ? (TypeVect*)this : nullptr;
+inline const TypePtr* Type::as_ptr() const {
+ return as(&Type::is_ptr, "a pointer");
}
-inline const TypePtr *Type::is_ptr() const {
- // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between.
- assert(_base >= AnyPtr && _base <= AryKlassPtr, "Not a pointer");
- return (TypePtr*)this;
+inline bool Type::is_rawptr() const {
+ return _base == RawPtr;
}
-inline const TypePtr *Type::isa_ptr() const {
- // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between.
- return (_base >= AnyPtr && _base <= AryKlassPtr) ? (TypePtr*)this : nullptr;
+inline const TypeRawPtr* Type::isa_rawptr() const {
+ return is_rawptr() ? static_cast(this) : nullptr;
}
-inline const TypeOopPtr *Type::is_oopptr() const {
- // OopPtr is the first and KlassPtr the last, with no non-oops between.
- assert(_base >= OopPtr && _base <= AryPtr, "Not a Java pointer" ) ;
- return (TypeOopPtr*)this;
+inline const TypeRawPtr* Type::as_rawptr() const {
+ return as(&Type::is_rawptr, "a raw pointer");
}
-inline const TypeOopPtr *Type::isa_oopptr() const {
- // OopPtr is the first and KlassPtr the last, with no non-oops between.
- return (_base >= OopPtr && _base <= AryPtr) ? (TypeOopPtr*)this : nullptr;
+inline bool Type::is_narrowoop() const {
+ return _base == NarrowOop;
}
-inline const TypeRawPtr *Type::isa_rawptr() const {
- return (_base == RawPtr) ? (TypeRawPtr*)this : nullptr;
+inline const TypeNarrowOop* Type::isa_narrowoop() const {
+ return is_narrowoop() ? static_cast(this) : nullptr;
}
-inline const TypeRawPtr *Type::is_rawptr() const {
- assert( _base == RawPtr, "Not a raw pointer" );
- return (TypeRawPtr*)this;
+inline const TypeNarrowOop* Type::as_narrowoop() const {
+ return as(&Type::is_narrowoop, "a narrow oop");
}
-inline const TypeInstPtr *Type::isa_instptr() const {
- return (_base == InstPtr) ? (TypeInstPtr*)this : nullptr;
+inline bool Type::is_narrowklass() const {
+ return _base == NarrowKlass;
}
-inline const TypeInstPtr *Type::is_instptr() const {
- assert( _base == InstPtr, "Not an object pointer" );
- return (TypeInstPtr*)this;
+inline const TypeNarrowKlass* Type::isa_narrowklass() const {
+ return is_narrowklass() ? static_cast(this) : nullptr;
}
-inline const TypeAryPtr *Type::isa_aryptr() const {
- return (_base == AryPtr) ? (TypeAryPtr*)this : nullptr;
+inline const TypeNarrowKlass* Type::as_narrowklass() const {
+ return as(&Type::is_narrowklass, "a narrow klass");
}
-inline const TypeAryPtr *Type::is_aryptr() const {
- assert( _base == AryPtr, "Not an array pointer" );
- return (TypeAryPtr*)this;
+inline bool Type::is_oopptr() const {
+ // OopPtr is the first and AryPtr the last, with no non-oops between.
+ return _base >= OopPtr && _base <= AryPtr;
}
-inline const TypeNarrowOop *Type::is_narrowoop() const {
- // OopPtr is the first and KlassPtr the last, with no non-oops between.
- assert(_base == NarrowOop, "Not a narrow oop" ) ;
- return (TypeNarrowOop*)this;
+inline const TypeOopPtr* Type::isa_oopptr() const {
+ return is_oopptr() ? static_cast(this) : nullptr;
}
-inline const TypeNarrowOop *Type::isa_narrowoop() const {
- // OopPtr is the first and KlassPtr the last, with no non-oops between.
- return (_base == NarrowOop) ? (TypeNarrowOop*)this : nullptr;
+inline const TypeOopPtr* Type::as_oopptr() const {
+ return as(&Type::is_oopptr, "a Java pointer");
}
-inline const TypeNarrowKlass *Type::is_narrowklass() const {
- assert(_base == NarrowKlass, "Not a narrow oop" ) ;
- return (TypeNarrowKlass*)this;
+inline bool Type::is_instptr() const {
+ return _base == InstPtr;
}
-inline const TypeNarrowKlass *Type::isa_narrowklass() const {
- return (_base == NarrowKlass) ? (TypeNarrowKlass*)this : nullptr;
+inline const TypeInstPtr* Type::isa_instptr() const {
+ return is_instptr() ? static_cast |
|---|
|---|