Optimize isdefined
on normal objects in codegen
#19334
Merged
isdefined
on normal objects in codegen
#19334