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

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

Issue 2260993002: Don't add empty typeinfo lists (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 | no next file » | 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 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 // 'new' of the constructor instead of via an upgrade. It is optimized out 2319 // 'new' of the constructor instead of via an upgrade. It is optimized out
2320 // if there are field initializers. 2320 // if there are field initializers.
2321 add(new HFieldGet(null, newObject, backend.dynamicType, 2321 add(new HFieldGet(null, newObject, backend.dynamicType,
2322 isAssignable: false)); 2322 isAssignable: false));
2323 for (int i = 0; i < fields.length; i++) { 2323 for (int i = 0; i < fields.length; i++) {
2324 add(new HFieldSet(fields[i], newObject, constructorArguments[i])); 2324 add(new HFieldSet(fields[i], newObject, constructorArguments[i]));
2325 } 2325 }
2326 } 2326 }
2327 removeInlinedInstantiation(type); 2327 removeInlinedInstantiation(type);
2328 // Create the runtime type information, if needed. 2328 // Create the runtime type information, if needed.
2329 if (backend.classNeedsRti(classElement)) { 2329 if (classElement.typeVariables.isNotEmpty &&
2330 backend.classNeedsRti(classElement)) {
2330 // Read the values of the type arguments and create a HTypeInfoExpression 2331 // Read the values of the type arguments and create a HTypeInfoExpression
2331 // to set on the newly create object. We can identify the case where the 2332 // to set on the newly create object. We can identify the case where the
2332 // expression would be of the form: 2333 // expression would be of the form:
2333 // 2334 //
2334 // [getTypeArgumentByIndex(this, 0), .., getTypeArgumentByIndex(this, k)] 2335 // [getTypeArgumentByIndex(this, 0), .., getTypeArgumentByIndex(this, k)]
2335 // 2336 //
2336 // and k is the number of type arguments of this. If this is the case, 2337 // and k is the number of type arguments of this. If this is the case,
2337 // we can simply copy the list from this. 2338 // we can simply copy the list from this.
2338 2339
2339 // These locals are modified by [isIndexedTypeArgumentGet]. 2340 // These locals are modified by [isIndexedTypeArgumentGet].
(...skipping 6299 matching lines...) Expand 10 before | Expand all | Expand 10 after
8639 const _LoopTypeVisitor(); 8640 const _LoopTypeVisitor();
8640 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP; 8641 int visitNode(ast.Node node) => HLoopBlockInformation.NOT_A_LOOP;
8641 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP; 8642 int visitWhile(ast.While node) => HLoopBlockInformation.WHILE_LOOP;
8642 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP; 8643 int visitFor(ast.For node) => HLoopBlockInformation.FOR_LOOP;
8643 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP; 8644 int visitDoWhile(ast.DoWhile node) => HLoopBlockInformation.DO_WHILE_LOOP;
8644 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; 8645 int visitAsyncForIn(ast.AsyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP;
8645 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP; 8646 int visitSyncForIn(ast.SyncForIn node) => HLoopBlockInformation.FOR_IN_LOOP;
8646 int visitSwitchStatement(ast.SwitchStatement node) => 8647 int visitSwitchStatement(ast.SwitchStatement node) =>
8647 HLoopBlockInformation.SWITCH_CONTINUE_LOOP; 8648 HLoopBlockInformation.SWITCH_CONTINUE_LOOP;
8648 } 8649 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698