src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java Thu Oct 17 20:27:44 2019 +0100
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2019, 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
@@ -32,9 +32,12 @@
import org.graalvm.compiler.nodeinfo.NodeInfo;
import org.graalvm.compiler.nodes.DeoptimizingFixedWithNextNode;
import org.graalvm.compiler.nodes.FrameState;
+import org.graalvm.compiler.nodes.extended.MembarNode;
import org.graalvm.compiler.nodes.spi.Lowerable;
import org.graalvm.compiler.nodes.spi.LoweringTool;
+import jdk.vm.ci.code.MemoryBarriers;
+
/**
* The {@code AbstractNewObjectNode} is the base class for the new instance and new array nodes.
*/
@@ -44,6 +47,12 @@
public static final NodeClass<AbstractNewObjectNode> TYPE = NodeClass.create(AbstractNewObjectNode.class);
protected final boolean fillContents;
+ /**
+ * Controls whether this allocation emits a {@link MembarNode} with
+ * {@link MemoryBarriers#STORE_STORE} as part of the object initialization.
+ */
+ protected boolean emitMemoryBarrier = true;
+
protected AbstractNewObjectNode(NodeClass<? extends AbstractNewObjectNode> c, Stamp stamp, boolean fillContents, FrameState stateBefore) {
super(c, stamp, stateBefore);
this.fillContents = fillContents;
@@ -65,4 +74,12 @@
public boolean canDeoptimize() {
return true;
}
+
+ public boolean emitMemoryBarrier() {
+ return emitMemoryBarrier;
+ }
+
+ public void clearEmitMemoryBarrier() {
+ this.emitMemoryBarrier = false;
+ }
}