8154174: Improve JitTester performance
authoraaivanov
Mon, 18 Apr 2016 15:40:11 +0300
changeset 38047 4787ae4b4d1c
parent 38045 808cbf1958ce
child 38048 21720d6174a2
8154174: Improve JitTester performance Reviewed-by: iignatyev
hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ProductionFailedException.java
hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/SymbolTable.java
--- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ProductionFailedException.java	Mon Apr 18 11:22:51 2016 +0200
+++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/ProductionFailedException.java	Mon Apr 18 15:40:11 2016 +0300
@@ -27,10 +27,10 @@
     static final long serialVersionUID = -2325617203741536725L;
 
     public ProductionFailedException(String msg) {
-        super(msg);
+        super(msg, null, false, false);
     }
 
     public ProductionFailedException() {
-        super();
+        super(null, null, false, false);
     }
 }
--- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/SymbolTable.java	Mon Apr 18 11:22:51 2016 +0200
+++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/SymbolTable.java	Mon Apr 18 15:40:11 2016 +0300
@@ -26,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Stack;
 import jdk.test.lib.jittester.types.TypeKlass;
 
@@ -37,7 +38,7 @@
     private static int VARIABLE_NUMBER = 0;
     private static int FUNCTION_NUMBER = 0;
 
-    static private void initExternalSymbols() {
+    private static void initExternalSymbols() {
 
         String classList = ProductionParams.addExternalSymbols.value();
         if (classList.equals("all")) {
@@ -254,12 +255,12 @@
     public static void push() {
         // Do deep cloning..
         HashMap<Type, ArrayList<Symbol>> prev = SYMBOL_STACK.peek();
-        SYMBOL_STACK.push(new HashMap<>());
-        HashMap<Type, ArrayList<Symbol>> top = SYMBOL_STACK.peek();
-        for (Type type : prev.keySet()) {
-            ArrayList<Symbol> prevArray = prev.get(type);
-            top.put(type, new ArrayList<>(prevArray.size()));
-            ArrayList<Symbol> topArray = top.get(type);
+        HashMap<Type, ArrayList<Symbol>> top = new HashMap<>(prev.size());
+        SYMBOL_STACK.push(top);
+        for (Map.Entry<Type, ArrayList<Symbol>> entry : prev.entrySet()) {
+            ArrayList<Symbol> prevArray = entry.getValue();
+            ArrayList<Symbol> topArray = new ArrayList<>(prevArray.size());
+            top.put(entry.getKey(), topArray);
             for (Symbol symbol : prevArray) {
                 topArray.add(symbol.copy());
             }