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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart

Issue 23494057: We can only use JavaScript's String.split and String.+ if both inputs are Strings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.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) 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 HInstruction constant = tryComputeConstantInterceptor( 257 HInstruction constant = tryComputeConstantInterceptor(
258 node.inputs[1], node.interceptedClasses); 258 node.inputs[1], node.interceptedClasses);
259 259
260 if (constant == null) return false; 260 if (constant == null) return false;
261 261
262 Selector selector = node.selector; 262 Selector selector = node.selector;
263 // TODO(ngeoffray): make one shot interceptors know whether 263 // TODO(ngeoffray): make one shot interceptors know whether
264 // they have side effects. 264 // they have side effects.
265 HInstruction instruction; 265 HInstruction instruction;
266 if (selector.isGetter()) { 266 if (selector.isGetter()) {
267 instruction= new HInvokeDynamicGetter( 267 instruction = new HInvokeDynamicGetter(
268 selector, 268 selector,
269 node.element, 269 node.element,
270 <HInstruction>[constant, node.inputs[1]], 270 <HInstruction>[constant, node.inputs[1]],
271 false); 271 false);
272 } else if (node.selector.isSetter()) { 272 } else if (node.selector.isSetter()) {
273 instruction = new HInvokeDynamicSetter( 273 instruction = new HInvokeDynamicSetter(
274 selector, 274 selector,
275 node.element, 275 node.element,
276 <HInstruction>[constant, node.inputs[1], node.inputs[2]], 276 <HInstruction>[constant, node.inputs[1], node.inputs[2]],
277 false); 277 false);
278 } else { 278 } else {
279 List<HInstruction> inputs = new List<HInstruction>.from(node.inputs); 279 List<HInstruction> inputs = new List<HInstruction>.from(node.inputs);
280 inputs[0] = constant; 280 inputs[0] = constant;
281 instruction = new HInvokeDynamicMethod(selector, inputs, true); 281 instruction = new HInvokeDynamicMethod(selector, inputs, true);
282 } 282 }
283 283
284 HBasicBlock block = node.block; 284 HBasicBlock block = node.block;
285 block.addAfter(node, instruction); 285 block.addAfter(node, instruction);
286 block.rewrite(node, instruction); 286 block.rewrite(node, instruction);
287 return true; 287 return true;
288 } 288 }
289 } 289 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698