src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 52910 583fd71c47d6
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright (c) 2017, Red Hat Inc. All rights reserved.
     3  * Copyright (c) 2017, Red Hat Inc. All rights reserved.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     7  * under the terms of the GNU General Public License version 2 only, as
    70         AArch64Kind readKind = (AArch64Kind) lirgen.getLIRKind(accessStamp).getPlatformKind();
    70         AArch64Kind readKind = (AArch64Kind) lirgen.getLIRKind(accessStamp).getPlatformKind();
    71         int resultBits = ((IntegerStamp) stamp(NodeView.DEFAULT)).getBits();
    71         int resultBits = ((IntegerStamp) stamp(NodeView.DEFAULT)).getBits();
    72         gen.setResult(this, arithgen.emitExtendMemory(isSigned, readKind, resultBits, (AArch64AddressValue) gen.operand(getAddress()), gen.state(this)));
    72         gen.setResult(this, arithgen.emitExtendMemory(isSigned, readKind, resultBits, (AArch64AddressValue) gen.operand(getAddress()), gen.state(this)));
    73     }
    73     }
    74 
    74 
       
    75     @Override
       
    76     public Stamp getAccessStamp() {
       
    77         return accessStamp;
       
    78     }
       
    79 
    75     /**
    80     /**
    76      * replace a ReadNode with an AArch64-specific variant which knows how to merge a downstream
    81      * replace a ReadNode with an AArch64-specific variant which knows how to merge a downstream
    77      * zero or sign extend into the read operation.
    82      * zero or sign extend into the read operation.
    78      *
    83      *
    79      * @param readNode
    84      * @param readNode
    80      */
    85      */
    81     public static void replace(ReadNode readNode) {
    86     public static void replace(ReadNode readNode) {
    82         assert readNode.getUsageCount() == 1;
    87         assert readNode.getUsageCount() == 1;
    83         assert readNode.getUsageAt(0) instanceof ZeroExtendNode || readNode.getUsageAt(0) instanceof SignExtendNode;
    88         assert readNode.usages().first() instanceof ZeroExtendNode || readNode.usages().first() instanceof SignExtendNode;
    84 
    89 
    85         ValueNode usage = (ValueNode) readNode.getUsageAt(0);
    90         ValueNode usage = (ValueNode) readNode.usages().first();
    86         boolean isSigned = usage instanceof SignExtendNode;
    91         boolean isSigned = usage instanceof SignExtendNode;
    87         IntegerStamp accessStamp = ((IntegerStamp) readNode.getAccessStamp());
    92         IntegerStamp accessStamp = ((IntegerStamp) readNode.getAccessStamp());
    88 
    93 
    89         AddressNode address = readNode.getAddress();
    94         AddressNode address = readNode.getAddress();
    90         LocationIdentity location = readNode.getLocationIdentity();
    95         LocationIdentity location = readNode.getLocationIdentity();