changeset 20043:b9041d4e91c5

Merge.
author Doug Simon <doug.simon@oracle.com>
date Thu, 26 Mar 2015 22:26:18 +0100
parents b2e8b26f5040 (diff) e87754e57be7 (current diff)
children c1f116cd4b67
files
diffstat 13 files changed, 44 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Thu Mar 26 22:26:18 2015 +0100
@@ -51,7 +51,7 @@
      */
     public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, JavaConstant constant, PrintStream out, int printTopN) {
         Set<JavaConstant> marked = new HashSet<>();
-        Stack<JavaConstant> stack = new Stack<>();
+        Deque<JavaConstant> stack = new ArrayDeque<>();
         if (constant.getKind() == Kind.Object && constant.isNonNull()) {
             marked.add(constant);
         }
@@ -120,7 +120,7 @@
         return sum;
     }
 
-    private static void pushConstant(Set<JavaConstant> marked, Stack<JavaConstant> stack, JavaConstant value) {
+    private static void pushConstant(Set<JavaConstant> marked, Deque<JavaConstant> stack, JavaConstant value) {
         if (value.isNonNull()) {
             if (!marked.contains(value)) {
                 marked.add(value);
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/UnsafeAccess.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/UnsafeAccess.java	Thu Mar 26 22:26:18 2015 +0100
@@ -65,7 +65,7 @@
         if (address == 0) {
             return null;
         }
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0;; i++) {
             char c = (char) unsafe.getByte(address + i);
             if (c == 0) {
--- a/graal/com.oracle.graal.graph/.checkstyle_checks.xml	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.graph/.checkstyle_checks.xml	Thu Mar 26 22:26:18 2015 +0100
@@ -122,9 +122,13 @@
       <property name="format" value=" ,"/>
       <property name="message" value="illegal space before a comma"/>
       <property name="ignoreComments" value="true"/>
+      <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/>
       <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/>
-      <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/>
     </module>
+    <module name="RegexpSinglelineJava">
+      <property name="format" value="new (Hashtable|Vector|Stack|StringBuffer)[^\w]"/>
+      <property name="message" value="Don't use old synchronized collection classes"/>
+    </module>    
   </module>
   <module name="RegexpHeader">
     <property name="header" value="/\*\n \* Copyright \(c\) (20[0-9][0-9], )?20[0-9][0-9], Oracle and/or its affiliates. All rights reserved.\n \* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n \*\n \* This code is free software; you can redistribute it and/or modify it\n \* under the terms of the GNU General Public License version 2 only, as\n \* published by the Free Software Foundation.\n \*\n \* This code is distributed in the hope that it will be useful, but WITHOUT\n \* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n \* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\n \* version 2 for more details \(a copy is included in the LICENSE file that\n \* accompanied this code\).\n \*\n \* You should have received a copy of the GNU General Public License version\n \* 2 along with this work; if not, write to the Free Software Foundation,\n \* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n \*\n \* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n \* or visit www.oracle.com if you need additional information or have any\n \* questions.\n \*/\n"/>
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java	Thu Mar 26 22:26:18 2015 +0100
@@ -299,8 +299,8 @@
 
     @Test
     public void test14() throws Exception {
-        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferTest", Object.class, Object.class);
-        StringBuffer buffer = new StringBuffer("TestTestTestTestTestTestTest");
+        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderTest", Object.class, Object.class);
+        StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest");
         Assert.assertTrue(buffer.length() == 28);
         String a = new String("TestTestTestTestTestTestTest");
         installedBenchmarkCode.executeVarargs(buffer, a.toCharArray());
@@ -308,8 +308,8 @@
         Assert.assertTrue(buffer.toString().equals("TestTestTestTestTestTestTestTestTestTestTestTestTestTest"));
     }
 
-    public static void stringBufferTest(Object c1, Object c2) {
-        StringBuffer source = (StringBuffer) c1;
+    public static void stringBuilderTest(Object c1, Object c2) {
+        StringBuilder source = (StringBuilder) c1;
         char[] add = (char[]) c2;
         for (int i = 0; i < add.length; i++) {
             source.append(add[i]);
@@ -318,12 +318,12 @@
 
     @Test
     public void test15() throws Exception {
-        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferTestIn");
+        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderTestIn");
         installedBenchmarkCode.executeVarargs();
     }
 
-    public static void stringBufferTestIn() {
-        StringBuffer buffer = new StringBuffer("TestTestTestTestTestTestTest");
+    public static void stringBuilderTestIn() {
+        StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest");
         Assert.assertTrue(buffer.length() == 28);
         String a = new String("TestTestTestTestTestTestTest");
         char[] add = a.toCharArray();
@@ -336,12 +336,12 @@
 
     @Test
     public void test16() throws Exception {
-        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferArrayCopy");
+        HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderArrayCopy");
         installedBenchmarkCode.executeVarargs();
     }
 
-    public static void stringBufferArrayCopy() {
-        StringBuffer buffer = new StringBuffer("TestTestTestTestTestTestTest");
+    public static void stringBuilderArrayCopy() {
+        StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest");
         Assert.assertTrue(buffer.length() == 28);
         String a = new String("TestTestTestTestTestTestTest");
         char[] dst = new char[buffer.length() * 2];
--- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java	Thu Mar 26 22:26:18 2015 +0100
@@ -63,7 +63,7 @@
             return cs.hashCode();
         }
 
-        if (cs instanceof StringBuffer) {
+        if (cs instanceof StringBuilder) {
             int[] hash = {0};
             cs.chars().forEach(c -> hash[0] += c);
             return hash[0];
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 26 22:26:18 2015 +0100
@@ -296,7 +296,7 @@
             private final boolean explodeLoops;
             private final boolean mergeExplosions;
             private final Map<HIRFrameStateBuilder, Integer> mergeExplosionsMap;
-            private Stack<ExplodedLoopContext> explodeLoopsContext;
+            private Deque<ExplodedLoopContext> explodeLoopsContext;
             private int nextPeelIteration = 1;
             private boolean controlFlowSplit;
             private final InvocationPluginReceiver invocationPluginReceiver = new InvocationPluginReceiver(this);
@@ -452,7 +452,7 @@
             private void detectLoops(FixedNode startInstruction) {
                 NodeBitMap visited = currentGraph.createNodeBitMap();
                 NodeBitMap active = currentGraph.createNodeBitMap();
-                Stack<Node> stack = new Stack<>();
+                Deque<Node> stack = new ArrayDeque<>();
                 stack.add(startInstruction);
                 visited.mark(startInstruction);
                 while (!stack.isEmpty()) {
@@ -498,7 +498,7 @@
 
             private void insertLoopEnds(FixedNode startInstruction) {
                 NodeBitMap visited = currentGraph.createNodeBitMap();
-                Stack<Node> stack = new Stack<>();
+                Deque<Node> stack = new ArrayDeque<>();
                 stack.add(startInstruction);
                 visited.mark(startInstruction);
                 List<LoopBeginNode> loopBegins = new ArrayList<>();
@@ -538,7 +538,7 @@
 
             private void insertLoopExits(LoopBeginNode loopBegin, IdentityHashMap<LoopBeginNode, List<LoopBeginNode>> innerLoopsMap) {
                 NodeBitMap visited = currentGraph.createNodeBitMap();
-                Stack<Node> stack = new Stack<>();
+                Deque<Node> stack = new ArrayDeque<>();
                 for (LoopEndNode loopEnd : loopBegin.loopEnds()) {
                     stack.push(loopEnd);
                     visited.mark(loopEnd);
@@ -622,7 +622,7 @@
 
             private int iterateExplodedLoopHeader(BciBlock[] blocks, BciBlock header) {
                 if (explodeLoopsContext == null) {
-                    explodeLoopsContext = new Stack<>();
+                    explodeLoopsContext = new ArrayDeque<>();
                 }
 
                 ExplodedLoopContext context = new ExplodedLoopContext();
@@ -1870,9 +1870,7 @@
             }
 
             private int findOperatingDimensionWithLoopExplosion(BciBlock block, HIRFrameStateBuilder state) {
-                int i;
-                for (i = explodeLoopsContext.size() - 1; i >= 0; --i) {
-                    ExplodedLoopContext context = explodeLoopsContext.elementAt(i);
+                for (ExplodedLoopContext context : explodeLoopsContext) {
                     if (context.header == block) {
 
                         if (this.mergeExplosions) {
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/Switch02.java	Thu Mar 26 22:26:18 2015 +0100
@@ -89,7 +89,7 @@
                 break;
             case (char) 0xFFFF - 21:
                 result = 858112498 / val;
-                x = new Hashtable<>();
+                x = new HashMap<>();
                 break;
             default:
                 result = 34324341 / val;
@@ -142,7 +142,7 @@
                 break;
             case (short) -0x7FFF + 21:
                 result = 858112498 / val;
-                x = new Hashtable<>();
+                x = new HashMap<>();
                 break;
             default:
                 result = 34324341 / val;
@@ -198,7 +198,7 @@
                 break;
             case (byte) -0x7F + 21:
                 result = 858112498 / val;
-                x = new Hashtable<>();
+                x = new HashMap<>();
                 break;
             default:
                 result = 34324341 / val;
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DominatorConditionalEliminationPhase.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DominatorConditionalEliminationPhase.java	Thu Mar 26 22:26:18 2015 +0100
@@ -130,13 +130,13 @@
     private static class Instance {
 
         private final NodeMap<Info> map;
-        private final Stack<LoopExitNode> loopExits;
+        private final Deque<LoopExitNode> loopExits;
         private final Function<Block, Iterable<? extends Node>> blockToNodes;
         private final Function<Node, Block> nodeToBlock;
 
         public Instance(StructuredGraph graph, Function<Block, Iterable<? extends Node>> blockToNodes, Function<Node, Block> nodeToBlock) {
             map = graph.createNodeMap();
-            loopExits = new Stack<>();
+            loopExits = new ArrayDeque<>();
             this.blockToNodes = blockToNodes;
             this.nodeToBlock = nodeToBlock;
         }
@@ -282,8 +282,8 @@
                 }
                 Block guardBlock = nodeToBlock.apply(proxiedGuard);
                 assert guardBlock != null;
-                for (int i = 0; i < loopExits.size(); ++i) {
-                    LoopExitNode loopExitNode = loopExits.get(i);
+                for (Iterator<LoopExitNode> iter = loopExits.descendingIterator(); iter.hasNext();) {
+                    LoopExitNode loopExitNode = iter.next();
                     Block loopExitBlock = nodeToBlock.apply(loopExitNode);
                     if (guardBlock != loopExitBlock && AbstractControlFlowGraph.dominates(guardBlock, loopExitBlock)) {
                         Block loopBeginBlock = nodeToBlock.apply(loopExitNode.loopBegin());
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java	Thu Mar 26 22:26:18 2015 +0100
@@ -57,7 +57,7 @@
     }
 
     public boolean apply(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args) {
-        if (wordOperationPlugin.apply(b, method, args)) {
+        if (b.parsingReplacement() && wordOperationPlugin.apply(b, method, args)) {
             return true;
         } else if (b.parsingReplacement()) {
             NodeIntrinsic intrinsic = nodeIntrinsification.getIntrinsic(method);
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java	Thu Mar 26 22:26:18 2015 +0100
@@ -268,6 +268,9 @@
             if (targetMethod != null) {
                 // TODO maybe cast arguments
 
+                if (!targetMethod.canBeInlined()) {
+                    return null;
+                }
                 if (targetMethod.canBeStaticallyBound()) {
                     return new InlineInfo(targetMethod, false, false);
                 }
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordTypes.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordTypes.java	Thu Mar 26 22:26:18 2015 +0100
@@ -91,6 +91,7 @@
             assert wordImplType.isLinked();
             wordMethod = wordImplType.resolveConcreteMethod(targetMethod, callingContextType);
         }
+        assert wordMethod != null : targetMethod;
         assert wordMethod.getAnnotation(Operation.class) != null : wordMethod;
         return wordMethod;
     }
--- a/graal/com.oracle.truffle.api/.checkstyle_checks.xml	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.truffle.api/.checkstyle_checks.xml	Thu Mar 26 22:26:18 2015 +0100
@@ -5,7 +5,7 @@
     This configuration file was written by the eclipse-cs plugin configuration editor
 -->
 <!--
-    Checkstyle-Configuration: Maxine Checks
+    Checkstyle-Configuration: Checks
     Description: none
 -->
 <module name="Checker">
@@ -122,8 +122,12 @@
       <property name="format" value=" ,"/>
       <property name="message" value="illegal space before a comma"/>
       <property name="ignoreComments" value="true"/>
+      <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/>
       <metadata name="com.atlassw.tools.eclipse.checkstyle.customMessage" value="Illegal whitespace before a comma."/>
-      <metadata name="com.atlassw.tools.eclipse.checkstyle.comment" value="Checks for whitespace before a comma."/>
+    </module>
+    <module name="RegexpSinglelineJava">
+      <property name="format" value="new (Hashtable|Vector|Stack|StringBuffer)[^\w]"/>
+      <property name="message" value="Don't use old synchronized collection classes"/>
     </module>
   </module>
   <module name="RegexpHeader">
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Mar 26 13:51:37 2015 -0700
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Mar 26 22:26:18 2015 +0100
@@ -84,7 +84,7 @@
     private static final List<WeakReference<Source>> allSources = Collections.synchronizedList(new ArrayList<WeakReference<Source>>());
 
     // Files and pseudo files are indexed.
-    private static final Map<String, WeakReference<Source>> filePathToSource = new Hashtable<>();
+    private static final Map<String, WeakReference<Source>> filePathToSource = new HashMap<>();
 
     private static boolean fileCacheEnabled = true;