5925 {
5926
5927
5928
5929
5930 const intptr_t kJumpTableMinExpressions = 16;
5931
5932
5933 const intptr_t kJumpTableMaxSize =
kMaxInt32;
5934
5935
5936
5937 const double kJumpTableMaxHolesRatio = 1.0;
5938
5940
5942 }
5943
5945
5946
5948 }
5949
5952 }
5953
5954 PrepareForOptimizedSwitch();
5955
5957
5958
5960 }
5961
5964 }
5965
5967 if (range > kJumpTableMaxSize) {
5969 }
5970
5971 const intptr_t num_expressions =
expressions().length();
5972 ASSERT(num_expressions <= range);
5973
5974 const intptr_t max_holes = num_expressions * kJumpTableMaxHolesRatio;
5975 const int64_t holes = range - num_expressions;
5976
5978 if (num_expressions < kJumpTableMinExpressions) {
5980 }
5981
5982 if (holes > max_holes) {
5984 }
5985 }
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6009
6010 max_holes - holes,
6011
6012 kJumpTableMaxSize - range);
6013
6015 if (required_holes <= holes_budget) {
6016 expression_min_ = &Object::smi_zero();
6017 }
6018 }
6019
6021}
static void is_empty(skiatest::Reporter *reporter, const SkPath &p)
static CompilerState & Current()
static T Minimum(T x, T y)
bool is_optimizable() const
const GrowableArray< SwitchExpression > & expressions() const
int64_t ExpressionRange() const
@ kSwitchDispatchLinearScan
@ kSwitchDispatchJumpTable
@ kSwitchDispatchBinarySearch
constexpr int32_t kMaxInt32