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

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

Issue 11413184: Create specialized versions of getInterceptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 15381)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1530,11 +1530,9 @@
}
void visitInterceptor(HInterceptor node) {
- Element element = backend.getInterceptorMethod;
- assert(element != null);
- world.registerStaticUse(element);
- js.VariableUse interceptor =
- new js.VariableUse(backend.namer.isolateAccess(element));
+ String name =
+ backend.registerSpecializedGetInterceptor(node.interceptedClasses);
+ js.VariableUse interceptor = new js.VariableUse(name);
use(node.receiver);
List<js.Expression> arguments = <js.Expression>[pop()];
push(new js.Call(interceptor, arguments), node);
@@ -1638,6 +1636,7 @@
if (node.isInterceptorCall) {
backend.addInterceptedSelector(getter);
}
+ world.registerInstantiatedClass(compiler.functionClass);
}
visitInvokeClosure(HInvokeClosure node) {
@@ -1781,6 +1780,10 @@
}
push(new js.LiteralExpression.withData(code, data), node);
}
+ DartType type = types[node].computeType(compiler);
+ if (type != null) {
+ world.registerInstantiatedClass(type.element);
+ }
// TODO(sra): Tell world.nativeEnqueuer about the types created here.
}
@@ -1852,6 +1855,8 @@
visitConstant(HConstant node) {
assert(isGenerateAtUseSite(node));
generateConstant(node.constant);
+ DartType type = node.constant.computeType(compiler);
+ world.registerInstantiatedClass(type.element);
}
visitLoopBranch(HLoopBranch node) {
@@ -2085,20 +2090,20 @@
node.usedBy.forEach((HInstruction instr) {
if (instr is !HInvokeStatic) {
backend.registerNonCallStaticUse(node);
- } else if (!identical(instr.target, node)) {
+ if (node.element.isFunction()) {
+ world.registerInstantiatedClass(compiler.functionClass);
+ }
+ } else if (instr.target != node) {
backend.registerNonCallStaticUse(node);
- } else {
- // If invoking the static is can still be passed as an argument as well
- // which will also be non call static use.
- for (int i = 1; i < node.inputs.length; i++) {
- if (identical(node.inputs, node)) {
- backend.registerNonCallStaticUse(node);
- break;
- }
- }
}
});
- world.registerStaticUse(node.element);
+ Element element = node.element;
+ world.registerStaticUse(element);
+ ClassElement cls = element.getEnclosingClass();
+ if (element.isGenerativeConstructor()
+ || (element.isFactoryConstructor() && cls == compiler.listClass)) {
+ world.registerInstantiatedClass(cls);
+ }
push(new js.VariableUse(backend.namer.isolateAccess(node.element)));
}
@@ -2153,6 +2158,7 @@
}
void visitLiteralList(HLiteralList node) {
+ world.registerInstantiatedClass(compiler.listClass);
generateArrayLiteral(node);
}

Powered by Google App Engine
This is Rietveld 408576698