6 public class BuildCode {
13 String localsprefix="___locals___";
14 String paramsprefix="___params___";
15 public static boolean GENERATEPRECISEGC=false;
16 public static String PREFIX="";
21 public BuildCode(State st, Hashtable temptovar, TypeUtil typeutil) {
23 this.temptovar=temptovar;
24 paramstable=new Hashtable();
25 tempstable=new Hashtable();
26 fieldorder=new Hashtable();
27 this.typeutil=typeutil;
28 virtualcalls=new Virtual(state);
31 public void buildCode() {
32 Iterator it=state.getClassSymbolTable().getDescriptorsIterator();
33 PrintWriter outclassdefs=null;
34 PrintWriter outstructs=null;
35 PrintWriter outmethodheader=null;
36 PrintWriter outmethod=null;
37 PrintWriter outvirtual=null;
40 OutputStream str=new FileOutputStream(PREFIX+"structdefs.h");
41 outstructs=new java.io.PrintWriter(str, true);
42 str=new FileOutputStream(PREFIX+"methodheaders.h");
43 outmethodheader=new java.io.PrintWriter(str, true);
44 str=new FileOutputStream(PREFIX+"classdefs.h");
45 outclassdefs=new java.io.PrintWriter(str, true);
46 str=new FileOutputStream(PREFIX+"methods.c");
47 outmethod=new java.io.PrintWriter(str, true);
48 str=new FileOutputStream(PREFIX+"virtualtable.h");
49 outvirtual=new java.io.PrintWriter(str, true);
50 } catch (Exception e) {
55 buildVirtualTables(outvirtual);
56 outstructs.println("#include \"classdefs.h\"");
57 outmethodheader.println("#include \"structdefs.h\"");
59 // Output the C declarations
60 // These could mutually reference each other
62 ClassDescriptor cn=(ClassDescriptor)it.next();
63 outclassdefs.println("struct "+cn.getSafeSymbol()+";");
65 outclassdefs.println("");
67 it=state.getClassSymbolTable().getDescriptorsIterator();
69 ClassDescriptor cn=(ClassDescriptor)it.next();
70 generateCallStructs(cn, outclassdefs, outstructs, outmethodheader);
74 outmethodheader.close();
76 /* Build the actual methods */
77 outmethod.println("#include \"methodheaders.h\"");
78 outmethod.println("#include \"virtualtable.h\"");
79 outmethod.println("#include <runtime.h>");
81 outclassdefs.println("extern int classsize[];");
82 generateSizeArray(outmethod);
84 Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
85 while(classit.hasNext()) {
86 ClassDescriptor cn=(ClassDescriptor)classit.next();
87 Iterator methodit=cn.getMethods();
88 while(methodit.hasNext()) {
89 /* Classify parameters */
90 MethodDescriptor md=(MethodDescriptor)methodit.next();
91 FlatMethod fm=state.getMethodFlat(md);
92 if (!md.getModifiers().isNative())
93 generateFlatMethod(fm,outmethod);
96 if (state.main!=null) {
97 outmethod.println("int main(int argc, const char *argv[]) {");
98 ClassDescriptor cd=typeutil.getClass(state.main);
99 Set mainset=cd.getMethodTable().getSet("main");
100 for(Iterator mainit=mainset.iterator();mainit.hasNext();) {
101 MethodDescriptor md=(MethodDescriptor)mainit.next();
102 if (md.numParameters()!=0)
104 if (!md.getModifiers().isStatic())
105 throw new Error("Error: Non static main");
106 outmethod.println(" "+cd.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"();");
109 outmethod.println("}");
114 private int maxcount=0;
116 private void buildVirtualTables(PrintWriter outvirtual) {
117 Iterator classit=state.getClassSymbolTable().getDescriptorsIterator();
118 while(classit.hasNext()) {
119 ClassDescriptor cd=(ClassDescriptor)classit.next();
120 if (virtualcalls.getMethodCount(cd)>maxcount)
121 maxcount=virtualcalls.getMethodCount(cd);
123 MethodDescriptor[][] virtualtable=new MethodDescriptor[state.numClasses()][maxcount];
125 /* Fill in virtual table */
126 classit=state.getClassSymbolTable().getDescriptorsIterator();
127 while(classit.hasNext()) {
128 ClassDescriptor cd=(ClassDescriptor)classit.next();
129 fillinRow(cd, virtualtable, cd.getId());
131 outvirtual.print("void * virtualtable[]={");
132 boolean needcomma=false;
133 for(int i=0;i<state.numClasses();i++) {
134 for(int j=0;j<maxcount;j++) {
136 outvirtual.print(", ");
137 if (virtualtable[i][j]!=null) {
138 MethodDescriptor md=virtualtable[i][j];
139 outvirtual.print("& "+md.getClassDesc().getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor());
141 outvirtual.print("0");
145 outvirtual.println("");
147 outvirtual.println("};");
151 private void fillinRow(ClassDescriptor cd, MethodDescriptor[][] virtualtable, int rownum) {
152 /* Get inherited methods */
153 if (cd.getSuperDesc()!=null)
154 fillinRow(cd.getSuperDesc(), virtualtable, rownum);
155 /* Override them with our methods */
156 for(Iterator it=cd.getMethods();it.hasNext();) {
157 MethodDescriptor md=(MethodDescriptor)it.next();
158 if (md.isStatic()||md.getReturnType()==null)
160 int methodnum=virtualcalls.getMethodNumber(md);
161 virtualtable[rownum][methodnum]=md;
165 private void generateSizeArray(PrintWriter outclassdefs) {
166 outclassdefs.print("int classsize[]={");
167 Iterator it=state.getClassSymbolTable().getDescriptorsIterator();
168 ClassDescriptor[] cdarray=new ClassDescriptor[state.numClasses()];
169 while(it.hasNext()) {
170 ClassDescriptor cd=(ClassDescriptor)it.next();
171 cdarray[cd.getId()]=cd;
173 boolean needcomma=false;
174 for(int i=0;i<state.numClasses();i++) {
176 outclassdefs.print(", ");
177 outclassdefs.print("sizeof(struct "+cdarray[i].getSafeSymbol()+")");
180 outclassdefs.println("};");
183 private void generateTempStructs(FlatMethod fm) {
184 MethodDescriptor md=fm.getMethod();
185 ParamsObject objectparams=new ParamsObject(md,tag++);
186 paramstable.put(md, objectparams);
187 for(int i=0;i<fm.numParameters();i++) {
188 TempDescriptor temp=fm.getParameter(i);
189 TypeDescriptor type=temp.getType();
190 if (type.isPtr()&&GENERATEPRECISEGC)
191 objectparams.addPtr(temp);
193 objectparams.addPrim(temp);
196 TempObject objecttemps=new TempObject(objectparams,md,tag++);
197 tempstable.put(md, objecttemps);
198 for(Iterator nodeit=fm.getNodeSet().iterator();nodeit.hasNext();) {
199 FlatNode fn=(FlatNode)nodeit.next();
200 TempDescriptor[] writes=fn.writesTemps();
201 for(int i=0;i<writes.length;i++) {
202 TempDescriptor temp=writes[i];
203 TypeDescriptor type=temp.getType();
204 if (type.isPtr()&&GENERATEPRECISEGC)
205 objecttemps.addPtr(temp);
207 objecttemps.addPrim(temp);
212 /* Force consistent field ordering between inherited classes */
213 private void printClassStruct(ClassDescriptor cn, PrintWriter classdefout) {
214 ClassDescriptor sp=cn.getSuperDesc();
216 printClassStruct(sp, classdefout);
218 if (!fieldorder.containsKey(cn)) {
219 Vector fields=new Vector();
220 fieldorder.put(cn,fields);
221 Iterator fieldit=cn.getFields();
222 while(fieldit.hasNext()) {
223 FieldDescriptor fd=(FieldDescriptor)fieldit.next();
224 if (sp==null||!sp.getFieldTable().contains(fd.getSymbol()))
228 Vector fields=(Vector)fieldorder.get(cn);
230 for(int i=0;i<fields.size();i++) {
231 FieldDescriptor fd=(FieldDescriptor)fields.get(i);
232 if (fd.getType().isClass())
233 classdefout.println(" struct "+fd.getType().getSafeSymbol()+" * "+fd.getSafeSymbol()+";");
235 classdefout.println(" "+fd.getType().getSafeSymbol()+" "+fd.getSafeSymbol()+";");
239 private void generateCallStructs(ClassDescriptor cn, PrintWriter classdefout, PrintWriter output, PrintWriter headersout) {
240 /* Output class structure */
241 classdefout.println("struct "+cn.getSafeSymbol()+" {");
242 classdefout.println(" int type;");
243 printClassStruct(cn, classdefout);
244 classdefout.println("};\n");
246 /* Cycle through methods */
247 Iterator methodit=cn.getMethods();
248 while(methodit.hasNext()) {
249 /* Classify parameters */
250 MethodDescriptor md=(MethodDescriptor)methodit.next();
251 FlatMethod fm=state.getMethodFlat(md);
252 generateTempStructs(fm);
254 ParamsObject objectparams=(ParamsObject) paramstable.get(md);
255 TempObject objecttemps=(TempObject) tempstable.get(md);
257 /* Output parameter structure */
258 if (GENERATEPRECISEGC) {
259 output.println("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params {");
260 output.println(" int type;");
261 output.println(" void * next;");
262 for(int i=0;i<objectparams.numPointers();i++) {
263 TempDescriptor temp=objectparams.getPointer(i);
264 output.println(" struct "+temp.getType().getSafeSymbol()+" * "+temp.getSafeSymbol()+";");
266 output.println("};\n");
269 /* Output temp structure */
270 if (GENERATEPRECISEGC) {
271 output.println("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_locals {");
272 output.println(" int type;");
273 output.println(" void * next;");
274 for(int i=0;i<objecttemps.numPointers();i++) {
275 TempDescriptor temp=objecttemps.getPointer(i);
276 if (temp.getType().isNull())
277 output.println(" void * "+temp.getSafeSymbol()+";");
279 output.println(" struct "+temp.getType().getSafeSymbol()+" * "+temp.getSafeSymbol()+";");
281 output.println("};\n");
284 /* Output method declaration */
285 if (md.getReturnType()!=null) {
286 if (md.getReturnType().isClass())
287 headersout.print("struct " + md.getReturnType().getSafeSymbol()+" * ");
289 headersout.print(md.getReturnType().getSafeSymbol()+" ");
291 //catch the constructor case
292 headersout.print("void ");
293 headersout.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"(");
295 boolean printcomma=false;
296 if (GENERATEPRECISEGC) {
297 headersout.print("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params * "+paramsprefix);
301 for(int i=0;i<objectparams.numPrimitives();i++) {
302 TempDescriptor temp=objectparams.getPrimitive(i);
304 headersout.print(", ");
306 if (temp.getType().isClass())
307 headersout.print("struct " + temp.getType().getSafeSymbol()+" * "+temp.getSafeSymbol());
309 headersout.print(temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol());
311 headersout.println(");\n");
315 private void generateFlatMethod(FlatMethod fm, PrintWriter output) {
316 MethodDescriptor md=fm.getMethod();
317 ClassDescriptor cn=md.getClassDesc();
318 ParamsObject objectparams=(ParamsObject)paramstable.get(md);
320 generateHeader(md,output);
322 output.println(" {");
324 if (GENERATEPRECISEGC) {
325 output.println(" struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_locals "+localsprefix+";");
327 TempObject objecttemp=(TempObject) tempstable.get(md);
328 for(int i=0;i<objecttemp.numPrimitives();i++) {
329 TempDescriptor td=objecttemp.getPrimitive(i);
330 TypeDescriptor type=td.getType();
332 output.println(" void * "+td.getSafeSymbol()+";");
333 else if (type.isClass())
334 output.println(" struct "+type.getSafeSymbol()+" * "+td.getSafeSymbol()+";");
336 output.println(" "+type.getSafeSymbol()+" "+td.getSafeSymbol()+";");
340 /* Generate labels first */
341 HashSet tovisit=new HashSet();
342 HashSet visited=new HashSet();
344 Hashtable nodetolabel=new Hashtable();
345 tovisit.add(fm.methodEntryNode());
346 FlatNode current_node=null;
349 //Node needs a label if it is
350 while(!tovisit.isEmpty()) {
351 FlatNode fn=(FlatNode)tovisit.iterator().next();
354 for(int i=0;i<fn.numNext();i++) {
355 FlatNode nn=fn.getNext(i);
358 nodetolabel.put(nn,new Integer(labelindex++));
360 if (!visited.contains(nn)&&!tovisit.contains(nn)) {
364 nodetolabel.put(nn,new Integer(labelindex++));
369 //Do the actual code generation
370 tovisit=new HashSet();
371 visited=new HashSet();
372 tovisit.add(fm.methodEntryNode());
373 while(current_node!=null||!tovisit.isEmpty()) {
374 if (current_node==null) {
375 current_node=(FlatNode)tovisit.iterator().next();
376 tovisit.remove(current_node);
378 visited.add(current_node);
379 if (nodetolabel.containsKey(current_node))
380 output.println("L"+nodetolabel.get(current_node)+":");
381 if (current_node.numNext()==0) {
383 generateFlatNode(fm, current_node, output);
384 if (current_node.kind()!=FKind.FlatReturnNode) {
385 output.println(" return;");
388 } else if(current_node.numNext()==1) {
390 generateFlatNode(fm, current_node, output);
391 FlatNode nextnode=current_node.getNext(0);
392 if (visited.contains(nextnode)) {
393 output.println("goto L"+nodetolabel.get(nextnode)+";");
396 current_node=nextnode;
397 } else if (current_node.numNext()==2) {
400 generateFlatCondBranch(fm, (FlatCondBranch)current_node, "L"+nodetolabel.get(current_node.getNext(1)), output);
401 if (!visited.contains(current_node.getNext(1)))
402 tovisit.add(current_node.getNext(1));
403 if (visited.contains(current_node.getNext(0))) {
404 output.println("goto L"+nodetolabel.get(current_node.getNext(0))+";");
407 current_node=current_node.getNext(0);
408 } else throw new Error();
410 output.println("}\n\n");
413 private String generateTemp(FlatMethod fm, TempDescriptor td) {
414 MethodDescriptor md=fm.getMethod();
415 TempObject objecttemps=(TempObject) tempstable.get(md);
416 if (objecttemps.isLocalPrim(td)||objecttemps.isParamPrim(td)) {
417 return td.getSafeSymbol();
420 if (objecttemps.isLocalPtr(td)) {
421 return localsprefix+"."+td.getSafeSymbol();
424 if (objecttemps.isParamPtr(td)) {
425 return paramsprefix+"->"+td.getSafeSymbol();
430 private void generateFlatNode(FlatMethod fm, FlatNode fn, PrintWriter output) {
433 generateFlatCall(fm, (FlatCall) fn,output);
435 case FKind.FlatFieldNode:
436 generateFlatFieldNode(fm, (FlatFieldNode) fn,output);
438 case FKind.FlatSetFieldNode:
439 generateFlatSetFieldNode(fm, (FlatSetFieldNode) fn,output);
442 generateFlatNew(fm, (FlatNew) fn,output);
444 case FKind.FlatOpNode:
445 generateFlatOpNode(fm, (FlatOpNode) fn,output);
447 case FKind.FlatCastNode:
448 generateFlatCastNode(fm, (FlatCastNode) fn,output);
450 case FKind.FlatLiteralNode:
451 generateFlatLiteralNode(fm, (FlatLiteralNode) fn,output);
453 case FKind.FlatReturnNode:
454 generateFlatReturnNode(fm, (FlatReturnNode) fn,output);
457 output.println("/* nop */");
464 private void generateFlatCall(FlatMethod fm, FlatCall fc, PrintWriter output) {
465 MethodDescriptor md=fc.getMethod();
466 ParamsObject objectparams=(ParamsObject) paramstable.get(md);
467 ClassDescriptor cn=md.getClassDesc();
469 if (GENERATEPRECISEGC) {
470 output.print(" struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params __parameterlist__={");
472 output.print(objectparams.getUID());
473 output.print(", & "+localsprefix);
474 if (fc.getThis()!=null) {
476 output.print(generateTemp(fm,fc.getThis()));
478 for(int i=0;i<fc.numArgs();i++) {
479 VarDescriptor var=md.getParameter(i);
480 TempDescriptor paramtemp=(TempDescriptor)temptovar.get(var);
481 if (objectparams.isParamPtr(paramtemp)) {
482 TempDescriptor targ=fc.getArg(i);
484 output.print(generateTemp(fm, targ));
487 output.println("};");
492 if (fc.getReturnTemp()!=null)
493 output.print(generateTemp(fm,fc.getReturnTemp())+"=");
494 if (md.isStatic()||md.getReturnType()==null||singleCall(fc.getThis().getType().getClassDesc(),md)) {
495 output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor());
499 if (md.getReturnType().isClass())
500 output.print("struct " + md.getReturnType().getSafeSymbol()+" * ");
502 output.print(md.getReturnType().getSafeSymbol()+" ");
503 output.print("(*)(");
505 boolean printcomma=false;
506 if (GENERATEPRECISEGC) {
507 output.print("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params * ");
512 for(int i=0;i<objectparams.numPrimitives();i++) {
513 TempDescriptor temp=objectparams.getPrimitive(i);
517 if (temp.getType().isClass())
518 output.print("struct " + temp.getType().getSafeSymbol()+" * ");
520 output.print(temp.getType().getSafeSymbol());
523 output.print("))virtualtable["+generateTemp(fm,fc.getThis())+"->type*"+maxcount+"+"+virtualcalls.getMethodNumber(md)+"])");
527 boolean needcomma=false;
528 if (GENERATEPRECISEGC) {
529 output.print("&__parameterlist__");
532 if (fc.getThis()!=null) {
533 output.print(generateTemp(fm,fc.getThis()));
537 for(int i=0;i<fc.numArgs();i++) {
538 VarDescriptor var=md.getParameter(i);
539 TempDescriptor paramtemp=(TempDescriptor)temptovar.get(var);
540 if (objectparams.isParamPrim(paramtemp)) {
541 TempDescriptor targ=fc.getArg(i);
544 output.print(generateTemp(fm, targ));
548 output.println(");");
549 output.println(" }");
552 private boolean singleCall(ClassDescriptor thiscd, MethodDescriptor md) {
553 Set subclasses=typeutil.getSubClasses(thiscd);
554 if (subclasses==null)
556 for(Iterator classit=subclasses.iterator();classit.hasNext();) {
557 ClassDescriptor cd=(ClassDescriptor)classit.next();
558 Set possiblematches=cd.getMethodTable().getSet(md.getSymbol());
559 for(Iterator matchit=possiblematches.iterator();matchit.hasNext();) {
560 MethodDescriptor matchmd=(MethodDescriptor)matchit.next();
561 if (md.matches(matchmd))
568 private void generateFlatFieldNode(FlatMethod fm, FlatFieldNode ffn, PrintWriter output) {
569 output.println(generateTemp(fm, ffn.getDst())+"="+ generateTemp(fm,ffn.getSrc())+"->"+ ffn.getField().getSafeSymbol()+";");
572 private void generateFlatSetFieldNode(FlatMethod fm, FlatSetFieldNode fsfn, PrintWriter output) {
573 output.println(generateTemp(fm, fsfn.getDst())+"->"+ fsfn.getField().getSafeSymbol()+"="+ generateTemp(fm,fsfn.getSrc())+";");
576 private void generateFlatNew(FlatMethod fm, FlatNew fn, PrintWriter output) {
577 output.println(generateTemp(fm,fn.getDst())+"=allocate_new("+fn.getType().getClassDesc().getId()+");");
580 private void generateFlatOpNode(FlatMethod fm, FlatOpNode fon, PrintWriter output) {
582 if (fon.getRight()!=null)
583 output.println(generateTemp(fm, fon.getDest())+" = "+generateTemp(fm, fon.getLeft())+fon.getOp().toString()+generateTemp(fm,fon.getRight())+";");
584 else if (fon.getOp().getOp()==Operation.ASSIGN)
585 output.println(generateTemp(fm, fon.getDest())+" = "+generateTemp(fm, fon.getLeft())+";");
586 else if (fon.getOp().getOp()==Operation.UNARYPLUS)
587 output.println(generateTemp(fm, fon.getDest())+" = "+generateTemp(fm, fon.getLeft())+";");
588 else if (fon.getOp().getOp()==Operation.UNARYMINUS)
589 output.println(generateTemp(fm, fon.getDest())+" = -"+generateTemp(fm, fon.getLeft())+";");
590 else if (fon.getOp().getOp()==Operation.POSTINC)
591 output.println(generateTemp(fm, fon.getDest())+" = "+generateTemp(fm, fon.getLeft())+"++;");
592 else if (fon.getOp().getOp()==Operation.POSTDEC)
593 output.println(generateTemp(fm, fon.getDest())+" = "+generateTemp(fm, fon.getLeft())+"--;");
594 else if (fon.getOp().getOp()==Operation.PREINC)
595 output.println(generateTemp(fm, fon.getDest())+" = ++"+generateTemp(fm, fon.getLeft())+";");
596 else if (fon.getOp().getOp()==Operation.PREDEC)
597 output.println(generateTemp(fm, fon.getDest())+" = --"+generateTemp(fm, fon.getLeft())+";");
599 output.println(generateTemp(fm, fon.getDest())+fon.getOp().toString()+generateTemp(fm, fon.getLeft())+";");
602 private void generateFlatCastNode(FlatMethod fm, FlatCastNode fcn, PrintWriter output) {
603 /* TODO: Make call into runtime */
604 output.println(generateTemp(fm,fcn.getDst())+"=("+fcn.getType().getSafeSymbol()+")"+generateTemp(fm,fcn.getSrc())+";");
607 private void generateFlatLiteralNode(FlatMethod fm, FlatLiteralNode fln, PrintWriter output) {
608 if (fln.getValue()==null)
609 output.println(generateTemp(fm, fln.getDst())+"=0;");
610 else if (fln.getType().getSymbol().equals(TypeUtil.StringClass))
611 output.println(generateTemp(fm, fln.getDst())+"=newstring(\""+FlatLiteralNode.escapeString((String)fln.getValue())+"\");");
612 else if (fln.getType().isBoolean()) {
613 if (((Boolean)fln.getValue()).booleanValue())
614 output.println(generateTemp(fm, fln.getDst())+"=1;");
616 output.println(generateTemp(fm, fln.getDst())+"=0;");
618 output.println(generateTemp(fm, fln.getDst())+"="+fln.getValue()+";");
621 private void generateFlatReturnNode(FlatMethod fm, FlatReturnNode frn, PrintWriter output) {
622 if (frn.getReturnTemp()!=null)
623 output.println("return "+generateTemp(fm, frn.getReturnTemp())+";");
625 output.println("return;");
628 private void generateFlatCondBranch(FlatMethod fm, FlatCondBranch fcb, String label, PrintWriter output) {
629 output.println("if (!"+generateTemp(fm, fcb.getTest())+") goto "+label+";");
632 private void generateHeader(MethodDescriptor md, PrintWriter output) {
634 ParamsObject objectparams=(ParamsObject)paramstable.get(md);
635 ClassDescriptor cn=md.getClassDesc();
637 if (md.getReturnType()!=null) {
638 if (md.getReturnType().isClass())
639 output.print("struct " + md.getReturnType().getSafeSymbol()+" * ");
641 output.print(md.getReturnType().getSafeSymbol()+" ");
643 //catch the constructor case
644 output.print("void ");
646 output.print(cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"(");
648 boolean printcomma=false;
649 if (GENERATEPRECISEGC) {
650 output.print("struct "+cn.getSafeSymbol()+md.getSafeSymbol()+"_"+md.getSafeMethodDescriptor()+"_params * "+paramsprefix);
654 for(int i=0;i<objectparams.numPrimitives();i++) {
655 TempDescriptor temp=objectparams.getPrimitive(i);
659 if (temp.getType().isClass())
660 output.print("struct "+temp.getType().getSafeSymbol()+" * "+temp.getSafeSymbol());
662 output.print(temp.getType().getSafeSymbol()+" "+temp.getSafeSymbol());