[VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v3.

* Enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

* Pass --limit-ints-to-64-bits to gen_kernel via environment
  variable to support batch mode compilation.

Issue: https://github.com/dart-lang/sdk/issues/31339

Re-landing https://dart-review.googlesource.com/29941 with the fix:

* Use checked-in SDK to avoid timeouts on SIMARM bots.
  Checked-in SDK was updated and now includes necessary fixes.

Change-Id: I4a5a99455b60204572f3d619d7eb374035b03e40
Reviewed-on: https://dart-review.googlesource.com/30640
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
Alexander Markov 2017-12-20 18:04:42 +00:00 committed by commit-bot@chromium.org
parent 294e8a1ac1
commit b6276eb3d5
13 changed files with 33 additions and 57 deletions

View file

@ -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 \
"$@"

View file

@ -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" $@

View file

@ -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" \

View file

@ -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

View file

@ -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<String>

View file

@ -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");

View file

@ -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

View file

@ -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 ]

View file

@ -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));

View file

@ -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() {

View file

@ -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;

View file

@ -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 ]

View file

@ -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);
}