# HG changeset patch # User Christian Humer # Date 1407765467 -7200 # Node ID 9f38d222fa6c741531a8a9573e099f4d810deb49 # Parent 23415229349b16be51f58f3acff9ffcc6e2e25ae Truffle-DSL: renamed @Generic to @Fallback. diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/AssumptionsTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -53,7 +53,7 @@ return 42; } - @Generic + @Fallback Object doFallBack() { return "42"; } @@ -86,7 +86,7 @@ return "41"; } - @Generic + @Fallback Object doFallBack() { return "42"; } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/BinaryNodeTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/BinaryNodeTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/BinaryNodeTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -60,7 +60,7 @@ return left + right; } - @Generic + @Fallback Object add(Object left, Object right) { return convertDouble(left) + convertDouble(right); } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/FallbackTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -58,7 +58,7 @@ return "(int)"; } - @Generic + @Fallback String f2(Object a) { return "(fallback)"; } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/MethodGuardsTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/MethodGuardsTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/MethodGuardsTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -77,7 +77,7 @@ return value0 + value1; } - @Generic + @Fallback int doGeneric(Object value0, Object value1) { genericInvocations++; return 42; // the generic answer to all questions @@ -111,7 +111,7 @@ return 41; } - @Generic + @Fallback int doGeneric(Object value0) { return 42; // the generic answer to all questions } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -108,7 +108,7 @@ return a; } - @Generic + @Fallback String add(Object left) { throw new AssertionError(left.toString()); } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SpecializationFallthroughTest.java --- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SpecializationFallthroughTest.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SpecializationFallthroughTest.java Mon Aug 11 15:57:47 2014 +0200 @@ -52,7 +52,7 @@ return a; } - @Generic + @Fallback Object doFallback(Object a) { return a; } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Fallback.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Fallback.java Mon Aug 11 15:57:47 2014 +0200 @@ -0,0 +1,36 @@ +/* + * 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * 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.truffle.api.dsl; + +import java.lang.annotation.*; + +/** + * + */ +@Retention(RetentionPolicy.CLASS) +@Target({ElementType.METHOD}) +public @interface Fallback { + +} diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Generic.java --- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Generic.java Mon Aug 11 15:57:14 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +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. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * 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.truffle.api.dsl; - -import java.lang.annotation.*; - -/** - * - */ -@Retention(RetentionPolicy.CLASS) -@Target({ElementType.METHOD}) -public @interface Generic { - -} diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/GenericParser.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/GenericParser.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/GenericParser.java Mon Aug 11 15:57:47 2014 +0200 @@ -63,7 +63,7 @@ @Override public Class getAnnotationType() { - return Generic.class; + return Fallback.class; } } diff -r 23415229349b -r 9f38d222fa6c graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java --- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Mon Aug 11 15:57:14 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Mon Aug 11 15:57:47 2014 +0200 @@ -42,7 +42,7 @@ public class NodeParser extends AbstractParser { - public static final List> ANNOTATIONS = Arrays.asList(Generic.class, TypeSystemReference.class, ShortCircuit.class, Specialization.class, NodeChild.class, + public static final List> ANNOTATIONS = Arrays.asList(Fallback.class, TypeSystemReference.class, ShortCircuit.class, Specialization.class, NodeChild.class, NodeChildren.class); private Map parsedNodes; @@ -923,7 +923,7 @@ if (generics.size() == 1 && node.getSpecializations().size() == 1) { // TODO this limitation should be lifted for (SpecializationData generic : generics) { - generic.addError("@%s defined but no @%s.", Generic.class.getSimpleName(), Specialization.class.getSimpleName()); + generic.addError("@%s defined but no @%s.", Fallback.class.getSimpleName(), Specialization.class.getSimpleName()); } } @@ -932,7 +932,7 @@ } else { if (generics.size() > 1) { for (SpecializationData generic : generics) { - generic.addError("Only @%s is allowed per operation.", Generic.class.getSimpleName()); + generic.addError("Only one @%s is allowed per operation.", Fallback.class.getSimpleName()); } } }