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

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: Avoid generating an interceptor when unused. 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..7c9961d6add78883f259d49ec34643b70eac8ddf 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
@@ -2212,8 +2212,27 @@ class HIs extends HInstruction {
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,
+ {this.nullOk: false}) : super(inputs) {
ngeoffray 2013/08/24 11:16:26 I think we can remove 'nullOK' now, it does not lo
Johnni Winther 2013/08/26 07:34:00 Done.
assert(kind >= RAW_CHECK && kind <= VARIABLE_CHECK);
setUseGvn();
instructionType = HType.BOOLEAN;
@@ -2221,6 +2240,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];

Powered by Google App Engine
This is Rietveld 408576698