Migrate 119.

Change-Id: Ie62df46d0fcf745ac45f693abf392040fda9e6c1
Reviewed-on: https://dart-review.googlesource.com/3426
Reviewed-by: Ben Konyi <bkonyi@google.com>
This commit is contained in:
Bob Nystrom
2017-09-07 13:29:01 -07:00
parent b075ae01ca
commit bd2a7a7993
27 changed files with 45 additions and 125 deletions
@@ -4,7 +4,7 @@
// Test inlining of simple function with control flow in a test context.
// Optimize function foo with instance of A and inlined function bar. Call later
// with instance of B and cause deoptimization.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr
// VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-compilation
import "package:expect/expect.dart";
@@ -35,7 +35,7 @@ int foo(o) {
}
main() {
var o = new A();
dynamic o = new A();
int sum = 0;
for (int i = 0; i < 20; i++) sum += foo(o);
o = new B();
@@ -4,7 +4,7 @@
// Test inlining of simple function with control flow in a value context.
// Optimize function foo with instance of A and inlined function bar. Call later
// with instance of B and cause deoptimization.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr
// VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-compilation
import "package:expect/expect.dart";
@@ -35,7 +35,7 @@ int foo(o) {
}
main() {
var o = new A();
dynamic o = new A();
int sum = 0;
for (int i = 0; i < 20; i++) sum += foo(o);
o = new B();
@@ -7,7 +7,7 @@
import 'package:expect/expect.dart';
var x = false;
dynamic x = false;
bool called;
@@ -83,7 +83,7 @@ bin() {
}
binCallThrow() {
return callMe() * kast("binct");
return (callMe() as dynamic) * kast("binct");
}
hoo() {
@@ -1,7 +1,7 @@
// Copyright (c) 2011, 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=--optimization-counter-threshold=10 --no-use-osr
// VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-compilation
import "package:expect/expect.dart";
@@ -5,8 +5,7 @@
import "package:expect/expect.dart";
// Test inlining of assignments in parameter passing. If [StringScanner.charAt]
// is inlined, the argument expression [: ++byteOffset :] should not be
// duplicated.
// is inlined, the argument expression `++byteOffset` should not be duplicated.
class StringScanner {
final String string;
@@ -59,9 +59,9 @@ class InstanceofTest {
var a = new List(5);
Expect.equals(true, a is List);
Expect.equals(true, a is List<Object>);
Expect.equals(true, a is List<int>);
Expect.equals(true, a is List<num>);
Expect.equals(true, a is List<String>);
Expect.equals(false, a is List<int>);
Expect.equals(false, a is List<num>);
Expect.equals(false, a is List<String>);
}
{
var a = new List<Object>(5);
@@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing the instanceof operation.
// Regression test for issue 5216.
// VMOptions=--optimization-counter-threshold=10 --no-use-osr
// VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-compilation
import "package:expect/expect.dart";
@@ -20,8 +20,8 @@ testFooString() {
var o = new Foo<String>();
Expect.isTrue(o.isT());
Expect.isTrue(!o.isNotT());
Expect.isTrue(o.isListT());
Expect.isTrue(!o.isNotListT());
Expect.isTrue(!o.isListT());
Expect.isTrue(o.isNotListT());
Expect.isTrue(!o.isAlsoListT()); // //# 01: ok
Expect.isTrue(o.isNeitherListT()); // //# 01: ok
for (var i = 0; i < 20; i++) {
@@ -35,8 +35,8 @@ testFooString() {
}
Expect.isTrue(o.isT(), "1");
Expect.isTrue(!o.isNotT(), "2");
Expect.isTrue(o.isListT(), "3");
Expect.isTrue(!o.isNotListT(), "4");
Expect.isTrue(!o.isListT(), "3");
Expect.isTrue(o.isNotListT(), "4");
Expect.isTrue(!o.isAlsoListT(), "5"); // //# 01: ok
Expect.isTrue(o.isNeitherListT(), "6"); // //# 01: ok
}
@@ -2,7 +2,7 @@
// 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.
// Testing optimized 'is' tests.
// VMOptions=--optimization-counter-threshold=5 --no-use-osr
// VMOptions=--optimization-counter-threshold=5 --no-use-osr --no-background-compilation
import "package:expect/expect.dart";
@@ -242,6 +242,10 @@ import_core_prefix_test: StaticWarning
initializing_formal_final_test: MissingCompileTimeError
type_variable_scope_test/none: fail # Issue 11578
type_variable_static_context_negative_test: fail # Issue 12161
instance_call_wrong_argument_count_negative_test: fail # Issue 11585
instance_method2_negative_test: CompileTimeError
instance_method_negative_test: CompileTimeError
inst_field_initializer1_negative_test: CompileTimeError
[ $strong && $compiler == dart2analyzer ]
accessor_conflict_export2_test: CompileTimeError # Issue 25626
@@ -214,6 +214,9 @@ generic_closure_test: RuntimeError
generic_function_typedef_test/01: RuntimeError
generic_instanceof_test: RuntimeError
generic_typedef_test: RuntimeError
instanceof2_test: RuntimeError
instanceof4_test/01: RuntimeError
instanceof4_test/none: RuntimeError
many_generic_instanceof_test: RuntimeError
[ $compiler == dart2js && $runtime != none && !$checked ]
@@ -322,6 +325,7 @@ illegal_initializer_test/04: Crash # Issue 27394
inference_mixin_field_test: Crash # Issue 27394
initializing_formal_final_test: RuntimeError # Issue 27394
inline_super_field_test: Crash # Issue 27394
instance_creation_in_function_annotation_test: Crash # Issue 27394
[ $compiler == dart2js && !$checked ]
function_subtype_inline2_test: RuntimeError
@@ -583,6 +587,10 @@ type_variable_nested_test/01: Crash # NoSuchMethodError: The method 'hasSubclass
unused_overridden_async_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
vm/allocation_sinking_vm_test: RuntimeError
vm/async_await_catch_stacktrace_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
inlined_throw_test: Crash
instance_creation_in_function_annotation_test: Crash
instanceof4_test/01: Crash
instanceof4_test/none: Crash
[ $compiler == dart2js && $dart2js_with_kernel && $minified ]
assert_message_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
@@ -744,6 +752,10 @@ if_null_assignment_static_test/01: RuntimeError
if_null_assignment_static_test/03: RuntimeError
if_null_assignment_static_test/05: RuntimeError
import_collection_no_prefix_test: Crash # NoSuchMethodError: The getter 'typeArguments' was called on null.
inlined_throw_test: Crash
instance_creation_in_function_annotation_test: Crash
instanceof4_test/01: Crash
instanceof4_test/none: Crash
regress_30339_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
type_variable_nested_test/01: Crash # NoSuchMethodError: The method 'hasSubclass' was called on null.
unused_overridden_async_test: Crash # RangeError (index): Invalid value: Not in range 0..2, inclusive: 3
@@ -830,3 +842,6 @@ call_through_getter_test: Fail, OK
[ $compiler == dart2js && $minified && ! $dart2js_with_kernel ]
generic_closure_test: Fail # Issue 12605
[ $compiler == dart2js && $fast_startup && ! $dart2js_with_kernel ]
instance_creation_in_function_annotation_test: Fail # mirrors not supported
@@ -133,3 +133,4 @@ getter_closure_execution_order_test: RuntimeError # Issue 29920
identical_closure2_test: RuntimeError # Issue 29920
infinite_switch_label_test: RuntimeError # Issue 29920
infinity_test: RuntimeError # Issue 29920
instance_creation_in_function_annotation_test: RuntimeError # Issue 29920
@@ -29,6 +29,7 @@ type_variable_scope_test/04: CompileTimeError
type_variable_scope_test/05: CompileTimeError
unicode_bom_test: CompileTimeError
type_variable_scope2_test: CompileTimeError
instance_creation_in_function_annotation_test: CompileTimeError
# The VM doesn't enforce that potentially const expressions are actually
# const expressions when the constructor is called with `const`.
@@ -182,6 +182,9 @@ inferrer_constructor5_test/01: MissingCompileTimeError
inferrer_synthesized_constructor_test: RuntimeError
initializing_formal_final_test: MissingCompileTimeError
initializing_formal_type_test: MissingCompileTimeError
instanceof2_test: RuntimeError
instanceof4_test/01: RuntimeError
instanceof4_test/none: RuntimeError
many_generic_instanceof_test: RuntimeError
type_variable_nested_test/01: RuntimeError
type_variable_promotion_test: RuntimeError
@@ -199,6 +202,7 @@ unresolved_default_constructor_test/01: MissingCompileTimeError
unresolved_in_factory_test: MissingCompileTimeError
unresolved_top_level_method_test: MissingCompileTimeError
unresolved_top_level_var_test: MissingCompileTimeError
instance_creation_in_function_annotation_test: SkipByDesign
[ $compiler == precompiler && $runtime == dart_precompiled ]
assertion_initializer_const_error2_test/cc01: Crash, MissingCompileTimeError
+3
View File
@@ -181,6 +181,9 @@ import_self_test/01: MissingCompileTimeError
inferrer_constructor5_test/01: MissingCompileTimeError
initializing_formal_final_test: MissingCompileTimeError
initializing_formal_type_test: MissingCompileTimeError
instanceof2_test: RuntimeError
instanceof4_test/01: RuntimeError
instanceof4_test/none: RuntimeError
many_generic_instanceof_test: RuntimeError
type_variable_nested_test/01: RuntimeError
type_variable_promotion_test: RuntimeError
@@ -1,96 +0,0 @@
// Copyright (c) 2012, 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.
// Dart test program for testing the instanceof operation.
import "package:expect/expect.dart";
// In the type test 'e is T', if T does not denote a type available in the
// current lexical scope, then T is mapped to dynamic. Direct tests against
// T cause a dynamic type error though.
isCheckedMode() {
try {
var i = 1;
String s = i;
return false;
} catch (e) {
return true;
}
}
testAll() {
{
bool got_type_error = false;
var x = null;
try {
Expect.isTrue(x is UndeclaredType); // x is null.
} on TypeError catch (error) {
got_type_error = true;
}
// Type error.
Expect.isTrue(got_type_error);
}
{
bool got_type_error = false;
var x = 1;
try {
Expect.isTrue(x is UndeclaredType); // x is not null.
} on TypeError catch (error) {
got_type_error = true;
}
// Type error.
Expect.isTrue(got_type_error);
}
{
bool got_type_error = false;
var x = null;
try {
Expect.isFalse(x is List<UndeclaredType>); // x is null.
} on TypeError catch (error) {
got_type_error = true;
}
// No type error.
Expect.isFalse(got_type_error);
}
{
bool got_type_error = false;
var x = 1;
try {
Expect.isFalse(x is List<UndeclaredType>); // x is not a List.
} on TypeError catch (error) {
got_type_error = true;
}
// No type error.
Expect.isFalse(got_type_error);
}
{
bool got_type_error = false;
var x = new List();
try {
Expect.isTrue(x is List<UndeclaredType>); // x is a List<dynamic>.
} on TypeError catch (error) {
got_type_error = true;
}
// No type error.
Expect.isFalse(got_type_error);
}
{
bool got_type_error = false;
var x = new List<int>();
try {
Expect.isTrue(x is List<UndeclaredType>); // x is a List<int>.
} on TypeError catch (error) {
got_type_error = true;
}
// No type error.
Expect.isFalse(got_type_error);
}
}
main() {
// Repeat type checks so that inlined tests can be tested as well.
for (int i = 0; i < 5; i++) {
testAll();
}
}
@@ -204,14 +204,6 @@ getter_parameters_test: Skip
getter_setter_in_lib_test: Skip
getters_setters2_test: Skip
getters_setters_test: Skip
inline_test_context_test: Skip
inline_value_context_test: Skip
inlined_throw_test: Skip
inst_field_initializer1_negative_test: Skip
instance_call_wrong_argument_count_negative_test: Skip
instance_method2_negative_test: Skip
instance_method_negative_test: Skip
instanceof3_test: Skip
instantiate_type_variable_test: Skip
interceptor2_test: Skip
interceptor3_test: Skip
@@ -108,9 +108,6 @@ function_type_alias3_test: RuntimeError
function_type_alias4_test: RuntimeError
inferrer_closure_test: RuntimeError
initializing_formal_final_test: RuntimeError
instance_creation_in_function_annotation_test: RuntimeError
instanceof4_test/01: RuntimeError
instanceof4_test/none: RuntimeError
issue_1751477_test: RuntimeError
lazy_static7_test: DartkCompileTimeError
main_not_a_function_test/01: DartkCrash