/* jit/parseRT.c - parser and print functions for Rapid Type Analyis
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
- M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
- P. Tomsich, J. Wenninger
+ Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+ R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+ C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+ Institut f. Computersprachen - TU Wien
This file is part of CACAO.
Authors: Carolyn Oates
- $Id: parseRT.c 1416 2004-10-19 12:07:18Z carolyn $
-
-Changes:
-opcode put into functions
-changed class_findmethod class_fetchmethod
+ $Id: parseRT.c 1735 2004-12-07 14:33:27Z twisti $
*/
/***************
+ Rapid Type Static Analysis of Java program
+ used -rt option is turned on either explicitly
+ or automatically with inlining of virtuals.
USAGE:
Methods called by NATIVE methods and classes loaded dynamically
Results: (currently) with -stat see # methods marked used
-TODO: end analysis if mono- or polymorphic call (in parseRTstats)
****************/
#include <stdio.h>
#include <string.h>
-#include "tables.h"
-
-#include "loader.h"
-#include "main.h"
-#include "options.h"
-#include "statistics.h"
-#include "jit/jit.h"
-#include "jit/parse.h"
+
+#include "cacao/cacao.h"
+#include "mm/memory.h"
#include "toolbox/list.h"
-#include "toolbox/memory.h"
-#include "parseRT.h"
+#include "vm/tables.h"
+#include "vm/statistics.h"
+#include "vm/loader.h"
+#include "vm/options.h"
+#include "vm/jit/jit.h"
+#include "vm/jit/parse.h"
+#include "vm/jit/inline/parseRT.h"
+#include "vm/jit/inline/parseRTstats.h"
+
static bool firstCall= true;
static list *rtaWorkList;
FILE *rtMissed; /* Methods missed during RTA parse of Main */
-#define LAZYLOADING(class) { \
- if (!class_load(class)) \
- return 0; \
- if (!class_link(class)) \
- return 0; }
-
+bool DEBUGinf = false;
bool DEBUGr = false;
bool DEBUGopcodes = false;
-#define METHINFO(mm) \
-if (DEBUGr == true) { \
- printf("<c%i/m%i>\t",mm->class->classUsed,mm->methodUsed); \
- utf_display(mm->class->name); printf("."); fflush(stdout); \
- method_display(mm); fflush(stdout); }
-
-#define METHINFOt(mm,TXT) \
-if (DEBUGr == true) { \
- printf(TXT); \
- printf("<c%i/m%i>\t",mm->class->classUsed,mm->methodUsed); \
- utf_display(mm->class->name); printf("."); fflush(stdout); \
- method_display(mm); fflush(stdout); }
-
-#define CLASSNAME1(cls,TXT) \
-if (DEBUGr == true) {printf(TXT); \
- printf("<c%i>\t",cls->classUsed); \
- utf_display(cls->name); fflush(stdout);}
-
-#define CLASSNAMEop(cls) \
-if (DEBUGr == true) {printf("\t%s: ",opcode_names[opcode]);\
- printf("<c%i>\t",cls->classUsed); \
- utf_display(cls->name); printf("\n");fflush(stdout);}
-
-#define CLASSNAME(cls,TXT) \
-if (DEBUGr == true) { printf(TXT); \
- printf("<c%i>\t",cls->classUsed); \
- utf_display(cls->name); printf("\n");fflush(stdout);}
-
-#define SHOWOPCODE \
-if (DEBUGopcodes == true) {printf("Parse p=%i<%i< opcode=<%i> %s\n", \
- p, m->jcodelength,opcode,opcode_names[opcode]);}
-
/*********************************************************************/
void addToRtaWorkList(methodinfo *meth, char *info) {
if (!(meth->flags & ACC_ABSTRACT)) {
count_methods_marked_used++;
- METHINFOt(meth,info)
+ METHINFOt(meth,info,DEBUGopcodes)
+ if (meth->class->super != NULL) {
+ CLASSNAME(meth->class->super,"\tsuper=",DEBUGr)
+ }
+ else {
+ if (DEBUGr) printf("\tsuper=NULL\n");}
+ fflush(stdout);
meth ->methodUsed = USED;
rta = NEW(rtaNode);
rta->method = meth ;
list_addlast(rtaWorkList,rta);
+if (meth->class->classUsed == NOTUSED) {
+ METHINFOx(meth)
+ printf("\nADDED method in class not used at all!\n");
+ fflush(stdout);
+ }
}
+/***
else {
printf("Method not added to work list!!!<%i> : ",
meth->methodUsed); fflush(stdout);
- METHINFO(meth)
+ METHINFO(meth,true)
}
+***/
+}
+
+/**************************************************************************/
+void rtaMarkSubs(classinfo *class, methodinfo *topmethod);
+
+/*------------------------------------------------------------------------*/
+void rtaAddUsedInterfaceMethods(classinfo *ci) {
+ int jj,mm;
+
+ /* add used interfaces methods to callgraph */
+ for (jj=0; jj < ci -> interfacescount; jj++) {
+ classinfo *ici = ci -> interfaces [jj];
+
+ if (DEBUGinf) {
+ printf("BInterface used: ");fflush(stdout);
+ utf_display(ici->name);
+ printf("<%i>\t",ici -> classUsed ); fflush(stdout);
+ if (ici -> classUsed == NOTUSED) printf("\t classUsed=NOTUSED\n" );
+ if (ici -> classUsed == USED) printf("\t classUsed=USED\n");
+ if (ici -> classUsed == PARTUSED) printf("\t classUsed=PARTUSED\n");
+ fflush(stdout);
+ }
+ /* add class to interfaces list of classes that implement it */
+ ici -> impldBy = addElement(ici -> impldBy, ci);
+
+ /* if interface class is used */
+ if (ici -> classUsed != NOTUSED) {
+
+ /* for each interface method implementation that has already been used */
+ for (mm=0; mm< ici->methodscount; mm++) {
+ methodinfo *imi = &(ici->methods[mm]);
+ if (DEBUGinf) {
+ if (imi->methodUsed != USED) {
+ if (imi->methodUsed == NOTUSED) printf("Interface Method notused: ");
+ if (imi->methodUsed == MARKED) printf("Interface Method marked: ");
+ utf_display(ici->name);printf(".");method_display(imi);fflush(stdout);
+ }
+ }
+ if (imi->methodUsed == USED) {
+ if (DEBUGinf) {
+ printf("Interface Method used: "); utf_display(ici->name);printf(".");method_display(imi);fflush(stdout);
+
+ /* Mark this method used in the (used) implementing class and its subclasses */
+ printf("rMAY ADD methods that was used by an interface\n");
+ }
+ if ((utf_new_char("<clinit>") != imi->name) &&
+ (utf_new_char("<init>") != imi->name))
+ rtaMarkSubs(ci,imi);
+ }
+ }
+ }
+ }
+
}
+
/**************************************************************************/
/* Add Marked methods for input class ci */
/* Add methods with the same name and descriptor as implemented interfaces*/
if (ici -> classUsed != NOTUSED) {
for (mm=0; mm< ici->methodscount; mm++) {
methodinfo *imi = &(ici->methods[mm]);
+ METHINFOt(imi,"NEW IMPD INTERFACE:",DEBUGinf)
/*if interface method=method is used*/
if ( (imi->methodUsed == USED)
&& ( (imi->name == mi->name)
}
}
+#define CLINITS_T true
+#define FINALIZE_T true
+#define ADDMARKED_T true
+#define CLINITS_F false
+#define FINALIZE_F false
+#define ADDMARKED_F false
/*********************************************************************/
void addClassInit(classinfo *ci, bool clinits, bool finalizes, bool addmark)
{
if (mi) {
if (ci->classUsed != USED)
ci->classUsed = PARTUSED;
+ mi->monoPoly = MONO;
addToRtaWorkList(mi,"addTo CLINIT added:");
}
}
if (mi) {
if (ci->classUsed != USED)
ci->classUsed = PARTUSED;
+ mi->monoPoly = MONO;
addToRtaWorkList(mi,"addTo FINALIZE added:");
}
}
if (addmark) {
- /* rtaAddMarkedMethods(ci); */
+ rtaAddMarkedMethods(ci);
}
+ rtaAddUsedInterfaceMethods(ci);
}
/* See if method defined in class heirarchy */
submeth = class_resolvemethod(class, name, descriptor);
-if (submeth == NULL)
+METHINFOt(submeth,"rtaMarkMethod submeth:",DEBUGr);
+if (submeth == NULL) {
+ utf_display(class->name); printf(".");
+ METHINFOx(topmethod);
+ printf("parse RT: Method not found in class hierarchy");fflush(stdout);
panic("parse RT: Method not found in class hierarchy");
+ }
if (submeth->methodUsed == USED) return;
#undef CTA
/* Class Type Analysis if class.method in virt cone marks it used */
/* very inexact, too many extra methods */
addClassInit( submeth->class,
- true,true,true);
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
+ submeth->monoPoly = POLY;
addToRtaWorkList(submeth,
"addTo RTA VIRT CONE:");
return;
/* method defined in this class -> */
/* Class IS marked USED */
/* -> mark method as USED */
+ submeth->monoPoly = POLY;
addToRtaWorkList(submeth,
"addTo VIRT CONE 1:");
}
/* Class IS NOT marked USED (PART or NOTUSED) */
/* -> if Method NOTUSED mark method as MARKED */
METHINFOt(submeth,
- "\tmarked VIRT CONE 2:");
+ "\tmarked VIRT CONE 2:",DEBUGr);
+ submeth->monoPoly = POLY;
submeth->methodUsed = MARKED;
/* Note: if class NOTUSED and subclass is used handled */
/* by subsequent calls to rtaMarkMethods for cone */
if (submeth->class->classUsed == NOTUSED) {
submeth->class->classUsed = PARTUSED;
if (class->classUsed != USED) {
+ submeth->monoPoly = POLY;
submeth->methodUsed = MARKED;
- METHINFOt(submeth,"JUST MARKED :");
+ METHINFOt(submeth,"JUST MARKED :",DEBUGr);
}
}
/* add method to rta work list if conditions met */
- //if ( (submeth->class->classUsed == USED) ||
+ /*??if ( (submeth->class->classUsed == USED) || */
if (class->classUsed == USED) {
+ submeth->monoPoly = POLY;
addToRtaWorkList(submeth,
"addTo VIRT CONE 3:");
}
void rtaMarkSubs(classinfo *class, methodinfo *topmethod) {
/* Mark method in class */
- CLASSNAME1(class," MARKSUBS ");
- METHINFOt(topmethod," TOP ");
+ CLASSNAME1(class," MARKSUBS ",DEBUGr);
+ METHINFOt(topmethod," TOP ",DEBUGr);
rtaMarkMethod(class, topmethod);
/* Mark method in subclasses */
if (!(topmethod->flags & ACC_FINAL )) {
for (subs = class->sub;subs != NULL;subs = subs->nextsub) {
- CLASSNAME1(subs," SUBS ");
+ CLASSNAME1(subs," SUBS ",DEBUGr);
rtaMarkSubs(subs, topmethod);
}
}
subs = mi->class->impldBy;
/*RTAPRINT08invokeInterface1*/
+ if (DEBUGinf) {
+ METHINFO(mi,DEBUGinf)
+ printf("Implemented By classes :\n");fflush(stdout);
+ if (subs == NULL) printf("\tNOT IMPLEMENTED !!!\n");
+ fflush(stdout);
+ }
while (subs != NULL) {
classinfo * isubs = subs->classType;
- /*RTAPRINT09invokeInterface2*/
- /* Mark method (mark/used) in classes that implement the method */
- if (isubs->classUsed != NOTUSED) {
- methodinfo *submeth;
-
- submeth = class_findmethod(isubs,mi->name, mi->descriptor);
- if (submeth != NULL)
- submeth->monoPoly = POLY; /* poly even if nosubs */
- rtaMarkSubs(isubs, mi);
+ methodinfo *submeth;
+ if (DEBUGinf) {
+ printf("\t");utf_display(isubs->name);fflush(stdout);
+ printf(" <%i>\n",isubs->classUsed);fflush(stdout);
}
+ /*Mark method (mark/used) in classes that implement method*/
+
+ submeth = class_findmethod(isubs,mi->name, mi->descriptor);
+ if (submeth != NULL)
+ submeth->monoPoly = POLY; /* poly even if nosubs */
+ rtaMarkSubs(isubs, mi);
subs = subs->nextClass;
} /* end while */
}
+
+
+
+
+
/*********************************************************************/
int parseRT(methodinfo *m)
bool iswide = false; /* true if last instruction was a wide*/
int rc = 1;
-METHINFOt(m,"\n----RT PARSING:");
-if (DEBUGr) printf("\n");
+METHINFOt(m,"\n----RT PARSING:",DEBUGopcodes);
+if ((DEBUGr)||(DEBUGopcodes)) printf("\n");
/* scan all java instructions */
for (p = 0; p < m->jcodelength; p = nextp) {
true);
if (!fi)
- return 0; // was NULL
+ return 0; /* was NULL */
- CLASSNAME(fi->class,"\tPUTSTATIC: ");
+ CLASSNAME(fi->class,"\tPUT/GETSTATIC: ",DEBUGr);
if (!fi->class->initialized) {
m->isleafmethod = false;
}
addClassInit( fi->class,
- true,true,false);
+ CLINITS_T,FINALIZE_T,ADDMARKED_F);
}
break;
if (mi)
{
+ METHINFOt(mi,"INVOKESTAT/SPEC:: ",DEBUGopcodes)
+ mi->monoPoly = MONO;
if ((opcode == JAVA_INVOKESTATIC)
|| (mi->flags & ACC_STATIC)
|| (mi->flags & ACC_PRIVATE)
|| (mi->flags & ACC_FINAL) )
{
- if (mi->class->classUsed == NOTUSED){
- addClassInit( mi->class,
- true,true,false);
+ if (mi->class->classUsed == PARTUSED){
+ addClassInit(mi->class,
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
+ }
+ else {
+ if (mi->class->classUsed == NOTUSED){
+ addClassInit(mi->class,
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
+ if (mi->class->classUsed == NOTUSED){
+ mi->class->classUsed = PARTUSED; }
+ }
}
if (opcode == JAVA_INVOKESTATIC)
addToRtaWorkList(mi,
}
else {
/* Handle special <init> calls */
- /* RTA special case:
- call of super's <init> then
- methods of super class not all used */
/* for now same as rest */
- if (mi->class->classUsed == NOTUSED){
- if (utf_new_char("<init>")==mi->name)
- addClassInit( mi->class,
- true,true,true);
+ if (mi->class->classUsed != USED){
+ /* RTA special case:
+ call of super's <init> then
+ methods of super class not all used */
+ if (utf_new_char("<init>")==mi->name) {
+ if ((m->class->super == mi->class)
+ && (m->descriptor == utf_new_char("()V")) )
+ {
+ METHINFOt(mi,"SUPER INIT:",DEBUGopcodes);
+ /* super init */
+ addClassInit(mi->class,
+ CLINITS_T,FINALIZE_T,ADDMARKED_F);
+ if (mi->class->classUsed == NOTUSED) mi->class->classUsed = PARTUSED;
+ }
+ else {
+ METHINFOt(mi,"NORMAL INIT:",DEBUGopcodes);
+ addClassInit(mi->class,
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
+ }
+ addToRtaWorkList(mi,
+ "addTo INIT ");
+ }
if (utf_new_char("<clinit>")==mi->name)
addClassInit( mi->class,
- true,true,false);
+ CLINITS_T,FINALIZE_T,ADDMARKED_F);
+
if (!((utf_new_char("<init>")==mi->name))
- || (utf_new_char("<clinit>")==mi->name))
- METHINFOt(mi,"SPECIAL not init:")
- addClassInit( mi->class,
- true,true,true);
+ || (utf_new_char("<clinit>")==mi->name)) {
+ METHINFOt(mi,"SPECIAL not init:",DEBUGopcodes)
+ if (mi->class->classUsed !=USED)
+ mi->class->classUsed = PARTUSED;
+ addToRtaWorkList(mi,
+ "addTo SPEC notINIT ");
+ }
+ }
+ addToRtaWorkList(mi,
+ "addTo SPEC whymissed ");
- }
-
- addToRtaWorkList(mi,
- "addTo INVOKESPECIALi ");
- }
+ }
}
/*** assume if method can't be resolved won't actually be called or
there is a real error in classpath and in normal parse an exception
will be thrown. Following debug print can verify this
else from if (mi) {
-CLASSNAME1(mr->class,"CouldNOT Resolve method:");printf(".");fflush(stdout);
+CLASSNAME1(mr->class,"CouldNOT Resolve method:",,DEBUGr);printf(".");fflush(stdout);
utf_display(mr->name); printf(" "); fflush(stdout);
utf_display(mr->descriptor); printf("\n");fflush(stdout);
***/
if (mi)
{
- METHINFOt(mi,"INVOKEVIRTUAL ::");
+ METHINFOt(mi,"INVOKEVIRTUAL ::",DEBUGopcodes);
if ((mi->flags & ACC_STATIC)
|| (mi->flags & ACC_PRIVATE)
|| (mi->flags & ACC_FINAL) )
{
-printf(" not virt "); fflush(stdout);
if (mi->class->classUsed == NOTUSED){
addClassInit(mi->class,
- true,true,true);
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
}
+ mi->monoPoly = MONO;
addToRtaWorkList(mi,
"addTo INVOKEVIRTUAL ");
}
}
}
else {
-CLASSNAME1(mr->class,"CouldNOT Resolve virt meth:");printf(".");fflush(stdout);
+CLASSNAME1(mr->class,"CouldNOT Resolve virt meth:",DEBUGr);printf(".");fflush(stdout);
utf_display(mr->name); printf(" "); fflush(stdout);
utf_display(mr->descriptor); printf("\n");fflush(stdout);
}
false);
if (mi)
{
- METHINFOt(mi,"\tINVOKEINTERFACE: ")
+ METHINFOt(mi,"\tINVOKEINTERFACE: ",DEBUGopcodes)
rtaMarkInterfaceSubs(mi);
}
/* see INVOKESTATIC for explanation about */
/* case when Interface is not resolved */
- //descriptor2types(mi); ?? do need paramcnt?
+ /*descriptor2types(mi);
+ ?? do need paramcnt? for RTA (or just XTA)*/
}
break;
classinfo *ci;
ci = class_getconstant(m->class, i, CONSTANT_Class);
m->isleafmethod = false; /* why for new ? */
- // s_count++; look for s_counts for VTA
- //ci->classUsed=USED;
+ /*** s_count++; look for s_counts for VTA */
+ /***ci->classUsed=USED; */
/* add marked methods */
- CLASSNAME(ci,"NEW : do nothing");
+ CLASSNAME(ci,"NEW : do nothing",DEBUGr);
+ addClassInit(ci, CLINITS_T, FINALIZE_T,ADDMARKED_T);
}
break;
(classinfo *)
class_getconstant(m->class, i, CONSTANT_Class);
LAZYLOADING(cls)
- CLASSNAMEop(cls);
- }
+ CLASSNAMEop(cls,DEBUGr);
+ if (cls->classUsed == NOTUSED){
+ addClassInit(cls,
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);
+ }
+ }
break;
default:
c, \
false); \
if (callmeth->class->classUsed != USED) { \
+ c->classUsed = PARTUSED; \
addClassInit(callmeth->class, \
- true,true,true);\
+ CLINITS_T,FINALIZE_T,ADDMARKED_T);\
} \
+ callmeth->monoPoly = POLY; \
addToRtaWorkList(callmeth,txt);
and
rtMissedIn list (missed becaused called from NATIVE &/or dynamic calls
--*/
-int initializeRTAworklist(methodinfo *m) {
+methodinfo *initializeRTAworklist(methodinfo *m) {
classinfo *c;
methodinfo* callmeth;
char systxt[] = "System Call :";
FILE *rtMissedIn; /* Methods missed during previous RTA parse */
char line[256];
char* class, *meth, *desc;
- char filename[256] = "rtMissed";
+ methodinfo *rm =NULL; /* return methodinfo ptr to main method */
+
/* Create RTA call work list */
rtaWorkList = NEW(list);
/* Add system called methods */
SYSADD(mainstring, "main","([Ljava/lang/String;)V",systxt)
- SYSADD("java/lang/Runtime","getRuntime","()Ljava/lang/Runtime;",systxt)
- SYSADD("java/lang/Runtime","exit","(I)V",systxt)
-
+ rm = callmeth;
+ SYSADD("java/lang/System","exit","(I)V",systxt)
/*----- rtMissedIn 0 */
if ( (rtMissedIn = fopen("rtMissedIn0", "r")) == NULL) {
- //if (verbose)
+ /*if (opt_verbose) */
{printf("No rtMissedIn0 file\n");fflush(stdout);}
- return 0;
+ return rm;
}
while (getline(line,256,rtMissedIn)) {
class = strtok(line, " \n");
}
fclose(rtMissedIn);
+
+
+
+ return rm;
+
+}
+
+/*- end initializeRTAworklist-------- */
+
+
+
+methodinfo *missedRTAworklist()
+{
+ FILE *rtMissedIn; /* Methods missed during previous RTA parse */
+ char filenameIn[256] = "rtIn/";
+ char line[256];
+ char* class, *meth, *desc;
+ char missedtxt[] = "rtIn/ missed Call :";
+ classinfo *c;
+ methodinfo* callmeth;
+
+ methodinfo *rm =NULL; /* return methodinfo ptr to main method */
+
/*----- rtMissedIn pgm specific */
- strcat(filename, (const char *)mainstring);
-printf("filename=%s=\n",filename);fflush(stdout);
- if ( (rtMissedIn = fopen(filename, "r")) == NULL) {
- //if (verbose)
- {printf("No rtMissedIn file\n");fflush(stdout);}
- return 0;
+ strcat(filenameIn, (const char *)mainstring);
+ if ( (rtMissedIn = fopen(filenameIn, "r")) == NULL) {
+ /*if (opt_verbose)*/
+ {printf("No rtIn/=%s file\n",filenameIn);fflush(stdout);}
+ return rm;
}
while (getline(line,256,rtMissedIn)) {
class = strtok(line, " \n");
meth = strtok(NULL, " \n");
desc = strtok(NULL, " \n");
- SYSADD(class,meth,desc,missedtxt)
+ if ((class == NULL) || (meth == NULL) || (desc == NULL)) {
+ fprintf(stderr,"Error in rtMissedIn file for: %s.%s %s\n",class, meth, desc);
+ fflush(stderr);
+ panic ("Error in rtMissedIn file for: class.meth, desc\n");
}
+ SYSADD(class,meth,desc,missedtxt)
+ }
fclose(rtMissedIn);
- return 0;
+ return rm;
}
-/*- end initializeRTAworklist-------- */
+/*--------------------------------------------------------*/
+/* parseRTmethod */
+/* input: method to be RTA static parsed */
+/*--------------------------------------------------------*/
+void parseRTmethod(methodinfo *rt_method) {
+ if (! ( (rt_method->flags & ACC_NATIVE )
+ || (rt_method->flags & ACC_ABSTRACT) ) )
+ {
+ /* RTA parse to approxmate....
+ what classes/methods will really be used during execution */
+ parseRT(rt_method);
+ }
+ else {
+ if (rt_method->flags & ACC_NATIVE )
+ {
+ METHINFOt(rt_method,"TO BE NATIVE RTA PARSED :",DEBUGopcodes);
+ /* parseRTpseudo(rt_method); */
+ }
+ else {
+ printf("Abstract method in RTA Work List: ");
+ METHINFOx(rt_method);
+ panic("Abstract method in RTA Work List.");
+ }
+ }
+}
+
+
/*-- RTA -- *******************************************************/
int RT_jit_parse(methodinfo *m)
{
- methodinfo *rt_method;
rtaNode *rta;
+ methodinfo *mainmeth;
/* Should only be called once */
if (firstCall) {
- firstCall = false; /* turn flag off */
/*----- RTA initializations --------*/
- if (verbose)
+ if (opt_verbose)
log_text("RTA static analysis started.\n");
- initializeRTAworklist(m);
+ mainmeth = initializeRTAworklist(m);
+ firstCall = false; /* turn flag off */
if ( (rtMissed = fopen("rtMissed", "w")) == NULL) {
printf("CACAO - rtMissed file: cant open file to write\n");
rta != NULL;
rta =list_next(rtaWorkList,rta))
{
- rt_method = rta->method;
- if (! ( (rt_method->flags & ACC_NATIVE )
- || (rt_method->flags & ACC_ABSTRACT) ) )
- {
- /* RTA parse to approxmate....
- what classes/methods will really be used during execution */
- parseRT(rt_method);
- }
- else {
- if (rt_method->flags & ACC_NATIVE )
- {
- METHINFOt(rt_method,"TO BE NATIVE RTA PARSED :")
- /* parseRTpseudo(rt_method); */
- }
- else {
- printf("Abstract method in RTA Work List: ");
- METHINFO(rt_method);
- panic("Abstract method in RTA Work List.");
- }
- }
+ parseRTmethod(rta->method);
}
+ missedRTAworklist();
+ for (rta =list_first(rtaWorkList);
+ rta != NULL;
+ rta =list_next(rtaWorkList,rta))
+ {
+ parseRTmethod(rta->method);
+ }
+
fclose(rtMissed);
- if (verbose) {
+ if (opt_verbose) {
+ if (opt_stat) {
+ printRThierarchyInfo(m);
+ }
+ printCallgraph(rtaWorkList);
+ }
+
+ if (opt_verbose) {
log_text("RTA static analysis done.\n");
}
}
* tab-width: 4
* End:
*/
+