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

Side by Side Diff: dart/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart

Issue 740273003: Incremental compiler: support optional arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42234. Created 6 years 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * This phase simplifies interceptors in multiple ways: 8 * This phase simplifies interceptors in multiple ways:
9 * 9 *
10 * 1) If the interceptor is for an object whose type is known, it 10 * 1) If the interceptor is for an object whose type is known, it
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 HInstruction constantInterceptor = 248 HInstruction constantInterceptor =
249 tryComputeConstantInterceptor(receiver, interceptedClasses); 249 tryComputeConstantInterceptor(receiver, interceptedClasses);
250 if (constantInterceptor != null) { 250 if (constantInterceptor != null) {
251 node.block.rewrite(node, constantInterceptor); 251 node.block.rewrite(node, constantInterceptor);
252 return false; 252 return false;
253 } 253 }
254 254
255 node.interceptedClasses = interceptedClasses; 255 node.interceptedClasses = interceptedClasses;
256 256
257 // Try creating a one-shot interceptor. 257 // Try creating a one-shot interceptor.
258 if (compiler.hasIncrementalSupport) return false;
258 if (node.usedBy.length != 1) return false; 259 if (node.usedBy.length != 1) return false;
259 if (node.usedBy[0] is !HInvokeDynamic) return false; 260 if (node.usedBy[0] is !HInvokeDynamic) return false;
260 261
261 HInvokeDynamic user = node.usedBy[0]; 262 HInvokeDynamic user = node.usedBy[0];
262 263
263 // If [node] was loop hoisted, we keep the interceptor. 264 // If [node] was loop hoisted, we keep the interceptor.
264 if (!user.hasSameLoopHeaderAs(node)) return false; 265 if (!user.hasSameLoopHeaderAs(node)) return false;
265 266
266 // Replace the user with a [HOneShotInterceptor]. 267 // Replace the user with a [HOneShotInterceptor].
267 HConstant nullConstant = graph.addConstantNull(compiler); 268 HConstant nullConstant = graph.addConstantNull(compiler);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 instruction = new HInvokeDynamicMethod( 322 instruction = new HInvokeDynamicMethod(
322 selector, inputs, node.instructionType, true); 323 selector, inputs, node.instructionType, true);
323 } 324 }
324 325
325 HBasicBlock block = node.block; 326 HBasicBlock block = node.block;
326 block.addAfter(node, instruction); 327 block.addAfter(node, instruction);
327 block.rewrite(node, instruction); 328 block.rewrite(node, instruction);
328 return true; 329 return true;
329 } 330 }
330 } 331 }
OLDNEW
« no previous file with comments | « dart/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | dart/pkg/dart2js_incremental/lib/caching_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698