Skip to content

Commit db72134

Browse files
aartbikcommit-bot@chromium.org
authored andcommitted
[vm/inliner] Add smi return type of clamped convertors.
Rationale: Rather than forced inlining of clamped convertors (the "saturated" method _toClampedUint8() from dart:typed_data), exposing the fact that it always returns smi values (since they check fail on null inputs) yields much better Uint8ClampedListView performance (it avoids re-compilation due to a speculative CheckSmi). Note: In the long run, we may still want them inlined and improve range analysis to deal with clamping. Performance: About 2.8x faster than previous optimized version, about 4.5x faster than original. #33205 Change-Id: I86a06525d2f2ea0476effd3c3d856ff8d9ab1d87 Reviewed-on: https://dart-review.googlesource.com/60201 Commit-Queue: Aart Bik <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
1 parent 33feee3 commit db72134

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/vm/compiler/method_recognizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ namespace dart {
4444
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, Dynamic, 0x38a80b0d) \
4545
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, Dynamic, 0x40052c4e) \
4646
V(_TypedList, _setInt32x4, ByteArrayBaseSetInt32x4, Dynamic, 0x07b89f54) \
47+
V(::, _toClampedUint8, ConvertIntToClampedUint8, Smi, 0x564b0435) \
4748
V(_StringBase, _interpolate, StringBaseInterpolate, Dynamic, 0x01ecb15a) \
4849
V(_IntegerImplementation, toDouble, IntegerToDouble, Double, 0x05da96ed) \
4950
V(_Double, _add, DoubleAdd, Double, 0x2a38277b) \
@@ -437,7 +438,6 @@ namespace dart {
437438
V(::, _toInt, ConvertMaskedInt, 0x713908fd) \
438439
V(::, _toInt8, ConvertIntToInt8, 0x7484a780) \
439440
V(::, _toUint8, ConvertIntToUint8, 0x0a15b522) \
440-
V(::, _toClampedUint8, ConvertIntToClampedUint8, 0x564b0435) \
441441
V(::, _toInt16, ConvertIntToInt16, 0x0a83fcc6) \
442442
V(::, _toUint16, ConvertIntToUint16, 0x6087d1af) \
443443
V(::, _toInt32, ConvertIntToInt32, 0x62b451b9) \

0 commit comments

Comments
 (0)