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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_fragment.dart

Issue 1537663002: dart2js: Initial implementation of inlining. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebaseline test expectations and fix a bug (typo). Created 4 years, 12 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 library cps_ir.cps_fragment; 5 library cps_ir.cps_fragment;
6 6
7 import 'cps_ir_nodes.dart'; 7 import 'cps_ir_nodes.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../universe/selector.dart' show Selector; 9 import '../universe/selector.dart' show Selector;
10 import '../types/types.dart' show TypeMask; 10 import '../types/types.dart' show TypeMask;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 List<Primitive> arguments, 123 List<Primitive> arguments,
124 {bool receiverIsNotNull: false}) { 124 {bool receiverIsNotNull: false}) {
125 ApplyBuiltinMethod apply = 125 ApplyBuiltinMethod apply =
126 new ApplyBuiltinMethod(method, receiver, arguments, sourceInformation); 126 new ApplyBuiltinMethod(method, receiver, arguments, sourceInformation);
127 apply.receiverIsNotNull = receiverIsNotNull; 127 apply.receiverIsNotNull = receiverIsNotNull;
128 return letPrim(apply); 128 return letPrim(apply);
129 } 129 }
130 130
131 /// Inserts an invocation and returns a primitive holding the returned value. 131 /// Inserts an invocation and returns a primitive holding the returned value.
132 Primitive invokeMethod(Primitive receiver, 132 Primitive invokeMethod(Primitive receiver,
133 Selector selector, 133 Selector selector,
134 TypeMask mask, 134 TypeMask mask,
135 List<Primitive> arguments) { 135 List<Primitive> arguments,
136 return letPrim(new InvokeMethod(receiver, selector, mask, arguments, 136 [CallingConvention callingConvention = CallingConvention.Normal]) {
137 sourceInformation)); 137 InvokeMethod invoke =
138 new InvokeMethod(receiver, selector, mask, arguments, sourceInformation)
139 ..callingConvention = callingConvention;
140 return letPrim(invoke);
138 } 141 }
139 142
140 /// Inserts an invocation and returns a primitive holding the returned value. 143 /// Inserts an invocation and returns a primitive holding the returned value.
141 Primitive invokeStatic(FunctionElement target, List<Primitive> arguments) { 144 Primitive invokeStatic(FunctionElement target, List<Primitive> arguments) {
142 return letPrim(new InvokeStatic(target, new Selector.fromElement(target), 145 return letPrim(new InvokeStatic(target, new Selector.fromElement(target),
143 arguments, sourceInformation)); 146 arguments, sourceInformation));
144 } 147 }
145 148
146 /// Inserts an invocation to a static function that throws an error. 149 /// Inserts an invocation to a static function that throws an error.
147 /// 150 ///
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 while (prim.firstRef != null) { 356 while (prim.firstRef != null) {
354 Refinement refine = prim.firstRef.parent; 357 Refinement refine = prim.firstRef.parent;
355 destroyRefinementsOfDeadPrimitive(refine); 358 destroyRefinementsOfDeadPrimitive(refine);
356 LetPrim letPrim = refine.parent; 359 LetPrim letPrim = refine.parent;
357 InteriorNode parent = letPrim.parent; 360 InteriorNode parent = letPrim.parent;
358 parent.body = letPrim.body; 361 parent.body = letPrim.body;
359 letPrim.body.parent = parent; 362 letPrim.body.parent = parent;
360 prim.firstRef.unlink(); 363 prim.firstRef.unlink();
361 } 364 }
362 } 365 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698