# HG changeset patch # User Doug Simon # Date 1383931564 -3600 # Node ID 8212479436e038fe1f9a04da40d020f550372b24 # Parent 8e862906e2e461c9867e63223d1dae3c1c757ef7 disabled type context specialization of allocation snippets unless allocation profiling is enabled diff -r 8e862906e2e4 -r 8212479436e0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Fri Nov 08 18:07:38 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Fri Nov 08 18:26:04 2013 +0100 @@ -23,7 +23,9 @@ package com.oracle.graal.hotspot.replacements; import static com.oracle.graal.api.code.UnsignedMath.*; +import static com.oracle.graal.api.meta.MetaUtil.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; +import static com.oracle.graal.hotspot.replacements.NewObjectSnippets.Options.*; import static com.oracle.graal.nodes.PiArrayNode.*; import static com.oracle.graal.nodes.PiNode.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; @@ -64,11 +66,11 @@ public static final LocationIdentity INIT_LOCATION = new NamedLocationIdentity("Initialization"); - public static class Options { + static class Options { //@formatter:off @Option(help = "") - private static final OptionValue ProfileAllocations = new OptionValue<>(false); + static final OptionValue ProfileAllocations = new OptionValue<>(false); //@formatter:on } @@ -114,7 +116,7 @@ @Fold private static boolean doProfile() { - return Options.ProfileAllocations.getValue(); + return ProfileAllocations.getValue(); } private static void profileAllocation(String path, long size, String typeContext) { @@ -315,7 +317,7 @@ args.add("hub", hub); args.add("prototypeMarkWord", type.prototypeMarkWord()); args.addConst("fillContents", newInstanceNode.fillContents()); - args.addConst("typeContext", MetaUtil.toJavaName(type, false)); + args.addConst("typeContext", ProfileAllocations.getValue() ? toJavaName(type, false) : ""); SnippetTemplate template = template(args); Debug.log("Lowering allocateInstance in %s: node=%s, template=%s, arguments=%s", graph, newInstanceNode, template, args); @@ -342,7 +344,7 @@ args.addConst("headerSize", headerSize); args.addConst("log2ElementSize", log2ElementSize); args.addConst("fillContents", newArrayNode.fillContents()); - args.addConst("typeContext", MetaUtil.toJavaName(arrayType, false)); + args.addConst("typeContext", ProfileAllocations.getValue() ? toJavaName(arrayType, false) : ""); SnippetTemplate template = template(args); Debug.log("Lowering allocateArray in %s: node=%s, template=%s, arguments=%s", graph, newArrayNode, template, args);