diff --git a/pkg/vm/tool/dart_precompiled_runtime2 b/pkg/vm/tool/dart_precompiled_runtime2 index d8c490a23ef..eeb33e39f4d 100755 --- a/pkg/vm/tool/dart_precompiled_runtime2 +++ b/pkg/vm/tool/dart_precompiled_runtime2 @@ -36,4 +36,5 @@ BIN_DIR="$OUT_DIR$DART_CONFIGURATION" 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 5b960477282..e5687b8efdc 100755 --- a/pkg/vm/tool/gen_kernel +++ b/pkg/vm/tool/gen_kernel @@ -8,6 +8,13 @@ set -e +# Enable Dart 2.0 fixed-size integers for gen_kernel if running in strong mode. +for arg in "$@"; do + if [ "$arg" == "--strong-mode" ]; then + DART_VM_FLAGS="--limit-ints-to-64-bits $DART_VM_FLAGS" + fi +done + function follow_links() { file="$1" while [ -h "$file" ]; do @@ -35,4 +42,4 @@ else OUT_DIR="$SDK_DIR/out" fi -exec "$DART" "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart" $@ +exec "$DART" $DART_VM_FLAGS "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart" $@ diff --git a/pkg/vm/tool/precompiler2 b/pkg/vm/tool/precompiler2 index a3aee3af229..faf92c07fbb 100755 --- a/pkg/vm/tool/precompiler2 +++ b/pkg/vm/tool/precompiler2 @@ -67,7 +67,9 @@ export DART_CONFIGURATION=${DART_CONFIGURATION:-ReleaseX64} BIN_DIR="$OUT_DIR/$DART_CONFIGURATION" # Step 1: Generate Kernel binary from the input Dart source. -"$BIN_DIR"/dart "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart" \ +"$BIN_DIR"/dart \ + --limit-ints-to-64-bits \ + "${SDK_DIR}/pkg/vm/bin/gen_kernel.dart" \ --platform "${BIN_DIR}/vm_platform_strong.dill" \ --aot \ $PACKAGES \ @@ -78,6 +80,7 @@ BIN_DIR="$OUT_DIR/$DART_CONFIGURATION" exec "$BIN_DIR"/dart_bootstrap \ --strong \ --reify-generic-functions \ + --limit-ints-to-64-bits \ --snapshot-kind=app-aot \ --use-blobs \ --snapshot="$SNAPSHOT_FILE" \ diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status index 407b338d60a..63981da9489 100644 --- a/runtime/tests/vm/vm.status +++ b/runtime/tests/vm/vm.status @@ -67,9 +67,6 @@ cc/IsolateReload_KernelIncrementalCompileGenerics: Skip cc/Mixin_PrivateSuperResolution: Skip cc/Mixin_PrivateSuperResolutionCrossLibraryShouldFail: Skip -[ $compiler == dartkp ] -dart/truncating_ints_test: CompileTimeError # Issue 31339 - [ $compiler == precompiler ] dart/byte_array_test: Skip # Incompatible flag --disable_alloc_stubs_after_gc @@ -353,6 +350,9 @@ dart/snapshot_version_test: RuntimeError # Please triage. dart/spawn_infinite_loop_test: Crash # Please triage. dart/truncating_ints_test: CompileTimeError # Please triage. +[ $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/base64: CompileTimeError dart/data_uri_import_test/nocharset: CompileTimeError diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status index 033f5d85da6..30ccbe777b4 100644 --- a/tests/corelib_2/corelib_2.status +++ b/tests/corelib_2/corelib_2.status @@ -63,13 +63,6 @@ symbol_test/01: MissingCompileTimeError symbol_test/02: MissingCompileTimeError symbol_test/03: MissingCompileTimeError -[ $compiler == dartkp ] -bit_twiddling_test/int64: CompileTimeError # Issue 31339 -integer_to_radix_string_test/01: CompileTimeError # Issue 31339 -integer_to_radix_string_test/02: CompileTimeError # Issue 31339 -integer_to_string_test/01: CompileTimeError # Issue 31339 -num_sign_test: CompileTimeError, Crash # Issue 31339 - [ $compiler == precompiler ] int_parse_radix_test: Pass, Timeout # --no_intrinsify integer_parsed_mul_div_vm_test: Pass, Timeout # --no_intrinsify @@ -463,15 +456,6 @@ symbol_test/03: MissingCompileTimeError symbol_test/none: RuntimeError unicode_test: RuntimeError -# Enabling of dartk for sim{arm,arm64,dbc64} revelaed these test failures, which -# are to be triaged. Isolate tests are skipped on purpose due to the usage of -# batch mode. -[ $compiler == dartk && $strong && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ] -bit_twiddling_test/int64: CompileTimeError # Please triage. -integer_to_radix_string_test/02: CompileTimeError # Please triage. -integer_to_string_test/01: CompileTimeError # Please triage. -num_sign_test: CompileTimeError # Please triage. - # ===== dartkp + dart_precompiled status lines ===== [ $compiler == dartkp && $runtime == dart_precompiled && $strong ] bool_from_environment2_test/03: MissingCompileTimeError @@ -686,7 +670,7 @@ regexp/pcre_test: Pass, Slow, Timeout [ $runtime == dart_precompiled || $runtime == vm ] integer_parsed_arith_vm_test/01: RuntimeError # Issue 31346 -integer_parsed_arith_vm_test/02: RuntimeError # Issue 31369 +integer_parsed_arith_vm_test/02: RuntimeError # Issue 31346 integer_parsed_div_rem_vm_test/01: RuntimeError # Issue 31346 integer_to_radix_string_test/01: RuntimeError # Issue 31346 string_split_test: RuntimeError # does not return List diff --git a/tests/corelib_2/integer_parsed_arith_vm_test.dart b/tests/corelib_2/integer_parsed_arith_vm_test.dart index 7ce266cbec5..d3e273d0acc 100644 --- a/tests/corelib_2/integer_parsed_arith_vm_test.dart +++ b/tests/corelib_2/integer_parsed_arith_vm_test.dart @@ -65,9 +65,9 @@ testAddSub() { one, // 64 bit overflow. //# 01: continued "-0x8000000000000000"); // //# 01: continued addSubParsed( // //# 02: ok - "0xFFFFFFFFFFFFFFFF", // //# 02: continued + minus_one, // //# 02: continued one, // 64 bit overflow. //# 02: continued - "0"); // //# 02: continued + zero); // //# 02: continued addSubParsed( "0x8000000", // 28 bit overflow. "0x8000000", @@ -81,9 +81,9 @@ testAddSub() { "0x80000000000000", "0x100000000000000"); addSubParsed( // //# 02: continued - "0x8000000000000000", // 64 bit overflow. //# 02: continued - "0x8000000000000000", // //# 02: continued - "0"); // //# 02: continued + "-0x8000000000000000", // 64 bit overflow. //# 02: continued + "-0x8000000000000000", // //# 02: continued + zero); // //# 02: continued addSubParsed("-0x123", minus_one, "-0x124"); addSubParsed(minus_one, "-0x123", "-0x124"); diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index fbe1059c7f7..88b177b6b81 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -12,14 +12,9 @@ # ===== Skip dartk and darkp in !$strong mode ==== [ $compiler == dartkp ] -bit_operations_test: CompileTimeError # Issue 31339 generic_no_such_method_dispatcher_test: RuntimeError # Issue 31424 -identical_closure2_test: CompileTimeError # Issue 31339 -mint_arithmetic_test: CompileTimeError # Issue 31339 mock_writable_final_field_test: RuntimeError # Issue 31424 no_such_method_subtype_test: RuntimeError # Issue 31424 -vm/unaligned_integer_access_literal_index_test: CompileTimeError # Issue 31339 -vm/unaligned_integer_access_register_index_test: CompileTimeError # Issue 31339 [ $compiler == dartk && $mode == debug && $runtime == vm && $strong ] bad_named_parameters_test/01: Crash # Issue(http://dartbug.com/31630) @@ -1197,9 +1192,6 @@ wrong_number_type_arguments_test/none: Pass # are to be triaged. Isolate tests are skipped on purpose due to the usage of # batch mode. [ $compiler == dartk && $strong && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ] -bit_operations_test/03: CompileTimeError # Please triage. -bit_operations_test/04: CompileTimeError # Please triage. -bit_operations_test/none: CompileTimeError # Please triage. class_cycle_test/02: MissingCompileTimeError # Please triage. class_cycle_test/03: MissingCompileTimeError # Please triage. duplicate_implements_test/01: MissingCompileTimeError # Please triage. @@ -1207,15 +1199,11 @@ duplicate_implements_test/02: MissingCompileTimeError # Please triage. duplicate_implements_test/03: MissingCompileTimeError # Please triage. duplicate_implements_test/04: MissingCompileTimeError # Please triage. generic_methods_generic_function_result_test/01: MissingCompileTimeError # Please triage. -identical_closure2_test: CompileTimeError # Please triage. issue23244_test: RuntimeError # Please triage. least_upper_bound_expansive_test/none: RuntimeError # Please triage. -mint_arithmetic_test: CompileTimeError # Please triage. mixin_black_listed_test/02: MissingCompileTimeError # Please triage. null_test/02: MissingCompileTimeError # Please triage. null_test/03: MissingCompileTimeError # Please triage. -vm/unaligned_integer_access_literal_index_test: CompileTimeError # Please triage. -vm/unaligned_integer_access_register_index_test: CompileTimeError # Please triage. [ $compiler == dartk && !$strong ] *: SkipByDesign # language_2 is only supported in strong mode. @@ -1969,8 +1957,6 @@ instanceof4_test/none: RuntimeError instantiate_tearoff_after_contravariance_check_test: CompileTimeError instantiate_tearoff_of_call_test: CompileTimeError instantiate_tearoff_test: CompileTimeError -int64_literal_test/03: MissingCompileTimeError # http://dartbug.com/31479 -int64_literal_test/30: MissingCompileTimeError # http://dartbug.com/31479 interface_test/00: MissingCompileTimeError invocation_mirror2_test: SkipByDesign invocation_mirror_invoke_on2_test: SkipByDesign diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status index 1ca7690878e..315dbeb4cb2 100644 --- a/tests/lib_2/lib_2_kernel.status +++ b/tests/lib_2/lib_2_kernel.status @@ -10,9 +10,6 @@ # missing a section you need, please reach out to sigmund@ to see the best way # to add them. -[ $compiler == dartkp ] -typed_data/int32x4_arithmetic_test/int64: CompileTimeError # Issue 31339 - [ $arch == x64 && $compiler == dartk && $mode == debug && $runtime == vm && $strong ] mirrors/invocation_fuzz_test: Skip # Because it times out, issue 29439. mirrors/variable_is_const_test/01: Crash @@ -396,7 +393,6 @@ mirrors/invocation_fuzz_test/smi: CompileTimeError # Please triage. mirrors/invocation_fuzz_test/string: CompileTimeError # Please triage. mirrors/library_uri_io_test: CompileTimeError # Please triage. mirrors/spawn_function_root_library_test: Skip -typed_data/int32x4_arithmetic_test/int64: CompileTimeError # Please triage. # ===== Skip dartk and darkp in !$strong mode ==== [ $compiler == dartk && !$strong ] diff --git a/tests/standalone_2/constant_left_shift_test.dart b/tests/standalone_2/constant_left_shift_test.dart index c3072c1246d..5f87650577e 100644 --- a/tests/standalone_2/constant_left_shift_test.dart +++ b/tests/standalone_2/constant_left_shift_test.dart @@ -38,7 +38,7 @@ main() { Expect.equals(2305843009213693952, shiftLeft1(61)); // Deoptimize on 64 bits. Expect.equals(4611686018427387904, shiftLeft1(62)); - Expect.equals(9223372036854775808, shiftLeft1(63)); + Expect.equals(-9223372036854775808, shiftLeft1(63)); Expect.equals(8448, shiftLeft8448(0)); Expect.equals(1081344, shiftLeft8448(7)); diff --git a/tests/standalone_2/int_array_test.dart b/tests/standalone_2/int_array_test.dart index f4a3c626c1b..30d326ac9b5 100644 --- a/tests/standalone_2/int_array_test.dart +++ b/tests/standalone_2/int_array_test.dart @@ -115,7 +115,7 @@ void testUint64ToSmi() { intArray[0] = 4611686018427387903; // SmiMax intArray[1] = -1; // 0xFFFFFFFFFFFFFFFF : 18446744073709551615 intArray[2] = 4611686018427387904; // SmiMax+1 - intArray[3] = 9223372036854775808; + intArray[3] = -9223372036854775808; var x = intArray[0]; var y = intArray[1]; var z = intArray[2]; @@ -123,7 +123,7 @@ void testUint64ToSmi() { Expect.equals(4611686018427387903, x); Expect.equals(-1, y); Expect.equals(4611686018427387904, z); - Expect.equals(9223372036854775808, w); + Expect.equals(-9223372036854775808, w); } main() { diff --git a/tests/standalone_2/medium_integer_test.dart b/tests/standalone_2/medium_integer_test.dart index 26a62b030f8..28532f9b43e 100644 --- a/tests/standalone_2/medium_integer_test.dart +++ b/tests/standalone_2/medium_integer_test.dart @@ -28,7 +28,7 @@ class MediumIntegerTest { Expect.equals(1234567890123456791, a + b); Expect.equals(1234567890123456791, b + a); a = 9223372036854775807; - Expect.equals(9223372036854775808, a + 1); + Expect.equals(-9223372036854775808, a + 1); // Mint and Mint. a = 100000000000000001; diff --git a/tests/standalone_2/standalone_2_kernel.status b/tests/standalone_2/standalone_2_kernel.status index c3efe4bdc3b..c7e70619b70 100644 --- a/tests/standalone_2/standalone_2_kernel.status +++ b/tests/standalone_2/standalone_2_kernel.status @@ -10,11 +10,6 @@ # missing a section you need, please reach out to sigmund@ to see the best way # to add them. -[ $compiler == dartkp ] -bytedata_test: CompileTimeError # Issue 31339 -typed_array_int64_uint64_test: CompileTimeError, Crash # Issue 31339 -typed_data_view_test: CompileTimeError # Issue 31339 - [ $compiler == dartk && $mode == debug && $runtime == vm && $strong ] io/file_lock_test: Slow, Pass io/raw_socket_test: Crash @@ -47,7 +42,6 @@ regress_29350_test/none: Pass # Issue 31537 # are to be triaged. Isolate tests are skipped on purpose due to the usage of # batch mode. [ $compiler == dartk && $strong && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ] -bytedata_test: CompileTimeError # Please triage. io/echo_server_stream_test: Skip # Uses isolates which don't work in batch mode. io/file_blocking_lock_test: Pass, Crash # Please triage. io/file_lock_test: RuntimeError # Please triage. @@ -72,10 +66,8 @@ package/scenarios/packages_option_only/packages_option_only_test: CompileTimeErr regress_26031_test: RuntimeError # Please triage. regress_28854_1_test: RuntimeError # Please triage. regress_28854_2_test: RuntimeError # Please triage. -typed_array_int64_uint64_test: CompileTimeError # Please triage. typed_array_test: RuntimeError # Please triage. typed_data_isolate_test: RuntimeError # Please triage. -typed_data_view_test: CompileTimeError # Please triage. # ===== Skip dartk and darkp in !$strong mode ==== [ $compiler == dartk && !$strong ] diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart index be504f660ea..73470e54919 100644 --- a/tools/testing/dart/compiler_configuration.dart +++ b/tools/testing/dart/compiler_configuration.dart @@ -1044,6 +1044,13 @@ abstract class VMKernelCompilerMixin { ]; args.add(arguments.where((name) => name.endsWith('.dart')).single); + if (_isStrong) { + // 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); }