protected final SpecializationNode polymorphicMerge(SpecializationNode newNode, SpecializationNode merged) { if (merged == newNode && count() <= 2) { return removeSame(new SlowPathEvent0(this, "merged polymorphic to monomorphic", null)); } return merged; }
protected SpecializationNode merge(SpecializationNode newNode, Frame frame, Object o1, Object o2) { if (isIdentical(newNode, frame, o1, o2)) { return this; } return next != null ? next.merge(newNode, frame, o1, o2) : newNode; }
protected final Object uninitialized(Frame frame) { CompilerDirectives.transferToInterpreterAndInvalidate(); SpecializationNode newNode = atomic(new InsertionEvent0(this, "insert new specialization", frame)); if (newNode == null) { return unsupported(frame); } return newNode.acceptAndExecute(frame); }
protected final Object uninitialized(Frame frame, Object o1, Object o2) { CompilerDirectives.transferToInterpreterAndInvalidate(); SpecializationNode newNode = atomic(new InsertionEvent2(this, "insert new specialization", frame, o1, o2)); if (newNode == null) { return unsupported(frame, o1, o2); } return newNode.acceptAndExecute(frame, o1, o2); }
protected final Object remove(String reason, Frame frame) { return atomic(new RemoveEvent0(this, reason, frame)).acceptAndExecute(frame); }
private static boolean includes(Node oldNode, DSLNode newNode) { return containsClass(newNode.getMetadata0().getIncludes(), oldNode); }
protected final Object remove(String reason, Frame frame, Object o1) { return atomic(new RemoveEvent1(this, reason, frame, o1)).acceptAndExecute(frame, o1); }
protected final Object remove(String reason, Frame frame, Object o1, Object o2, Object o3) { return atomic(new RemoveEvent3(this, reason, frame, o1, o2, o3)).acceptAndExecute(frame, o1, o2, o3); }
public static Node updateRoot(Node node) { updateRootImpl(((SpecializedNode) node).getSpecializationNode(), node); return node; }
private int countSameImpl(SpecializationNode node) { if (next != null) { return next.countSameImpl(node) + (isSame(node) ? 1 : 0); } else { return 0; } }
private String getMessage() { if (message == null) { message = createMessage(); } return message; }
@Override public String toString() { return getMessage(); }
protected static boolean isValid(Assumption[] assumptions) { if (assumptions != null) { for (Assumption assumption : assumptions) { if (!isValid(assumption)) { return false; } } } return true; }
@SuppressWarnings("unchecked") public static <T extends Node> T findRoot(T node) { Node prev = node; Node cur; do { cur = prev; prev = getPrevious(cur); } while (prev != null); return (T) cur; }
public final NodeCost getNodeCost() { switch (count()) { case 0: case 1: return NodeCost.UNINITIALIZED; case 2: return NodeCost.MONOMORPHIC; default: return NodeCost.POLYMORPHIC; } }
private static Node findUninitialized(Node node) { Node next = node; Node cur; do { cur = next; next = getNext(cur); } while (next != null); return cur; }
protected SpecializationNode merge(SpecializationNode newNode, Frame frame, Object o1, Object o2, Object o3, Object o4) { if (isIdentical(newNode, frame, o1, o2, o3, o4)) { return this; } return next != null ? next.merge(newNode, frame, o1, o2, o3, o4) : newNode; }
protected SpecializationNode merge(SpecializationNode newNode, Frame frame, Object o1, Object o2, Object o3, Object o4, Object o5) { if (isIdentical(newNode, frame, o1, o2, o3, o4, o5)) { return this; } return next != null ? next.merge(newNode, frame, o1, o2, o3, o4, o5) : newNode; }
protected SpecializationNode merge(SpecializationNode newNode, Frame frame) { if (isIdentical(newNode, frame)) { return this; } return next != null ? next.merge(newNode, frame) : newNode; }