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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/unsugar.dart

Issue 1335933004: dart2js cps: Set a flag on InvokeMethod when the receiver is intercepted (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Also use getDartReceiver, getDartArgument in constant folding Created 5 years, 3 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 | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library dart2js.unsugar_cps; 1 library dart2js.unsugar_cps;
2 2
3 import '../../cps_ir/cps_ir_nodes.dart'; 3 import '../../cps_ir/cps_ir_nodes.dart';
4 4
5 import '../../cps_ir/optimizers.dart' show ParentVisitor; 5 import '../../cps_ir/optimizers.dart' show ParentVisitor;
6 import '../../constants/values.dart'; 6 import '../../constants/values.dart';
7 import '../../elements/elements.dart'; 7 import '../../elements/elements.dart';
8 import '../../io/source_information.dart'; 8 import '../../io/source_information.dart';
9 import '../../js_backend/codegen/glue.dart'; 9 import '../../js_backend/codegen/glue.dart';
10 import '../../universe/universe.dart' show Selector; 10 import '../../universe/universe.dart' show Selector;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 LetCont contBinding = node.parent; 243 LetCont contBinding = node.parent;
244 newReceiver = new Interceptor(receiver, node.sourceInformation) 244 newReceiver = new Interceptor(receiver, node.sourceInformation)
245 ..interceptedClasses.addAll(_glue.getInterceptedClassesOn(selector)); 245 ..interceptedClasses.addAll(_glue.getInterceptedClassesOn(selector));
246 if (receiver.hint != null) { 246 if (receiver.hint != null) {
247 newReceiver.hint = new InterceptorEntity(receiver.hint); 247 newReceiver.hint = new InterceptorEntity(receiver.hint);
248 } 248 }
249 insertLetPrim(newReceiver, contBinding); 249 insertLetPrim(newReceiver, contBinding);
250 } 250 }
251 node.arguments.insert(0, node.receiver); 251 node.arguments.insert(0, node.receiver);
252 node.receiver = new Reference<Primitive>(newReceiver); 252 node.receiver = new Reference<Primitive>(newReceiver);
253 node.receiverIsIntercepted = true;
253 } 254 }
254 255
255 processInvokeMethodDirectly(InvokeMethodDirectly node) { 256 processInvokeMethodDirectly(InvokeMethodDirectly node) {
256 if (!_glue.isInterceptedMethod(node.target)) return; 257 if (!_glue.isInterceptedMethod(node.target)) return;
257 258
258 Selector selector = node.selector; 259 Selector selector = node.selector;
259 Primitive receiver = node.receiver.definition; 260 Primitive receiver = node.receiver.definition;
260 Primitive newReceiver; 261 Primitive newReceiver;
261 262
262 if (receiver == explicitReceiverParameter) { 263 if (receiver == explicitReceiverParameter) {
(...skipping 11 matching lines...) Expand all
274 insertLetPrim(newReceiver, contBinding); 275 insertLetPrim(newReceiver, contBinding);
275 } 276 }
276 node.arguments.insert(0, node.receiver); 277 node.arguments.insert(0, node.receiver);
277 node.receiver = new Reference<Primitive>(newReceiver); 278 node.receiver = new Reference<Primitive>(newReceiver);
278 } 279 }
279 280
280 processInterceptor(Interceptor node) { 281 processInterceptor(Interceptor node) {
281 _glue.registerSpecializedGetInterceptor(node.interceptedClasses); 282 _glue.registerSpecializedGetInterceptor(node.interceptedClasses);
282 } 283 }
283 } 284 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698