Search in sources :

Example 6 with MethodSpec

use of com.oracle.truffle.dsl.processor.model.MethodSpec in project graal by oracle.

the class TypeCheckParser method createSpecification.

@Override
public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) {
    MethodSpec spec = new MethodSpec(new ParameterSpec("returnType", getContext().getType(boolean.class)));
    spec.addRequired(new ParameterSpec("value", getContext().getType(Object.class)));
    return spec;
}
Also used : MethodSpec(com.oracle.truffle.dsl.processor.model.MethodSpec) ParameterSpec(com.oracle.truffle.dsl.processor.model.ParameterSpec)

Example 7 with MethodSpec

use of com.oracle.truffle.dsl.processor.model.MethodSpec in project graal by oracle.

the class ImplicitCastParser method createSpecification.

@Override
public MethodSpec createSpecification(ExecutableElement method, AnnotationMirror mirror) {
    MethodSpec spec = new MethodSpec(new ParameterSpec("target", getContext().getType(Object.class)));
    spec.addRequired(new ParameterSpec("source", getContext().getType(Object.class))).setSignature(true);
    return spec;
}
Also used : MethodSpec(com.oracle.truffle.dsl.processor.model.MethodSpec) ParameterSpec(com.oracle.truffle.dsl.processor.model.ParameterSpec)

Example 8 with MethodSpec

use of com.oracle.truffle.dsl.processor.model.MethodSpec in project graal by oracle.

the class NodeMethodParser method createDefaultMethodSpec.

@SuppressWarnings("unused")
protected final MethodSpec createDefaultMethodSpec(ExecutableElement method, AnnotationMirror mirror, boolean shortCircuitsEnabled, String shortCircuitName) {
    MethodSpec methodSpec = new MethodSpec(createReturnParameterSpec());
    addDefaultFrame(methodSpec);
    addDefaultFieldMethodSpec(methodSpec);
    addDefaultChildren(shortCircuitName, methodSpec);
    return methodSpec;
}
Also used : MethodSpec(com.oracle.truffle.dsl.processor.model.MethodSpec)

Aggregations

MethodSpec (com.oracle.truffle.dsl.processor.model.MethodSpec)8 ParameterSpec (com.oracle.truffle.dsl.processor.model.ParameterSpec)5 TypeMirror (javax.lang.model.type.TypeMirror)3 ArrayCodeTypeMirror (com.oracle.truffle.dsl.processor.java.model.CodeTypeMirror.ArrayCodeTypeMirror)1 CodeVariableElement (com.oracle.truffle.dsl.processor.java.model.CodeVariableElement)1 CachedParameterSpec (com.oracle.truffle.dsl.processor.model.CachedParameterSpec)1 NodeChildData (com.oracle.truffle.dsl.processor.model.NodeChildData)1 SpecializationData (com.oracle.truffle.dsl.processor.model.SpecializationData)1 TemplateMethod (com.oracle.truffle.dsl.processor.model.TemplateMethod)1 ArrayList (java.util.ArrayList)1 VariableElement (javax.lang.model.element.VariableElement)1