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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2653633002: Further improve precision of the type of node that hold type inference data. (Closed)
Patch Set: dartfmt Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:js_runtime/shared/embedded_names.dart'; 7 import 'package:js_runtime/shared/embedded_names.dart';
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5225 !link.isEmpty; 5225 !link.isEmpty;
5226 link = link.tail) { 5226 link = link.tail) {
5227 visit(link.head); 5227 visit(link.head);
5228 inputs.add(pop()); 5228 inputs.add(pop());
5229 } 5229 }
5230 instruction = buildLiteralList(inputs); 5230 instruction = buildLiteralList(inputs);
5231 add(instruction); 5231 add(instruction);
5232 instruction = setRtiIfNeeded(instruction, node); 5232 instruction = setRtiIfNeeded(instruction, node);
5233 } 5233 }
5234 5234
5235 TypeMask type = _inferredTypeOfNewList(node); 5235 TypeMask type = _inferredTypeOfListLiteral(node);
5236 if (!type.containsAll(closedWorld)) { 5236 if (!type.containsAll(closedWorld)) {
5237 instruction.instructionType = type; 5237 instruction.instructionType = type;
5238 } 5238 }
5239 stack.add(instruction); 5239 stack.add(instruction);
5240 } 5240 }
5241 5241
5242 _inferredTypeOfNewList(ast.Node node) => 5242 _inferredTypeOfNewList(ast.Send node) =>
5243 _resultOf(sourceElement).typeOfNewList(node) ?? commonMasks.dynamicType; 5243 _resultOf(sourceElement).typeOfNewList(node) ?? commonMasks.dynamicType;
5244 5244
5245 _inferredTypeOfListLiteral(ast.LiteralList node) =>
5246 _resultOf(sourceElement).typeOfListLiteral(node) ??
5247 commonMasks.dynamicType;
5248
5245 visitConditional(ast.Conditional node) { 5249 visitConditional(ast.Conditional node) {
5246 SsaBranchBuilder brancher = new SsaBranchBuilder(this, compiler, node); 5250 SsaBranchBuilder brancher = new SsaBranchBuilder(this, compiler, node);
5247 brancher.handleConditional(() => visit(node.condition), 5251 brancher.handleConditional(() => visit(node.condition),
5248 () => visit(node.thenExpression), () => visit(node.elseExpression)); 5252 () => visit(node.thenExpression), () => visit(node.elseExpression));
5249 } 5253 }
5250 5254
5251 visitStringInterpolation(ast.StringInterpolation node) { 5255 visitStringInterpolation(ast.StringInterpolation node) {
5252 StringBuilderVisitor stringBuilder = new StringBuilderVisitor(this, node); 5256 StringBuilderVisitor stringBuilder = new StringBuilderVisitor(this, node);
5253 stringBuilder.visit(node); 5257 stringBuilder.visit(node);
5254 stack.add(stringBuilder.result); 5258 stack.add(stringBuilder.result);
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
6719 this.oldReturnLocal, 6723 this.oldReturnLocal,
6720 this.oldReturnType, 6724 this.oldReturnType,
6721 this.oldResolvedAst, 6725 this.oldResolvedAst,
6722 this.oldStack, 6726 this.oldStack,
6723 this.oldLocalsHandler, 6727 this.oldLocalsHandler,
6724 this.inTryStatement, 6728 this.inTryStatement,
6725 this.allFunctionsCalledOnce, 6729 this.allFunctionsCalledOnce,
6726 this.oldElementInferenceResults) 6730 this.oldElementInferenceResults)
6727 : super(function); 6731 : super(function);
6728 } 6732 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698