private boolean processStoreIndexed(StoreIndexedNode store, PEReadEliminationBlockState state, GraphEffectList effects) { int index = store.index().isConstant() ? ((JavaConstant) store.index().asConstant()).asInt() : -1; JavaKind elementKind = store.elementKind(); LocationIdentity arrayLocation = NamedLocationIdentity.getArrayLocation(elementKind); if (index != -1) { return processStore(store, store.array(), arrayLocation, index, elementKind, false, store.value(), state, effects); } else { state.killReadCache(arrayLocation, -1); } return false; }
StoreIndexedNode store = (StoreIndexedNode) successor; assert store.array().equals(newArray); ValueNode valueNode = store.value(); if (valueNode.isConstant() && !valueNode.isNullConstant()) { Class<?> clazz = snippetReflection.asObject(Class.class, valueNode.asJavaConstant());
@Override public void virtualize(VirtualizerTool tool) { ValueNode alias = tool.getAlias(array()); if (alias instanceof VirtualObjectNode) { ValueNode indexValue = tool.getAlias(index()); int idx = indexValue.isConstant() ? indexValue.asJavaConstant().asInt() : -1; VirtualArrayNode virtual = (VirtualArrayNode) alias; if (idx >= 0 && idx < virtual.entryCount()) { ResolvedJavaType componentType = virtual.type().getComponentType(); if (componentType.isPrimitive() || StampTool.isPointerAlwaysNull(value) || componentType.isJavaLangObject() || (StampTool.typeReferenceOrNull(value) != null && componentType.isAssignableFrom(StampTool.typeOrNull(value)))) { tool.setVirtualEntry(virtual, idx, value()); tool.delete(); } } } }
protected void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool tool) { StructuredGraph graph = storeIndexed.graph(); ValueNode value = storeIndexed.value(); ValueNode array = storeIndexed.array();
ValueNode array = storeIndexedNode.array(); ValueNode index = storeIndexedNode.index(); ValueNode value = storeIndexedNode.value(); for (NodePlugin nodePlugin : nodePlugins) { if (nodePlugin.handleStoreIndexed(graphBuilderContext, array, index, storeIndexedNode.getBoundsCheck(), storeIndexedNode.getStoreCheck(), storeIndexedNode.elementKind(), value)) {
if (node.value().getStackKind() == JavaKind.Object) { AnalysisType arrayType = (AnalysisType) StampTool.typeOrNull(node.array()); AnalysisType componentType = arrayType != null ? arrayType.getComponentType() : null; TypeFlowBuilder<?> arrayBuilder = state.lookup(node.array()); TypeFlowBuilder<?> valueBuilder = state.lookup(node.value()); TypeFlowBuilder<?> storeIndexedBuilder = TypeFlowBuilder.create(bb, node, StoreIndexedTypeFlow.class, () -> { StoreIndexedTypeFlow storeIndexedFlow = new StoreIndexedTypeFlow(node, componentType, arrayBuilder.get(), valueBuilder.get());