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

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

Issue 829913006: Optimize is-check to instanceof when it eliminates an interceptor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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: 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 a8050bd1c78f3a6333bf42f36fa065c0f43f2a34..7337b7b14c7a41568c706f8ce58ad313f60a836d 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -2421,12 +2421,20 @@ class HIs extends HInstruction {
final DartType typeExpression;
final int kind;
+ final bool useInstanceOf;
HIs.direct(DartType typeExpression,
HInstruction expression,
TypeMask type)
: this.internal(typeExpression, [expression], RAW_CHECK, type);
+ // Pre-verified that the check can be done using 'instanceof'.
+ HIs.instanceOf(DartType typeExpression,
+ HInstruction expression,
+ TypeMask type)
+ : this.internal(typeExpression, [expression], RAW_CHECK, type,
+ useInstanceOf: true);
+
HIs.raw(DartType typeExpression,
HInstruction expression,
HInterceptor interceptor,
@@ -2446,7 +2454,8 @@ class HIs extends HInstruction {
TypeMask type)
: this.internal(typeExpression, [expression, call], VARIABLE_CHECK, type);
- HIs.internal(this.typeExpression, List<HInstruction> inputs, this.kind, type)
+ HIs.internal(this.typeExpression, List<HInstruction> inputs, this.kind,
+ TypeMask type, {bool this.useInstanceOf: false})
: super(inputs, type) {
assert(kind >= RAW_CHECK && kind <= VARIABLE_CHECK);
setUseGvn();
« no previous file with comments | « pkg/compiler/lib/src/ssa/interceptor_simplifier.dart ('k') | tests/compiler/dart2js_extra/is_check_instanceof_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698