OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 abstract class HVisitor<R> { | 7 abstract class HVisitor<R> { |
8 R visitAdd(HAdd node); | 8 R visitAdd(HAdd node); |
9 R visitBailoutTarget(HBailoutTarget node); | 9 R visitBailoutTarget(HBailoutTarget node); |
10 R visitBitAnd(HBitAnd node); | 10 R visitBitAnd(HBitAnd node); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 HInstruction instruction = first; | 510 HInstruction instruction = first; |
511 while (instruction != null) { | 511 while (instruction != null) { |
512 int instructionId = instruction.id; | 512 int instructionId = instruction.id; |
513 String inputsAsString = instruction.inputsToString(); | 513 String inputsAsString = instruction.inputsToString(); |
514 compiler.log('$instructionId: $instruction $inputsAsString'); | 514 compiler.log('$instructionId: $instruction $inputsAsString'); |
515 instruction = instruction.next; | 515 instruction = instruction.next; |
516 } | 516 } |
517 } | 517 } |
518 | 518 |
519 void addAtEntry(HInstruction instruction) { | 519 void addAtEntry(HInstruction instruction) { |
520 assert(isClosed()); | |
521 assert(instruction is !HPhi); | 520 assert(instruction is !HPhi); |
522 super.addBefore(first, instruction); | 521 super.addBefore(first, instruction); |
523 instruction.notifyAddedToBlock(this); | 522 instruction.notifyAddedToBlock(this); |
524 } | 523 } |
525 | 524 |
526 void addAtExit(HInstruction instruction) { | 525 void addAtExit(HInstruction instruction) { |
527 assert(isClosed()); | 526 assert(isClosed()); |
528 assert(last is HControlFlow); | 527 assert(last is HControlFlow); |
529 assert(instruction is !HPhi); | 528 assert(instruction is !HPhi); |
530 super.addBefore(last, instruction); | 529 super.addBefore(last, instruction); |
(...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 } | 2151 } |
2153 | 2152 |
2154 class HParameterValue extends HLocalValue { | 2153 class HParameterValue extends HLocalValue { |
2155 HParameterValue(Element element) : super(element); | 2154 HParameterValue(Element element) : super(element); |
2156 | 2155 |
2157 toString() => 'parameter ${sourceElement.name.slowToString()}'; | 2156 toString() => 'parameter ${sourceElement.name.slowToString()}'; |
2158 accept(HVisitor visitor) => visitor.visitParameterValue(this); | 2157 accept(HVisitor visitor) => visitor.visitParameterValue(this); |
2159 } | 2158 } |
2160 | 2159 |
2161 class HThis extends HParameterValue { | 2160 class HThis extends HParameterValue { |
2162 HThis([HType type = HType.UNKNOWN]) : super(null) { | 2161 HThis(Element element, [HType type = HType.UNKNOWN]) : super(element) { |
2163 guaranteedType = type; | 2162 guaranteedType = type; |
2164 } | 2163 } |
2165 toString() => 'this'; | 2164 toString() => 'this'; |
2166 accept(HVisitor visitor) => visitor.visitThis(this); | 2165 accept(HVisitor visitor) => visitor.visitThis(this); |
2167 } | 2166 } |
2168 | 2167 |
2169 class HPhi extends HInstruction { | 2168 class HPhi extends HInstruction { |
2170 static const IS_NOT_LOGICAL_OPERATOR = 0; | 2169 static const IS_NOT_LOGICAL_OPERATOR = 0; |
2171 static const IS_AND = 1; | 2170 static const IS_AND = 1; |
2172 static const IS_OR = 2; | 2171 static const IS_OR = 2; |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3015 HBasicBlock get start => expression.start; | 3014 HBasicBlock get start => expression.start; |
3016 HBasicBlock get end { | 3015 HBasicBlock get end { |
3017 // We don't create a switch block if there are no cases. | 3016 // We don't create a switch block if there are no cases. |
3018 assert(!statements.isEmpty); | 3017 assert(!statements.isEmpty); |
3019 return statements.last.end; | 3018 return statements.last.end; |
3020 } | 3019 } |
3021 | 3020 |
3022 bool accept(HStatementInformationVisitor visitor) => | 3021 bool accept(HStatementInformationVisitor visitor) => |
3023 visitor.visitSwitchInfo(this); | 3022 visitor.visitSwitchInfo(this); |
3024 } | 3023 } |
OLD | NEW |