fix #2509, === on immutable structs
while I'm at it, add more efficient code generation for such comparisons.