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

Unified Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart

Issue 1525163002: dart2js cps: Use oneshot interceptors and 'instanceof' expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge Created 5 years 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/cps_ir/optimize_interceptors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 38b228e281a5206ce6e589584a38af61ee65b3bb..02b963eb6b3231088104bb2d22cc68af3c6c179b 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -513,6 +513,11 @@ enum CallingConvention {
///
/// For example: `foo.bar$1(0, x)`
DummyIntercepted,
+
+ /// JS receiver is the Dart receiver, there are no extra arguments.
+ ///
+ /// Compiles to a one-shot interceptor, e.g: `J.bar$1(foo, x)`
+ OneShotIntercepted,
}
/// Invoke a method on an object.
@@ -542,9 +547,15 @@ class InvokeMethod extends UnsafePrimitive {
Primitive get dartReceiver => dartReceiverReference.definition;
Reference<Primitive> dartArgumentReference(int n) {
- return callingConvention == CallingConvention.Normal
- ? arguments[n]
- : arguments[n + 1];
+ switch (callingConvention) {
+ case CallingConvention.Normal:
+ case CallingConvention.OneShotIntercepted:
+ return arguments[n];
+
+ case CallingConvention.Intercepted:
+ case CallingConvention.DummyIntercepted:
+ return arguments[n + 1];
+ }
}
Primitive dartArgument(int n) => dartArgumentReference(n).definition;
@@ -861,7 +872,7 @@ class NullCheck extends Primitive {
/// An "is" type test.
///
-/// Returns `true` if [value] is an instance of [type].
+/// Returns `true` if [value] is an instance of [dartType].
///
/// [type] must not be the [Object], `dynamic` or [Null] types (though it might
/// be a type variable containing one of these types). This design is chosen
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/optimize_interceptors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698