[builtins] Port String.prototype.substr to Torque
... and refactor String.prototype.substring. This is done to simplify cleaning up callers of ConvertToRelativeIndex() in a follow-up CL. This CL also introduces Smi-overflow friendly helper function ClampToIndexRange(index: JSAny, min: uintptr, max: uintptr): uintptr which can be used in other String builtins as a better alternative to NumberMin(NumberMax(value, min), max) pattern. Bug: v8:8996, v8:4153 Change-Id: Ie1bb5ab305ebf851c033d109ffe9e6afb9418274 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1872392 Commit-Queue: Igor Sheludko <ishell@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#64463}
Showing
Please
register
or
sign in
to comment