src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
changeset 50330 2cbc42a5764b
parent 47216 71c04702a3d5
child 50858 2d3e99a72541
equal deleted inserted replaced
50329:18fba780c1d1 50330:2cbc42a5764b
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 package org.graalvm.compiler.nodes.graphbuilderconf;
    23 package org.graalvm.compiler.nodes.graphbuilderconf;
    24 
    24 
    25 import org.graalvm.compiler.nodes.ValueNode;
    25 import org.graalvm.compiler.nodes.ValueNode;
       
    26 import org.graalvm.compiler.nodes.extended.GuardingNode;
    26 
    27 
    27 import jdk.vm.ci.meta.JavaKind;
    28 import jdk.vm.ci.meta.JavaKind;
    28 import jdk.vm.ci.meta.JavaTypeProfile;
    29 import jdk.vm.ci.meta.JavaTypeProfile;
    29 import jdk.vm.ci.meta.ResolvedJavaField;
    30 import jdk.vm.ci.meta.ResolvedJavaField;
    30 import jdk.vm.ci.meta.ResolvedJavaMethod;
    31 import jdk.vm.ci.meta.ResolvedJavaMethod;
   104      * {@link GraphBuilderContext#push push} a value using the provided elementKind.
   105      * {@link GraphBuilderContext#push push} a value using the provided elementKind.
   105      *
   106      *
   106      * @param b the context
   107      * @param b the context
   107      * @param array the accessed array
   108      * @param array the accessed array
   108      * @param index the index for the array access
   109      * @param index the index for the array access
       
   110      * @param boundsCheck the explicit bounds check already emitted, or null if no bounds check was
       
   111      *            emitted yet
   109      * @param elementKind the element kind of the accessed array
   112      * @param elementKind the element kind of the accessed array
   110      * @return true if the plugin handles the array access, false otherwise.
   113      * @return true if the plugin handles the array access, false otherwise.
   111      */
   114      */
   112     default boolean handleLoadIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, JavaKind elementKind) {
   115     default boolean handleLoadIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, JavaKind elementKind) {
   113         return false;
   116         return false;
   114     }
   117     }
   115 
   118 
   116     /**
   119     /**
   117      * Handle the parsing of an array store bytecode.
   120      * Handle the parsing of an array store bytecode.
   118      *
   121      *
   119      * @param b the context
   122      * @param b the context
   120      * @param array the accessed array
   123      * @param array the accessed array
   121      * @param index the index for the array access
   124      * @param index the index for the array access
       
   125      * @param boundsCheck the explicit array bounds check already emitted, or null if no array
       
   126      *            bounds check was emitted yet
       
   127      * @param storeCheck the explicit array store check already emitted, or null if no array store
       
   128      *            check was emitted yet
   122      * @param elementKind the element kind of the accessed array
   129      * @param elementKind the element kind of the accessed array
   123      * @param value the value to be stored into the array
   130      * @param value the value to be stored into the array
   124      * @return true if the plugin handles the array access, false otherwise.
   131      * @return true if the plugin handles the array access, false otherwise.
   125      */
   132      */
   126     default boolean handleStoreIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, JavaKind elementKind, ValueNode value) {
   133     default boolean handleStoreIndexed(GraphBuilderContext b, ValueNode array, ValueNode index, GuardingNode boundsCheck, GuardingNode storeCheck, JavaKind elementKind, ValueNode value) {
   127         return false;
   134         return false;
   128     }
   135     }
   129 
   136 
   130     /**
   137     /**
   131      * Handle the parsing of a CHECKCAST bytecode. If the method returns true, it must
   138      * Handle the parsing of a CHECKCAST bytecode. If the method returns true, it must