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

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

Issue 1761903002: dart2js cps: Keep interceptors in a separate field. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 4 years, 10 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.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_sexpr.dart
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index 4c39e16ac888ca8ff7cdeee862a2412eb87c2964..5dad783db771bb80f85113d38a0edcca26ac1e47 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -98,18 +98,21 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
return decorator(node, s);
}
- String formatThisParameter(Parameter thisParameter) {
- return thisParameter == null ? '()' : '(${visit(thisParameter)})';
+ String formatOptionalParameter(Parameter parameter) {
+ return parameter == null ? '()' : '(${visit(parameter)})';
}
String visitFunctionDefinition(FunctionDefinition node) {
String name = node.element.name;
- String thisParameter = formatThisParameter(node.thisParameter);
+ String interceptorParameter =
+ formatOptionalParameter(node.interceptorParameter);
+ String thisParameter = formatOptionalParameter(node.receiverParameter);
String parameters = node.parameters.map(visit).join(' ');
namer.setReturnContinuation(node.returnContinuation);
String body = indentBlock(() => visit(node.body));
return '$indentation'
- '(FunctionDefinition $name $thisParameter ($parameters) return\n'
+ '(FunctionDefinition $name $interceptorParameter $thisParameter '
+ '($parameters) return\n'
'$body)';
}
@@ -179,10 +182,6 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
List<Reference<Primitive>> arguments,
[CallingConvention callingConvention = CallingConvention.Normal]) {
int positionalArgumentCount = call.positionalArgumentCount;
- if (callingConvention == CallingConvention.Intercepted ||
- callingConvention == CallingConvention.DummyIntercepted) {
- ++positionalArgumentCount;
- }
List<String> args =
arguments.take(positionalArgumentCount).map(access).toList();
List<String> argumentNames = call.getOrderedNamedArguments();
@@ -206,18 +205,20 @@ class SExpressionStringifier extends Indentation implements Visitor<String> {
String visitInvokeMethod(InvokeMethod node) {
String name = node.selector.name;
- String rcv = access(node.receiverRef);
- String args = formatArguments(node.selector.callStructure, node.argumentRefs,
- node.callingConvention);
- return '(InvokeMethod $rcv $name $args)';
+ String interceptor = optionalAccess(node.interceptorRef);
+ String receiver = access(node.receiverRef);
+ String arguments = formatArguments(node.selector.callStructure,
+ node.argumentRefs, node.callingConvention);
+ return '(InvokeMethod $interceptor $receiver $name $arguments)';
}
String visitInvokeMethodDirectly(InvokeMethodDirectly node) {
+ String interceptor = optionalAccess(node.interceptorRef);
String receiver = access(node.receiverRef);
String name = node.selector.name;
- String args = formatArguments(node.selector.callStructure, node.argumentRefs,
- node.callingConvention);
- return '(InvokeMethodDirectly $receiver $name $args)';
+ String arguments = formatArguments(node.selector.callStructure,
+ node.argumentRefs, node.callingConvention);
+ return '(InvokeMethodDirectly $interceptor $receiver $name $arguments)';
}
String visitInvokeConstructor(InvokeConstructor node) {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698