src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java
equal
deleted
inserted
replaced
54 import java.util.List; |
54 import java.util.List; |
55 import java.util.Map; |
55 import java.util.Map; |
56 import java.util.SortedMap; |
56 import java.util.SortedMap; |
57 import java.util.TreeMap; |
57 import java.util.TreeMap; |
58 |
58 |
|
59 import org.graalvm.collections.EconomicMap; |
|
60 import org.graalvm.collections.EconomicSet; |
|
61 import org.graalvm.collections.Pair; |
59 import org.graalvm.compiler.options.OptionKey; |
62 import org.graalvm.compiler.options.OptionKey; |
60 import org.graalvm.compiler.options.OptionValues; |
63 import org.graalvm.compiler.options.OptionValues; |
61 import org.graalvm.graphio.GraphOutput; |
64 import org.graalvm.graphio.GraphOutput; |
62 import org.graalvm.util.EconomicMap; |
|
63 import org.graalvm.util.EconomicSet; |
|
64 import org.graalvm.util.Pair; |
|
65 |
65 |
66 import jdk.vm.ci.meta.JavaMethod; |
66 import jdk.vm.ci.meta.JavaMethod; |
67 |
67 |
68 /** |
68 /** |
69 * A facility for logging and dumping as well as a container for values associated with |
69 * A facility for logging and dumping as well as a container for values associated with |
1935 public void close() { |
1935 public void close() { |
1936 closeDumpHandlers(false); |
1936 closeDumpHandlers(false); |
1937 if (description != null) { |
1937 if (description != null) { |
1938 printMetrics(description); |
1938 printMetrics(description); |
1939 } |
1939 } |
1940 if (metricsEnabled && globalMetrics != null && metricValues != null) { |
1940 if (metricsEnabled && metricValues != null && globalMetrics != null) { |
1941 globalMetrics.add(this); |
1941 globalMetrics.add(this); |
1942 } |
1942 } |
1943 metricValues = null; |
1943 metricValues = null; |
|
1944 if (sharedChannel != null) { |
|
1945 try { |
|
1946 sharedChannel.realClose(); |
|
1947 } catch (IOException ex) { |
|
1948 // ignore. |
|
1949 } |
|
1950 } |
1944 } |
1951 } |
1945 |
1952 |
1946 public void closeDumpHandlers(boolean ignoreErrors) { |
1953 public void closeDumpHandlers(boolean ignoreErrors) { |
1947 if (currentConfig != null) { |
1954 if (currentConfig != null) { |
1948 currentConfig.closeDumpHandlers(ignoreErrors); |
1955 currentConfig.closeDumpHandlers(ignoreErrors); |
2020 Files.write(path, content, StandardOpenOption.CREATE, StandardOpenOption.APPEND); |
2027 Files.write(path, content, StandardOpenOption.CREATE, StandardOpenOption.APPEND); |
2021 } catch (IOException e) { |
2028 } catch (IOException e) { |
2022 } |
2029 } |
2023 } |
2030 } |
2024 } |
2031 } |
2025 |
|
2026 } |
2032 } |
2027 |
2033 |
2028 /** |
2034 /** |
2029 * Lock to serialize writes to {@link DebugOptions#MetricsFile}. |
2035 * Lock to serialize writes to {@link DebugOptions#MetricsFile}. |
2030 */ |
2036 */ |