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

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

Issue 85813002: Revert "Revert "Build new IR for functions returning a constant."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: feedback by kasper Created 7 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 if (constant == null) return false; 261 if (constant == null) return false;
262 262
263 Selector selector = node.selector; 263 Selector selector = node.selector;
264 HInstruction instruction; 264 HInstruction instruction;
265 if (selector.isGetter()) { 265 if (selector.isGetter()) {
266 instruction = new HInvokeDynamicGetter( 266 instruction = new HInvokeDynamicGetter(
267 selector, 267 selector,
268 node.element, 268 node.element,
269 <HInstruction>[constant, node.inputs[1]], 269 <HInstruction>[constant, node.inputs[1]],
270 node.instructionType); 270 node.instructionType);
271 } else if (node.selector.isSetter()) { 271 } else if (selector.isSetter()) {
272 instruction = new HInvokeDynamicSetter( 272 instruction = new HInvokeDynamicSetter(
273 selector, 273 selector,
274 node.element, 274 node.element,
275 <HInstruction>[constant, node.inputs[1], node.inputs[2]], 275 <HInstruction>[constant, node.inputs[1], node.inputs[2]],
276 node.instructionType); 276 node.instructionType);
277 } else { 277 } else {
278 List<HInstruction> inputs = new List<HInstruction>.from(node.inputs); 278 List<HInstruction> inputs = new List<HInstruction>.from(node.inputs);
279 inputs[0] = constant; 279 inputs[0] = constant;
280 instruction = new HInvokeDynamicMethod( 280 instruction = new HInvokeDynamicMethod(
281 selector, inputs, node.instructionType, true); 281 selector, inputs, node.instructionType, 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

Powered by Google App Engine
This is Rietveld 408576698