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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart

Issue 23003031: Extract interceptor calls from raw is-checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Populate interceptedClasses dynamically Created 7 years, 4 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
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
index a5110bbe6c7d979fb9511d28bdff48d572df734d..ab9121e00c45793055b93e23b1a63f01da06746c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -2209,11 +2209,29 @@ class HIs extends HInstruction {
static const int VARIABLE_CHECK = 2;
final DartType typeExpression;
- final bool nullOk;
final int kind;
- HIs(this.typeExpression, List<HInstruction> inputs, this.kind,
- {this.nullOk: false}) : super(inputs) {
+ HIs.direct(DartType typeExpression,
+ HInstruction expression)
+ : this.internal(typeExpression, [expression], RAW_CHECK);
+
+ HIs.raw(DartType typeExpression,
+ HInstruction expression,
+ HInterceptor interceptor)
+ : this.internal(typeExpression, [expression, interceptor], RAW_CHECK);
+
+ HIs.compound(DartType typeExpression,
+ HInstruction expression,
+ HInstruction call)
+ : this.internal(typeExpression, [expression, call], COMPOUND_CHECK);
+
+ HIs.variable(DartType typeExpression,
+ HInstruction expression,
+ HInstruction call)
+ : this.internal(typeExpression, [expression, call], VARIABLE_CHECK);
+
+ HIs.internal(this.typeExpression, List<HInstruction> inputs, this.kind)
+ : super(inputs) {
assert(kind >= RAW_CHECK && kind <= VARIABLE_CHECK);
setUseGvn();
instructionType = HType.BOOLEAN;
@@ -2221,6 +2239,11 @@ class HIs extends HInstruction {
HInstruction get expression => inputs[0];
+ HInstruction get interceptor {
+ assert(kind == RAW_CHECK);
+ return inputs.length > 1 ? inputs[1] : null;
+ }
+
HInstruction get checkCall {
assert(kind == VARIABLE_CHECK || kind == COMPOUND_CHECK);
return inputs[1];
@@ -2240,7 +2263,6 @@ class HIs extends HInstruction {
bool dataEquals(HIs other) {
return typeExpression == other.typeExpression
- && nullOk == other.nullOk
&& kind == other.kind;
}
}

Powered by Google App Engine
This is Rietveld 408576698