comparison graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/TemplateMethod.java @ 7847:06a7cd6aaf00

Casting is now done on demand using local variables for explicit guards.
author Christian Humer <christian.humer@gmail.com>
date Tue, 19 Feb 2013 17:20:45 +0100
parents 6343a09b2ec1
children 6b74ffe38183
comparison
equal deleted inserted replaced
7846:91cc98eae8ee 7847:06a7cd6aaf00
38 this.specification = specification; 38 this.specification = specification;
39 this.method = method; 39 this.method = method;
40 this.markerAnnotation = markerAnnotation; 40 this.markerAnnotation = markerAnnotation;
41 this.returnType = returnType; 41 this.returnType = returnType;
42 this.parameters = parameters; 42 this.parameters = parameters;
43
44 if (parameters != null) {
45 for (ActualParameter param : parameters) {
46 param.setMethod(this);
47 }
48 }
43 } 49 }
44 50
45 public TemplateMethod(TemplateMethod method) { 51 public TemplateMethod(TemplateMethod method) {
46 this.template = method.template; 52 this(method.template, method.specification, method.method, method.markerAnnotation, method.returnType, method.parameters);
47 this.specification = method.specification;
48 this.method = method.method;
49 this.markerAnnotation = method.markerAnnotation;
50 this.returnType = method.returnType;
51 this.parameters = method.parameters;
52 } 53 }
53 54
54 public Template getTemplate() { 55 public Template getTemplate() {
55 return template; 56 return template;
56 } 57 }
99 100
100 @Override 101 @Override
101 public String toString() { 102 public String toString() {
102 return getClass().getSimpleName() + " [method = " + method + "]"; 103 return getClass().getSimpleName() + " [method = " + method + "]";
103 } 104 }
105
106 public ActualParameter getPreviousParam(ActualParameter searchParam) {
107 ActualParameter prev = null;
108 for (ActualParameter param : getParameters()) {
109 if (param == searchParam) {
110 return prev;
111 }
112 prev = param;
113 }
114 return prev;
115 }
104 } 116 }