+
+ /* do not change instack Stackslots */
+ /* it won't improve performance if we copy the interface */
+ /* at the BB begin or here, and lsra relies that no */
+ /* instack stackslot is marked LOCALVAR */
+ if (curstack->varkind == STACKVAR)
+ goto _possible_conflict;
+
+ /* check for a DUPX,SWAP while the lifetime of curstack */
+ /* and as creator curstack */
+ if (last_dupx != -1) {
+ /* we have to look at the dst stack of DUPX */
+ /* == src Stack of PEI */
+ copy = bptr->iinstr[last_dupx].dst;
+ /*
+ if (last_pei == 0)
+ copy = bptr->instack;
+ else
+ copy = bptr->iinstr[last_pei-1].dst;
+ */
+ if ((copy != NULL) && (curstack <= copy)) {
+ /* curstack alive at or created by DUPX */
+
+ /* TODO:.... */
+ /* now look, if there is a LOCALVAR at anyone of */
+ /* the src stacklots used by DUPX */
+
+ goto _possible_conflict;
+ }
+ }
+
+ /* check for a PEI while the lifetime of curstack */
+ if (last_pei != -1) {
+ /* && there are exception handler in this method */
+ /* when this is checked prevent ARGVAR from */
+ /* overwriting LOCALVAR!!! */
+
+ /* we have to look at the stack _before_ the PEI! */
+ /* == src Stack of PEI */
+ if (last_pei == 0)
+ copy = bptr->instack;
+ else
+ copy = bptr->iinstr[last_pei-1].dst;
+ if ((copy != NULL) && (curstack <= copy)) {
+ /* curstack alive at PEI */
+ goto _possible_conflict;
+ }
+ }
+
+ /* check if there is a possible conflicting XSTORE */
+ if (last_store[5 * iptr->op1 + opcode - ICMD_ISTORE] != -1) {
+ /* we have to look at the stack _before_ the XSTORE! */
+ /* == src Stack of XSTORE */
+ if (last_store[5 * iptr->op1 + opcode - ICMD_ISTORE] == 0)
+ copy = bptr->instack;
+ else
+ copy = bptr->iinstr[last_store[5 * iptr->op1 + opcode - ICMD_ISTORE] - 1].dst;
+ if ((copy != NULL) && (curstack <= copy)) {
+ /* curstack alive at Last Store */
+ goto _possible_conflict;
+ }
+ }
+
+ /* check if there is a conflict with a XLOAD */
+ /* this is done indirectly by looking if a Stackslot is */
+ /* marked LOCALVAR and is live while curstack is live */
+ /* see figure 5.3 */
+
+ /* First check "above" stackslots of the instack */
+ copy = curstack + 1;
+ for(;(copy <= bptr->instack); copy++)
+ if ((copy->varkind == LOCALVAR) && (copy->varnum == iptr->op1)) {
+ goto _possible_conflict;
+ }
+
+ /* "intra" Basic Block Stackslots are allocated above */
+ /* bptr->stack (see doc/stack.txt), so if curstack + 1 */
+ /* is an instack, copy could point now to the stackslots */
+ /* of an inbetween analysed Basic Block */
+ if (copy < bptr->stack)
+ copy = bptr->stack;
+ while (copy < new) {
+ if ((copy->varkind == LOCALVAR) && (copy->varnum == iptr->op1)) {
+ goto _possible_conflict;
+ }
+ copy++;
+ }
+ /* no conflict - mark the Stackslot as LOCALVAR */
+ curstack->varkind = LOCALVAR;
+ curstack->varnum = iptr->op1;
+
+ goto _local_join;
+ _possible_conflict:
+ if ((curstack->varkind == LOCALVAR)
+ && (curstack->varnum == iptr->op1)) {
+ curstack->varkind = TEMPVAR;
+ curstack->varnum = stackdepth-1;
+ }
+ _local_join:
+ last_store[5 * iptr->op1 + opcode - ICMD_ISTORE] = bptr->icount - len - 1;
+