[vm] Inline isErrorState to avoid calls in central UTF-8 decoding loop.

Benchmarks show a slight speed improvement (1-2% on average) for ARM
JIT targets and differences below noise level for other targets.

Change-Id: I2f862b643fa5fd601f75c397dea4e9ed6914fc91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148525
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This commit is contained in:
Aske Simon Christensen
2020-05-20 07:37:11 +00:00
committed by commit-bot@chromium.org
parent 5dd096ac99
commit 2e0ec12e62
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -493,6 +493,7 @@ class _Utf8Decoder {
static const int errorSurrogate = E6;
static const int errorUnfinished = E7;
@pragma("vm:prefer-inline")
static bool isErrorState(int state) => (state & 1) != 0;
static String errorDescription(int state) {
+1
View File
@@ -494,6 +494,7 @@ class _Utf8Decoder {
static const int errorSurrogate = E6;
static const int errorUnfinished = E7;
@pragma("vm:prefer-inline")
static bool isErrorState(int state) => (state & 1) != 0;
static String errorDescription(int state) {