# HG changeset patch # User Doug Simon # Date 1426708916 -3600 # Node ID b94503d3840c30742c40e041f53826bc3bd76a5d # Parent 212566f9cd69e2e15d73d9ef37f26a994f46ac97 removed logic for estimating invocation plugin count diff -r 212566f9cd69 -r b94503d3840c graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Wed Mar 18 20:17:41 2015 +0100 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Wed Mar 18 21:01:56 2015 +0100 @@ -220,10 +220,10 @@ */ private InvocationPlugins parent; - private InvocationPlugins(InvocationPlugins parent, MetaAccessProvider metaAccess, int estimatePluginCount) { + private InvocationPlugins(InvocationPlugins parent, MetaAccessProvider metaAccess) { this.registrationThread = Thread.currentThread(); this.metaAccess = metaAccess; - this.registrations = new ArrayList<>(estimatePluginCount); + this.registrations = new ArrayList<>(INITIAL_PLUGIN_CAPACITY); InvocationPlugins p = parent; // Only adopt a non-empty parent while (p != null && p.size() == 0) { @@ -232,21 +232,17 @@ this.parent = p; } - private static final int DEFAULT_ESTIMATE_PLUGIN_COUNT = 16; + private static final int INITIAL_PLUGIN_CAPACITY = 64; /** * Creates a set of invocation plugins with a non-null {@linkplain #getParent() parent}. */ public InvocationPlugins(InvocationPlugins parent) { - this(parent, parent.metaAccess, DEFAULT_ESTIMATE_PLUGIN_COUNT); + this(parent, parent.metaAccess); } public InvocationPlugins(MetaAccessProvider metaAccess) { - this(metaAccess, DEFAULT_ESTIMATE_PLUGIN_COUNT); - } - - public InvocationPlugins(MetaAccessProvider metaAccess, int estimatePluginCount) { - this(null, metaAccess, estimatePluginCount); + this(null, metaAccess); } /** diff -r 212566f9cd69 -r b94503d3840c graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Wed Mar 18 20:17:41 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Wed Mar 18 21:01:56 2015 +0100 @@ -40,8 +40,6 @@ @ServiceProvider(HotSpotBackendFactory.class) public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory { - private static final int PLUGIN_COUNT_ESTIMATE = 160; - protected Architecture createArchitecture(HotSpotVMConfig config) { return new AMD64(computeFeatures(config), computeFlags(config)); } @@ -173,8 +171,7 @@ wordTypes = new HotSpotWordTypes(metaAccess, target.wordKind); } try (InitTimer rt = timer("create GraphBuilderPhase plugins")) { - plugins = HotSpotGraphBuilderPlugins.create(runtime.getConfig(), wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, stampProvider, replacements, target.arch, - PLUGIN_COUNT_ESTIMATE); + plugins = HotSpotGraphBuilderPlugins.create(runtime.getConfig(), wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, stampProvider, replacements, target.arch); replacements.setGraphBuilderPlugins(plugins); } try (InitTimer rt = timer("create Suites provider")) { @@ -263,15 +260,15 @@ } else { /* * System V Application Binary Interface, AMD64 Architecture Processor Supplement - * + * * Draft Version 0.96 - * + * * http://www.uclibc.org/docs/psABI-x86_64.pdf - * + * * 3.2.1 - * + * * ... - * + * * This subsection discusses usage of each register. Registers %rbp, %rbx and %r12 * through %r15 "belong" to the calling function and the called function is required to * preserve their values. In other words, a called function must preserve these diff -r 212566f9cd69 -r b94503d3840c graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Wed Mar 18 20:17:41 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Wed Mar 18 21:01:56 2015 +0100 @@ -39,8 +39,6 @@ @ServiceProvider(HotSpotBackendFactory.class) public class SPARCHotSpotBackendFactory implements HotSpotBackendFactory { - private static final int PLUGIN_COUNT_ESTIMATE = 155; - protected Architecture createArchitecture(HotSpotVMConfig config) { return new SPARC(computeFeatures(config)); } @@ -70,8 +68,7 @@ HotSpotReplacementsImpl replacements = new HotSpotReplacementsImpl(p, snippetReflection, runtime.getConfig(), target); HotSpotDisassemblerProvider disassembler = new HotSpotDisassemblerProvider(runtime); HotSpotWordTypes wordTypes = new HotSpotWordTypes(metaAccess, target.wordKind); - Plugins plugins = HotSpotGraphBuilderPlugins.create(runtime.getConfig(), wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, stampProvider, replacements, target.arch, - PLUGIN_COUNT_ESTIMATE); + Plugins plugins = HotSpotGraphBuilderPlugins.create(runtime.getConfig(), wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, stampProvider, replacements, target.arch); replacements.setGraphBuilderPlugins(plugins); HotSpotSuitesProvider suites = createSuites(runtime, plugins); HotSpotProviders providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, foreignCalls, lowerer, replacements, disassembler, suites, registers, snippetReflection, diff -r 212566f9cd69 -r b94503d3840c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Wed Mar 18 20:17:41 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Wed Mar 18 21:01:56 2015 +0100 @@ -58,9 +58,8 @@ * @param stampProvider */ public static Plugins create(HotSpotVMConfig config, HotSpotWordTypes wordTypes, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection, - SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, StampProvider stampProvider, ReplacementsImpl replacements, Architecture arch, - int pluginCountEstimate) { - InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, metaAccess, pluginCountEstimate); + SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, StampProvider stampProvider, ReplacementsImpl replacements, Architecture arch) { + InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, metaAccess); Plugins plugins = new Plugins(invocationPlugins); NodeIntrinsificationPhase nodeIntrinsification = new NodeIntrinsificationPhase(metaAccess, constantReflection, snippetReflection, foreignCalls, stampProvider); @@ -78,9 +77,6 @@ registerStableOptionPlugins(invocationPlugins); StandardGraphBuilderPlugins.registerInvocationPlugins(metaAccess, arch, invocationPlugins, !config.useHeapProfiler); - int size = invocationPlugins.size(); - assert pluginCountEstimate >= size : String.format("adjust %s.PLUGIN_COUNT_ESTIMATE to be above or equal to %d", HotSpotGraphBuilderPlugins.class.getSimpleName(), size); - assert pluginCountEstimate - size < 20 : String.format("adjust %s.PLUGIN_COUNT_ESTIMATE to be closer to %d", HotSpotGraphBuilderPlugins.class.getSimpleName(), size); return plugins; } diff -r 212566f9cd69 -r b94503d3840c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Wed Mar 18 20:17:41 2015 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Wed Mar 18 21:01:56 2015 +0100 @@ -33,8 +33,8 @@ final class HotSpotInvocationPlugins extends InvocationPlugins { final HotSpotVMConfig config; - public HotSpotInvocationPlugins(HotSpotVMConfig config, MetaAccessProvider metaAccess, int estimatePluginCount) { - super(metaAccess, estimatePluginCount); + public HotSpotInvocationPlugins(HotSpotVMConfig config, MetaAccessProvider metaAccess) { + super(metaAccess); this.config = config; }