| 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 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1906 HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs, | 1906 HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs, |
| 1907 SideEffects effects, native.NativeBehavior nativeBehavior, TypeMask type) | 1907 SideEffects effects, native.NativeBehavior nativeBehavior, TypeMask type) |
| 1908 : this(codeTemplate, type, inputs, | 1908 : this(codeTemplate, type, inputs, |
| 1909 isStatement: true, | 1909 isStatement: true, |
| 1910 effects: effects, | 1910 effects: effects, |
| 1911 nativeBehavior: nativeBehavior); | 1911 nativeBehavior: nativeBehavior); |
| 1912 | 1912 |
| 1913 accept(HVisitor visitor) => visitor.visitForeignCode(this); | 1913 accept(HVisitor visitor) => visitor.visitForeignCode(this); |
| 1914 | 1914 |
| 1915 bool isJsStatement() => isStatement; | 1915 bool isJsStatement() => isStatement; |
| 1916 bool canThrow() => | 1916 bool canThrow() { |
| 1917 canBeNull() ? throwBehavior.canThrow : throwBehavior.onNonNull.canThrow; | 1917 if (inputs.length > 0) { |
| 1918 return inputs.first.canBeNull() |
| 1919 ? throwBehavior.canThrow |
| 1920 : throwBehavior.onNonNull.canThrow; |
| 1921 } |
| 1922 return throwBehavior.canThrow; |
| 1923 } |
| 1918 | 1924 |
| 1919 bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard; | 1925 bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard; |
| 1920 | 1926 |
| 1921 bool get isAllocation => | 1927 bool get isAllocation => |
| 1922 nativeBehavior != null && nativeBehavior.isAllocation && !canBeNull(); | 1928 nativeBehavior != null && nativeBehavior.isAllocation && !canBeNull(); |
| 1923 | 1929 |
| 1924 String toString() => 'HForeignCode("${codeTemplate.source}",$inputs)'; | 1930 String toString() => 'HForeignCode("${codeTemplate.source}",$inputs)'; |
| 1925 } | 1931 } |
| 1926 | 1932 |
| 1927 abstract class HInvokeBinary extends HInstruction { | 1933 abstract class HInvokeBinary extends HInstruction { |
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3448 class HDynamicType extends HRuntimeType { | 3454 class HDynamicType extends HRuntimeType { |
| 3449 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3455 HDynamicType(DynamicType dartType, TypeMask instructionType) |
| 3450 : super(const <HInstruction>[], dartType, instructionType); | 3456 : super(const <HInstruction>[], dartType, instructionType); |
| 3451 | 3457 |
| 3452 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3458 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
| 3453 | 3459 |
| 3454 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3460 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
| 3455 | 3461 |
| 3456 bool typeEquals(HInstruction other) => other is HDynamicType; | 3462 bool typeEquals(HInstruction other) => other is HDynamicType; |
| 3457 } | 3463 } |
| OLD | NEW |