Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 R visitIdentity(HIdentity node); | 21 R visitIdentity(HIdentity node); |
| 22 R visitIf(HIf node); | 22 R visitIf(HIf node); |
| 23 R visitIndex(HIndex node); | 23 R visitIndex(HIndex node); |
| 24 R visitIndexAssign(HIndexAssign node); | 24 R visitIndexAssign(HIndexAssign node); |
| 25 R visitIntegerCheck(HIntegerCheck node); | 25 R visitIntegerCheck(HIntegerCheck node); |
| 26 R visitInvokeDynamicMethod(HInvokeDynamicMethod node); | 26 R visitInvokeDynamicMethod(HInvokeDynamicMethod node); |
| 27 R visitInvokeDynamicGetter(HInvokeDynamicGetter node); | 27 R visitInvokeDynamicGetter(HInvokeDynamicGetter node); |
| 28 R visitInvokeDynamicSetter(HInvokeDynamicSetter node); | 28 R visitInvokeDynamicSetter(HInvokeDynamicSetter node); |
| 29 R visitInvokeInterceptor(HInvokeInterceptor node); | 29 R visitInvokeInterceptor(HInvokeInterceptor node); |
| 30 R visitInvokeStatic(HInvokeStatic node); | 30 R visitInvokeStatic(HInvokeStatic node); |
| 31 R visitInvokeSuper(HInvokeSuper node); | |
| 31 R visitLess(HLess node); | 32 R visitLess(HLess node); |
| 32 R visitLessEqual(HLessEqual node); | 33 R visitLessEqual(HLessEqual node); |
| 33 R visitLoad(HLoad node); | 34 R visitLoad(HLoad node); |
| 34 R visitLocal(HLocal node); | 35 R visitLocal(HLocal node); |
| 35 R visitLogicalOperator(HLogicalOperator node); | 36 R visitLogicalOperator(HLogicalOperator node); |
| 36 R visitLoopBranch(HLoopBranch node); | 37 R visitLoopBranch(HLoopBranch node); |
| 37 R visitLiteral(HLiteral node); | 38 R visitLiteral(HLiteral node); |
| 38 R visitLiteralList(HLiteralList node); | 39 R visitLiteralList(HLiteralList node); |
| 39 R visitModulo(HModulo node); | 40 R visitModulo(HModulo node); |
| 40 R visitMultiply(HMultiply node); | 41 R visitMultiply(HMultiply node); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 visitIntegerCheck(HIntegerCheck node) => visitCheck(node); | 216 visitIntegerCheck(HIntegerCheck node) => visitCheck(node); |
| 216 visitInvokeDynamicMethod(HInvokeDynamicMethod node) | 217 visitInvokeDynamicMethod(HInvokeDynamicMethod node) |
| 217 => visitInvokeDynamic(node); | 218 => visitInvokeDynamic(node); |
| 218 visitInvokeDynamicGetter(HInvokeDynamicGetter node) | 219 visitInvokeDynamicGetter(HInvokeDynamicGetter node) |
| 219 => visitInvokeDynamicField(node); | 220 => visitInvokeDynamicField(node); |
| 220 visitInvokeDynamicSetter(HInvokeDynamicSetter node) | 221 visitInvokeDynamicSetter(HInvokeDynamicSetter node) |
| 221 => visitInvokeDynamicField(node); | 222 => visitInvokeDynamicField(node); |
| 222 visitInvokeInterceptor(HInvokeInterceptor node) | 223 visitInvokeInterceptor(HInvokeInterceptor node) |
| 223 => visitInvokeStatic(node); | 224 => visitInvokeStatic(node); |
| 224 visitInvokeStatic(HInvokeStatic node) => visitInvoke(node); | 225 visitInvokeStatic(HInvokeStatic node) => visitInvoke(node); |
| 226 visitInvokeSuper(HInvokeSuper node) => visitInvoke(node); | |
| 225 visitLess(HLess node) => visitRelational(node); | 227 visitLess(HLess node) => visitRelational(node); |
| 226 visitLessEqual(HLessEqual node) => visitRelational(node); | 228 visitLessEqual(HLessEqual node) => visitRelational(node); |
| 227 visitLoad(HLoad node) => visitInstruction(node); | 229 visitLoad(HLoad node) => visitInstruction(node); |
| 228 visitLocal(HLocal node) => visitInstruction(node); | 230 visitLocal(HLocal node) => visitInstruction(node); |
| 229 visitLogicalOperator(HLogicalOperator node) => visitInstruction(node); | 231 visitLogicalOperator(HLogicalOperator node) => visitInstruction(node); |
| 230 visitLiteral(HLiteral node) => visitInstruction(node); | 232 visitLiteral(HLiteral node) => visitInstruction(node); |
| 231 visitLiteralList(HLiteralList node) => visitInstruction(node); | 233 visitLiteralList(HLiteralList node) => visitInstruction(node); |
| 232 visitLoopBranch(HLoopBranch node) => visitConditionalBranch(node); | 234 visitLoopBranch(HLoopBranch node) => visitConditionalBranch(node); |
| 233 visitModulo(HModulo node) => visitBinaryArithmetic(node); | 235 visitModulo(HModulo node) => visitBinaryArithmetic(node); |
| 234 visitNegate(HNegate node) => visitInvokeUnary(node); | 236 visitNegate(HNegate node) => visitInvokeUnary(node); |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1011 && element.enclosingElement.name.toString() == 'List') { | 1013 && element.enclosingElement.name.toString() == 'List') { |
| 1012 builtin = true; | 1014 builtin = true; |
| 1013 return HType.ARRAY; | 1015 return HType.ARRAY; |
| 1014 } | 1016 } |
| 1015 return HType.UNKNOWN; | 1017 return HType.UNKNOWN; |
| 1016 } | 1018 } |
| 1017 | 1019 |
| 1018 bool hasExpectedType() => builtin; | 1020 bool hasExpectedType() => builtin; |
| 1019 } | 1021 } |
| 1020 | 1022 |
| 1023 class HInvokeSuper extends HInvoke { | |
|
ngeoffray
2012/01/10 16:52:50
Should that be an HInvokeStatic instead?
karlklose
2012/01/11 12:45:17
Done.
| |
| 1024 HInvokeSuper(inputs) : super(inputs); | |
| 1025 toString() => 'invoke super: ${element.name}'; | |
| 1026 accept(HVisitor visitor) => visitor.visitInvokeSuper(this); | |
| 1027 Element get element() => target.element; | |
| 1028 HStatic get target() => inputs[0]; | |
| 1029 } | |
| 1030 | |
| 1021 class HInvokeInterceptor extends HInvokeStatic { | 1031 class HInvokeInterceptor extends HInvokeStatic { |
| 1022 final String name; | 1032 final String name; |
| 1023 final bool getter; | 1033 final bool getter; |
| 1024 String builtinJsName; | 1034 String builtinJsName; |
| 1025 | 1035 |
| 1026 HInvokeInterceptor(String this.name, bool this.getter, inputs) | 1036 HInvokeInterceptor(String this.name, bool this.getter, inputs) |
| 1027 : super(inputs); | 1037 : super(inputs); |
| 1028 toString() => 'invoke interceptor: ${element.name}'; | 1038 toString() => 'invoke interceptor: ${element.name}'; |
| 1029 accept(HVisitor visitor) => visitor.visitInvokeInterceptor(this); | 1039 accept(HVisitor visitor) => visitor.visitInvokeInterceptor(this); |
| 1030 | 1040 |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1986 HInstruction first, | 1996 HInstruction first, |
| 1987 HInstruction second) | 1997 HInstruction second) |
| 1988 : super(<HInstruction>[first, second]); | 1998 : super(<HInstruction>[first, second]); |
| 1989 toString() => operation; | 1999 toString() => operation; |
| 1990 accept(HVisitor visitor) => visitor.visitLogicalOperator(this); | 2000 accept(HVisitor visitor) => visitor.visitLogicalOperator(this); |
| 1991 HInstruction get left() => inputs[0]; | 2001 HInstruction get left() => inputs[0]; |
| 1992 HInstruction get right() => inputs[1]; | 2002 HInstruction get right() => inputs[1]; |
| 1993 HType computeType() => HType.BOOLEAN; | 2003 HType computeType() => HType.BOOLEAN; |
| 1994 bool hasExpectedType() => true; | 2004 bool hasExpectedType() => true; |
| 1995 } | 2005 } |
| OLD | NEW |