< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 67,76 ****
--- 67,78 ----
import org.graalvm.compiler.nodes.spi.ValueProxy;
import org.graalvm.compiler.nodes.virtual.VirtualObjectNode;
import org.graalvm.compiler.phases.Phase;
import org.graalvm.compiler.phases.schedule.SchedulePhase;
+ import jdk.vm.ci.services.Services;
+
/**
* This phase add counters for the dynamically executed number of nodes. Incrementing the counter
* for each node would be too costly, so this phase takes the compromise that it trusts split
* probabilities, but not loop frequencies. This means that it will insert counters at the start of
* a method and at each loop header.
*** 85,97 ****
private static final String GROUP_NAME = "~profiled weight";
private static final String GROUP_NAME_WITHOUT = "~profiled weight (invoke-free sections)";
private static final String GROUP_NAME_INVOKES = "~profiled invokes";
! private static final boolean WITH_SECTION_HEADER = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_SECTION_HEADER", "false"));
! private static final boolean WITH_INVOKE_FREE_SECTIONS = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_FREE_SECTIONS", "false"));
! private static final boolean WITH_INVOKES = Boolean.parseBoolean(System.getProperty("ProfileCompiledMethodsPhase.WITH_INVOKES", "true"));
@Override
protected void run(StructuredGraph graph) {
SchedulePhase schedule = new SchedulePhase(graph.getOptions());
schedule.apply(graph, false);
--- 87,107 ----
private static final String GROUP_NAME = "~profiled weight";
private static final String GROUP_NAME_WITHOUT = "~profiled weight (invoke-free sections)";
private static final String GROUP_NAME_INVOKES = "~profiled invokes";
! private static String getProperty(String name, String def) {
! String value = Services.getSavedProperties().get(name);
! if (value == null) {
! return def;
! }
! return value;
! }
!
! private static final boolean WITH_SECTION_HEADER = Boolean.parseBoolean(getProperty("ProfileCompiledMethodsPhase.WITH_SECTION_HEADER", "false"));
! private static final boolean WITH_INVOKE_FREE_SECTIONS = Boolean.parseBoolean(getProperty("ProfileCompiledMethodsPhase.WITH_FREE_SECTIONS", "false"));
! private static final boolean WITH_INVOKES = Boolean.parseBoolean(getProperty("ProfileCompiledMethodsPhase.WITH_INVOKES", "true"));
@Override
protected void run(StructuredGraph graph) {
SchedulePhase schedule = new SchedulePhase(graph.getOptions());
schedule.apply(graph, false);
< prev index next >