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

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

Issue 2731163002: Split js interop registration into library/class/member elements (Closed)
Patch Set: Updated cf. comments Created 3 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/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index e7695114498257cbb1be5f1ca03290a3226464af..4ab076f31c6c940cd35c0660d539ec8cec6f1aea 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1076,7 +1076,7 @@ class SsaBuilder extends ast.Visitor
ast.Send call = link.head;
assert(ast.Initializers.isSuperConstructorCall(call) ||
ast.Initializers.isConstructorRedirect(call));
- FunctionElement target = elements[call].implementation;
+ ConstructorElement target = elements[call];
CallStructure callStructure =
elements.getSelector(call).callStructure;
Link<ast.Node> arguments = call.arguments;
@@ -2497,8 +2497,8 @@ class SsaBuilder extends ast.Visitor
* Invariant: [element] must be an implementation element.
*/
List<HInstruction> makeStaticArgumentList(CallStructure callStructure,
- Link<ast.Node> arguments, FunctionElement element) {
- assert(invariant(element, element.isImplementation));
+ Link<ast.Node> arguments, MethodElement element) {
+ assert(invariant(element, element.isDeclaration));
HInstruction compileArgument(ast.Node argument) {
visit(argument);
@@ -2508,7 +2508,7 @@ class SsaBuilder extends ast.Visitor
return Elements.makeArgumentsList<HInstruction>(
callStructure,
arguments,
- element,
+ element.implementation,
compileArgument,
backend.nativeData.isJsInteropMember(element)
? handleConstantForOptionalParameterJsInterop
@@ -3076,8 +3076,8 @@ class SsaBuilder extends ast.Visitor
Selector selector = elements.getSelector(node);
assert(invariant(node, selector.applies(method.implementation),
message: "$selector does not apply to ${method.implementation}"));
- List<HInstruction> inputs = makeStaticArgumentList(
- selector.callStructure, node.arguments, method.implementation);
+ List<HInstruction> inputs =
+ makeStaticArgumentList(selector.callStructure, node.arguments, method);
push(buildInvokeSuper(selector, method, inputs, sourceInformation));
}
@@ -3409,7 +3409,7 @@ class SsaBuilder extends ast.Visitor
inputs.add(graph.addConstantNull(closedWorld));
}
inputs.addAll(makeStaticArgumentList(
- callStructure, send.arguments, constructorImplementation));
+ callStructure, send.arguments, constructorImplementation.declaration));
TypeMask elementType = computeType(constructor);
if (isFixedListConstructorCall) {
@@ -3569,9 +3569,9 @@ class SsaBuilder extends ast.Visitor
/// Generate an invocation to the static or top level [function].
void generateStaticFunctionInvoke(
- ast.Send node, FunctionElement function, CallStructure callStructure) {
- List<HInstruction> inputs = makeStaticArgumentList(
- callStructure, node.arguments, function.implementation);
+ ast.Send node, MethodElement function, CallStructure callStructure) {
+ List<HInstruction> inputs =
+ makeStaticArgumentList(callStructure, node.arguments, function);
pushInvokeStatic(node, function, inputs,
sourceInformation:
@@ -4033,7 +4033,7 @@ class SsaBuilder extends ast.Visitor
if (argument != null) {
filteredArguments.add(argument);
var jsName =
- backend.nativeData.getUnescapedJSInteropName(parameter.name);
+ backend.nativeData.computeUnescapedJSInteropName(parameter.name);
parameterNameMap[jsName] = new js.InterpolatedExpression(positions++);
}
i++;
@@ -4052,7 +4052,8 @@ class SsaBuilder extends ast.Visitor
..sourceInformation = sourceInformation;
}
var target = new HForeignCode(
- js.js.parseForeignJS("${backend.namer.fixedBackendMethodPath(element)}."
+ js.js.parseForeignJS(
+ "${backend.nativeData.getFixedBackendMethodPath(element)}."
"${backend.nativeData.getFixedBackendName(element)}"),
commonMasks.dynamicType,
<HInstruction>[]);
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart ('k') | pkg/compiler/lib/src/types/types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698