204 * {@link JavaKind#Object}. 205 * 206 * @param b the context 207 * @param type the type of the outermost array to be instantiated 208 * @param dimensions the array of lengths for all the dimensions to be instantiated 209 * @return true if the plugin handles the bytecode, false otherwise 210 */ 211 default boolean handleNewMultiArray(GraphBuilderContext b, ResolvedJavaType type, ValueNode[] dimensions) { 212 return false; 213 } 214 215 /** 216 * Allows this plugin to add nodes after the exception object has been loaded in the dispatch 217 * sequence. Note that a {@link StructuredGraph} is provided to this call instead of a 218 * {@link GraphBuilderContext} so that the caller has a guarantee that its current control flow 219 * insertion point is not changed by this call. This means nodes must be added to the graph with 220 * the appropriate method (e.g., {@link StructuredGraph#unique} for {@link ValueNumberable} 221 * nodes) and fixed nodes must be manually {@linkplain FixedWithNextNode#setNext added} as 222 * successors of {@code afterExceptionLoaded}. 223 * 224 * @param graph the graph being parsed 225 * @param afterExceptionLoaded the last fixed node after loading the exception 226 * @return the last fixed node after instrumentation 227 */ 228 default FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded) { 229 return afterExceptionLoaded; 230 } 231 232 /** 233 * If the plugin {@link GraphBuilderContext#push pushes} a value with a different 234 * {@link JavaKind} than specified by the bytecode, it must override this method and return 235 * {@code true}. This disables assertion checking for value kinds. 236 * 237 * @param b the context 238 */ 239 default boolean canChangeStackKind(GraphBuilderContext b) { 240 return false; 241 } 242 } | 204 * {@link JavaKind#Object}. 205 * 206 * @param b the context 207 * @param type the type of the outermost array to be instantiated 208 * @param dimensions the array of lengths for all the dimensions to be instantiated 209 * @return true if the plugin handles the bytecode, false otherwise 210 */ 211 default boolean handleNewMultiArray(GraphBuilderContext b, ResolvedJavaType type, ValueNode[] dimensions) { 212 return false; 213 } 214 215 /** 216 * Allows this plugin to add nodes after the exception object has been loaded in the dispatch 217 * sequence. Note that a {@link StructuredGraph} is provided to this call instead of a 218 * {@link GraphBuilderContext} so that the caller has a guarantee that its current control flow 219 * insertion point is not changed by this call. This means nodes must be added to the graph with 220 * the appropriate method (e.g., {@link StructuredGraph#unique} for {@link ValueNumberable} 221 * nodes) and fixed nodes must be manually {@linkplain FixedWithNextNode#setNext added} as 222 * successors of {@code afterExceptionLoaded}. 223 * 224 * The reason for this constraint is that when this plugin runs, it's inserting instructions 225 * into a different block than the one currently being parsed. 226 * 227 * @param graph the graph being parsed 228 * @param afterExceptionLoaded the last fixed node after loading the exception 229 * @return the last fixed node after instrumentation 230 */ 231 default FixedWithNextNode instrumentExceptionDispatch(StructuredGraph graph, FixedWithNextNode afterExceptionLoaded) { 232 return afterExceptionLoaded; 233 } 234 235 /** 236 * If the plugin {@link GraphBuilderContext#push pushes} a value with a different 237 * {@link JavaKind} than specified by the bytecode, it must override this method and return 238 * {@code true}. This disables assertion checking for value kinds. 239 * 240 * @param b the context 241 */ 242 default boolean canChangeStackKind(GraphBuilderContext b) { 243 return false; 244 } 245 } |