Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/MethodParser.java @ 7796:6ad077b60cb3
Minor cleanup.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 15 Feb 2013 20:04:03 +0100 |
parents | 5e3d1a68664e |
children | 6b74ffe38183 |
comparison
equal
deleted
inserted
replaced
7795:ee84a187f84a | 7796:6ad077b60cb3 |
---|---|
39 | 39 |
40 public NodeData getNode() { | 40 public NodeData getNode() { |
41 return template; | 41 return template; |
42 } | 42 } |
43 | 43 |
44 protected ParameterSpec createValueParameterSpec(String valueName, NodeData nodeData) { | 44 protected ParameterSpec createValueParameterSpec(String valueName, NodeData nodeData, boolean optional) { |
45 return new ParameterSpec(valueName, nodeData, false, Cardinality.ONE); | 45 return new ParameterSpec(valueName, nodeData, optional, Cardinality.ONE); |
46 } | 46 } |
47 | 47 |
48 protected ParameterSpec createReturnParameterSpec() { | 48 protected ParameterSpec createReturnParameterSpec() { |
49 return createValueParameterSpec("operation", getNode()); | 49 return createValueParameterSpec("operation", getNode(), false); |
50 } | 50 } |
51 | 51 |
52 @Override | 52 @Override |
53 public boolean isParsable(ExecutableElement method) { | 53 public boolean isParsable(ExecutableElement method) { |
54 return Utils.findAnnotationMirror(getContext().getEnvironment(), method, getAnnotationType()) != null; | 54 return Utils.findAnnotationMirror(getContext().getEnvironment(), method, getAnnotationType()) != null; |
63 if (field.getExecutionKind() == ExecutionKind.IGNORE) { | 63 if (field.getExecutionKind() == ExecutionKind.IGNORE) { |
64 continue; | 64 continue; |
65 } | 65 } |
66 | 66 |
67 if (field.getExecutionKind() == ExecutionKind.DEFAULT) { | 67 if (field.getExecutionKind() == ExecutionKind.DEFAULT) { |
68 defaultParameters.add(createValueParameterSpec(field.getName(), field.getNodeData())); | 68 defaultParameters.add(createValueParameterSpec(field.getName(), field.getNodeData(), false)); |
69 } else if (field.getExecutionKind() == ExecutionKind.SHORT_CIRCUIT) { | 69 } else if (field.getExecutionKind() == ExecutionKind.SHORT_CIRCUIT) { |
70 String valueName = field.getName(); | 70 String valueName = field.getName(); |
71 if (shortCircuitName != null && valueName.equals(shortCircuitName)) { | 71 if (shortCircuitName != null && valueName.equals(shortCircuitName)) { |
72 break; | 72 break; |
73 } | 73 } |
74 | 74 |
75 defaultParameters.add(new ParameterSpec(shortCircuitValueName(valueName), getContext().getType(boolean.class), false)); | 75 defaultParameters.add(new ParameterSpec(shortCircuitValueName(valueName), getContext().getType(boolean.class), false)); |
76 | 76 defaultParameters.add(createValueParameterSpec(valueName, field.getNodeData(), false)); |
77 defaultParameters.add(createValueParameterSpec(valueName, field.getNodeData())); | |
78 } else { | 77 } else { |
79 assert false; | 78 assert false; |
80 } | 79 } |
81 } | 80 } |
82 | 81 |