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

Side by Side Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 10544026: Simplify generated code for string interpolation by delaying the constant folding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 interface HVisitor<R> { 5 interface HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBitAnd(HBitAnd node); 7 R visitBitAnd(HBitAnd node);
8 R visitBitNot(HBitNot node); 8 R visitBitNot(HBitNot node);
9 R visitBitOr(HBitOr node); 9 R visitBitOr(HBitOr node);
10 R visitBitXor(HBitXor node); 10 R visitBitXor(HBitXor node);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 R visitMultiply(HMultiply node); 44 R visitMultiply(HMultiply node);
45 R visitNegate(HNegate node); 45 R visitNegate(HNegate node);
46 R visitNot(HNot node); 46 R visitNot(HNot node);
47 R visitParameterValue(HParameterValue node); 47 R visitParameterValue(HParameterValue node);
48 R visitPhi(HPhi node); 48 R visitPhi(HPhi node);
49 R visitReturn(HReturn node); 49 R visitReturn(HReturn node);
50 R visitShiftLeft(HShiftLeft node); 50 R visitShiftLeft(HShiftLeft node);
51 R visitShiftRight(HShiftRight node); 51 R visitShiftRight(HShiftRight node);
52 R visitStatic(HStatic node); 52 R visitStatic(HStatic node);
53 R visitStaticStore(HStaticStore node); 53 R visitStaticStore(HStaticStore node);
54 R visitStringConcat(HStringConcat node);
54 R visitSubtract(HSubtract node); 55 R visitSubtract(HSubtract node);
55 R visitThis(HThis node); 56 R visitThis(HThis node);
56 R visitThrow(HThrow node); 57 R visitThrow(HThrow node);
57 R visitTruncatingDivide(HTruncatingDivide node); 58 R visitTruncatingDivide(HTruncatingDivide node);
58 R visitTry(HTry node); 59 R visitTry(HTry node);
59 R visitTypeGuard(HTypeGuard node); 60 R visitTypeGuard(HTypeGuard node);
60 R visitTypeConversion(HTypeConversion node); 61 R visitTypeConversion(HTypeConversion node);
61 } 62 }
62 63
63 class HGraphVisitor { 64 class HGraphVisitor {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 visitNot(HNot node) => visitInstruction(node); 295 visitNot(HNot node) => visitInstruction(node);
295 visitPhi(HPhi node) => visitInstruction(node); 296 visitPhi(HPhi node) => visitInstruction(node);
296 visitMultiply(HMultiply node) => visitBinaryArithmetic(node); 297 visitMultiply(HMultiply node) => visitBinaryArithmetic(node);
297 visitParameterValue(HParameterValue node) => visitInstruction(node); 298 visitParameterValue(HParameterValue node) => visitInstruction(node);
298 visitReturn(HReturn node) => visitControlFlow(node); 299 visitReturn(HReturn node) => visitControlFlow(node);
299 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node); 300 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node);
300 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node); 301 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node);
301 visitSubtract(HSubtract node) => visitBinaryArithmetic(node); 302 visitSubtract(HSubtract node) => visitBinaryArithmetic(node);
302 visitStatic(HStatic node) => visitInstruction(node); 303 visitStatic(HStatic node) => visitInstruction(node);
303 visitStaticStore(HStaticStore node) => visitInstruction(node); 304 visitStaticStore(HStaticStore node) => visitInstruction(node);
305 visitStringConcat(HStringConcat node) => visitInstruction(node);
304 visitThis(HThis node) => visitParameterValue(node); 306 visitThis(HThis node) => visitParameterValue(node);
305 visitThrow(HThrow node) => visitControlFlow(node); 307 visitThrow(HThrow node) => visitControlFlow(node);
306 visitTry(HTry node) => visitControlFlow(node); 308 visitTry(HTry node) => visitControlFlow(node);
307 visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node); 309 visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node);
308 visitTypeGuard(HTypeGuard node) => visitCheck(node); 310 visitTypeGuard(HTypeGuard node) => visitCheck(node);
309 visitIs(HIs node) => visitInstruction(node); 311 visitIs(HIs node) => visitInstruction(node);
310 visitTypeConversion(HTypeConversion node) => visitCheck(node); 312 visitTypeConversion(HTypeConversion node) => visitCheck(node);
311 } 313 }
312 314
313 class SubGraph { 315 class SubGraph {
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
2198 sourceElement = input.sourceElement; 2200 sourceElement = input.sourceElement;
2199 } 2201 }
2200 2202
2201 HType get guaranteedType() => type; 2203 HType get guaranteedType() => type;
2202 2204
2203 accept(HVisitor visitor) => visitor.visitTypeConversion(this); 2205 accept(HVisitor visitor) => visitor.visitTypeConversion(this);
2204 2206
2205 bool hasSideEffects() => checked; 2207 bool hasSideEffects() => checked;
2206 } 2208 }
2207 2209
2210 class HStringConcat extends HInstruction {
2211 HStringConcat(inputs) : super(inputs);
2212 HType get guaranteedType() => HType.STRING;
2213
2214 accept(HVisitor visitor) => visitor.visitStringConcat(this);
2215 toString() => "string concat";
Lasse Reichstein Nielsen 2012/06/06 12:11:40 Should this class be allowed to have more than two
kasperl 2012/06/06 13:31:03 Changed the constructor to take exactly two argume
2216 }
2217
2208 /** Non-block-based (aka. traditional) loop information. */ 2218 /** Non-block-based (aka. traditional) loop information. */
2209 class HLoopInformation { 2219 class HLoopInformation {
2210 final HBasicBlock header; 2220 final HBasicBlock header;
2211 final List<HBasicBlock> blocks; 2221 final List<HBasicBlock> blocks;
2212 final List<HBasicBlock> backEdges; 2222 final List<HBasicBlock> backEdges;
2213 final List<LabelElement> labels; 2223 final List<LabelElement> labels;
2214 final TargetElement target; 2224 final TargetElement target;
2215 2225
2216 /** Corresponding block information for the loop. */ 2226 /** Corresponding block information for the loop. */
2217 HLoopBlockInformation loopBlockInformation; 2227 HLoopBlockInformation loopBlockInformation;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2491 this.catchBlock, 2501 this.catchBlock,
2492 this.finallyBlock); 2502 this.finallyBlock);
2493 2503
2494 HBasicBlock get start() => body.start; 2504 HBasicBlock get start() => body.start;
2495 HBasicBlock get end() => 2505 HBasicBlock get end() =>
2496 finallyBlock === null ? catchBlock.end : finallyBlock.end; 2506 finallyBlock === null ? catchBlock.end : finallyBlock.end;
2497 2507
2498 bool accept(HStatementInformationVisitor visitor) => 2508 bool accept(HStatementInformationVisitor visitor) =>
2499 visitor.visitTryInfo(this); 2509 visitor.visitTryInfo(this);
2500 } 2510 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698