5892 {
5893
5894
5895
5896
5897 const intptr_t kJumpTableMinExpressions = 16;
5898
5899
5900 const intptr_t kJumpTableMaxSize =
kMaxInt32;
5901
5902
5903
5904 const double kJumpTableMaxHolesRatio = 1.0;
5905
5907
5909 }
5910
5912
5913
5915 }
5916
5919 }
5920
5921 PrepareForOptimizedSwitch();
5922
5924
5925
5927 }
5928
5931 }
5932
5934 if (range > kJumpTableMaxSize) {
5936 }
5937
5938 const intptr_t num_expressions =
expressions().length();
5939 ASSERT(num_expressions <= range);
5940
5941 const intptr_t max_holes = num_expressions * kJumpTableMaxHolesRatio;
5942 const int64_t holes = range - num_expressions;
5943
5945 if (num_expressions < kJumpTableMinExpressions) {
5947 }
5948
5949 if (holes > max_holes) {
5951 }
5952 }
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5976
5977 max_holes - holes,
5978
5979 kJumpTableMaxSize - range);
5980
5982 if (required_holes <= holes_budget) {
5983 expression_min_ = &Object::smi_zero();
5984 }
5985 }
5986
5988}
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