Remove all uses of --limit-ints-to-64-bits VM option

VM option --limit-ints-to-64-bits was enabled by default a while ago,
and now we're preparing to remove it from Dart VM.

This CL removes all uses of this option in preparation for this cleanup.

Issue: https://github.com/dart-lang/sdk/issues/33306
Change-Id: I8f33cf4ca8ce7ef9a171a982346e43dd8cb722a9
Reviewed-on: https://dart-review.googlesource.com/57960
Reviewed-by: RĂ©gis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
diff --git a/pkg/vm/tool/dart2 b/pkg/vm/tool/dart2
index e127775..a41cfc2 100755
--- a/pkg/vm/tool/dart2
+++ b/pkg/vm/tool/dart2
@@ -43,5 +43,4 @@
      --preview_dart_2                                                          \
      --strong                                                                  \
      --reify-generic-functions                                                 \
-     --limit-ints-to-64-bits                                                   \
      "$@"
diff --git a/pkg/vm/tool/dart2.bat b/pkg/vm/tool/dart2.bat
index 83e73bb..5d82e33 100644
--- a/pkg/vm/tool/dart2.bat
+++ b/pkg/vm/tool/dart2.bat
@@ -35,4 +35,4 @@
 )
 set KERNEL_SERVICE_SNAPSHOT=%BUILD_DIR%/gen/kernel-service.dart.snapshot
 
-"%DART_BINARY%" --preview_dart_2 --strong --reify-generic-functions --limit-ints-to-64-bits %*
+"%DART_BINARY%" --preview_dart_2 --strong --reify-generic-functions %*
diff --git a/pkg/vm/tool/dart_precompiled_runtime2 b/pkg/vm/tool/dart_precompiled_runtime2
index eeb33e3..d8c490a 100755
--- a/pkg/vm/tool/dart_precompiled_runtime2
+++ b/pkg/vm/tool/dart_precompiled_runtime2
@@ -36,5 +36,4 @@
 exec "$BIN_DIR"/dart_precompiled_runtime               \
      --strong                                          \
      --reify-generic-functions                         \
-     --limit-ints-to-64-bits                           \
      "$@"
diff --git a/pkg/vm/tool/gen_kernel b/pkg/vm/tool/gen_kernel
index 551d2d5..63130b2 100755
--- a/pkg/vm/tool/gen_kernel
+++ b/pkg/vm/tool/gen_kernel
@@ -8,9 +8,6 @@
 
 set -e
 
-# Enable Dart 2.0 fixed-size integers for gen_kernel
-DART_VM_FLAGS="--limit-ints-to-64-bits $DART_VM_FLAGS"
-
 function follow_links() {
   file="$1"
   while [ -h "$file" ]; do
diff --git a/pkg/vm/tool/gen_kernel.bat b/pkg/vm/tool/gen_kernel.bat
index 83a99572..17af350 100644
--- a/pkg/vm/tool/gen_kernel.bat
+++ b/pkg/vm/tool/gen_kernel.bat
@@ -13,9 +13,6 @@
 
 set SDK_DIR=%SCRIPTPATH%/../../../
 
-REM Enable Dart 2.0 fixed-size integers for gen_kernel
-set DART_VM_OPTIONS=--limit-ints-to-64-bits %DART_VM_OPTIONS%
-
 set DART=%SDK_DIR%/tools/sdks/win/dart-sdk/bin/dart.exe
 
 "%DART%" %DART_VM_OPTIONS% "%SDK_DIR%/pkg/vm/bin/gen_kernel.dart" %*
diff --git a/pkg/vm/tool/precompiler2 b/pkg/vm/tool/precompiler2
index d707213..5689819 100755
--- a/pkg/vm/tool/precompiler2
+++ b/pkg/vm/tool/precompiler2
@@ -95,7 +95,6 @@
 
 # Step 1: Generate Kernel binary from the input Dart source.
 "$BIN_DIR"/dart                                                                \
-     --limit-ints-to-64-bits                                                   \
      "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart"                                   \
      --platform "${BIN_DIR}/vm_platform_strong.dill"                           \
      --aot                                                                     \
@@ -109,7 +108,6 @@
 "$BIN_DIR"/dart_bootstrap                                                      \
      --strong                                                                  \
      --reify-generic-functions                                                 \
-     --limit-ints-to-64-bits                                                   \
      --snapshot-kind=app-aot                                                   \
      --snapshot="$DART_BOOTSTRAP_OUT"                                          \
      "${OPTIONS[@]}"                                                           \
diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc
index 3dfe66c..4fca3b2 100644
--- a/runtime/bin/main_options.cc
+++ b/runtime/bin/main_options.cc
@@ -70,7 +70,6 @@
   OPTION_FIELD(preview_dart_2) = true;
   vm_options->AddArgument("--strong");
   vm_options->AddArgument("--reify-generic-functions");
-  vm_options->AddArgument("--limit-ints-to-64-bits");
   vm_options->AddArgument("--sync-async");
 }
 
