Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: tests/language/deopt_inlined_function_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated latest tests. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Test deoptimization from within an inlined function. 4 // Test deoptimization from within an inlined function.
5 5
6 import "package:expect/expect.dart";
7
6 class A { 8 class A {
7 deopt_here() => 1; 9 deopt_here() => 1;
8 } 10 }
9 11
10 class B { 12 class B {
11 deopt_here() => 2; 13 deopt_here() => 2;
12 } 14 }
13 15
14 var obj = new A(); 16 var obj = new A();
15 17
16 bar(x) { 18 bar(x) {
17 x = 42; 19 x = 42;
18 obj.deopt_here(); 20 obj.deopt_here();
19 return x; 21 return x;
20 } 22 }
21 23
22 foo(x) { 24 foo(x) {
23 x = bar(x); 25 x = bar(x);
24 return x; 26 return x;
25 } 27 }
26 28
27 main() { 29 main() {
28 Expect.equals(42, foo(1)); 30 Expect.equals(42, foo(1));
29 for (var i = 0; i < 2000; i++) foo(7); 31 for (var i = 0; i < 2000; i++) foo(7);
30 Expect.equals(42, foo(2)); 32 Expect.equals(42, foo(2));
31 obj = new B(); 33 obj = new B();
32 Expect.equals(42, foo(3)); // <-- deoptimization via foo/bar/obj.deopt_here 34 Expect.equals(42, foo(3)); // <-- deoptimization via foo/bar/obj.deopt_here
33 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698