| 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 import '../closure.dart'; | 5 import '../closure.dart'; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../compiler.dart' show Compiler; | 7 import '../compiler.dart' show Compiler; |
| 8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 R visitLoopBranch(HLoopBranch node); | 72 R visitLoopBranch(HLoopBranch node); |
| 73 R visitMultiply(HMultiply node); | 73 R visitMultiply(HMultiply node); |
| 74 R visitNegate(HNegate node); | 74 R visitNegate(HNegate node); |
| 75 R visitNot(HNot node); | 75 R visitNot(HNot node); |
| 76 R visitOneShotInterceptor(HOneShotInterceptor node); | 76 R visitOneShotInterceptor(HOneShotInterceptor node); |
| 77 R visitParameterValue(HParameterValue node); | 77 R visitParameterValue(HParameterValue node); |
| 78 R visitPhi(HPhi node); | 78 R visitPhi(HPhi node); |
| 79 R visitRangeConversion(HRangeConversion node); | 79 R visitRangeConversion(HRangeConversion node); |
| 80 R visitReadModifyWrite(HReadModifyWrite node); | 80 R visitReadModifyWrite(HReadModifyWrite node); |
| 81 R visitRef(HRef node); | 81 R visitRef(HRef node); |
| 82 R visitRemainder(HRemainder node); |
| 82 R visitReturn(HReturn node); | 83 R visitReturn(HReturn node); |
| 83 R visitShiftLeft(HShiftLeft node); | 84 R visitShiftLeft(HShiftLeft node); |
| 84 R visitShiftRight(HShiftRight node); | 85 R visitShiftRight(HShiftRight node); |
| 85 R visitStatic(HStatic node); | 86 R visitStatic(HStatic node); |
| 86 R visitStaticStore(HStaticStore node); | 87 R visitStaticStore(HStaticStore node); |
| 87 R visitStringConcat(HStringConcat node); | 88 R visitStringConcat(HStringConcat node); |
| 88 R visitStringify(HStringify node); | 89 R visitStringify(HStringify node); |
| 89 R visitSubtract(HSubtract node); | 90 R visitSubtract(HSubtract node); |
| 90 R visitSwitch(HSwitch node); | 91 R visitSwitch(HSwitch node); |
| 91 R visitThis(HThis node); | 92 R visitThis(HThis node); |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 visitLoopBranch(HLoopBranch node) => visitConditionalBranch(node); | 376 visitLoopBranch(HLoopBranch node) => visitConditionalBranch(node); |
| 376 visitNegate(HNegate node) => visitInvokeUnary(node); | 377 visitNegate(HNegate node) => visitInvokeUnary(node); |
| 377 visitNot(HNot node) => visitInstruction(node); | 378 visitNot(HNot node) => visitInstruction(node); |
| 378 visitOneShotInterceptor(HOneShotInterceptor node) => visitInvokeDynamic(node); | 379 visitOneShotInterceptor(HOneShotInterceptor node) => visitInvokeDynamic(node); |
| 379 visitPhi(HPhi node) => visitInstruction(node); | 380 visitPhi(HPhi node) => visitInstruction(node); |
| 380 visitMultiply(HMultiply node) => visitBinaryArithmetic(node); | 381 visitMultiply(HMultiply node) => visitBinaryArithmetic(node); |
| 381 visitParameterValue(HParameterValue node) => visitLocalValue(node); | 382 visitParameterValue(HParameterValue node) => visitLocalValue(node); |
| 382 visitRangeConversion(HRangeConversion node) => visitCheck(node); | 383 visitRangeConversion(HRangeConversion node) => visitCheck(node); |
| 383 visitReadModifyWrite(HReadModifyWrite node) => visitInstruction(node); | 384 visitReadModifyWrite(HReadModifyWrite node) => visitInstruction(node); |
| 384 visitRef(HRef node) => node.value.accept(this); | 385 visitRef(HRef node) => node.value.accept(this); |
| 386 visitRemainder(HRemainder node) => visitBinaryArithmetic(node); |
| 385 visitReturn(HReturn node) => visitControlFlow(node); | 387 visitReturn(HReturn node) => visitControlFlow(node); |
| 386 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node); | 388 visitShiftLeft(HShiftLeft node) => visitBinaryBitOp(node); |
| 387 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node); | 389 visitShiftRight(HShiftRight node) => visitBinaryBitOp(node); |
| 388 visitSubtract(HSubtract node) => visitBinaryArithmetic(node); | 390 visitSubtract(HSubtract node) => visitBinaryArithmetic(node); |
| 389 visitSwitch(HSwitch node) => visitControlFlow(node); | 391 visitSwitch(HSwitch node) => visitControlFlow(node); |
| 390 visitStatic(HStatic node) => visitInstruction(node); | 392 visitStatic(HStatic node) => visitInstruction(node); |
| 391 visitStaticStore(HStaticStore node) => visitInstruction(node); | 393 visitStaticStore(HStaticStore node) => visitInstruction(node); |
| 392 visitStringConcat(HStringConcat node) => visitInstruction(node); | 394 visitStringConcat(HStringConcat node) => visitInstruction(node); |
| 393 visitStringify(HStringify node) => visitInstruction(node); | 395 visitStringify(HStringify node) => visitInstruction(node); |
| 394 visitThis(HThis node) => visitParameterValue(node); | 396 visitThis(HThis node) => visitParameterValue(node); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 static const int INTERFACE_TYPE_TYPECODE = 34; | 872 static const int INTERFACE_TYPE_TYPECODE = 34; |
| 871 static const int DYNAMIC_TYPE_TYPECODE = 35; | 873 static const int DYNAMIC_TYPE_TYPECODE = 35; |
| 872 static const int TRUNCATING_DIVIDE_TYPECODE = 36; | 874 static const int TRUNCATING_DIVIDE_TYPECODE = 36; |
| 873 static const int IS_VIA_INTERCEPTOR_TYPECODE = 37; | 875 static const int IS_VIA_INTERCEPTOR_TYPECODE = 37; |
| 874 | 876 |
| 875 static const int TYPE_INFO_READ_RAW_TYPECODE = 38; | 877 static const int TYPE_INFO_READ_RAW_TYPECODE = 38; |
| 876 static const int TYPE_INFO_READ_VARIABLE_TYPECODE = 39; | 878 static const int TYPE_INFO_READ_VARIABLE_TYPECODE = 39; |
| 877 static const int TYPE_INFO_EXPRESSION_TYPECODE = 40; | 879 static const int TYPE_INFO_EXPRESSION_TYPECODE = 40; |
| 878 | 880 |
| 879 static const int FOREIGN_CODE_TYPECODE = 41; | 881 static const int FOREIGN_CODE_TYPECODE = 41; |
| 882 static const int REMAINDER_TYPECODE = 42; |
| 880 | 883 |
| 881 HInstruction(this.inputs, this.instructionType) | 884 HInstruction(this.inputs, this.instructionType) |
| 882 : id = idCounter++, | 885 : id = idCounter++, |
| 883 usedBy = <HInstruction>[] { | 886 usedBy = <HInstruction>[] { |
| 884 assert(inputs.every((e) => e != null)); | 887 assert(inputs.every((e) => e != null)); |
| 885 } | 888 } |
| 886 | 889 |
| 887 int get hashCode => id; | 890 int get hashCode => id; |
| 888 | 891 |
| 889 bool useGvn() => _useGvn; | 892 bool useGvn() => _useGvn; |
| (...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2030 : super(left, right, selector, type); | 2033 : super(left, right, selector, type); |
| 2031 accept(HVisitor visitor) => visitor.visitTruncatingDivide(this); | 2034 accept(HVisitor visitor) => visitor.visitTruncatingDivide(this); |
| 2032 | 2035 |
| 2033 BinaryOperation operation(ConstantSystem constantSystem) => | 2036 BinaryOperation operation(ConstantSystem constantSystem) => |
| 2034 constantSystem.truncatingDivide; | 2037 constantSystem.truncatingDivide; |
| 2035 int typeCode() => HInstruction.TRUNCATING_DIVIDE_TYPECODE; | 2038 int typeCode() => HInstruction.TRUNCATING_DIVIDE_TYPECODE; |
| 2036 bool typeEquals(other) => other is HTruncatingDivide; | 2039 bool typeEquals(other) => other is HTruncatingDivide; |
| 2037 bool dataEquals(HInstruction other) => true; | 2040 bool dataEquals(HInstruction other) => true; |
| 2038 } | 2041 } |
| 2039 | 2042 |
| 2043 class HRemainder extends HBinaryArithmetic { |
| 2044 HRemainder( |
| 2045 HInstruction left, HInstruction right, Selector selector, TypeMask type) |
| 2046 : super(left, right, selector, type); |
| 2047 accept(HVisitor visitor) => visitor.visitRemainder(this); |
| 2048 |
| 2049 BinaryOperation operation(ConstantSystem constantSystem) => |
| 2050 constantSystem.remainder; |
| 2051 int typeCode() => HInstruction.REMAINDER_TYPECODE; |
| 2052 bool typeEquals(other) => other is HRemainder; |
| 2053 bool dataEquals(HInstruction other) => true; |
| 2054 } |
| 2055 |
| 2040 /** | 2056 /** |
| 2041 * An [HSwitch] instruction has one input for the incoming | 2057 * An [HSwitch] instruction has one input for the incoming |
| 2042 * value, and one input per constant that it can switch on. | 2058 * value, and one input per constant that it can switch on. |
| 2043 * Its block has one successor per constant, and one for the default. | 2059 * Its block has one successor per constant, and one for the default. |
| 2044 */ | 2060 */ |
| 2045 class HSwitch extends HControlFlow { | 2061 class HSwitch extends HControlFlow { |
| 2046 HSwitch(List<HInstruction> inputs) : super(inputs); | 2062 HSwitch(List<HInstruction> inputs) : super(inputs); |
| 2047 | 2063 |
| 2048 HConstant constant(int index) => inputs[index + 1]; | 2064 HConstant constant(int index) => inputs[index + 1]; |
| 2049 HInstruction get expression => inputs[0]; | 2065 HInstruction get expression => inputs[0]; |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3480 class HDynamicType extends HRuntimeType { | 3496 class HDynamicType extends HRuntimeType { |
| 3481 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3497 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 3482 : super(const <HInstruction>[], dartType, instructionType); | 3498 : super(const <HInstruction>[], dartType, instructionType); |
| 3483 | 3499 |
| 3484 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3500 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 3485 | 3501 |
| 3486 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3502 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 3487 | 3503 |
| 3488 bool typeEquals(HInstruction other) => other is HDynamicType; | 3504 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 3489 } | 3505 } |
| OLD | NEW |