manual cherrypick of 8a19e2740cc500f467d737179f2d3f82b6af68d9,  "Use obj...

...ect id for equality and hashing."