changeset 21743:b54b13157d4b

removed BytecodeDisassemblerProvider
author Doug Simon <doug.simon@oracle.com>
date Fri, 05 Jun 2015 10:50:00 +0200
parents 2e850dbf82ae
children d62a384b2415
files graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestBytecodeDisassemblerProvider.java graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/BytecodeDisassemblerProvider.java mx/suite.py
diffstat 4 files changed, 4 insertions(+), 125 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestBytecodeDisassemblerProvider.java	Fri Jun 05 14:12:49 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2012, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.java.test;
-
-import com.oracle.jvmci.meta.ResolvedJavaMethod;
-import com.oracle.jvmci.meta.BytecodeDisassemblerProvider;
-import com.oracle.jvmci.runtime.test.*;
-
-import org.junit.*;
-
-import com.oracle.graal.java.*;
-
-/**
- * Tests for {@link BytecodeDisassemblerProvider}.
- */
-public class TestBytecodeDisassemblerProvider extends MethodUniverse {
-
-    public TestBytecodeDisassemblerProvider() {
-    }
-
-    /**
-     * Tests that successive disassembling of the same method produces the same result.
-     */
-    @Test
-    public void disassembleTest() {
-        BytecodeDisassemblerProvider dis = new BytecodeDisassembler();
-        if (dis != null) {
-            int count = 0;
-            for (ResolvedJavaMethod m : methods.values()) {
-                String disasm1 = dis.disassemble(m);
-                String disasm2 = dis.disassemble(m);
-                if (disasm1 == null) {
-                    Assert.assertTrue(disasm2 == null);
-                } else {
-                    Assert.assertTrue(String.valueOf(m), disasm1.length() > 0);
-                    Assert.assertEquals(String.valueOf(m), disasm1, disasm2);
-                }
-                if (count++ > 20) {
-                    break;
-                }
-            }
-        }
-    }
-}
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java	Fri Jun 05 14:12:49 2015 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java	Fri Jun 05 10:50:00 2015 +0200
@@ -22,21 +22,15 @@
  */
 package com.oracle.graal.java;
 
+import static com.oracle.graal.bytecode.Bytecodes.*;
+
 import com.oracle.graal.bytecode.*;
-import com.oracle.jvmci.meta.JavaField;
-import com.oracle.jvmci.meta.ResolvedJavaMethod;
-import com.oracle.jvmci.meta.BytecodeDisassemblerProvider;
-import com.oracle.jvmci.meta.JavaConstant;
-import com.oracle.jvmci.meta.JavaType;
-import com.oracle.jvmci.meta.JavaMethod;
-import com.oracle.jvmci.meta.ConstantPool;
-
-import static com.oracle.graal.bytecode.Bytecodes.*;
+import com.oracle.jvmci.meta.*;
 
 /**
  * Utility for producing a {@code javap}-like disassembly of bytecode.
  */
-public class BytecodeDisassembler implements BytecodeDisassemblerProvider {
+public class BytecodeDisassembler {
 
     /**
      * Specifies if the disassembly for a single instruction can span multiple lines.
--- a/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/BytecodeDisassemblerProvider.java	Fri Jun 05 14:12:49 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2013, 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.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.jvmci.meta;
-
-/**
- * Interface for disassembling bytecode.
- */
-public interface BytecodeDisassemblerProvider {
-
-    /**
-     * Gets a textual disassembly of the bytecode for a given method. In the absence of bytecode
-     * rewriting, disassembling a method will produce the same result.
-     *
-     * @return a non-zero length string containing a disassembly of {@code method}'s bytecode or
-     *         null if {@code method} has no bytecode (i.e., {@code method.getCodeSize() == 0})
-     */
-    String disassemble(ResolvedJavaMethod method);
-}
--- a/mx/suite.py	Fri Jun 05 14:12:49 2015 +0200
+++ b/mx/suite.py	Fri Jun 05 10:50:00 2015 +0200
@@ -973,19 +973,6 @@
       "workingSets" : "Graal,Java",
     },
 
-    "com.oracle.graal.java.test" : {
-      "subDir" : "graal",
-      "sourceDirs" : ["src"],
-      "dependencies" : [
-        "com.oracle.jvmci.runtime.test",
-        "com.oracle.graal.java",
-      ],
-      "checkstyle" : "com.oracle.graal.graph",
-      "javaCompliance" : "1.8",
-      "workingSets" : "API,Graal,Test",
-      "jacoco" : "exclude",
-    },
-
     "com.oracle.graal.graphbuilderconf" : {
       "subDir" : "graal",
       "sourceDirs" : ["src"],