From 062123bcf5e205813f059050d9686a66952c8290 Mon Sep 17 00:00:00 2001 From: Modestas Valauskas Date: Fri, 29 May 2026 03:37:25 -0700 Subject: [PATCH] [vm] Remove unused Integer_parse native The Integer_parse VM native has no Dart-side caller. int.parse is implemented entirely in Dart in sdk/lib/_internal/vm_shared/lib/integers_patch.dart (_tryParseSmi and _parseRadix). Removes the native entry and drops a stale reference in the comment on the shared ParseInteger helper, which is still used by Integer_fromEnvironment. TEST=ci Change-Id: I8d034e3081c09357094abc6415fc709e3edbea07 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/507322 Reviewed-by: Martin Kustermann Auto-Submit: Modestas Valauskas Reviewed-by: Slava Egorov Commit-Queue: Slava Egorov --- runtime/lib/integers.cc | 7 +------ runtime/vm/bootstrap_natives.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc index 4d2ad40825d..d055a6947c4 100644 --- a/runtime/lib/integers.cc +++ b/runtime/lib/integers.cc @@ -160,7 +160,7 @@ DEFINE_NATIVE_ENTRY(Integer_equalToInteger, 0, 2) { } static IntegerPtr ParseInteger(const String& value) { - // Used by both Integer_parse and Integer_fromEnvironment. + // Used by Integer_fromEnvironment. if (value.IsOneByteString()) { // Quick conversion for unpadded integers in strings. const intptr_t len = value.Length(); @@ -180,11 +180,6 @@ static IntegerPtr ParseInteger(const String& value) { return Integer::New(value); } -DEFINE_NATIVE_ENTRY(Integer_parse, 0, 1) { - GET_NON_NULL_NATIVE_ARGUMENT(String, value, arguments->NativeArgAt(0)); - return ParseInteger(value); -} - DEFINE_NATIVE_ENTRY(Integer_fromEnvironment, 0, 2) { GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); GET_NATIVE_ARGUMENT(Integer, default_value, arguments->NativeArgAt(1)); diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h index 2fa4f13d3ea..551ecd2c67b 100644 --- a/runtime/vm/bootstrap_natives.h +++ b/runtime/vm/bootstrap_natives.h @@ -46,7 +46,6 @@ namespace dart { V(Integer_greaterThanFromInteger, 2) \ V(Integer_equalToInteger, 2) \ V(Integer_fromEnvironment, 2) \ - V(Integer_parse, 1) \ V(Integer_shlFromInteger, 2) \ V(Integer_shrFromInteger, 2) \ V(Integer_ushrFromInteger, 2) \