void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) {
  if (src->is_register()) {
    if (dest->is_register()) {
      assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
      assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands");
      reg2reg(src,  dest);
    } else if (dest->is_stack()) {
      assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
      assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands");
reg2stack(src,dest,type);
    } else if (dest->is_address()) {
reg2mem(src,dest,tmp1,tmp2,tmp3,type,patch_code,info,unaligned);
    } else {
      ShouldNotReachHere();
    }

  } else if (src->is_stack()) {
    assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
    if (dest->is_register()) {
      assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands");
      stack2reg(src, dest, type);
    } else if (dest->is_stack()) {
assert(!tmp2->is_valid(),"unnecessary definition of temp operands");
      stack2stack(src, dest, tmp1, type);
    } else {
      ShouldNotReachHere();
    }

  } else if (src->is_constant()) {
    if (dest->is_register()) {
assert(!tmp3->is_valid(),"unnecessary definition of temp operands");
      const2reg(src, dest, patch_code, info, tmp1, tmp2); // patching is possible
    } else if (dest->is_stack()) {
      assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
assert(!tmp3->is_valid(),"unnecessary definition of temp operands");
      const2stack(src, dest, tmp1, tmp2);
    } else if (dest->is_address()) {
      assert(patch_code == lir_patch_none, "no patching allowed here");
      const2mem(src, dest, tmp1, tmp2, tmp3, type, info);
    } else {
      ShouldNotReachHere();
    }

  } else if (src->is_address()) {
assert(!tmp2->is_valid(),"unnecessary definition of temp operand");
    mem2reg(src, dest, tmp1, type, patch_code, info, unaligned);

  } else {
    ShouldNotReachHere();
  }
}
void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide) {
    if (src->is_register()) {
        if (dest->is_register()) {
            assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
            reg2reg(src,  dest);
        } else if (dest->is_stack()) {
            assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
            reg2stack(src, dest, type, pop_fpu_stack);
        } else if (dest->is_address()) {
            reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, wide, unaligned);
        } else {
            ShouldNotReachHere();
        }

    } else if (src->is_stack()) {
        assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
        if (dest->is_register()) {
            stack2reg(src, dest, type);
        } else if (dest->is_stack()) {
            stack2stack(src, dest, type);
        } else {
            ShouldNotReachHere();
        }

    } else if (src->is_constant()) {
        if (dest->is_register()) {
            const2reg(src, dest, patch_code, info); // patching is possible
        } else if (dest->is_stack()) {
            assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");
            const2stack(src, dest);
        } else if (dest->is_address()) {
            assert(patch_code == lir_patch_none, "no patching allowed here");
            const2mem(src, dest, type, info, wide);
        } else {
            ShouldNotReachHere();
        }

    } else if (src->is_address()) {
        mem2reg(src, dest, type, patch_code, info, wide, unaligned);

    } else {
        ShouldNotReachHere();
    }
}
Beispiel #3
0
void pile_over (Stack stacks[N], int locations[N], int a, int b) {
  stack2stack (stacks, locations, locations[a], locations[b], a);
  locations[a] = locations[b];
}
Beispiel #4
0
void pile_onto (Stack stacks[N], int locations[N], int a, int b) {
  pop_to_init (stacks, locations, b); 
  stack2stack (stacks, locations, locations[a], locations[b], a); 
  locations[a] = locations[b]; 
}