- if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) {
- // error! the obj is right on this core, but cannot find it
- GC_BAMBOO_DEBUGPRINT_REG(objptr);
- BAMBOO_EXIT(0xb003);
- } else {
- int hostc = hostcore(objptr);
- // check the corresponsing sharedptbl
- BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
- mgcsharedhashtbl_t * sptbl = gcrpointertbls[hostc];
- if(sptbl != NULL) {
- dstptr = mgcsharedhashSearch(sptbl, (int)objptr);
- if(dstptr != NULL) {
-#ifdef LOCALHASHTBL_TEST
- RuntimeHashadd_I(gcpointertbl, (int)objptr, (int)dstptr);
-#else
- mgchashInsert_I(gcpointertbl, (int)objptr, (int)dstptr);
-#endif
- }
- }
- BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
-
- if(dstptr == NULL) {
- // still can not get the mapping info,
- // send msg to host core for the mapping info
- gcobj2map = (int)objptr;
- gcismapped = false;
- gcmappedobj = NULL;
- // the first time require the mapping, send msg to the hostcore
- // for the mapping info
- send_msg_3(hostc, GCMAPREQUEST, (int)objptr,
- BAMBOO_NUM_OF_CORE, false);
- while(true) {
- if(gcismapped) {
- break;
- }
- }
- BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
-#ifdef LOCALHASHTBL_TEST
- RuntimeHashget(gcpointertbl, objptr, &dstptr);
-#else
- dstptr = mgchashSearch(gcpointertbl, objptr);
-#endif
- BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
- } // if(dstptr == NULL)
- } // if(hostcore(objptr) == BAMBOO_NUM_OF_CORE) else ...
- GC_BAMBOO_DEBUGPRINT_REG(dstptr);