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

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

Issue 16077015: Rip-off the backend type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 23797)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -54,33 +54,11 @@
if (!identical(kind, ElementKind.FIELD)) {
FunctionElement function = element;
graph.calledInLoop = compiler.world.isCalledInLoop(function);
- OptionalParameterTypes defaultValueTypes = null;
FunctionSignature signature = function.computeSignature(compiler);
- if (signature.optionalParameterCount > 0) {
- defaultValueTypes =
- new OptionalParameterTypes(signature.optionalParameterCount);
- int index = 0;
- signature.forEachOptionalParameter((Element parameter) {
- Constant defaultValue = builder.compileVariable(parameter);
- HType type = HGraph.mapConstantTypeToSsaType(defaultValue);
- defaultValueTypes.update(index, parameter.name, type);
- index++;
- });
- } else {
- // BUG(10938): the types are stored in the wrong order.
- // order.
- HTypeList parameterTypes =
- backend.optimisticParameterTypes(element.declaration,
- defaultValueTypes);
- if (!parameterTypes.allUnknown) {
- int i = 0;
- signature.forEachParameter((Element param) {
- builder.parameters[param].instructionType = parameterTypes[i++];
- });
- }
- backend.registerParameterTypesOptimization(
- element.declaration, parameterTypes, defaultValueTypes);
- }
+ signature.forEachOptionalParameter((Element parameter) {
+ // This ensures the default value will be computed.
+ builder.compileVariable(parameter);
+ });
}
if (compiler.tracer.enabled) {
@@ -1141,12 +1119,6 @@
List<HInstruction> compiledArguments;
bool isInstanceMember = function.isInstanceMember();
- if (function.isGenerativeConstructor()) {
- // The optimistic field type optimization requires
- // to know all generative constructors seen in codegen.
- backend.registerConstructor(function);
- }
-
if (currentNode == null
|| currentNode.asForIn() != null
|| !isInstanceMember
@@ -3790,14 +3762,6 @@
if (type == null) {
type = new HType.inferredReturnTypeForElement(element, compiler);
- if (type.isUnknown()) {
- // TODO(ngeoffray): Only do this if knowing the return type is
- // useful.
- type =
- builder.backend.optimisticReturnTypesWithRecompilationOnTypeChange(
- currentElement, element);
- if (type == null) type = HType.UNKNOWN;
- }
}
// TODO(5346): Try to avoid the need for calling [declaration] before
// creating an [HInvokeStatic].

Powered by Google App Engine
This is Rietveld 408576698