Chromium Code Reviews| 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 interface HVisitor<R> { | 5 interface HVisitor<R> { |
| 6 R visitAdd(HAdd node); | 6 R visitAdd(HAdd node); |
| 7 R visitBailoutTarget(HBailoutTarget node); | 7 R visitBailoutTarget(HBailoutTarget node); |
| 8 R visitBitAnd(HBitAnd node); | 8 R visitBitAnd(HBitAnd node); |
| 9 R visitBitNot(HBitNot node); | 9 R visitBitNot(HBitNot node); |
| 10 R visitBitOr(HBitOr node); | 10 R visitBitOr(HBitOr node); |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 752 // Changes flags. | 752 // Changes flags. |
| 753 static const int FLAG_CHANGES_SOMETHING = 0; | 753 static const int FLAG_CHANGES_SOMETHING = 0; |
| 754 static const int FLAG_CHANGES_COUNT = FLAG_CHANGES_SOMETHING + 1; | 754 static const int FLAG_CHANGES_COUNT = FLAG_CHANGES_SOMETHING + 1; |
| 755 | 755 |
| 756 // Depends flags (one for each changes flag). | 756 // Depends flags (one for each changes flag). |
| 757 static const int FLAG_DEPENDS_ON_SOMETHING = FLAG_CHANGES_COUNT; | 757 static const int FLAG_DEPENDS_ON_SOMETHING = FLAG_CHANGES_COUNT; |
| 758 | 758 |
| 759 // Other flags. | 759 // Other flags. |
| 760 static const int FLAG_USE_GVN = FLAG_DEPENDS_ON_SOMETHING + 1; | 760 static const int FLAG_USE_GVN = FLAG_DEPENDS_ON_SOMETHING + 1; |
| 761 | 761 |
| 762 // Type codes. | 762 // DartType codes. |
|
kasperl
2012/08/30 14:11:27
Remove Dart again.
| |
| 763 static const int UNDEFINED_TYPECODE = -1; | 763 static const int UNDEFINED_TYPECODE = -1; |
| 764 static const int BOOLIFY_TYPECODE = 0; | 764 static const int BOOLIFY_TYPECODE = 0; |
| 765 static const int TYPE_GUARD_TYPECODE = 1; | 765 static const int TYPE_GUARD_TYPECODE = 1; |
| 766 static const int BOUNDS_CHECK_TYPECODE = 2; | 766 static const int BOUNDS_CHECK_TYPECODE = 2; |
| 767 static const int INTEGER_CHECK_TYPECODE = 3; | 767 static const int INTEGER_CHECK_TYPECODE = 3; |
| 768 static const int INVOKE_INTERCEPTOR_TYPECODE = 4; | 768 static const int INVOKE_INTERCEPTOR_TYPECODE = 4; |
| 769 static const int ADD_TYPECODE = 5; | 769 static const int ADD_TYPECODE = 5; |
| 770 static const int DIVIDE_TYPECODE = 6; | 770 static const int DIVIDE_TYPECODE = 6; |
| 771 static const int MODULO_TYPECODE = 7; | 771 static const int MODULO_TYPECODE = 7; |
| 772 static const int MULTIPLY_TYPECODE = 8; | 772 static const int MULTIPLY_TYPECODE = 8; |
| (...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2395 // because the integer check will simply throw if it fails. | 2395 // because the integer check will simply throw if it fails. |
| 2396 return HType.UNKNOWN; | 2396 return HType.UNKNOWN; |
| 2397 } | 2397 } |
| 2398 | 2398 |
| 2399 bool isBuiltin(HTypeMap types) | 2399 bool isBuiltin(HTypeMap types) |
| 2400 => receiver.isMutableArray(types) && index.isInteger(types); | 2400 => receiver.isMutableArray(types) && index.isInteger(types); |
| 2401 bool isJsStatement(HTypeMap types) => !isBuiltin(types); | 2401 bool isJsStatement(HTypeMap types) => !isBuiltin(types); |
| 2402 } | 2402 } |
| 2403 | 2403 |
| 2404 class HIs extends HInstruction { | 2404 class HIs extends HInstruction { |
| 2405 final Type typeExpression; | 2405 final DartType typeExpression; |
| 2406 final bool nullOk; | 2406 final bool nullOk; |
| 2407 | 2407 |
| 2408 HIs.withTypeInfoCall(this.typeExpression, HInstruction expression, | 2408 HIs.withTypeInfoCall(this.typeExpression, HInstruction expression, |
| 2409 HInstruction typeInfo, [this.nullOk = false]) | 2409 HInstruction typeInfo, [this.nullOk = false]) |
| 2410 : super(<HInstruction>[expression, typeInfo]); | 2410 : super(<HInstruction>[expression, typeInfo]); |
| 2411 | 2411 |
| 2412 HIs(this.typeExpression, HInstruction expression, [this.nullOk = false]) | 2412 HIs(this.typeExpression, HInstruction expression, [this.nullOk = false]) |
| 2413 : super(<HInstruction>[expression]); | 2413 : super(<HInstruction>[expression]); |
| 2414 | 2414 |
| 2415 HInstruction get expression => inputs[0]; | 2415 HInstruction get expression => inputs[0]; |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2801 HBasicBlock get start => expression.start; | 2801 HBasicBlock get start => expression.start; |
| 2802 HBasicBlock get end { | 2802 HBasicBlock get end { |
| 2803 // We don't create a switch block if there are no cases. | 2803 // We don't create a switch block if there are no cases. |
| 2804 assert(!statements.isEmpty()); | 2804 assert(!statements.isEmpty()); |
| 2805 return statements.last().end; | 2805 return statements.last().end; |
| 2806 } | 2806 } |
| 2807 | 2807 |
| 2808 bool accept(HStatementInformationVisitor visitor) => | 2808 bool accept(HStatementInformationVisitor visitor) => |
| 2809 visitor.visitSwitchInfo(this); | 2809 visitor.visitSwitchInfo(this); |
| 2810 } | 2810 } |
| OLD | NEW |