Fix FxPick code emission

- Fixed: Integer constants passed to pick() need to manually generate load
  instructions, since FxConstant::Emit() will just return a constant
  register with its value.
- Fixed: VMFunctionBuilder::RegAvailability::Reuse() didn't actually
  calculate a proper mask. Also added another assert to this function.
This commit is contained in:
Randy Heit 2014-12-21 21:57:30 -06:00
commit b14f768b68
2 changed files with 19 additions and 10 deletions

View file

@ -423,8 +423,9 @@ void VMFunctionBuilder::RegAvailability::Return(int reg, int count)
bool VMFunctionBuilder::RegAvailability::Reuse(int reg)
{
assert(reg >= 0 && reg <= 255);
assert(reg < MostUsed && "Attempt to reuse a register that was never used");
VM_UWORD mask = reg & 31;
VM_UWORD mask = 1 << (reg & 31);
int word = reg / 32;
if (Used[word] & mask)