#ifdef PERFCOUNT
#include "bme_perf_counter.h"
#endif
+#ifdef MEMPERFCOUNT
+#include "memprof.h"
+#endif
extern int classsize[];
extern int typearray[];
print_statistics();
#endif
gc_outputProfileDataReadable();
+ tprintf("FINISH_EXECUTION\n");
}
#endif
BAMBOO_EXIT_APP(___status___);
}
#endif
+#ifdef D___System______numGCs____
+long long ___System______numGCs____(struct ___System______numGCs_____params * ___params___) {
+#ifdef MULTICORE_GC
+ return numGCs;
+#else
+ return 0;
+#endif
+}
+#endif
+
+#ifdef D___System______milliGcTime____
+long long CALL00(___System______milliGcTime____) {
+#ifdef MULTICORE_GC
+ return GCtime/700000;
+#else
+ return 0;
+#endif
+}
+#endif
+
+#ifdef D___System______nanoTime____
+long long CALL00(___System______nanoTime____) {
+ //TilePro64 is 700mHz
+ return ((unsigned long long)BAMBOO_GET_EXE_TIME())/700;
+}
+#endif
+
#ifdef D___System______setgcprofileflag____
void CALL00(___System______setgcprofileflag____) {
#ifdef GC_PROFILE
}
for(int i = 0; i < NUMCORES4GC; i++) {
if(i != STARTUPCORE) {
- send_msg_1_I(i,GCSTARTPRE);
+ send_msg_1(i,GCSTARTPRE);
}
}
}
}
#endif
+#ifdef D___Scanner______nextInt____
+int CALL01(___Scanner______nextInt____, struct ___Scanner___ * ___this___) {
+ int pos = VAR(___this___)->___currentpos___;
+ int i = 0;
+ unsigned char * filearray = (unsigned char *)(VAR(___this___)->___filearray___);
+ while((filearray[pos]==' ')||(filearray[pos]=='\n')){
+ pos++;
+ }
+ int value = 0;
+ bool isNeg=false;
+ int radix = 10;
+
+ if (filearray[pos]=='-') {
+ isNeg=true;
+ pos++;
+ }
+ bool cont=true;
+ do {
+ unsigned char b=filearray[pos];
+ int val;
+ if (b>='0'&&b<='9')
+ val=b-'0';
+ else if (b>='a'&&b<='z')
+ val=10+b-'a';
+ else if (b>='A'&&b<='Z')
+ val=10+b-'A';
+ else {
+ cont=false;
+ }
+ if (cont) {
+ if (val>=radix)
+ printf("Error in Scanner.nextInt(): val >= radix");
+ value=value*radix+val;
+ pos++;
+ }
+ }while(cont);
+ if (isNeg)
+ value=-value;
+
+ VAR(___this___)->___currentpos___ = pos;
+ return value;
+}
+#endif
+
+#ifdef D___Scanner______nextDouble____
+double CALL01(___Scanner______nextDouble____, struct ___Scanner___ * ___this___) {
+ int pos = VAR(___this___)->___currentpos___;
+ int i = 0;
+ unsigned char * filearray = (unsigned char *)(VAR(___this___)->___filearray___);
+ while((filearray[pos]==' ')||(filearray[pos]=='\n')){
+ pos++;
+ }
+ double value = 0.0;
+ bool isNeg=false;
+ int radix = 10;
+
+ if (filearray[pos]=='-') {
+ isNeg=true;
+ pos++;
+ } else if(filearray[pos]=='+') {
+ pos++;
+ }
+ bool cont=true;
+ // TODO
+ /*do {
+ unsigned char b=filearray[pos];
+ int val;
+ if (b>='0'&&b<='9')
+ val=b-'0';
+ else if (b>='a'&&b<='z')
+ val=10+b-'a';
+ else if (b>='A'&&b<='Z')
+ val=10+b-'A';
+ else {
+ cont=false;
+ }
+ if (cont) {
+ if (val>=radix)
+ System.error();
+ value=value*radix+val;
+ pos++;
+ }
+ }while(cont)*/
+ if (isNeg)
+ value=-value;
+
+ VAR(___this___)->___currentpos___ = pos;
+ return value;
+}
+#endif
+
/* Object allocation function */
#if defined(MULTICORE_GC)||defined(PMC_GC)
v->lockcount = 0;
#endif
initlock(v);
-#ifdef GC_PROFILE
- extern unsigned int gc_num_obj;
- gc_num_obj++;
-#endif
return v;
}
}
v->___length___=length;
initlock((struct ___Object___ *)v);
-#ifdef GC_PROFILE
- extern unsigned int gc_num_obj;
- gc_num_obj++;
-#endif
return v;
}
#endif
gc_outputProfileDataReadable();
disruntimedata();
+ tprintf("FINISH_EXECUTION\n");
BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
terminate(); // All done.
}
pmc_onceInit();
#endif
#ifdef PERFCOUNT
- profile_init(_LOCAL_DRD_CNT,_LOCAL_WR_CNT, _REMOTE_DRD_CNT, _REMOTE_WR_CNT);
+ if (BAMBOO_NUM_OF_CORE==STARTUPCORE)
+ profile_init(_LOCAL_DRD_CNT,_LOCAL_WR_CNT, _REMOTE_DRD_CNT, _REMOTE_WR_CNT);
+ else {
+ int offcore=4*(BAMBOO_NUM_OF_CORE-1);
+ profile_init(validevents[(offcore)%87], validevents[(offcore+1)%87], validevents[(offcore+2)%87], validevents[(offcore+3)%87]);
+ }
#endif
if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
numconfirm=NUMCORES-1;