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

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

Issue 1571953002: cps_ir: add refinement on "success" arguments for a set of whitelisted methods (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/insert_refinements.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 659b5e2f288f75b6f4e2d8ef46b682d026efa13b..69afd7ab1b302a4ba5b8f1b5dbb70cb2caabae4f 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -509,7 +509,28 @@ abstract class InvocationPrimitive extends UnsafePrimitive {
SourceInformation get sourceInformation;
Reference<Primitive> get dartReceiverReference => null;
+ Primitive get dartReceiver => dartReceiverReference.definition;
+
CallingConvention get callingConvention => CallingConvention.Normal;
+
+ Reference<Primitive> dartArgumentReference(int n) {
+ 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;
+
+ int get dartArgumentsLength =>
Siggi Cherem (dart-lang) 2016/01/11 18:45:37 FYI - I also added dartArgumentsLength to expose t
+ arguments.length -
+ (callingConvention == CallingConvention.Intercepted ||
+ callingConvention == CallingConvention.DummyIntercepted ? 1 : 0);
}
/// Invoke a static function.
@@ -570,22 +591,6 @@ class InvokeMethod extends InvocationPrimitive {
: receiver;
}
- Primitive get dartReceiver => dartReceiverReference.definition;
-
- Reference<Primitive> dartArgumentReference(int n) {
- 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;
-
/// If true, it is known that the receiver cannot be `null`.
bool receiverIsNotNull = false;
@@ -642,16 +647,6 @@ class InvokeMethodDirectly extends InvocationPrimitive {
: receiver;
}
- Primitive get dartReceiver => dartReceiverReference.definition;
-
- Reference<Primitive> dartArgumentReference(int n) {
- return callingConvention == CallingConvention.Normal
- ? arguments[n]
- : arguments[n + 1];
- }
-
- Primitive dartArgument(int n) => dartArgumentReference(n).definition;
-
InvokeMethodDirectly(Primitive receiver,
this.target,
this.selector,
« no previous file with comments | « no previous file | pkg/compiler/lib/src/cps_ir/insert_refinements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698