changeset 23309:94f855720119

removed unused AOT write barrier code
author Doug Simon <doug.simon@oracle.com>
date Thu, 14 Jan 2016 22:41:45 +0100
parents 279eb7ca5d24
children ca8c504c32f7
files graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java
diffstat 8 files changed, 2 insertions(+), 260 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java	Thu Jan 14 18:43:15 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2014, 2015, 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.
- */
-package com.oracle.graal.hotspot.amd64;
-
-import jdk.vm.ci.code.ValueUtil;
-import jdk.vm.ci.hotspot.HotSpotVMConfig;
-import jdk.vm.ci.meta.AllocatableValue;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.PlatformKind;
-
-import com.oracle.graal.asm.amd64.AMD64Address;
-import com.oracle.graal.asm.amd64.AMD64MacroAssembler;
-import com.oracle.graal.lir.LIRInstructionClass;
-import com.oracle.graal.lir.amd64.AMD64LIRInstruction;
-import com.oracle.graal.lir.asm.CompilationResultBuilder;
-
-public final class AMD64HotSpotCardTableAddressOp extends AMD64LIRInstruction {
-    public static final LIRInstructionClass<AMD64HotSpotCardTableAddressOp> TYPE = LIRInstructionClass.create(AMD64HotSpotCardTableAddressOp.class);
-
-    @Def({OperandFlag.REG}) private AllocatableValue result;
-
-    private final HotSpotVMConfig config;
-
-    public AMD64HotSpotCardTableAddressOp(AllocatableValue result, HotSpotVMConfig config) {
-        super(TYPE);
-        this.result = result;
-        this.config = config;
-    }
-
-    @Override
-    public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) {
-        PlatformKind wordKind = crb.target.arch.getWordKind();
-        int alignment = wordKind.getSizeInBytes();
-        JavaConstant address = JavaConstant.forPrimitiveInt(wordKind.getSizeInBytes() * 8, 0);
-        // recordDataReferenceInCode forces the mov to be rip-relative
-        asm.movq(ValueUtil.asRegister(result), (AMD64Address) crb.recordDataReferenceInCode(address, alignment));
-        crb.recordMark(config.MARKID_CARD_TABLE_ADDRESS);
-    }
-
-}
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java	Thu Jan 14 18:43:15 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2014, 2015, 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.
- */
-package com.oracle.graal.hotspot.amd64;
-
-import jdk.vm.ci.code.ValueUtil;
-import jdk.vm.ci.hotspot.HotSpotVMConfig;
-import jdk.vm.ci.meta.AllocatableValue;
-import jdk.vm.ci.meta.JavaConstant;
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.PlatformKind;
-
-import com.oracle.graal.asm.amd64.AMD64Address;
-import com.oracle.graal.asm.amd64.AMD64MacroAssembler;
-import com.oracle.graal.lir.LIRInstructionClass;
-import com.oracle.graal.lir.amd64.AMD64LIRInstruction;
-import com.oracle.graal.lir.asm.CompilationResultBuilder;
-
-public final class AMD64HotSpotCardTableShiftOp extends AMD64LIRInstruction {
-    public static final LIRInstructionClass<AMD64HotSpotCardTableShiftOp> TYPE = LIRInstructionClass.create(AMD64HotSpotCardTableShiftOp.class);
-
-    @Def({OperandFlag.REG, OperandFlag.ILLEGAL}) private AllocatableValue result;
-
-    private final HotSpotVMConfig config;
-
-    public AMD64HotSpotCardTableShiftOp(AllocatableValue result, HotSpotVMConfig config) {
-        super(TYPE);
-        this.result = result;
-        this.config = config;
-    }
-
-    @Override
-    public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) {
-        PlatformKind wordKind = crb.target.arch.getWordKind();
-        int alignment = JavaKind.Int.getBitCount() / Byte.SIZE;
-        JavaConstant shift = JavaConstant.forPrimitiveInt(wordKind.getSizeInBytes() * 8, 0);
-        // recordDataReferenceInCode forces the mov to be rip-relative
-        asm.movq(ValueUtil.asRegister(result), (AMD64Address) crb.recordDataReferenceInCode(shift, alignment));
-        crb.recordMark(config.MARKID_CARD_TABLE_SHIFT);
-    }
-}
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Thu Jan 14 18:43:15 2016 +0100
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Thu Jan 14 22:41:45 2016 +0100
@@ -295,20 +295,6 @@
         append(new AMD64HotSpotLeaveUnpackFramesStackFrameOp(threadRegister, config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadLastJavaFpOffset(), saveRegisterOp));
     }
 
-    @Override
-    public Value emitCardTableShift() {
-        Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
-        append(new AMD64HotSpotCardTableShiftOp(result, config));
-        return result;
-    }
-
-    @Override
-    public Value emitCardTableAddress() {
-        Variable result = newVariable(LIRKind.value(AMD64Kind.QWORD));
-        append(new AMD64HotSpotCardTableAddressOp(result, config));
-        return result;
-    }
-
     /**
      * @param savedRegisters the registers saved by this operation which may be subject to pruning
      * @param savedRegisterLocations the slots to which the registers are saved
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java	Thu Jan 14 18:43:15 2016 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java	Thu Jan 14 22:41:45 2016 +0100
@@ -140,14 +140,6 @@
         throw JVMCIError.unimplemented();
     }
 
-    default Value emitCardTableShift() {
-        throw JVMCIError.unimplemented();
-    }
-
-    default Value emitCardTableAddress() {
-        throw JVMCIError.unimplemented();
-    }
-
     /**
      * Gets a stack slot for a lock at a given lock nesting depth.
      */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java	Thu Jan 14 18:43:15 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2014, 2015, 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.
