[core] gc engine: use == to check token type