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

Side by Side Diff: tests/compiler/dart2js/js_backend_cps_ir_supercall_test.dart

Issue 918653002: Propagate pseudo-constants expressions separately in tree rewriter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // VMOptions=-DUSE_CPS_IR=true 4 // VMOptions=-DUSE_CPS_IR=true
5 5
6 // Tests of interceptors. 6 // Tests of interceptors.
7 7
8 library supercall_test; 8 library supercall_test;
9 9
10 import 'js_backend_cps_ir.dart'; 10 import 'js_backend_cps_ir.dart';
11 11
12 const List<TestEntry> tests = const [ 12 const List<TestEntry> tests = const [
13 const TestEntry.forMethod('function(Sub#m)', """ 13 const TestEntry.forMethod('function(Sub#m)', """
14 class Base { 14 class Base {
15 m(x) { 15 m(x) {
16 print(x+1); 16 print(x+1);
17 } 17 }
18 } 18 }
19 class Sub extends Base { 19 class Sub extends Base {
20 m(x) => super.m(x+10); 20 m(x) => super.m(x+10);
21 } 21 }
22 main() { 22 main() {
23 new Sub().m(100); 23 new Sub().m(100);
24 }""", 24 }""",
25 r""" 25 r"""
26 function(x) { 26 function(x) {
27 var v0, v1; 27 return V.Base.prototype.m$1.call(this, J.getInterceptor$ns(x).$add(x, 10));
28 v0 = 10;
29 v1 = J.getInterceptor$ns(x).$add(x, v0);
30 return V.Base.prototype.m$1.call(this, v1);
31 }"""), 28 }"""),
32 29
33 // Reenable when we support compiling functions that 30 // Reenable when we support compiling functions that
34 // need interceptor calling convention. 31 // need interceptor calling convention.
35 // const TestEntry.forMethod('function(Sub#+)', """ 32 // const TestEntry.forMethod('function(Sub#+)', """
36 // class Base { 33 // class Base {
37 // m(x) { 34 // m(x) {
38 // print(x+1000); 35 // print(x+1000);
39 // } 36 // }
40 // operator+(x) => m(x+10); 37 // operator+(x) => m(x+10);
(...skipping 30 matching lines...) Expand all
71 v0 = this.field; 68 v0 = this.field;
72 return J.getInterceptor$ns(x).$add(x, v0); 69 return J.getInterceptor$ns(x).$add(x, v0);
73 }"""), 70 }"""),
74 71
75 72
76 ]; 73 ];
77 74
78 void main() { 75 void main() {
79 runTests(tests); 76 runTests(tests);
80 } 77 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart ('k') | tests/language/propagate_past_constant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698