diff --git a/pkg/vm/bin/gen_kernel.dart b/pkg/vm/bin/gen_kernel.dart index f48b3295dbf..16212bf43c0 100644 --- a/pkg/vm/bin/gen_kernel.dart +++ b/pkg/vm/bin/gen_kernel.dart @@ -43,7 +43,7 @@ final ArgParser _argParser = new ArgParser(allowTrailingOptions: true) help: 'Whether asserts will be enabled.', defaultsTo: false) ..addFlag('enable-constant-evaluation', help: 'Whether kernel constant evaluation will be enabled.', - defaultsTo: false) + defaultsTo: true) ..addMultiOption('entry-points', help: 'Path to JSON file with the list of entry points') ..addFlag('gen-bytecode', diff --git a/pkg/vm/lib/kernel_front_end.dart b/pkg/vm/lib/kernel_front_end.dart index 985b68560f9..7d3cec8321c 100644 --- a/pkg/vm/lib/kernel_front_end.dart +++ b/pkg/vm/lib/kernel_front_end.dart @@ -58,7 +58,7 @@ Future compileToKernel(Uri source, CompilerOptions options, bool genBytecode: false, bool dropAST: false, bool enableAsserts: false, - bool enableConstantEvaluation: false}) async { + bool enableConstantEvaluation: true}) async { // Replace error handler to detect if there are compilation errors. final errorDetector = new ErrorDetector(previousErrorHandler: options.onProblem); diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status index cde173940eb..7927e906f63 100644 --- a/tests/language_2/language_2_kernel.status +++ b/tests/language_2/language_2_kernel.status @@ -68,11 +68,8 @@ bad_override_test/02: MissingCompileTimeError # Issue 32984 call_non_method_field_test/01: MissingCompileTimeError # Issue 32975 call_non_method_field_test/02: MissingCompileTimeError # Issue 32975 check_member_static_test/01: MissingCompileTimeError # Issue 32613 -compile_time_constant_o_test/01: MissingCompileTimeError # Issue 32983 -compile_time_constant_o_test/02: MissingCompileTimeError # Issue 32983 const_cast2_test/01: CompileTimeError # Issue 32517 const_cast2_test/none: CompileTimeError # Issue 32517 -const_dynamic_type_literal_test/02: MissingCompileTimeError # Issue 32983 const_instance_field_test/01: MissingCompileTimeError # Fasta bug: Const instance field. Issue 32326. const_map2_test/00: MissingCompileTimeError # KernelVM bug: Constant evaluation. const_map3_test/00: MissingCompileTimeError # KernelVM bug: Constant evaluation. @@ -106,10 +103,6 @@ generic_methods_bounds_test/01: MissingCompileTimeError # Issue 33018 generic_methods_overriding_test/01: MissingCompileTimeError # Issue 32613 generic_methods_recursive_bound_test/02: MissingCompileTimeError # Issue 33018 getter_override_test/03: MissingCompileTimeError # Issue 32984 -identical_const_test/01: MissingCompileTimeError # Issue 32983 -identical_const_test/02: MissingCompileTimeError # Issue 32983 -identical_const_test/03: MissingCompileTimeError # Issue 32983 -identical_const_test/04: MissingCompileTimeError # Issue 32983 issue31596_override_test/07: MissingCompileTimeError issue31596_override_test/08: MissingCompileTimeError issue31596_super_test/02: MissingCompileTimeError @@ -450,10 +443,15 @@ export_ambiguous_main_test: Crash # Issue 32618 [ $compiler != dart2js && $compiler != dartk && $compiler != dartkp && $fasta ] const_optional_args_test/01: MissingCompileTimeError -[ $compiler != dart2js && $fasta ] +# The precomilation configuration uses a kernel2kernel constants evaluator +# which is is more correct than fasta/vm in JIT mode (i.e. it catches more +# compile-time errors). +[ $compiler != dart2js && $compiler != dartkp && $fasta ] compile_time_constant_c_test/02: MissingCompileTimeError const_constructor_nonconst_field_test/01: MissingCompileTimeError const_syntax_test/05: MissingCompileTimeError + +[ $compiler != dart2js && $fasta ] mixin_super_2_test/01: MissingCompileTimeError mixin_super_2_test/03: MissingCompileTimeError mixin_supertype_subclass_test/02: MissingCompileTimeError @@ -859,11 +857,6 @@ check_member_static_test/02: MissingCompileTimeError # Issue 32613: override che checked_setter3_test/01: MissingCompileTimeError checked_setter3_test/02: MissingCompileTimeError checked_setter3_test/03: MissingCompileTimeError -compile_time_constant_k_test/01: MissingCompileTimeError -compile_time_constant_k_test/02: MissingCompileTimeError -compile_time_constant_k_test/03: MissingCompileTimeError -compile_time_constant_o_test/01: RuntimeError # KernelVM bug: Constant map duplicated key. -compile_time_constant_o_test/02: RuntimeError # KernelVM bug: Constant map duplicated key. compile_time_constant_static5_test/11: CompileTimeError # Issue 31537 compile_time_constant_static5_test/16: CompileTimeError # Issue 31537 compile_time_constant_static5_test/21: CompileTimeError # Issue 31537 @@ -872,11 +865,9 @@ conditional_import_string_test: CompileTimeError # KernelVM bug: Deferred loadin conditional_import_test: CompileTimeError # KernelVM bug: Deferred loading kernel issue 30273. config_import_corelib_test: CompileTimeError # Issue 31533 config_import_test: RuntimeError # KernelVM bug: Configurable imports. -const_dynamic_type_literal_test/02: RuntimeError # KernelVM bug: Constant map duplicated key. const_evaluation_test: SkipByDesign const_list_test: RuntimeError const_map4_test: RuntimeError -const_nested_test: RuntimeError # KernelVM bug: Constant evaluation. constructor12_test: RuntimeError constructor3_test: Fail, OK, Pass ct_const2_test: Skip # Incompatible flag: --compile_all @@ -976,8 +967,6 @@ local_function_test/none: RuntimeError main_not_a_function_test: Skip main_test/03: RuntimeError many_overridden_no_such_method_test: SkipByDesign -map_literal3_test/01: MissingCompileTimeError -map_literal3_test/02: MissingCompileTimeError map_literal3_test/03: MissingCompileTimeError method_override4_test/01: MissingCompileTimeError method_override4_test/02: MissingCompileTimeError @@ -1105,6 +1094,28 @@ recursive_generic_test: RuntimeError # Compares a (dynamic) toString call to 'C< tearoff_dynamic_test: RuntimeError # Compares call to "foo" (noSuchMethod) with string "foo" type_variable_promotion_test: RuntimeError # Compares runtime type to the string "List" +# The precomilation configuration uses a kernel2kernel constants evaluator +# which is is more correct than fasta/vm in JIT mode (i.e. it catches more +# compile-time errors). +[ $compiler != dartkp && $fasta ] +compile_time_constant_o_test/01: MissingCompileTimeError # Issue 32983 +compile_time_constant_o_test/02: MissingCompileTimeError # Issue 32983 +const_dynamic_type_literal_test/02: MissingCompileTimeError # Issue 32983 +identical_const_test/01: MissingCompileTimeError # Issue 32983 +identical_const_test/02: MissingCompileTimeError # Issue 32983 +identical_const_test/03: MissingCompileTimeError # Issue 32983 +identical_const_test/04: MissingCompileTimeError # Issue 32983 + +# The precomilation configuration uses a kernel2kernel constants evaluator +# which is is more correct than fasta/vm in JIT mode (i.e. it catches more +# compile-time errors). +[ $compiler != dartkp && $fasta && $strong ] +compile_time_constant_k_test/01: MissingCompileTimeError +compile_time_constant_k_test/02: MissingCompileTimeError +compile_time_constant_k_test/03: MissingCompileTimeError +map_literal3_test/01: MissingCompileTimeError +map_literal3_test/02: MissingCompileTimeError + [ $compiler == fasta && $strong ] bad_override_test/03: MissingCompileTimeError check_member_static_test/02: MissingCompileTimeError @@ -1298,16 +1309,11 @@ setter_override2_test/02: MissingCompileTimeError variable_shadow_class_test/01: MissingCompileTimeError [ $fasta && $strong ] -compile_time_constant_k_test/01: MissingCompileTimeError -compile_time_constant_k_test/02: MissingCompileTimeError -compile_time_constant_k_test/03: MissingCompileTimeError compile_time_constant_static2_test/04: MissingCompileTimeError compile_time_constant_static3_test/04: MissingCompileTimeError initializing_formal_type_annotation_test/01: MissingCompileTimeError initializing_formal_type_annotation_test/02: MissingCompileTimeError issue18628_2_test/01: MissingCompileTimeError -map_literal3_test/01: MissingCompileTimeError -map_literal3_test/02: MissingCompileTimeError map_literal3_test/03: MissingCompileTimeError redirecting_factory_infinite_steps_test/01: MissingCompileTimeError redirecting_factory_malbounded_test/01: MissingCompileTimeError