diff --git a/runtime/tests/vm/dart/truncating_ints_test.dart b/runtime/tests/vm/dart/truncating_ints_test.dart
index c464457..0050383 100644
--- a/runtime/tests/vm/dart/truncating_ints_test.dart
+++ b/runtime/tests/vm/dart/truncating_ints_test.dart
@@ -2,9 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// VMOptions=--limit-ints-to-64-bits --enable-inlining-annotations --optimization_counter_threshold=10 --no-use-osr --no-background-compilation
+// VMOptions=--enable-inlining-annotations --optimization_counter_threshold=10 --no-use-osr --no-background-compilation
 
-// Test for truncating (wrap-around) integer arithmetic in --limit-ints-to-64-bits mode.
+// Test for truncating (wrap-around) integer arithmetic.
 
 import "package:expect/expect.dart";
 
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 6c3b027..7bab455 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -51,7 +51,7 @@
 dart/redirection_type_shuffling_test: Skip # Depends on lazy enforcement of type bounds
 dart/simd128float32_array_test: Skip # compilers not aware of Simd128
 dart/simd128float32_test: Skip # compilers not aware of Simd128
-dart/truncating_ints_test: Skip # dart2js doesn't know about --limit-ints-to-64-bits
+dart/truncating_ints_test: SkipByDesign # The test requires int64.
 dart/wrap_around_in_range_analysis_test: SkipByDesign # The test requires int64.
 
 [ $compiler == dartk ]
@@ -238,9 +238,6 @@
 dart/appjit_determinism_test: SkipByDesign # Test needs to run from source
 dart/script_determinism_test: SkipByDesign # Test needs to run from source
 
-[ $compiler == dartkp && !$strong ]
-dart/truncating_ints_test: Skip # This test cannot be run in dartkp/legacy mode (gen_kernel does not pass --limit-ints-to-64-bits in legacy mode).
-
 [ $compiler == dartkp && ($runtime == dart_precompiled || $runtime == vm) ]
 dart/data_uri_import_test/utf16: MissingRuntimeError # UTF-16 data URIs work in dartk
 dart/issue32950_test: SkipByDesign # uses spawnUri.
diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status
index d996c09..f5e7fe7 100644
--- a/tests/corelib_2/corelib_2.status
+++ b/tests/corelib_2/corelib_2.status
@@ -394,13 +394,13 @@
 double_truncate_test/int64: RuntimeError, OK # Requires fixed-size int64 support.
 hash_set_test/01: RuntimeError # non JS number semantics - Issue 11551
 int_modulo_arith_test/modPow: RuntimeError # Issue 29921
-int_parse_with_limited_ints_test: Skip # dart2js and dartdevc don't know about --limit-ints-to-64-bits
+int_parse_with_limited_ints_test: Skip # Requires fixed-size int64 support.
 integer_arith_vm_test/modPow: RuntimeError # Issues 10245, 30170
 integer_parsed_arith_vm_test: RuntimeError # Issues 10245, 29921
 integer_parsed_div_rem_vm_test: RuntimeError # Issue 29921
 integer_parsed_mul_div_vm_test: RuntimeError # Issue 29921
 regress_r21715_test: RuntimeError # Requires fixed-size int64 support.
-typed_data_with_limited_ints_test: Skip # dart2js and dartdevc don't know about --limit-ints-to-64-bits
+typed_data_with_limited_ints_test: Skip # Requires fixed-size int64 support.
 
 [ $runtime != none && ($compiler == dartdevc || $compiler == dartdevk) ]
 bigint_test: Pass, Slow
@@ -411,7 +411,7 @@
 int_modulo_arith_test/none: RuntimeError # Issue 29921
 int_parse_radix_test/01: RuntimeError # Issue 29921
 int_parse_radix_test/02: RuntimeError # Issue 29921
-int_parse_with_limited_ints_test: Skip # dartdevc doesn't know about --limit-ints-to-64-bits
+int_parse_with_limited_ints_test: Skip # Requires fixed-size int64 support.
 integer_arith_vm_test/modPow: RuntimeError # Issue 30170
 integer_parsed_arith_vm_test: RuntimeError # Issue 29921
 integer_to_radix_string_test: RuntimeError # Issue 29921
@@ -467,7 +467,7 @@
 symbol_reserved_word_test/09: RuntimeError # Issue 29921
 symbol_reserved_word_test/12: RuntimeError # Issue 29921
 symbol_test/none: RuntimeError # Issue 29921
-typed_data_with_limited_ints_test: Skip # dartdevc doesn't know about --limit-ints-to-64-bits
+typed_data_with_limited_ints_test: Skip # Requires fixed-size int64 support.
 
 [ $runtime == vm && !$strong ]
 collection_of_test: RuntimeError
diff --git a/tests/corelib_2/int_parse_with_limited_ints_test.dart b/tests/corelib_2/int_parse_with_limited_ints_test.dart
index 0007cec..19198b2 100644
--- a/tests/corelib_2/int_parse_with_limited_ints_test.dart
+++ b/tests/corelib_2/int_parse_with_limited_ints_test.dart
@@ -1,10 +1,8 @@
 // Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--limit-ints-to-64-bits
 
