Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 2815403004: dart2js: Avoid inserting redundant HTypeKnown (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/nodes.dart
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 915ec54aa46778730a8153fad263fc2d3c351195..fb1d40f385daba5a6b523b5186de8371c230bce0 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -1417,6 +1417,10 @@ class DominatedUses {
}
}
+ bool get isSingleton => _instructions.length == 1;
+
+ HInstruction get single => _instructions.single;
+
void _addUse(HInstruction user, int inputIndex) {
_instructions.add(user);
_indexes.add(inputIndex);
@@ -3046,7 +3050,7 @@ class HTypeConversion extends HCheck {
/// The [HTypeKnown] instruction marks a value with a refined type.
class HTypeKnown extends HCheck {
TypeMask knownType;
- bool _isMovable;
+ final bool _isMovable;
HTypeKnown.pinned(TypeMask knownType, HInstruction input)
: this.knownType = knownType,
@@ -3066,6 +3070,8 @@ class HTypeKnown extends HCheck {
bool isControlFlow() => false;
bool canThrow() => false;
+ bool get isPinned => inputs.length == 1;
+
HInstruction get witness => inputs.length == 2 ? inputs[1] : null;
int typeCode() => HInstruction.TYPE_KNOWN_TYPECODE;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698