Rewrite compiler code that translates Logtalk directives for better performance