OLD | NEW |
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 Loading... |
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 visitSwitch(HSwitch node); | 56 R visitSwitch(HSwitch node); |
56 R visitThis(HThis node); | 57 R visitThis(HThis node); |
57 R visitThrow(HThrow node); | 58 R visitThrow(HThrow node); |
58 R visitTruncatingDivide(HTruncatingDivide node); | 59 R visitTruncatingDivide(HTruncatingDivide node); |
59 R visitTry(HTry node); | 60 R visitTry(HTry node); |
60 R visitTypeGuard(HTypeGuard node); | 61 R visitTypeGuard(HTypeGuard node); |
61 R visitTypeConversion(HTypeConversion node); | 62 R visitTypeConversion(HTypeConversion node); |
62 } | 63 } |
63 | 64 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 visitPhi(HPhi node) => visitInstruction(node); | 298 visitPhi(HPhi node) => visitInstruction(node); |
298 visitMultiply(HMultiply node) => visitBinaryArithmetic(node); | 299 visitMultiply(HMultiply node) => visitBinaryArithmetic(node); |
299 visitParameterValue(HParameterValue node) => visitInstruction(node); | 300 visitParameterValue(HParameterValue node) => visitInstruction(node); |
300 visitReturn(HReturn node) => visitControlFlow(node); | 301 visitReturn(HReturn node) => visitControlFlow(node); |
301 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node); | 302 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node); |
302 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node); | 303 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node); |
303 visitSubtract(HSubtract node) => visitBinaryArithmetic(node); | 304 visitSubtract(HSubtract node) => visitBinaryArithmetic(node); |
304 visitSwitch(HSwitch node) => visitControlFlow(node); | 305 visitSwitch(HSwitch node) => visitControlFlow(node); |
305 visitStatic(HStatic node) => visitInstruction(node); | 306 visitStatic(HStatic node) => visitInstruction(node); |
306 visitStaticStore(HStaticStore node) => visitInstruction(node); | 307 visitStaticStore(HStaticStore node) => visitInstruction(node); |
| 308 visitStringConcat(HStringConcat node) => visitInstruction(node); |
307 visitThis(HThis node) => visitParameterValue(node); | 309 visitThis(HThis node) => visitParameterValue(node); |
308 visitThrow(HThrow node) => visitControlFlow(node); | 310 visitThrow(HThrow node) => visitControlFlow(node); |
309 visitTry(HTry node) => visitControlFlow(node); | 311 visitTry(HTry node) => visitControlFlow(node); |
310 visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node); | 312 visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node); |
311 visitTypeGuard(HTypeGuard node) => visitCheck(node); | 313 visitTypeGuard(HTypeGuard node) => visitCheck(node); |
312 visitIs(HIs node) => visitInstruction(node); | 314 visitIs(HIs node) => visitInstruction(node); |
313 visitTypeConversion(HTypeConversion node) => visitCheck(node); | 315 visitTypeConversion(HTypeConversion node) => visitCheck(node); |
314 } | 316 } |
315 | 317 |
316 class SubGraph { | 318 class SubGraph { |
(...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 sourceElement = input.sourceElement; | 2227 sourceElement = input.sourceElement; |
2226 } | 2228 } |
2227 | 2229 |
2228 HType get guaranteedType() => type; | 2230 HType get guaranteedType() => type; |
2229 | 2231 |
2230 accept(HVisitor visitor) => visitor.visitTypeConversion(this); | 2232 accept(HVisitor visitor) => visitor.visitTypeConversion(this); |
2231 | 2233 |
2232 bool hasSideEffects() => checked; | 2234 bool hasSideEffects() => checked; |
2233 } | 2235 } |
2234 | 2236 |
| 2237 class HStringConcat extends HInstruction { |
| 2238 HStringConcat(HInstruction left, HInstrunction right) |
| 2239 : super(<HInstruction>[left, right]); |
| 2240 HType get guaranteedType() => HType.STRING; |
| 2241 |
| 2242 HInstruction get left() => inputs[0]; |
| 2243 HInstruction get right() => inputs[1]; |
| 2244 |
| 2245 accept(HVisitor visitor) => visitor.visitStringConcat(this); |
| 2246 toString() => "string concat"; |
| 2247 } |
| 2248 |
2235 /** Non-block-based (aka. traditional) loop information. */ | 2249 /** Non-block-based (aka. traditional) loop information. */ |
2236 class HLoopInformation { | 2250 class HLoopInformation { |
2237 final HBasicBlock header; | 2251 final HBasicBlock header; |
2238 final List<HBasicBlock> blocks; | 2252 final List<HBasicBlock> blocks; |
2239 final List<HBasicBlock> backEdges; | 2253 final List<HBasicBlock> backEdges; |
2240 final List<LabelElement> labels; | 2254 final List<LabelElement> labels; |
2241 final TargetElement target; | 2255 final TargetElement target; |
2242 | 2256 |
2243 /** Corresponding block information for the loop. */ | 2257 /** Corresponding block information for the loop. */ |
2244 HLoopBlockInformation loopBlockInformation; | 2258 HLoopBlockInformation loopBlockInformation; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2549 HBasicBlock get start() => expression.start; | 2563 HBasicBlock get start() => expression.start; |
2550 HBasicBlock get end() { | 2564 HBasicBlock get end() { |
2551 // We don't create a switch block if there are no cases. | 2565 // We don't create a switch block if there are no cases. |
2552 assert(!statements.isEmpty()); | 2566 assert(!statements.isEmpty()); |
2553 return statements.last().end; | 2567 return statements.last().end; |
2554 } | 2568 } |
2555 | 2569 |
2556 bool accept(HStatementInformationVisitor visitor) => | 2570 bool accept(HStatementInformationVisitor visitor) => |
2557 visitor.visitSwitchInfo(this); | 2571 visitor.visitSwitchInfo(this); |
2558 } | 2572 } |
OLD | NEW |