[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:
committed by
commit-bot@chromium.org
parent
5dd096ac99
commit
2e0ec12e62
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user