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

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

Issue 2884233002: Use entities in runtime_types (Closed)
Patch Set: Remove debug print Created 3 years, 7 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
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';
11 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 11 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
12 import '../common/names.dart' show Identifiers, Selectors; 12 import '../common/names.dart' show Identifiers, Selectors;
13 import '../common/tasks.dart' show CompilerTask; 13 import '../common/tasks.dart' show CompilerTask;
14 import '../compiler.dart'; 14 import '../compiler.dart';
15 import '../constants/constant_system.dart'; 15 import '../constants/constant_system.dart';
16 import '../constants/expressions.dart'; 16 import '../constants/expressions.dart';
17 import '../constants/values.dart'; 17 import '../constants/values.dart';
18 import '../diagnostics/messages.dart' show Message, MessageTemplate; 18 import '../diagnostics/messages.dart' show Message, MessageTemplate;
19 import '../dump_info.dart' show InfoReporter; 19 import '../dump_info.dart' show InfoReporter;
20 import '../elements/elements.dart'; 20 import '../elements/elements.dart';
21 import '../elements/entities.dart'; 21 import '../elements/entities.dart';
22 import '../elements/modelx.dart' show ConstructorBodyElementX; 22 import '../elements/modelx.dart' show ConstructorBodyElementX;
23 import '../elements/names.dart'; 23 import '../elements/names.dart';
24 import '../elements/operators.dart'; 24 import '../elements/operators.dart';
25 import '../elements/resolution_types.dart'; 25 import '../elements/resolution_types.dart';
26 import '../elements/types.dart'; 26 import '../elements/types.dart';
27 import '../io/source_information.dart'; 27 import '../io/source_information.dart';
28 import '../js/js.dart' as js; 28 import '../js/js.dart' as js;
29 import '../js_backend/backend.dart' show JavaScriptBackend; 29 import '../js_backend/backend.dart' show JavaScriptBackend;
30 import '../js_backend/js_backend.dart'; 30 import '../js_backend/runtime_types.dart';
31 import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter; 31 import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
32 import '../native/native.dart' as native; 32 import '../native/native.dart' as native;
33 import '../resolution/semantic_visitor.dart'; 33 import '../resolution/semantic_visitor.dart';
34 import '../resolution/tree_elements.dart' show TreeElements; 34 import '../resolution/tree_elements.dart' show TreeElements;
35 import '../tree/tree.dart' as ast; 35 import '../tree/tree.dart' as ast;
36 import '../types/types.dart'; 36 import '../types/types.dart';
37 import '../universe/call_structure.dart' show CallStructure; 37 import '../universe/call_structure.dart' show CallStructure;
38 import '../universe/selector.dart' show Selector; 38 import '../universe/selector.dart' show Selector;
39 import '../universe/side_effects.dart' show SideEffects; 39 import '../universe/side_effects.dart' show SideEffects;
40 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse; 40 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse;
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1371 open(graph.entry); 1371 open(graph.entry);
1372 1372
1373 localsHandler.startFunction(element, node); 1373 localsHandler.startFunction(element, node);
1374 close(new HGoto()).addSuccessor(block); 1374 close(new HGoto()).addSuccessor(block);
1375 1375
1376 open(block); 1376 open(block);
1377 1377
1378 // Add the type parameters of the class as parameters of this method. This 1378 // Add the type parameters of the class as parameters of this method. This
1379 // must be done before adding the normal parameters, because their types 1379 // must be done before adding the normal parameters, because their types
1380 // may contain references to type variables. 1380 // may contain references to type variables.
1381 var enclosing = element.enclosingElement; 1381 ClassElement cls = element.enclosingClass;
1382 if ((element.isConstructor || element.isGenerativeConstructorBody) && 1382 if ((element.isConstructor || element.isGenerativeConstructorBody) &&
1383 rtiNeed.classNeedsRti(enclosing.declaration)) { 1383 rtiNeed.classNeedsRti(cls)) {
1384 enclosing.typeVariables 1384 cls.typeVariables.forEach((ResolutionTypeVariableType typeVariable) {
1385 .forEach((ResolutionTypeVariableType typeVariable) {
1386 HParameterValue param = 1385 HParameterValue param =
1387 addParameter(typeVariable.element, commonMasks.nonNullType); 1386 addParameter(typeVariable.element, commonMasks.nonNullType);
1388 localsHandler.directLocals[ 1387 localsHandler.directLocals[
1389 localsHandler.getTypeVariableAsLocal(typeVariable)] = param; 1388 localsHandler.getTypeVariableAsLocal(typeVariable)] = param;
1390 }); 1389 });
1391 } 1390 }
1392 1391
1393 if (element is MethodElement) { 1392 if (element is MethodElement) {
1394 MethodElement functionElement = element; 1393 MethodElement functionElement = element;
1395 FunctionSignature signature = functionElement.functionSignature; 1394 FunctionSignature signature = functionElement.functionSignature;
(...skipping 5342 matching lines...) Expand 10 before | Expand all | Expand 10 after
6738 this.oldReturnLocal, 6737 this.oldReturnLocal,
6739 this.oldReturnType, 6738 this.oldReturnType,
6740 this.oldResolvedAst, 6739 this.oldResolvedAst,
6741 this.oldStack, 6740 this.oldStack,
6742 this.oldLocalsHandler, 6741 this.oldLocalsHandler,
6743 this.inTryStatement, 6742 this.inTryStatement,
6744 this.allFunctionsCalledOnce, 6743 this.allFunctionsCalledOnce,
6745 this.oldElementInferenceResults) 6744 this.oldElementInferenceResults)
6746 : super(function); 6745 : super(function);
6747 } 6746 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698