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

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

Issue 2616933003: Ensure we're looking at the correct resolved AST when initializing fields in constructors. (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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 '../closure.dart'; 5 import '../closure.dart';
6 import '../common.dart'; 6 import '../common.dart';
7 import '../common/codegen.dart' show CodegenRegistry; 7 import '../common/codegen.dart' show CodegenRegistry;
8 import '../compiler.dart'; 8 import '../compiler.dart';
9 import '../constants/constant_system.dart'; 9 import '../constants/constant_system.dart';
10 import '../elements/resolution_types.dart'; 10 import '../elements/resolution_types.dart';
11 import '../elements/elements.dart'; 11 import '../elements/elements.dart';
12 import '../io/source_information.dart'; 12 import '../io/source_information.dart';
13 import '../js_backend/js_backend.dart'; 13 import '../js_backend/js_backend.dart';
14 import '../resolution/tree_elements.dart';
15 import '../tree/tree.dart' as ast; 14 import '../tree/tree.dart' as ast;
16 import '../types/types.dart'; 15 import '../types/types.dart';
17 import '../universe/call_structure.dart' show CallStructure; 16 import '../universe/call_structure.dart' show CallStructure;
18 import '../universe/use.dart' show TypeUse; 17 import '../universe/use.dart' show TypeUse;
19 import '../world.dart' show ClosedWorld; 18 import '../world.dart' show ClosedWorld;
20 import 'jump_handler.dart'; 19 import 'jump_handler.dart';
21 import 'locals_handler.dart'; 20 import 'locals_handler.dart';
22 import 'nodes.dart'; 21 import 'nodes.dart';
23 import 'ssa_branch_builder.dart'; 22 import 'ssa_branch_builder.dart';
24 import 'type_builder.dart'; 23 import 'type_builder.dart';
25 24
26 /// Base class for objects that build up an SSA graph. 25 /// Base class for objects that build up an SSA graph.
27 /// 26 ///
28 /// This contains helpers for building the graph and tracking information about 27 /// This contains helpers for building the graph and tracking information about
29 /// the current state of the graph being built. 28 /// the current state of the graph being built.
30 abstract class GraphBuilder { 29 abstract class GraphBuilder {
31 /// Holds the resulting SSA graph. 30 /// Holds the resulting SSA graph.
32 final HGraph graph = new HGraph(); 31 final HGraph graph = new HGraph();
33 32
34 // TODO(het): remove this 33 // TODO(het): remove this
35 /// A reference to the compiler. 34 /// A reference to the compiler.
36 Compiler compiler; 35 Compiler compiler;
37 36
38 /// The JavaScript backend we are targeting in this compilation. 37 /// The JavaScript backend we are targeting in this compilation.
39 JavaScriptBackend get backend; 38 JavaScriptBackend get backend;
40 39
41 /// The tree elements for the element being built into an SSA graph.
42 TreeElements get elements;
43
44 CodegenRegistry get registry; 40 CodegenRegistry get registry;
45 41
46 ClosedWorld get closedWorld; 42 ClosedWorld get closedWorld;
47 43
48 CommonMasks get commonMasks => closedWorld.commonMasks; 44 CommonMasks get commonMasks => closedWorld.commonMasks;
49 45
50 GlobalTypeInferenceResults get globalInferenceResults => 46 GlobalTypeInferenceResults get globalInferenceResults =>
51 compiler.globalInference.results; 47 compiler.globalInference.results;
52 48
53 /// Used to track the locals while building the graph. 49 /// Used to track the locals while building the graph.
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 if (unaliased is TypedefType) throw 'unable to unalias $type'; 325 if (unaliased is TypedefType) throw 'unable to unalias $type';
330 unaliased.accept(this, builder); 326 unaliased.accept(this, builder);
331 } 327 }
332 328
333 void visitDynamicType(DynamicType type, GraphBuilder builder) { 329 void visitDynamicType(DynamicType type, GraphBuilder builder) {
334 JavaScriptBackend backend = builder.compiler.backend; 330 JavaScriptBackend backend = builder.compiler.backend;
335 ClassElement cls = backend.helpers.DynamicRuntimeType; 331 ClassElement cls = backend.helpers.DynamicRuntimeType;
336 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld))); 332 builder.push(new HDynamicType(type, new TypeMask.exact(cls, closedWorld)));
337 } 333 }
338 } 334 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698