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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10908068: Better tracking of provided types at call sites (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase again Created 8 years, 3 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 | « lib/compiler/implementation/js_backend/backend.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index 8d6c163875223f6a40e72eb8db446ab1be043565..ff5ef6c54f38d5597927afec2797ba9951f4c6a7 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -171,6 +171,7 @@ class SsaBuilderTask extends CompilerTask {
graph = builder.buildLazyInitializer(work.element);
}
assert(graph.isValid());
+<<<<<<< HEAD
if (kind !== ElementKind.FIELD) {
bool inLoop = functionsCalledInLoop.contains(element);
if (!inLoop) {
@@ -195,6 +196,40 @@ class SsaBuilderTask extends CompilerTask {
}
backend.registerParameterTypesOptimization(element, parameterTypes);
}
+=======
+ bool inLoop = functionsCalledInLoop.contains(element);
+ if (!inLoop) {
+ Selector selector = selectorsCalledInLoop[element.name];
+ inLoop = selector !== null && selector.applies(element, compiler);
+ }
+ graph.calledInLoop = inLoop;
+
+ // If there is an estimate of the parameter types assume these types when
+ // compiling.
+ OptionalParameterTypes defaultValueTypes = null;
+ FunctionSignature signature = element.computeSignature(compiler);
+ if (signature.optionalParameterCount > 0) {
+ defaultValueTypes =
+ new OptionalParameterTypes(signature.optionalParameterCount);
+ int index = 0;
+ signature.forEachOptionalParameter((Element parameter) {
+ Constant defaultValue = compiler.compileVariable(parameter);
+ HType type = HGraph.mapConstantTypeToSsaType(defaultValue);
+ defaultValueTypes.update(index, parameter.name, type);
+ index++;
+ });
+ }
+ HTypeList parameterTypes =
+ backend.optimisticParameterTypes(element, defaultValueTypes);
+ if (!parameterTypes.allUnknown) {
+ int i = 0;
+ signature.forEachParameter((Element param) {
+ builder.parameters[param].guaranteedType = parameterTypes[i++];
+ });
+ }
+ backend.registerParameterTypesOptimization(
+ element, parameterTypes, defaultValueTypes);
+>>>>>>> Better tracking of provided types at call sites
if (compiler.tracer.enabled) {
String name;
« no previous file with comments | « lib/compiler/implementation/js_backend/backend.dart ('k') | lib/compiler/implementation/universe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698