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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 15697004: Add a proper HInvokeConstructorBody instead of mis-using HInvokeDynamicMethod. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 23010)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1487,32 +1487,26 @@
List<js.Expression> arguments = visitArguments(node.inputs);
Element target = node.element;
- if (target != null) {
- // Avoid adding the generative constructor name to the list of
- // seen selectors.
- if (target.isGenerativeConstructorBody()) {
- methodName = name.slowToString();
- } else if (!node.isInterceptedCall) {
- if (target == backend.jsArrayAdd) {
- methodName = 'push';
- } else if (target == backend.jsArrayRemoveLast) {
- methodName = 'pop';
- } else if (target == backend.jsStringSplit) {
- methodName = 'split';
- // Split returns a List, so we make sure the backend knows the
- // list class is instantiated.
- world.registerInstantiatedClass(
- compiler.listClass, work.resolutionTree);
- } else if (target == backend.jsStringConcat) {
- push(new js.Binary('+', object, arguments[0]), node);
- return;
- } else if (target.isNative() && target.isFunction()
- && !node.isInterceptedCall) {
- // A direct (i.e. non-interceptor) native call is the result of
- // optimization. The optimization ensures any type checks or
- // conversions have been satisified.
- methodName = target.fixedBackendName();
- }
+ if (target != null && !node.isInterceptedCall) {
+ if (target == backend.jsArrayAdd) {
+ methodName = 'push';
+ } else if (target == backend.jsArrayRemoveLast) {
+ methodName = 'pop';
+ } else if (target == backend.jsStringSplit) {
+ methodName = 'split';
+ // Split returns a List, so we make sure the backend knows the
+ // list class is instantiated.
+ world.registerInstantiatedClass(
+ compiler.listClass, work.resolutionTree);
+ } else if (target == backend.jsStringConcat) {
+ push(new js.Binary('+', object, arguments[0]), node);
+ return;
+ } else if (target.isNative() && target.isFunction()
+ && !node.isInterceptedCall) {
+ // A direct (i.e. non-interceptor) native call is the result of
+ // optimization. The optimization ensures any type checks or
+ // conversions have been satisified.
+ methodName = target.fixedBackendName();
}
}
@@ -1523,6 +1517,14 @@
push(jsPropertyCall(object, methodName, arguments), node);
}
+ void visitInvokeConstructorBody(HInvokeConstructorBody node) {
+ use(node.inputs[0]);
+ js.Expression object = pop();
+ String methodName = backend.namer.getName(node.element);
+ List<js.Expression> arguments = visitArguments(node.inputs);
+ push(jsPropertyCall(object, methodName, arguments), node);
+ }
+
void visitOneShotInterceptor(HOneShotInterceptor node) {
List<js.Expression> arguments = visitArguments(node.inputs);
var isolate = new js.VariableUse(backend.namer.CURRENT_ISOLATE);

Powered by Google App Engine
This is Rietveld 408576698