- */
-package com.oracle.graal.hotspot.replacements;
-
-import jdk.vm.ci.meta.JavaKind;
-import jdk.vm.ci.meta.Value;
-
-import com.oracle.graal.compiler.common.type.StampFactory;
-import com.oracle.graal.graph.NodeClass;
-import com.oracle.graal.hotspot.HotSpotLIRGenerator;
-import com.oracle.graal.nodeinfo.NodeInfo;
-import com.oracle.graal.nodes.calc.FloatingNode;
-import com.oracle.graal.nodes.spi.LIRLowerable;
-import com.oracle.graal.nodes.spi.NodeLIRBuilderTool;
-
-@NodeInfo
-public final class CardTableAddressNode extends FloatingNode implements LIRLowerable {
-    public static final NodeClass<CardTableAddressNode> TYPE = NodeClass.create(CardTableAddressNode.class);
-
-    public CardTableAddressNode() {
-        super(TYPE, StampFactory.forKind(JavaKind.Long));
-    }
-
-    @Override
-    public void generate(NodeLIRBuilderTool generator) {
-        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitCardTableAddress();
-        generator.setResult(this, res);
-    }
-
-    @NodeIntrinsic
-    public static native long cardTableAddress();
-}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java	Thu Jan 14 18:43:15 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2014, 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.
- */
-package com.oracle.graal.hotspot.replacements;
-
-import jdk.vm.ci.meta.Value;
-
-import com.oracle.graal.compiler.common.type.StampFactory;
-import com.oracle.graal.graph.NodeClass;
-import com.oracle.graal.hotspot.HotSpotLIRGenerator;
-import com.oracle.graal.nodeinfo.NodeInfo;
-import com.oracle.graal.nodes.calc.FloatingNode;
-import com.oracle.graal.nodes.spi.LIRLowerable;
-import com.oracle.graal.nodes.spi.NodeLIRBuilderTool;
-
-@NodeInfo
-public final class CardTableShiftNode extends FloatingNode implements LIRLowerable {
-    public static final NodeClass<CardTableShiftNode> TYPE = NodeClass.create(CardTableShiftNode.class);
-
-    public CardTableShiftNode() {
-        super(TYPE, StampFactory.intValue());
-    }
-
-    @Override
-    public void generate(NodeLIRBuilderTool generator) {
-        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitCardTableShift();
-        generator.setResult(this, res);
-    }
-
-    @NodeIntrinsic
-    public static native int cardTableShift();
-}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java	Thu Jan 14 18:43:15 2016 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java	Thu Jan 14 22:41:45 2016 +0100
@@ -47,7 +47,6 @@
 import jdk.vm.ci.meta.ResolvedJavaType;
 
 import com.oracle.graal.api.replacements.Fold;
-import com.oracle.graal.compiler.common.GraalOptions;
 import com.oracle.graal.compiler.common.spi.ForeignCallDescriptor;
 import com.oracle.graal.compiler.common.type.ObjectStamp;
 import com.oracle.graal.graph.Node.ConstantNodeParameter;
@@ -977,16 +976,6 @@
     public static native int identityHashCode(@ConstantNodeParameter ForeignCallDescriptor descriptor, Object object);
 
     @Fold
-    public static boolean isImmutableCode() {
-        return GraalOptions.ImmutableCode.getValue();
-    }
-
-    @Fold
-    public static boolean generatePIC() {
-        return GraalOptions.GeneratePIC.getValue();
-    }
-
-    @Fold
     public static int verifiedEntryPointOffset() {
         return config().nmethodEntryOffset;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java	Thu Jan 14 18:43:15 2016 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java	Thu Jan 14 22:41:45 2016 +0100
@@ -34,8 +34,6 @@
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.g1SATBQueueIndexOffset;
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.g1SATBQueueMarkingOffset;
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.g1YoungCardValue;
-import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.generatePIC;
-import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.isImmutableCode;
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.logOfHeapRegionGrainBytes;
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord;
 import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.verifyOop;
@@ -115,8 +113,8 @@
 
     private static void serialWriteBarrier(Pointer ptr) {
         serialWriteBarrierCounter.inc();
-        int cardTableShift = (isImmutableCode() && generatePIC()) ? CardTableShiftNode.cardTableShift() : cardTableShift();
-        long cardTableAddress = (isImmutableCode() && generatePIC()) ? CardTableAddressNode.cardTableAddress() : cardTableStart();
+        int cardTableShift = cardTableShift();
+        long cardTableAddress = cardTableStart();
         Word base = (Word) ptr.unsignedShiftRight(cardTableShift);
         long startAddress = cardTableAddress;
         int displacement = 0;