# HG changeset patch # User Christian Wimmer # Date 1349821965 25200 # Node ID 31aa76ffd3bbbcc32a80a7f3646be2419ce4b322 # Parent 2463eb24b6443c9b686ef805e203d9cb723cd278 Rename project graal.api to graal.api.runtime diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api.runtime/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.runtime/overview.html Tue Oct 09 15:32:45 2012 -0700 @@ -0,0 +1,36 @@ + + + + + + + + +Documentation for the com.oracle.graal.api project. + + + diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/Graal.java Tue Oct 09 15:32:45 2012 -0700 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2012, 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.api.runtime; + +public class Graal { + + private static GraalRuntime runtime; + + private static native GraalRuntime initializeRuntime(); + + public static GraalRuntime getRuntime() { + return runtime; + } + + static { + try { + runtime = initializeRuntime(); + } catch (UnsatisfiedLinkError e) { + runtime = new GraalRuntime() { + @Override + public String getName() { + return ""; + } + @Override + public T getCapability(Class clazz) { + return null; + } + }; + } + } + + public static T getRequiredCapability(Class clazz) { + T t = getRuntime().getCapability(clazz); + if (t == null) { + throw new IllegalAccessError("Runtime does not expose required capability " + clazz.getName()); + } + return t; + } +} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/GraalRuntime.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.runtime/src/com/oracle/graal/api/runtime/GraalRuntime.java Tue Oct 09 15:32:45 2012 -0700 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2012, 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.api.runtime; + + +public interface GraalRuntime { + String getName(); + T getCapability(Class clazz); +} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api.test/src/com/oracle/graal/api/GraalTest.java --- a/graal/com.oracle.graal.api.test/src/com/oracle/graal/api/GraalTest.java Tue Oct 09 15:23:38 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2012, 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.api; - -import static org.junit.Assert.*; - -import org.junit.*; - - -public class GraalTest { - - @Test - public void testRuntimeAvailable() { - assertNotNull(Graal.getRuntime()); - System.out.println(Graal.getRuntime().getClass()); - } - - @Test - public void testRuntimeNamed() { - assertNotNull(Graal.getRuntime().getName()); - System.out.println(Graal.getRuntime().getName()); - } -} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/GraalTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.test/src/com/oracle/graal/api/test/GraalTest.java Tue Oct 09 15:32:45 2012 -0700 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2012, 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.api.test; + +import static org.junit.Assert.*; + +import org.junit.*; + +import com.oracle.graal.api.runtime.*; + + +public class GraalTest { + + @Test + public void testRuntimeAvailable() { + assertNotNull(Graal.getRuntime()); + System.out.println(Graal.getRuntime().getClass()); + } + + @Test + public void testRuntimeNamed() { + assertNotNull(Graal.getRuntime().getName()); + System.out.println(Graal.getRuntime().getName()); + } +} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api/overview.html --- a/graal/com.oracle.graal.api/overview.html Tue Oct 09 15:23:38 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ - - - - - - - - -Documentation for the com.oracle.graal.api project. - - - diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api/src/com/oracle/graal/api/Graal.java --- a/graal/com.oracle.graal.api/src/com/oracle/graal/api/Graal.java Tue Oct 09 15:23:38 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2012, 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.api; - -public class Graal { - - private static GraalRuntime runtime; - - private static native GraalRuntime initializeRuntime(); - - public static GraalRuntime getRuntime() { - return runtime; - } - - static { - try { - runtime = initializeRuntime(); - } catch (UnsatisfiedLinkError e) { - runtime = new GraalRuntime() { - @Override - public String getName() { - return ""; - } - @Override - public T getCapability(Class clazz) { - return null; - } - }; - } - } - - public static T getRequiredCapability(Class clazz) { - T t = getRuntime().getCapability(clazz); - if (t == null) { - throw new IllegalAccessError("Runtime does not expose required capability " + clazz.getName()); - } - return t; - } -} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.api/src/com/oracle/graal/api/GraalRuntime.java --- a/graal/com.oracle.graal.api/src/com/oracle/graal/api/GraalRuntime.java Tue Oct 09 15:23:38 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2012, 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.api; - - -public interface GraalRuntime { - String getName(); - T getCapability(Class clazz); -} diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.boot/src/com/oracle/graal/boot/BootImageGenerator.java --- a/graal/com.oracle.graal.boot/src/com/oracle/graal/boot/BootImageGenerator.java Tue Oct 09 15:23:38 2012 -0700 +++ b/graal/com.oracle.graal.boot/src/com/oracle/graal/boot/BootImageGenerator.java Tue Oct 09 15:32:45 2012 -0700 @@ -26,6 +26,7 @@ import com.oracle.graal.api.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.boot.meta.*; diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue Oct 09 15:23:38 2012 -0700 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue Oct 09 15:32:45 2012 -0700 @@ -31,6 +31,7 @@ import com.oracle.graal.api.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.debug.*; import com.oracle.graal.graph.*; diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Tue Oct 09 15:23:38 2012 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Tue Oct 09 15:32:45 2012 -0700 @@ -28,6 +28,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.interpreter.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.hotspot.bridge.*; import com.oracle.graal.hotspot.logging.*; diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java --- a/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Tue Oct 09 15:23:38 2012 -0700 +++ b/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Tue Oct 09 15:32:45 2012 -0700 @@ -28,6 +28,7 @@ import com.oracle.graal.api.*; import com.oracle.graal.api.interpreter.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.bytecode.*; /** diff -r 2463eb24b644 -r 31aa76ffd3bb graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java --- a/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java Tue Oct 09 15:23:38 2012 -0700 +++ b/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/WordTest.java Tue Oct 09 15:32:45 2012 -0700 @@ -29,6 +29,7 @@ import com.oracle.graal.api.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; diff -r 2463eb24b644 -r 31aa76ffd3bb mx/projects --- a/mx/projects Tue Oct 09 15:23:38 2012 -0700 +++ b/mx/projects Tue Oct 09 15:32:45 2012 -0700 @@ -22,16 +22,16 @@ library@DACAPO_SCALA@path=lib/dacapo-scala-0.1.0.jar library@DACAPO_SCALA@urls=http://repo.scalabench.org/snapshots/org/scalabench/benchmarks/scala-benchmark-suite/0.1.0-SNAPSHOT/scala-benchmark-suite-0.1.0-20110908.085753-2.jar -# graal.api -project@com.oracle.graal.api@subDir=graal -project@com.oracle.graal.api@sourceDirs=src -project@com.oracle.graal.api@checkstyle=com.oracle.graal.graph -project@com.oracle.graal.api@javaCompliance=1.7 +# graal.api.runtime +project@com.oracle.graal.api.runtime@subDir=graal +project@com.oracle.graal.api.runtime@sourceDirs=src +project@com.oracle.graal.api.runtime@checkstyle=com.oracle.graal.graph +project@com.oracle.graal.api.runtime@javaCompliance=1.7 # graal.api.test project@com.oracle.graal.api.test@subDir=graal project@com.oracle.graal.api.test@sourceDirs=src -project@com.oracle.graal.api.test@dependencies=JUNIT,com.oracle.graal.api +project@com.oracle.graal.api.test@dependencies=JUNIT,com.oracle.graal.api.runtime project@com.oracle.graal.api.test@checkstyle=com.oracle.graal.graph project@com.oracle.graal.api.test@javaCompliance=1.7 @@ -58,7 +58,7 @@ # graal.hotspot project@com.oracle.graal.hotspot@subDir=graal project@com.oracle.graal.hotspot@sourceDirs=src -project@com.oracle.graal.hotspot@dependencies=com.oracle.graal.snippets,com.oracle.graal.api.interpreter,com.oracle.graal.api,com.oracle.graal.printer +project@com.oracle.graal.hotspot@dependencies=com.oracle.graal.snippets,com.oracle.graal.api.interpreter,com.oracle.graal.api.runtime,com.oracle.graal.printer project@com.oracle.graal.hotspot@checkstyle=com.oracle.graal.graph project@com.oracle.graal.hotspot@javaCompliance=1.7 @@ -140,7 +140,7 @@ # graal.interpreter project@com.oracle.graal.interpreter@subDir=graal project@com.oracle.graal.interpreter@sourceDirs=src -project@com.oracle.graal.interpreter@dependencies=com.oracle.graal.api.interpreter,com.oracle.graal.bytecode,com.oracle.graal.api +project@com.oracle.graal.interpreter@dependencies=com.oracle.graal.api.interpreter,com.oracle.graal.bytecode,com.oracle.graal.api.runtime project@com.oracle.graal.interpreter@checkstyle=com.oracle.graal.graph project@com.oracle.graal.interpreter@javaCompliance=1.7 @@ -189,7 +189,7 @@ # graal.boot project@com.oracle.graal.boot@subDir=graal project@com.oracle.graal.boot@sourceDirs=src -project@com.oracle.graal.boot@dependencies=com.oracle.graal.java,com.oracle.graal.api,com.oracle.graal.phases.common +project@com.oracle.graal.boot@dependencies=com.oracle.graal.java,com.oracle.graal.api.runtime,com.oracle.graal.phases.common project@com.oracle.graal.boot@checkstyle=com.oracle.graal.graph project@com.oracle.graal.boot@javaCompliance=1.7 @@ -223,7 +223,7 @@ # graal.compiler.test project@com.oracle.graal.compiler.test@subDir=graal project@com.oracle.graal.compiler.test@sourceDirs=src -project@com.oracle.graal.compiler.test@dependencies=JUNIT,com.oracle.graal.compiler,com.oracle.graal.java,com.oracle.graal.api +project@com.oracle.graal.compiler.test@dependencies=JUNIT,com.oracle.graal.compiler,com.oracle.graal.java,com.oracle.graal.api.runtime project@com.oracle.graal.compiler.test@checkstyle=com.oracle.graal.graph project@com.oracle.graal.compiler.test@javaCompliance=1.7