4 #include "multicoreruntime.h"
5 #include "runtime_arch.h"
6 #include "GenericHashtable.h"
7 #include "structdefs.h"
8 #include "methodheaders.h"
15 #define INLINE inline __attribute__((always_inline))
16 #endif // #ifndef INLINE
18 extern int classsize[];
19 extern int typearray[];
20 extern int typearray2[];
21 extern int* supertypes[];
24 extern struct genhashtable * activetasks;
28 extern unsigned int gcmem_mixed_threshold;
29 extern unsigned int gcmem_mixed_usedmem;
31 #endif // MULTICORE_GC
38 int instanceofif(int otype, int type) {
45 int num = supertypes[otype][0];
46 for(int i = 1; i < num + 1; i++) {
47 int t = supertypes[otype][i];
48 if(instanceofif(t, type) == 1) {
55 int instanceof(struct ___Object___ *ptr, int type) {
60 if(instanceofif(i, type) == 1) {
67 i=typearray2[i-NUMCLASSES];
73 void initializeexithandler() {
76 /* This function inject failures */
78 void injectinstructionfailure() {
79 // not supported in MULTICORE version
83 #ifdef D___Double______nativeparsedouble____L___String___
84 double CALL01(___Double______nativeparsedouble____L___String___,struct ___String___ * ___str___) {
85 /*int length=VAR(___str___)->___count___;
86 int maxlength=(length>60) ? 60 : length;
87 char str[maxlength+1];
88 struct ArrayObject * chararray=VAR(___str___)->___value___;
90 int offset=VAR(___str___)->___offset___;
91 for(i=0; i<maxlength; i++) {
92 str[i]=((short *)(((char *)&chararray->___length___)+sizeof(int)))[i+offset];
96 printf("Unimplemented Double.nativeparsedouble(S) \n");
102 #ifdef D___Double______nativeparsedouble_____AR_B_I_I
103 double CALL23(___Double______nativeparsedouble_____AR_B_I_I, int start, int length,int start,int length,struct ArrayObject * ___str___) {
104 /*int maxlength=(length>60)?60:length;
105 char str[maxlength+1];
106 struct ArrayObject * bytearray=VAR(___str___);
108 for(i=0; i<maxlength; i++) {
109 str[i]=(((char *)&bytearray->___length___)+sizeof(int))[i+start];
112 double d=atof(str);*/
113 printf("Unimplemented Double.nativeparsedouble() \n");
130 #ifdef D___Double______doubleToRawLongBits____D
131 long long CALL11(___Double______doubleToRawLongBits____D, double dval, double dval) {
135 #if defined(__IEEE_BYTES_LITTLE_ENDIAN)
136 /* On little endian ARM processors when using FPA, word order of
137 doubles is still big endian. So take that into account here. When
138 using VFP, word order of doubles follows byte order. */
140 #define SWAP_DOUBLE(a) (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
142 val.j = SWAP_DOUBLE(val.j);
149 #ifdef D___Double______longBitsToDouble____J
150 double CALL11(___Double______longBitsToDouble____J, long long lval, long long lval) {
154 #if defined(__IEEE_BYTES_LITTLE_ENDIAN)
156 #define SWAP_DOUBLE(a) (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
158 val.j = SWAP_DOUBLE(val.j);
165 #ifdef D___String______convertdoubletochar____D__AR_C
166 int CALL12(___String______convertdoubletochar____D__AR_C, double ___val___, double ___val___, struct ArrayObject * ___chararray___) {
167 int length=VAR(___chararray___)->___length___;
170 int num=snprintf(str, length, "%f",___val___);
173 for(i=0; i<length; i++) {
174 ((short *)(((char *)&VAR(___chararray___)->___length___)+sizeof(int)))[i]=(short)str[i];
179 int CALL12(___String______convertdoubletochar____D__AR_C, double ___val___, double ___val___, struct ArrayObject ___chararray___) {
184 #ifdef D___System______deepArrayCopy____L___Object____L___Object___
185 void deepArrayCopy(struct ___Object___ * dst, struct ___Object___ * src) {
186 int dsttype=((int *)dst)[0];
187 int srctype=((int *)src)[0];
188 if (dsttype<NUMCLASSES||srctype<NUMCLASSES||srctype!=dsttype)
190 struct ArrayObject *aodst=(struct ArrayObject *)dst;
191 struct ArrayObject *aosrc=(struct ArrayObject *)src;
192 int dstlength=aodst->___length___;
193 int srclength=aosrc->___length___;
194 if (dstlength!=srclength)
196 unsigned INTPTR *pointer=pointerarray[srctype];
198 int elementsize=classsize[srctype];
199 int size=srclength*elementsize;
201 memcpy(((char *)&aodst->___length___)+sizeof(int) , ((char *)&aosrc->___length___)+sizeof(int), size);
205 for(i=0;i<srclength;i++) {
206 struct ___Object___ * ptr=((struct ___Object___**)(((char*) &aosrc->___length___)+sizeof(int)))[i];
207 int ptrtype=((int *)ptr)[0];
208 if (ptrtype>=NUMCLASSES) {
209 struct ___Object___ * dstptr=((struct ___Object___**)(((char*) &aodst->___length___)+sizeof(int)))[i];
210 deepArrayCopy(dstptr,ptr);
213 ((struct ___Object___ **)(((char*) &aodst->___length___)+sizeof(int)))[i]=ptr;
219 void CALL02(___System______deepArrayCopy____L___Object____L___Object___, struct ___Object___ * ___dst___, struct ___Object___ * ___src___) {
220 deepArrayCopy(VAR(___dst___), VAR(___src___));
224 #ifdef D___System______arraycopy____L___Object____I_L___Object____I_I
225 void arraycopy(struct ___Object___ *src, int srcPos, struct ___Object___ *dst, int destPos, int length) {
226 int dsttype=((int *)dst)[0];
227 int srctype=((int *)src)[0];
229 //not an array or type mismatch
230 if (dsttype<NUMCLASSES||srctype<NUMCLASSES/*||srctype!=dsttype*/)
233 struct ArrayObject *aodst=(struct ArrayObject *)dst;
234 struct ArrayObject *aosrc=(struct ArrayObject *)src;
235 int dstlength=aodst->___length___;
236 int srclength=aosrc->___length___;
240 if (srcPos+length>srclength)
242 if (destPos+length>dstlength)
245 unsigned INTPTR *pointer=pointerarray[srctype];
247 int elementsize=classsize[srctype];
248 int size=length*elementsize;
250 memcpy(((char *)&aodst->___length___)+sizeof(int)+destPos*elementsize, ((char *)&aosrc->___length___)+sizeof(int)+srcPos*elementsize, size);
254 for(i=0;i<length;i++) {
255 struct ___Object___ * ptr=((struct ___Object___**)(((char*) &aosrc->___length___)+sizeof(int)))[i+srcPos];
256 int ptrtype=((int *)ptr)[0];
258 ((struct ___Object___ **)(((char*) &aodst->___length___)+sizeof(int)))[i+destPos]=ptr;
263 void CALL35(___System______arraycopy____L___Object____I_L___Object____I_I, int ___srcPos___, int ___destPos___, int ___length___, struct ___Object___ * ___src___, int ___srcPos___, struct ___Object___ * ___dst___, int ___destPos___, int ___length___) {
264 arraycopy(VAR(___src___), ___srcPos___, VAR(___dst___), ___destPos___, ___length___);
268 void CALL11(___System______exit____I,int ___status___, int ___status___) {
269 BAMBOO_EXIT(___status___);
272 #ifdef D___Vector______removeElement_____AR_L___Object____I_I
273 void CALL23(___Vector______removeElement_____AR_L___Object____I_I, int ___index___, int ___size___, struct ArrayObject * ___array___, int ___index___, int ___size___) {
274 char* offset=((char *)(&VAR(___array___)->___length___))+sizeof(unsigned int)+sizeof(void *)*___index___;
275 memmove(offset, offset+sizeof(void *),(___size___-___index___-1)*sizeof(void *));
279 void CALL11(___System______printI____I,int ___status___, int ___status___) {
280 BAMBOO_DEBUGPRINT(0x1111);
281 BAMBOO_DEBUGPRINT_REG(___status___);
284 long long CALL00(___System______currentTimeMillis____) {
285 // not supported in MULTICORE version
289 void CALL01(___System______printString____L___String___,struct ___String___ * ___s___) {
292 struct ArrayObject * chararray=VAR(___s___)->___value___;
294 int offset=VAR(___s___)->___offset___;
296 for(i=0; i<VAR(___s___)->___count___; i++) {
298 ((short *)(((char *)&chararray->___length___)+sizeof(int)))[i+offset];
305 /* Object allocation function */
308 void * allocate_new(void * ptr, int type) {
309 struct ___Object___ * v=
310 (struct ___Object___*)FREEMALLOC((struct garbagelist*) ptr,classsize[type]);
319 extern unsigned int gc_num_obj;
325 /* Array allocation function */
327 struct ArrayObject * allocate_newarray(void * ptr, int type, int length) {
328 struct ArrayObject * v=(struct ArrayObject *)
329 FREEMALLOC((struct garbagelist*)ptr,
330 sizeof(struct ArrayObject)+length*classsize[type]);
339 v->___length___=length;
342 extern unsigned int gc_num_obj;
349 void * allocate_new(int type) {
350 struct ___Object___ * v=FREEMALLOC(classsize[type]);
360 /* Array allocation function */
362 struct ArrayObject * allocate_newarray(int type, int length) {
363 struct ArrayObject * v=
364 FREEMALLOC(sizeof(struct ArrayObject)+length*classsize[type]);
370 v->___length___=length;
377 /* Converts C character arrays into Java strings */
379 struct ___String___ * NewString(void * ptr, const char *str,int length) {
381 struct ___String___ * NewString(const char *str,int length) {
385 struct ArrayObject * chararray=
386 allocate_newarray((struct garbagelist *)ptr, CHARARRAYTYPE, length);
387 int ptrarray[]={1, (int) ptr, (int) chararray};
388 struct ___String___ * strobj=
389 allocate_new((struct garbagelist *) &ptrarray, STRINGTYPE);
390 chararray=(struct ArrayObject *) ptrarray[2];
392 struct ArrayObject * chararray=allocate_newarray(CHARARRAYTYPE, length);
393 struct ___String___ * strobj=allocate_new(STRINGTYPE);
395 strobj->___value___=chararray;
396 strobj->___count___=length;
397 strobj->___offset___=0;
399 for(i=0; i<length; i++) {
400 ((short*)(((char*)&chararray->___length___)+sizeof(int)))[i]=(short)str[i];
405 /* Generated code calls this if we fail a bounds check */
407 void failedboundschk() {
409 printf("Array out of bounds\n");
419 printf("Array out of bounds\n");
420 longjmp(error_handler,2);
427 /* Abort task call */
431 printf("Aborting\n");
432 longjmp(error_handler,4);
435 printf("Aborting\n");
440 INLINE void initruntimedata() {
442 // initialize the arrays
443 if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
444 // startup core to initialize corestatus[]
445 for(i = 0; i < NUMCORESACTIVE; ++i) {
448 numreceiveobjs[i] = 0;
451 gcnumsendobjs[0][i] = gcnumsendobjs[1][i] = 0;
452 gcnumreceiveobjs[0][i] = gcnumreceiveobjs[1][i] = 0;
454 } // for(i = 0; i < NUMCORESACTIVE; ++i)
456 for(i = 0; i < NUMCORES4GC; ++i) {
458 gcrequiredmems[i] = 0;
460 gcfilledblocks[i] = 0;
461 } // for(i = 0; i < NUMCORES4GC; ++i)
464 gc_infoOverflow = false;
465 gc_num_livespace = 0;
466 gc_num_freespace = 0;
474 self_numsendobjs = 0;
475 self_numreceiveobjs = 0;
477 for(i = 0; i < BAMBOO_MSG_BUF_LENGTH; ++i) {
482 msglength = BAMBOO_MSG_BUF_LENGTH;
484 for(i = 0; i < BAMBOO_OUT_BUF_LENGTH; ++i) {
490 isMsgHanging = false;
493 bamboo_cur_msp = NULL;
494 bamboo_smem_size = 0;
497 bamboo_smem_zero_top = NULL;
499 gcprocessing = false;
500 gcphase = FINISHPHASE;
503 gcself_numsendobjs = 0;
504 gcself_numreceiveobjs = 0;
505 gcmarkedptrbound = 0;
506 #ifdef LOCALHASHTBL_TEST
507 gcpointertbl = allocateRuntimeHash_I(20);
509 gcpointertbl = mgchashCreate_I(2000, 0.75);
511 gcforwardobjtbl = allocateMGCHash_I(20, 3);
522 gcsbstarttbl = BAMBOO_BASE_VA;
523 bamboo_smemtbl = (void *)gcsbstarttbl
524 + (BAMBOO_SHARED_MEM_SIZE/BAMBOO_SMEM_SIZE)*sizeof(INTPTR);
525 if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) {
526 int t_size = ((BAMBOO_RMSP_SIZE)-sizeof(mgcsharedhashtbl_t)*2
527 -128*sizeof(size_t))/sizeof(mgcsharedhashlistnode_t)-2;
529 unsigned int tmp_k = 1 << (sizeof(int)*8 -1);
530 while(((t_size & tmp_k) == 0) && (kk < sizeof(int)*8)) {
531 t_size = t_size << 1;
534 t_size = tmp_k >> kk;
535 gcsharedptbl = mgcsharedhashCreate_I(t_size,0.30);
539 BAMBOO_MEMSET_WH(gcrpointertbls, 0,
540 sizeof(mgcsharedhashtbl_t *)*NUMCORES4GC);
542 gcmem_mixed_threshold = (unsigned int)((BAMBOO_SHARED_MEM_SIZE
543 -bamboo_reserved_smem*BAMBOO_SMEM_SIZE)*0.8);
544 gcmem_mixed_usedmem = 0;
549 gc_num_forwardobj = 0;
550 gc_num_profiles = NUMCORESACTIVE - 1;
553 gc_num_flush_dtlb = 0;
555 gc_localheap_s = false;
556 #ifdef GC_CACHE_ADAPT
557 gccachestage = false;
558 #endif // GC_CACHE_ADAPT
559 #endif // MULTICORE_GC
566 bamboo_current_thread = NULL;
574 INLINE void disruntimedata() {
576 #ifdef LOCALHASHTBL_TEST
577 freeRuntimeHash(gcpointertbl);
579 mgchashDelete(gcpointertbl);
581 freeMGCHash(gcforwardobjtbl);
582 #endif // MULTICORE_GC
586 BAMBOO_LOCAL_MEM_CLOSE();
587 BAMBOO_SHARE_MEM_CLOSE();
590 INLINE void checkCoreStatus() {
591 bool allStall = false;
595 (waitconfirm && (numconfirm == 0))) {
596 BAMBOO_DEBUGPRINT(0xee04);
597 BAMBOO_DEBUGPRINT_REG(waitconfirm);
598 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
599 BAMBOO_DEBUGPRINT(0xf001);
600 corestatus[BAMBOO_NUM_OF_CORE] = 0;
601 numsendobjs[BAMBOO_NUM_OF_CORE] = self_numsendobjs;
602 numreceiveobjs[BAMBOO_NUM_OF_CORE] = self_numreceiveobjs;
603 // check the status of all cores
605 BAMBOO_DEBUGPRINT_REG(NUMCORESACTIVE);
606 for(i = 0; i < NUMCORESACTIVE; ++i) {
607 BAMBOO_DEBUGPRINT(0xe000 + corestatus[i]);
608 if(corestatus[i] != 0) {
612 } // for(i = 0; i < NUMCORESACTIVE; ++i)
614 // check if the sum of send objs and receive obj are the same
615 // yes->check if the info is the latest; no->go on executing
617 for(i = 0; i < NUMCORESACTIVE; ++i) {
618 sumsendobj += numsendobjs[i];
619 BAMBOO_DEBUGPRINT(0xf000 + numsendobjs[i]);
620 } // for(i = 0; i < NUMCORESACTIVE; ++i)
621 for(i = 0; i < NUMCORESACTIVE; ++i) {
622 sumsendobj -= numreceiveobjs[i];
623 BAMBOO_DEBUGPRINT(0xf000 + numreceiveobjs[i]);
624 } // for(i = 0; i < NUMCORESACTIVE; ++i)
625 if(0 == sumsendobj) {
627 // the first time found all cores stall
628 // send out status confirm msg to all other cores
629 // reset the corestatus array too
630 BAMBOO_DEBUGPRINT(0xee05);
631 corestatus[BAMBOO_NUM_OF_CORE] = 1;
633 numconfirm = NUMCORESACTIVE - 1;
634 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
635 for(i = 1; i < NUMCORESACTIVE; ++i) {
637 // send status confirm msg to core i
638 send_msg_1(i, STATUSCONFIRM, false);
639 } // for(i = 1; i < NUMCORESACTIVE; ++i)
642 // all the core status info are the latest
643 // terminate; for profiling mode, send request to all
644 // other cores to pour out profiling data
645 BAMBOO_DEBUGPRINT(0xee06);
648 totalexetime = BAMBOO_GET_EXE_TIME() - bamboo_start_time;
651 BAMBOO_PRINT(BAMBOO_GET_EXE_TIME() - bamboo_start_time);
652 //BAMBOO_DEBUGPRINT_REG(total_num_t6); // TODO for test
654 BAMBOO_PRINT_REG(gc_num_flush_dtlb);
656 #ifndef BAMBOO_MEMPROF
657 BAMBOO_PRINT(0xbbbbbbbb);
660 // profile mode, send msgs to other cores to request pouring
661 // out progiling data
663 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
664 BAMBOO_DEBUGPRINT(0xf000);
665 for(i = 1; i < NUMCORESACTIVE; ++i) {
666 // send profile request msg to core i
667 send_msg_2(i, PROFILEOUTPUT, totalexetime, false);
668 } // for(i = 1; i < NUMCORESACTIVE; ++i)
670 // pour profiling data on startup core
674 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
675 BAMBOO_DEBUGPRINT(0xf001);
676 profilestatus[BAMBOO_NUM_OF_CORE] = 0;
677 // check the status of all cores
679 BAMBOO_DEBUGPRINT_REG(NUMCORESACTIVE);
680 for(i = 0; i < NUMCORESACTIVE; ++i) {
681 BAMBOO_DEBUGPRINT(0xe000 + profilestatus[i]);
682 if(profilestatus[i] != 0) {
686 } // for(i = 0; i < NUMCORESACTIVE; ++i)
689 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
690 BAMBOO_DEBUGPRINT(0xf000);
694 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
700 // gc_profile mode, output gc prfiling data
702 #ifdef GC_CACHE_ADAPT
703 bamboo_mask_timer_intr(); // disable the TILE_TIMER interrupt
704 #endif // GC_CACHE_ADAPT
706 gc_outputProfileData();
707 #endif // #ifdef GC_PROFILE
708 #endif // #ifdef MULTICORE_GC
710 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
711 terminate(); // All done.
712 } // if(!waitconfirm)
714 // still some objects on the fly on the network
715 // reset the waitconfirm and numconfirm
716 BAMBOO_DEBUGPRINT(0xee07);
719 } // if(0 == sumsendobj)
721 // not all cores are stall, keep on waiting
722 BAMBOO_DEBUGPRINT(0xee08);
726 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
727 BAMBOO_DEBUGPRINT(0xf000);
728 } // if((!waitconfirm) ||
731 // main function for each core
732 inline void run(int argc, char** argv) {
734 bool sendStall = false;
736 bool tocontinue = false;
738 corenum = BAMBOO_GET_NUM_OF_CORE();
739 BAMBOO_DEBUGPRINT(0xeeee);
740 BAMBOO_DEBUGPRINT_REG(corenum);
741 BAMBOO_DEBUGPRINT(STARTUPCORE);
743 // initialize runtime data structures
746 // other architecture related initialization
750 #ifdef GC_CACHE_ADAPT
751 // enable the timer interrupt
752 #ifdef GC_CACHE_SAMPLING
753 bamboo_tile_timer_set_next_event(GC_TILE_TIMER_EVENT_SETTING); // TODO
754 bamboo_unmask_timer_intr();
755 bamboo_dtlb_sampling_process();
756 #endif // GC_CACHE_SAMPLING
757 #endif // GC_CACHE_ADAPT
759 initializeexithandler();
761 // main process of the execution module
762 if(BAMBOO_NUM_OF_CORE > NUMCORESACTIVE - 1) {
764 // non-executing cores, only processing communications
770 /* Create queue of active tasks */
772 genallocatehashtable((unsigned int (*)(void *)) &hashCodetpd,
773 (int (*)(void *,void *)) &comparetpd);
775 /* Process task information */
778 if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
779 /* Create startup object */
780 createstartupobject(argc, argv);
783 BAMBOO_DEBUGPRINT(0xee00);
787 if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
788 // run the main method in the specified mainclass
789 mgc_main(argc, argv);
796 // check if need to do GC
800 #endif // MULTICORE_GC
803 // check if there are new active tasks can be executed
810 while(receiveObject() != -1) {
814 BAMBOO_DEBUGPRINT(0xee01);
816 // check if there are some pending objects,
817 // if yes, enqueue them and executetasks again
818 tocontinue = checkObjQueue();
820 tocontinue = trystartthread();
828 if(STARTUPCORE == BAMBOO_NUM_OF_CORE) {
830 BAMBOO_DEBUGPRINT(0xee03);
836 BAMBOO_DEBUGPRINT(0xee09);
841 // wait for some time
843 BAMBOO_DEBUGPRINT(0xee0a);
848 // send StallMsg to startup core
849 BAMBOO_DEBUGPRINT(0xee0b);
851 send_msg_4(STARTUPCORE, TRANSTALL, BAMBOO_NUM_OF_CORE,
852 self_numsendobjs, self_numreceiveobjs, false);
863 BAMBOO_DEBUGPRINT(0xee0c);
865 } // if(STARTUPCORE == BAMBOO_NUM_OF_CORE)
868 } // if(BAMBOO_NUM_OF_CORE > NUMCORESACTIVE - 1)
872 INLINE int checkMsgLength_I(int size) {
874 BAMBOO_DEBUGPRINT(0xcccc);
876 int type = msgdata[msgdataindex];
889 #ifdef GC_CACHE_ADAPT
891 #endif // GC_CACHE_ADAPT
892 #endif // MULTICORE_GC
906 case GCFINISHMAPINFO:
908 #ifdef GC_CACHE_ADAPT
910 #endif // GC_CACHE_ADAPT
911 #endif // MULTICORE_GC
937 case REDIRECTRELEASE:
957 case GCFINISHCOMPACT:
974 case TRANSOBJ: // nonfixed size
981 msglength = msgdata[(msgdataindex+1)&(BAMBOO_MSG_BUF_MASK)];
990 BAMBOO_DEBUGPRINT_REG(type);
991 BAMBOO_DEBUGPRINT_REG(size);
992 BAMBOO_DEBUGPRINT_REG(msgdataindex);
993 BAMBOO_DEBUGPRINT_REG(msgdatalast);
994 BAMBOO_DEBUGPRINT_REG(msgdatafull);
997 BAMBOO_DEBUGPRINT(msgdata[msgdataindex+i]);
1004 BAMBOO_DEBUGPRINT_REG(msgdata[msgdataindex]);
1005 BAMBOO_DEBUGPRINT(0xffff);
1010 INLINE void processmsg_transtall_I() {
1011 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1012 // non startup core can not receive stall msg
1014 BAMBOO_DEBUGPRINT_REG(msgdata[msgdataindex] /*[1]*/);
1016 BAMBOO_EXIT(0xe006);
1018 int num_core = msgdata[msgdataindex]; //[1]
1020 int data2 = msgdata[msgdataindex]; //[2];
1022 int data3 = msgdata[msgdataindex]; //[3];
1024 if(num_core < NUMCORESACTIVE) {
1026 BAMBOO_DEBUGPRINT(0xe881);
1028 corestatus[num_core] = 0;
1029 numsendobjs[num_core] = data2; //[2];
1030 numreceiveobjs[num_core] = data3; //[3];
1034 INLINE void processmsg_statusconfirm_I() {
1035 if((BAMBOO_NUM_OF_CORE == STARTUPCORE)
1036 || (BAMBOO_NUM_OF_CORE > NUMCORESACTIVE - 1)) {
1037 // wrong core to receive such msg
1038 BAMBOO_EXIT(0xe011);
1040 // send response msg
1042 BAMBOO_DEBUGPRINT(0xe887);
1044 // cache the msg first
1045 if(BAMBOO_CHECK_SEND_MODE()) {
1046 cache_msg_5(STARTUPCORE, STATUSREPORT,
1047 busystatus ? 1 : 0, BAMBOO_NUM_OF_CORE,
1048 self_numsendobjs, self_numreceiveobjs);
1050 send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0,
1051 BAMBOO_NUM_OF_CORE, self_numsendobjs,
1052 self_numreceiveobjs, true);
1057 INLINE void processmsg_statusreport_I() {
1058 int data1 = msgdata[msgdataindex];
1060 int data2 = msgdata[msgdataindex];
1062 int data3 = msgdata[msgdataindex];
1064 int data4 = msgdata[msgdataindex];
1066 // receive a status confirm info
1067 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1068 // wrong core to receive such msg
1070 BAMBOO_DEBUGPRINT_REG(data2);
1072 BAMBOO_EXIT(0xe012);
1075 BAMBOO_DEBUGPRINT(0xe888);
1080 corestatus[data2] = data1;
1081 numsendobjs[data2] = data3;
1082 numreceiveobjs[data2] = data4;
1086 INLINE void processmsg_terminate_I() {
1088 BAMBOO_DEBUGPRINT(0xe889);
1092 #ifdef GC_CACHE_ADAPT
1093 bamboo_mask_timer_intr(); // disable the TILE_TIMER interrupt
1094 #endif // GC_CACHE_ADAPT
1095 #endif // MULTICORE_GC
1099 INLINE void processmsg_memrequest_I() {
1100 int data1 = msgdata[msgdataindex];
1102 int data2 = msgdata[msgdataindex];
1104 // receive a shared memory request msg
1105 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1106 // wrong core to receive such msg
1108 BAMBOO_DEBUGPRINT_REG(data2);
1110 BAMBOO_EXIT(0xe013);
1113 BAMBOO_DEBUGPRINT(0xe88a);
1119 // is currently doing gc, dump this msg
1120 if(INITPHASE == gcphase) {
1121 // if still in the initphase of gc, send a startinit msg again,
1122 // cache the msg first
1123 if(BAMBOO_CHECK_SEND_MODE()) {
1124 cache_msg_1(data2, GCSTARTINIT);
1126 send_msg_1(data2, GCSTARTINIT, true);
1131 mem = smemalloc_I(data2, data1, &allocsize);
1133 // send the start_va to request core, cache the msg first
1134 if(BAMBOO_CHECK_SEND_MODE()) {
1135 cache_msg_3(data2, MEMRESPONSE, mem, allocsize);
1137 send_msg_3(data2, MEMRESPONSE, mem, allocsize, true);
1140 // if mem == NULL, the gcflag of the startup core has been set
1141 // and all the other cores have been informed to start gc
1148 INLINE void processmsg_memresponse_I() {
1149 int data1 = msgdata[msgdataindex];
1151 int data2 = msgdata[msgdataindex];
1153 // receive a shared memory response msg
1155 BAMBOO_DEBUGPRINT(0xe88b);
1158 // if is currently doing gc, dump this msg
1162 bamboo_smem_size = 0;
1165 bamboo_smem_zero_top = 0;
1169 // fill header to store the size of this mem block
1170 BAMBOO_MEMSET_WH(data1, '\0', BAMBOO_CACHE_LINE_SIZE);
1171 (*((int*)data1)) = data2;
1172 bamboo_smem_size = data2 - BAMBOO_CACHE_LINE_SIZE;
1173 bamboo_cur_msp = data1 + BAMBOO_CACHE_LINE_SIZE;
1174 bamboo_smem_zero_top = bamboo_cur_msp;
1176 bamboo_smem_size = data2;
1177 bamboo_cur_msp =(void*)(data1);
1187 INLINE void processmsg_gcstartpre_I() {
1189 // already stall for gc
1190 // send a update pregc information msg to the master core
1191 if(BAMBOO_CHECK_SEND_MODE()) {
1192 cache_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE,
1193 self_numsendobjs, self_numreceiveobjs);
1195 send_msg_4(STARTUPCORE, GCFINISHPRE, BAMBOO_NUM_OF_CORE,
1196 self_numsendobjs, self_numreceiveobjs, true);
1199 // the first time to be informed to start gc
1202 // is waiting for response of mem request
1203 // let it return NULL and start gc
1204 bamboo_smem_size = 0;
1205 bamboo_cur_msp = NULL;
1207 bamboo_smem_zero_top = NULL;
1212 INLINE void processmsg_gcstartinit_I() {
1213 gcphase = INITPHASE;
1216 INLINE void processmsg_gcstart_I() {
1218 BAMBOO_DEBUGPRINT(0xe88c);
1221 gcphase = MARKPHASE;
1224 INLINE void processmsg_gcstartcompact_I() {
1225 gcblock2fill = msgdata[msgdataindex];
1226 MSG_INDEXINC_I(); //msgdata[1];
1227 gcphase = COMPACTPHASE;
1230 INLINE void processmsg_gcstartmapinfo_I() {
1234 INLINE void processmsg_gcstartflush_I() {
1235 gcphase = FLUSHPHASE;
1238 INLINE void processmsg_gcfinishpre_I() {
1239 int data1 = msgdata[msgdataindex];
1241 int data2 = msgdata[msgdataindex];
1243 int data3 = msgdata[msgdataindex];
1245 // received a init phase finish msg
1246 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1247 // non startup core can not receive this msg
1249 BAMBOO_DEBUGPRINT_REG(data1);
1251 BAMBOO_EXIT(0xe014);
1253 // All cores should do init GC
1257 gccorestatus[data1] = 0;
1258 gcnumsendobjs[0][data1] = data2;
1259 gcnumreceiveobjs[0][data1] = data3;
1262 INLINE void processmsg_gcfinishinit_I() {
1263 int data1 = msgdata[msgdataindex];
1265 // received a init phase finish msg
1266 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1267 // non startup core can not receive this msg
1269 BAMBOO_DEBUGPRINT_REG(data1);
1271 BAMBOO_EXIT(0xe015);
1274 BAMBOO_DEBUGPRINT(0xe88c);
1275 BAMBOO_DEBUGPRINT_REG(data1);
1277 // All cores should do init GC
1278 if(data1 < NUMCORESACTIVE) {
1279 gccorestatus[data1] = 0;
1283 INLINE void processmsg_gcfinishmark_I() {
1284 int data1 = msgdata[msgdataindex];
1286 int data2 = msgdata[msgdataindex];
1288 int data3 = msgdata[msgdataindex];
1290 // received a mark phase finish msg
1291 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1292 // non startup core can not receive this msg
1294 BAMBOO_DEBUGPRINT_REG(data1);
1296 BAMBOO_EXIT(0xe016);
1298 // all cores should do mark
1299 if(data1 < NUMCORESACTIVE) {
1300 gccorestatus[data1] = 0;
1301 int entry_index = 0;
1304 entry_index = (gcnumsrobjs_index == 0) ? 1 : 0;
1307 entry_index = gcnumsrobjs_index;
1309 gcnumsendobjs[entry_index][data1] = data2;
1310 gcnumreceiveobjs[entry_index][data1] = data3;
1314 INLINE void processmsg_gcfinishcompact_I() {
1315 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1316 // non startup core can not receive this msg
1319 BAMBOO_DEBUGPRINT_REG(msgdata[msgdataindex] /*[1]*/);
1321 BAMBOO_EXIT(0xe017);
1323 int cnum = msgdata[msgdataindex];
1324 MSG_INDEXINC_I(); //msgdata[1];
1325 int filledblocks = msgdata[msgdataindex];
1326 MSG_INDEXINC_I(); //msgdata[2];
1327 int heaptop = msgdata[msgdataindex];
1328 MSG_INDEXINC_I(); //msgdata[3];
1329 int data4 = msgdata[msgdataindex];
1330 MSG_INDEXINC_I(); //msgdata[4];
1331 // only gc cores need to do compact
1332 if(cnum < NUMCORES4GC) {
1333 if(COMPACTPHASE == gcphase) {
1334 gcfilledblocks[cnum] = filledblocks;
1335 gcloads[cnum] = heaptop;
1342 if(gcfindSpareMem_I(&startaddr, &tomove, &dstcore, data4, cnum)) {
1343 // cache the msg first
1344 if(BAMBOO_CHECK_SEND_MODE()) {
1345 cache_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove);
1347 send_msg_4(cnum, GCMOVESTART, dstcore, startaddr, tomove, true);
1351 gccorestatus[cnum] = 0;
1353 } // if(cnum < NUMCORES4GC)
1356 INLINE void processmsg_gcfinishmapinfo_I() {
1357 int data1 = msgdata[msgdataindex];
1359 // received a map phase finish msg
1360 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1361 // non startup core can not receive this msg
1363 BAMBOO_DEBUGPRINT_REG(data1);
1365 BAMBOO_EXIT(0xe018);
1367 // all cores should do flush
1368 if(data1 < NUMCORES4GC) {
1369 gccorestatus[data1] = 0;
1374 INLINE void processmsg_gcfinishflush_I() {
1375 int data1 = msgdata[msgdataindex];
1377 // received a flush phase finish msg
1378 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1379 // non startup core can not receive this msg
1381 BAMBOO_DEBUGPRINT_REG(data1);
1383 BAMBOO_EXIT(0xe019);
1385 // all cores should do flush
1386 if(data1 < NUMCORESACTIVE) {
1387 gccorestatus[data1] = 0;
1391 INLINE void processmsg_gcmarkconfirm_I() {
1392 if((BAMBOO_NUM_OF_CORE == STARTUPCORE)
1393 || (BAMBOO_NUM_OF_CORE > NUMCORESACTIVE - 1)) {
1394 // wrong core to receive such msg
1395 BAMBOO_EXIT(0xe01a);
1397 // send response msg, cahce the msg first
1398 if(BAMBOO_CHECK_SEND_MODE()) {
1399 cache_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
1400 gcbusystatus, gcself_numsendobjs,
1401 gcself_numreceiveobjs);
1403 send_msg_5(STARTUPCORE, GCMARKREPORT, BAMBOO_NUM_OF_CORE,
1404 gcbusystatus, gcself_numsendobjs,
1405 gcself_numreceiveobjs, true);
1410 INLINE void processmsg_gcmarkreport_I() {
1411 int data1 = msgdata[msgdataindex];
1413 int data2 = msgdata[msgdataindex];
1415 int data3 = msgdata[msgdataindex];
1417 int data4 = msgdata[msgdataindex];
1419 // received a marked phase finish confirm response msg
1420 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1421 // wrong core to receive such msg
1423 BAMBOO_DEBUGPRINT_REG(data2);
1425 BAMBOO_EXIT(0xe01b);
1427 int entry_index = 0;
1431 entry_index = (gcnumsrobjs_index == 0) ? 1 : 0;
1433 // can never reach here
1435 entry_index = gcnumsrobjs_index;
1437 gccorestatus[data1] = data2;
1438 gcnumsendobjs[entry_index][data1] = data3;
1439 gcnumreceiveobjs[entry_index][data1] = data4;
1443 INLINE void processmsg_gcmarkedobj_I() {
1444 int data1 = msgdata[msgdataindex];
1446 // received a markedObj msg
1447 if(((int *)data1)[6] == INIT) {
1448 // this is the first time that this object is discovered,
1449 // set the flag as DISCOVERED
1450 ((int *)data1)[6] = DISCOVERED;
1451 gc_enqueue_I(data1);
1453 // set the remote flag
1454 ((int *)data1)[6] |= REMOTEM;
1455 gcself_numreceiveobjs++;
1456 gcbusystatus = true;
1459 INLINE void processmsg_gcmovestart_I() {
1461 gcdstcore = msgdata[msgdataindex];
1462 MSG_INDEXINC_I(); //msgdata[1];
1463 gcmovestartaddr = msgdata[msgdataindex];
1464 MSG_INDEXINC_I(); //msgdata[2];
1465 gcblock2fill = msgdata[msgdataindex];
1466 MSG_INDEXINC_I(); //msgdata[3];
1469 INLINE void processmsg_gcmaprequest_I() {
1470 void * dstptr = NULL;
1471 int data1 = msgdata[msgdataindex];
1473 int data2 = msgdata[msgdataindex];
1475 #ifdef LOCALHASHTBL_TEST
1476 RuntimeHashget(gcpointertbl, data1, &dstptr);
1478 dstptr = mgchashSearch(gcpointertbl, data1);
1480 if(NULL == dstptr) {
1481 // no such pointer in this core, something is wrong
1483 BAMBOO_DEBUGPRINT_REG(data1);
1484 BAMBOO_DEBUGPRINT_REG(data2);
1486 BAMBOO_EXIT(0xe01c);
1488 // send back the mapping info, cache the msg first
1489 if(BAMBOO_CHECK_SEND_MODE()) {
1490 cache_msg_3(data2, GCMAPINFO, data1, (int)dstptr);
1492 send_msg_3(data2, GCMAPINFO, data1, (int)dstptr, true);
1497 INLINE void processmsg_gcmapinfo_I() {
1498 int data1 = msgdata[msgdataindex];
1500 gcmappedobj = msgdata[msgdataindex]; // [2]
1502 #ifdef LOCALHASHTBL_TEST
1503 RuntimeHashadd_I(gcpointertbl, data1, gcmappedobj);
1505 mgchashInsert_I(gcpointertbl, data1, gcmappedobj);
1507 if(data1 == gcobj2map) {
1512 INLINE void processmsg_gcmaptbl_I() {
1513 int data1 = msgdata[msgdataindex];
1515 int data2 = msgdata[msgdataindex];
1517 gcrpointertbls[data2] = (mgcsharedhashtbl_t *)data1;
1520 INLINE void processmsg_gclobjinfo_I() {
1523 int data1 = msgdata[msgdataindex];
1525 int data2 = msgdata[msgdataindex];
1527 if(BAMBOO_NUM_OF_CORE > NUMCORES4GC - 1) {
1529 BAMBOO_DEBUGPRINT_REG(data2);
1531 BAMBOO_EXIT(0xe01d);
1533 // store the mark result info
1535 gcloads[cnum] = msgdata[msgdataindex];
1536 MSG_INDEXINC_I(); // msgdata[3];
1537 int data4 = msgdata[msgdataindex];
1539 if(gcheaptop < data4) {
1542 // large obj info here
1543 for(int k = 5; k < data1; k+=2) {
1544 int lobj = msgdata[msgdataindex];
1545 MSG_INDEXINC_I(); //msgdata[k++];
1546 int length = msgdata[msgdataindex];
1547 MSG_INDEXINC_I(); //msgdata[k++];
1548 gc_lobjenqueue_I(lobj, length, cnum);
1550 } // for(int k = 5; k < msgdata[1];)
1553 INLINE void processmsg_gclobjmapping_I() {
1554 int data1 = msgdata[msgdataindex];
1556 int data2 = msgdata[msgdataindex];
1558 #ifdef LOCALHASHTBL_TEST
1559 RuntimeHashadd_I(gcpointertbl, data1, data2);
1561 mgchashInsert_I(gcpointertbl, data1, data2);
1563 mgcsharedhashInsert_I(gcsharedptbl, data1, data2);
1567 INLINE void processmsg_gcprofiles_I() {
1568 int data1 = msgdata[msgdataindex];
1570 int data2 = msgdata[msgdataindex];
1572 int data3 = msgdata[msgdataindex];
1574 gc_num_obj += data1;
1575 gc_num_liveobj += data2;
1576 gc_num_forwardobj += data3;
1579 #endif // GC_PROFILE
1581 #ifdef GC_CACHE_ADAPT
1582 INLINE void processmsg_gcstartpref_I() {
1583 gcphase = PREFINISHPHASE;
1586 INLINE void processmsg_gcfinishpref_I() {
1587 int data1 = msgdata[msgdataindex];
1589 // received a flush phase finish msg
1590 if(BAMBOO_NUM_OF_CORE != STARTUPCORE) {
1591 // non startup core can not receive this msg
1593 BAMBOO_DEBUGPRINT_REG(data1);
1595 BAMBOO_EXIT(0xe01e);
1597 // all cores should do flush
1598 if(data1 < NUMCORESACTIVE) {
1599 gccorestatus[data1] = 0;
1602 #endif // GC_CACHE_ADAPT
1603 #endif // #ifdef MULTICORE_GC
1605 // receive object transferred from other cores
1606 // or the terminate message from other cores
1607 // Should be invoked in critical sections!!
1608 // NOTICE: following format is for threadsimulate version only
1609 // RAW version please see previous description
1610 // format: type + object
1611 // type: -1--stall msg
1613 // return value: 0--received an object
1614 // 1--received nothing
1615 // 2--received a Stall Msg
1616 // 3--received a lock Msg
1617 // RAW version: -1 -- received nothing
1618 // otherwise -- received msg type
1619 int receiveObject(int send_port_pending) {
1621 #ifdef PROFILE_INTERRUPT
1622 if(!interruptInfoOverflow) {
1623 InterruptInfo* intInfo = RUNMALLOC_I(sizeof(struct interrupt_info));
1624 interruptInfoArray[interruptInfoIndex] = intInfo;
1625 intInfo->startTime = BAMBOO_GET_EXE_TIME();
1626 intInfo->endTime = -1;
1628 #endif // PROFILE_INTERRUPT
1631 // get the incoming msgs
1632 if(receiveMsg(send_port_pending) == -1) {
1636 // processing received msgs
1638 MSG_REMAINSIZE_I(&size);
1639 if((size == 0) || (checkMsgLength_I(size) == -1)) {
1641 // have new coming msg
1642 if((BAMBOO_MSG_AVAIL() != 0) && !msgdatafull) {
1649 if(msglength <= size) {
1650 // have some whole msg
1652 type = msgdata[msgdataindex]; //[0]
1654 msgdatafull = false;
1658 // receive a object transfer msg
1659 processmsg_transobj_I();
1665 // receive a stall msg
1666 processmsg_transtall_I();
1671 // GC version have no lock msgs
1672 #ifndef MULTICORE_GC
1674 // receive lock request msg, handle it right now
1675 processmsg_lockrequest_I();
1677 } // case LOCKREQUEST
1680 // receive lock grount msg
1681 processmsg_lockgrount_I();
1683 } // case LOCKGROUNT
1686 // receive lock deny msg
1687 processmsg_lockdeny_I();
1692 processmsg_lockrelease_I();
1694 } // case LOCKRELEASE
1695 #endif // #ifndef MULTICORE_GC
1698 case PROFILEOUTPUT: {
1699 // receive an output profile data request msg
1700 processmsg_profileoutput_I();
1702 } // case PROFILEOUTPUT
1704 case PROFILEFINISH: {
1705 // receive a profile output finish msg
1706 processmsg_profilefinish_I();
1708 } // case PROFILEFINISH
1709 #endif // #ifdef PROFILE
1711 // GC version has no lock msgs
1712 #ifndef MULTICORE_GC
1713 case REDIRECTLOCK: {
1714 // receive a redirect lock request msg, handle it right now
1715 processmsg_redirectlock_I();
1717 } // case REDIRECTLOCK
1719 case REDIRECTGROUNT: {
1720 // receive a lock grant msg with redirect info
1721 processmsg_redirectgrount_I();
1723 } // case REDIRECTGROUNT
1725 case REDIRECTDENY: {
1726 // receive a lock deny msg with redirect info
1727 processmsg_redirectdeny_I();
1729 } // case REDIRECTDENY
1731 case REDIRECTRELEASE: {
1732 // receive a lock release msg with redirect info
1733 processmsg_redirectrelease_I();
1735 } // case REDIRECTRELEASE
1736 #endif // #ifndef MULTICORE_GC
1739 case STATUSCONFIRM: {
1740 // receive a status confirm info
1741 processmsg_statusconfirm_I();
1743 } // case STATUSCONFIRM
1745 case STATUSREPORT: {
1746 processmsg_statusreport_I();
1748 } // case STATUSREPORT
1751 // receive a terminate msg
1752 processmsg_terminate_I();
1757 processmsg_memrequest_I();
1759 } // case MEMREQUEST
1762 processmsg_memresponse_I();
1764 } // case MEMRESPONSE
1769 processmsg_gcstartpre_I();
1771 } // case GCSTARTPRE
1774 processmsg_gcstartinit_I();
1776 } // case GCSTARTINIT
1779 // receive a start GC msg
1780 processmsg_gcstart_I();
1784 case GCSTARTCOMPACT: {
1785 // a compact phase start msg
1786 processmsg_gcstartcompact_I();
1788 } // case GCSTARTCOMPACT
1790 case GCSTARTMAPINFO: {
1791 // received a flush phase start msg
1792 processmsg_gcstartmapinfo_I();
1794 } // case GCSTARTFLUSH
1796 case GCSTARTFLUSH: {
1797 // received a flush phase start msg
1798 processmsg_gcstartflush_I();
1800 } // case GCSTARTFLUSH
1803 processmsg_gcfinishpre_I();
1805 } // case GCFINISHPRE
1807 case GCFINISHINIT: {
1808 processmsg_gcfinishinit_I();
1810 } // case GCFINISHINIT
1812 case GCFINISHMARK: {
1813 processmsg_gcfinishmark_I();
1815 } // case GCFINISHMARK
1817 case GCFINISHCOMPACT: {
1818 // received a compact phase finish msg
1819 processmsg_gcfinishcompact_I();
1821 } // case GCFINISHCOMPACT
1823 case GCFINISHMAPINFO: {
1824 processmsg_gcfinishmapinfo_I();
1826 } // case GCFINISHMAPINFO
1828 case GCFINISHFLUSH: {
1829 processmsg_gcfinishflush_I();
1831 } // case GCFINISHFLUSH
1834 // received a GC finish msg
1835 gcphase = FINISHPHASE;
1839 case GCMARKCONFIRM: {
1840 // received a marked phase finish confirm request msg
1841 // all cores should do mark
1842 processmsg_gcmarkconfirm_I();
1844 } // case GCMARKCONFIRM
1846 case GCMARKREPORT: {
1847 processmsg_gcmarkreport_I();
1849 } // case GCMARKREPORT
1852 processmsg_gcmarkedobj_I();
1854 } // case GCMARKEDOBJ
1857 // received a start moving objs msg
1858 processmsg_gcmovestart_I();
1860 } // case GCMOVESTART
1862 case GCMAPREQUEST: {
1863 // received a mapping info request msg
1864 processmsg_gcmaprequest_I();
1866 } // case GCMAPREQUEST
1869 // received a mapping info response msg
1870 processmsg_gcmapinfo_I();
1875 // received a mapping tbl response msg
1876 processmsg_gcmaptbl_I();
1880 case GCLOBJREQUEST: {
1881 // received a large objs info request msg
1882 transferMarkResults_I();
1884 } // case GCLOBJREQUEST
1887 // received a large objs info response msg
1888 processmsg_gclobjinfo_I();
1890 } // case GCLOBJINFO
1892 case GCLOBJMAPPING: {
1893 // received a large obj mapping info msg
1894 processmsg_gclobjmapping_I();
1896 } // case GCLOBJMAPPING
1900 // received a gcprofiles msg
1901 processmsg_gcprofiles_I();
1904 #endif // GC_PROFILE
1906 #ifdef GC_CACHE_ADAPT
1908 // received a gcstartpref msg
1909 processmsg_gcstartpref_I();
1913 case GCFINISHPREF: {
1914 // received a gcfinishpref msg
1915 processmsg_gcfinishpref_I();
1918 #endif // GC_CACHE_ADAPT
1919 #endif // #ifdef MULTICORE_GC
1924 msglength = BAMBOO_MSG_BUF_LENGTH;
1926 if((msgdataindex != msgdatalast) || (msgdatafull)) {
1927 // still have available msg
1931 BAMBOO_DEBUGPRINT(0xe88d);
1934 // have new coming msg
1935 if(BAMBOO_MSG_AVAIL() != 0) {
1940 #ifdef PROFILE_INTERRUPT
1941 if(!interruptInfoOverflow) {
1942 interruptInfoArray[interruptInfoIndex]->endTime=BAMBOO_GET_EXE_TIME();
1943 interruptInfoIndex++;
1944 if(interruptInfoIndex == INTERRUPTINFOLENGTH) {
1945 interruptInfoOverflow = true;
1954 BAMBOO_DEBUGPRINT(0xe88e);