Add optimization for opcode_compiler_t.

optimization switch were added for opcode_compiler_t, along with its
testing code.