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

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

Issue 1031633003: Almost-constant interceptors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 f4e813b870b72674a4401c262ebc78b05794359c..062463e1d341816802bb7751058e15c579eb81cd 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -2300,12 +2300,21 @@ class HInterceptor extends HInstruction {
// This field should originally be null to allow GVN'ing all
// [HInterceptor] on the same input.
Set<ClassElement> interceptedClasses;
+
+ // inputs[0] is initially the only input, the receiver.
floitsch 2015/03/26 20:26:45 Create getters.
sra1 2015/04/01 23:06:59 Done.
+
+ // inputs[1] is a constant interceptor when the interceptor is a constant
+ // except for a `null` receiver. This is used when the receiver can't, except
+ // for `null`, be a falsy JavaScript value, allowing the generation of code
+ // like `(a && C.JSArray_methods).get$first(a)`.
+
HInterceptor(HInstruction receiver, TypeMask type)
: super(<HInstruction>[receiver], type) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
setUseGvn();
}
+
String toString() => 'interceptor on $interceptedClasses';
accept(HVisitor visitor) => visitor.visitInterceptor(this);
HInstruction get receiver => inputs[0];

Powered by Google App Engine
This is Rietveld 408576698