src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
changeset 54328 37648a9c4a6a
parent 54084 84f10bbf993f
child 57537 ecc6e394475f
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54327:a4d19817609c 54328:37648a9c4a6a
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    50 import org.graalvm.compiler.phases.contract.NodeCostUtil;
    50 import org.graalvm.compiler.phases.contract.NodeCostUtil;
    51 import org.graalvm.compiler.serviceprovider.GraalServices;
    51 import org.graalvm.compiler.serviceprovider.GraalServices;
    52 
    52 
    53 import jdk.vm.ci.meta.JavaMethod;
    53 import jdk.vm.ci.meta.JavaMethod;
    54 import jdk.vm.ci.meta.ResolvedJavaMethod;
    54 import jdk.vm.ci.meta.ResolvedJavaMethod;
       
    55 import jdk.vm.ci.services.Services;
    55 
    56 
    56 //JaCoCo Exclude
    57 //JaCoCo Exclude
    57 
    58 
    58 /**
    59 /**
    59  * Observes compilation events and uses {@link BinaryGraphPrinter} to generate a graph
    60  * Observes compilation events and uses {@link BinaryGraphPrinter} to generate a graph
    84      */
    85      */
    85     public GraphPrinterDumpHandler(GraphPrinterSupplier printerSupplier) {
    86     public GraphPrinterDumpHandler(GraphPrinterSupplier printerSupplier) {
    86         this.printerSupplier = printerSupplier;
    87         this.printerSupplier = printerSupplier;
    87         /* Add the JVM and Java arguments to the graph properties to help identify it. */
    88         /* Add the JVM and Java arguments to the graph properties to help identify it. */
    88         this.jvmArguments = jvmArguments();
    89         this.jvmArguments = jvmArguments();
    89         this.sunJavaCommand = System.getProperty("sun.java.command");
    90         this.sunJavaCommand = Services.getSavedProperties().get("sun.java.command");
    90     }
    91     }
    91 
    92 
    92     private static String jvmArguments() {
    93     private static String jvmArguments() {
    93         List<String> inputArguments = GraalServices.getInputArguments();
    94         List<String> inputArguments = GraalServices.getInputArguments();
    94         if (inputArguments != null) {
    95         if (inputArguments != null) {