@Override public Pair<String, String> toCSVFormat(long value) { return Pair.create(String.valueOf(value), "bytes"); } }
/** * Constructs a pair with its left value being {@code left}, or returns an empty pair if * {@code left} is null. * * @return the constructed pair or an empty pair if {@code left} is null. * @since 1.0 */ public static <L, R> Pair<L, R> createLeft(L left) { if (left == null) { return empty(); } else { return new Pair<>(left, null); } }
/** * Appends metrics in CSV format to {@code out} for a single method compilation. * * @param identity the identity hash code of {@code compilable} * @param compilationNr where this compilation lies in the ordered sequence of all compilations * identified by {@code identity} * @param compilationId the runtime issued identifier for the compilation */ private void printMetricsCSV(PrintStream out, Object compilable, Integer identity, int compilationNr, String compilationId) { String compilableName = compilable instanceof JavaMethod ? ((JavaMethod) compilable).format("%H.%n(%p)%R") : String.valueOf(compilable); String csvFormat = CSVUtil.buildFormatString("%s", "%s", "%d", "%s"); String format = String.format(csvFormat, CSVUtil.Escape.escapeArgs(compilableName, identity, compilationNr, compilationId)); char sep = CSVUtil.SEPARATOR; format += sep + "%s" + sep + "%s" + sep + "%s"; for (MetricKey key : KeyRegistry.getKeys()) { int index = ((AbstractKey) key).getIndex(); if (index < metricValues.length) { Pair<String, String> valueAndUnit = key.toCSVFormat(metricValues[index]); CSVUtil.Escape.println(out, format, CSVUtil.Escape.escape(key.getName()), valueAndUnit.getLeft(), valueAndUnit.getRight()); } } }
fixedIntervals = createUnhandledLists(IS_PRECOLORED_INTERVAL, null).getLeft();
firstValueSet = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); Pair<ValueNode, Object> pair = Pair.create(unproxified, firstValueSet.get(unproxified)); firstValueSet.put(unproxified, pair); Pair<ValueNode, Object> pair = firstValueSet.get(object); while (pair != null) { initialState.addReadCache(pair.getLeft(), entry.identity, entry.index, entry.kind, entry.overflowAccess, initialState.getReadCache().get(entry), this); pair = (Pair<ValueNode, Object>) pair.getRight();
interval = allocator.createUnhandledLists(mustStoreAtDefinition, null).getLeft(); if (Assertions.detailedAssertionsEnabled(allocator.getOptions())) { checkIntervals(debug, interval);
@SuppressWarnings("try") void allocateRegisters() { try (Indent indent = allocator.getDebug().logAndIndent("allocate registers")) { Interval precoloredIntervals; Interval notPrecoloredIntervals; Pair<Interval, Interval> result = allocator.createUnhandledLists(LinearScan.IS_PRECOLORED_INTERVAL, LinearScan.IS_VARIABLE_INTERVAL); precoloredIntervals = result.getLeft(); notPrecoloredIntervals = result.getRight(); // allocate cpu registers LinearScanWalker lsw; if (OptimizingLinearScanWalker.Options.LSRAOptimization.getValue(allocator.getOptions())) { lsw = new OptimizingLinearScanWalker(allocator, precoloredIntervals, notPrecoloredIntervals); } else { lsw = new LinearScanWalker(allocator, precoloredIntervals, notPrecoloredIntervals); } lsw.walk(); lsw.finishAllocation(); } }
/** * Constructs a pair with its left value being {@code left}, or returns an empty pair if * {@code left} is null. * * @return the constructed pair or an empty pair if {@code left} is null. * @since 1.0 */ public static <L, R> Pair<L, R> createLeft(L left) { if (left == null) { return empty(); } else { return new Pair<>(left, null); } }
@Override public Pair<String, String> toCSVFormat(long value) { return Pair.create(String.valueOf(value), ""); }
/** * Constructs a pair with its right value being {@code right}, or returns an empty pair if * {@code right} is null. * * @return the constructed pair or an empty pair if {@code right} is null. * @since 1.0 */ public static <L, R> Pair<L, R> createRight(R right) { if (right == null) { return empty(); } else { return new Pair<>(null, right); } }
@Override public Pair<String, String> toCSVFormat(long value) { return Pair.create(String.valueOf(value), "bytes"); }
ValueNode[] args = new ValueNode[argsWithTypes.size()]; for (int i = 0; i < argsWithTypes.size(); i++) { ValueNode value = argsWithTypes.get(i).getLeft(); ResolvedJavaType type = argsWithTypes.get(i).getRight(); if (!type.isPrimitive() && !type.isJavaLangObject()) { TypeReference typeRef = TypeReference.createTrusted(kit.getAssumptions(), type);
/** * Constructs a pair with its right value being {@code right}, or returns an empty pair if * {@code right} is null. * * @return the constructed pair or an empty pair if {@code right} is null. * @since 1.0 */ public static <L, R> Pair<L, R> createRight(R right) { if (right == null) { return empty(); } else { return new Pair<>(null, right); } }
static Pair<String, String> toCSVFormatHelper(long value) { return Pair.create(Long.toString(value / 1000), "us"); }
TriState result = unaryLogicNode.tryFold(foldResult.getRight()); if (result.isKnown()) { return rewireGuards(foldResult.getLeft().getGuard(), result.toBoolean(), foldResult.getLeft().getProxifiedInput(), foldResult.getRight(), rewireGuardFunction); Pair<InfoElement, Stamp> foldResult = recursiveFoldStampFromInfo(x); if (foldResult != null) { TriState result = binaryOpLogicNode.tryFold(foldResult.getRight(), y.stamp(NodeView.DEFAULT)); if (result.isKnown()) { return rewireGuards(foldResult.getLeft().getGuard(), result.toBoolean(), foldResult.getLeft().getProxifiedInput(), foldResult.getRight(), rewireGuardFunction);
/** * Constructs a pair with its left value being {@code left}, and its right value being * {@code right}, or returns an empty pair if both inputs are null. * * @return the constructed pair or an empty pair if both inputs are null. * @since 1.0 */ public static <L, R> Pair<L, R> create(L left, R right) { if (right == null && left == null) { return empty(); } else { return new Pair<>(left, right); } }
protected static void pushToWorklist(Node expectedNode, Node actualNode, NodeMap<Node> nodeMapping, Deque<Pair<Node, Node>> workList) { nodeMapping.set(expectedNode, actualNode); if (expectedNode instanceof AbstractEndNode) { /* To ensure phi nodes have been added, we handle everything before block ends. */ workList.addLast(Pair.create(expectedNode, actualNode)); } else { workList.addFirst(Pair.create(expectedNode, actualNode)); } } }