Optimize _looksLikeClassName() in AOT builds. (#835)
Optimize _looksLikeClassName() in AOT builds. (#835)

* Optimize _looksLikeClassName() in AOT builds.

The AOT compiler does not currently compile regexes to machine code,
which makes them significantly slower. The regex in this function is
perf critical and makes the dart_style benchmark 65% slower on AOT than
on the JIT.

This fixes some of that regression.

Before:

// JIT
Best   : 4.93ms ========================
Best   : 4.83ms ========================
Best   : 4.80ms ========================

// AOT
Best   : 8.33ms =========================================
Best   : 8.43ms ==========================================
Best   : 8.37ms =========================================

After:

// JIT
Best   : 4.93ms ========================
Best   : 4.83ms ========================
Best   : 4.80ms ========================

// AOT
Best   : 6.93ms ==================================
Best   : 6.87ms ==================================
Best   : 6.77ms =================================

* Don't crash if identifier is "_".

dart-lang/dart_style