-// Test for int.parse in --limit-ints-to-64-bits mode (with limited 64-bit
-// integers).
+// Test for int.parse with limited 64-bit integers.
 
 import "package:expect/expect.dart";
 
diff --git a/tests/corelib_2/typed_data_with_limited_ints_test.dart b/tests/corelib_2/typed_data_with_limited_ints_test.dart
index 934e246..58c56d5 100644
--- a/tests/corelib_2/typed_data_with_limited_ints_test.dart
+++ b/tests/corelib_2/typed_data_with_limited_ints_test.dart
@@ -1,10 +1,10 @@
 // Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--limit-ints-to-64-bits --optimization_counter_threshold=10 --no-background-compilation
+// VMOptions=--optimization_counter_threshold=10 --no-background-compilation
 
 // Test for dart:typed_data (in particular, ByteData.get/setUint64 and
-// UInt64List) in --limit-ints-to-64-bits mode (with limited 64-bit integers).
+// UInt64List) with limited 64-bit integers.
 
 import 'dart:typed_data';
 import "package:expect/expect.dart";
diff --git a/tests/language/bit_shift_test.dart b/tests/language/bit_shift_test.dart
index 1ec143b..4c4e8f6 100644
--- a/tests/language/bit_shift_test.dart
+++ b/tests/language/bit_shift_test.dart
@@ -5,7 +5,7 @@
 
 import "package:expect/expect.dart";
 
-// Note: in --limit-ints-to-64-bits mode all integers are 64-bit already.
+// Note: in Dart 2 mode all integers are 64-bit already.
 // Still, it is harmless to apply _uint64Mask because (1 << 64) is 0 (all bits
 // are shifted out), so _uint64Mask is -1 (its bit pattern is 0xffffffffffffffff).
 const _uint64Mask = (1 << 64) - 1;
diff --git a/tests/language_2/bit_shift_test.dart b/tests/language_2/bit_shift_test.dart
index 1ec143b..1f00423 100644
--- a/tests/language_2/bit_shift_test.dart
+++ b/tests/language_2/bit_shift_test.dart
@@ -5,16 +5,11 @@
 
 import "package:expect/expect.dart";
 
-// Note: in --limit-ints-to-64-bits mode all integers are 64-bit already.
-// Still, it is harmless to apply _uint64Mask because (1 << 64) is 0 (all bits
-// are shifted out), so _uint64Mask is -1 (its bit pattern is 0xffffffffffffffff).
-const _uint64Mask = (1 << 64) - 1;
-
 constants() {
   Expect.equals(0, 499 >> 33);
   Expect.equals(0, (499 << 33) & 0xFFFFFFFF);
   Expect.equals(0, (499 << 32) >> 65);
-  Expect.equals(0, ((499 << 32) << 65) & _uint64Mask);
+  Expect.equals(0, (499 << 32) << 65);
 }
 
 foo(i) {
@@ -38,7 +33,7 @@
   Expect.equals(0, id(499) >> 33);
   Expect.equals(0, (id(499) << 33) & 0xFFFFFFFF);
   Expect.equals(0, id(499 << 32) >> 65);
-  Expect.equals(0, (id(499 << 32) << 65) & _uint64Mask);
+  Expect.equals(0, id(499 << 32) << 65);
 }
 
 speculative() {
@@ -48,7 +43,7 @@
     Expect.equals(0, a >> 33);
     Expect.equals(0, (a << 33) & 0xFFFFFFFF);
     Expect.equals(0, b >> 65);
-    Expect.equals(0, (b << 65) & _uint64Mask);
+    Expect.equals(0, b << 65);
   }
 }
 
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 3110e64..9661adc 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -1132,11 +1132,6 @@
       args.add('--enable_asserts');
     }
 
-    // Pass environment variable to the gen_kernel script as
-    // arguments are not passed if gen_kernel runs in batch mode.
-    environmentOverrides = new Map.from(environmentOverrides);
-    environmentOverrides['DART_VM_FLAGS'] = '--limit-ints-to-64-bits';
-
     return Command.vmKernelCompilation(dillFile, true, bootstrapDependencies(),
         genKernel, args, environmentOverrides);
   }
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 52974f7..d7beed3 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -862,12 +862,9 @@
       // TODO(rnystrom): Hack. When running the 2.0 tests, always implicitly
       // turn on reified generics in the VM.
       // Note that VMOptions=--no-reify-generic-functions in test is ignored.
-      // Also, enable Dart 2.0 fixed-size integers with --limit-ints-to-64-bits.
       // Dart 2 VM wrapper (pkg/vm/tool/dart2) already passes correct arguments.
       if (suiteName.endsWith("_2") && !configuration.usingDart2VMWrapper) {
-        allVmOptions = allVmOptions.toList()
-          ..add("--reify-generic-functions")
-          ..add("--limit-ints-to-64-bits");
+        allVmOptions = allVmOptions.toList()..add("--reify-generic-functions");
       }
 
       var commands =