@@ -62,28 +62,32 @@ public final class CFunctionPrologueNode extends FixedWithNextNode implements Lo
6262
6363 private final int newThreadStatus ;
6464 /**
65- * The marker object prevents value numbering of the node. This means that the marker must be a
66- * unique object per node, even after node cloning (e.g., because of method inlining).
67- * Therefore, {@link #afterClone} properly re-initializes the field to a new marker instance.
68- *
69- * The marker is also used for LIR frame state verification, to ensure we have a proper matching
70- * of prologue and epilogue and no unexpected machine code while the thread is in Native state.
65+ * The marker is used for LIR frame state verification, to ensure we have a proper matching of
66+ * prologue and epilogue and no unexpected machine code while the thread is in Native state.
7167 */
7268 private CFunctionPrologueMarker marker ;
7369
7470 public CFunctionPrologueNode (int newThreadStatus ) {
7571 super (TYPE , StampFactory .forVoid ());
7672 this .newThreadStatus = newThreadStatus ;
77- marker = new CFunctionPrologueMarker (newThreadStatus );
7873 }
7974
8075 @ Override
8176 protected void afterClone (Node other ) {
8277 super .afterClone (other );
83- marker = new CFunctionPrologueMarker (newThreadStatus );
78+ /*
79+ * Note that this method is invoked by the regular method inlining, but not by the
80+ * PEGraphDecoder. So the method inlining before analysis, as well as the trivial method
81+ * inlining before compilation, do not invoke this method. So it is only suitable for
82+ * assertion checking.
83+ */
84+ assert marker == null : "Marker must be unique" ;
8485 }
8586
8687 public CFunctionPrologueMarker getMarker () {
88+ if (marker == null ) {
89+ marker = new CFunctionPrologueMarker (newThreadStatus );
90+ }
8791 return marker ;
8892 }
8993
0 commit comments