Fix bug with "switch"; handle operands already in table

A problem exists: acquiring an entry that already in table will be
return true directly when it's a read, but when it's a write, it will
acqure a X lock. I don't know if it's conflicting.