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

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

Issue 196223017: Fix bad generate-at-use-site. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.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 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * A special element for the extra parameter taken by intercepted 8 * A special element for the extra parameter taken by intercepted
9 * methods. We need to implement [TypedElement.type] because our 9 * methods. We need to implement [TypedElement.type] because our
10 * optimizers may look at its declared type. 10 * optimizers may look at its declared type.
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 builder.jumpTargets.remove(target); 878 builder.jumpTargets.remove(target);
879 } 879 }
880 super.close(); 880 super.close();
881 } 881 }
882 } 882 }
883 883
884 /** 884 /**
885 * This class builds SSA nodes for functions represented in AST. 885 * This class builds SSA nodes for functions represented in AST.
886 */ 886 */
887 class SsaBuilder extends ResolvedVisitor { 887 class SsaBuilder extends ResolvedVisitor {
888 final Compiler compiler;
889 final JavaScriptBackend backend; 888 final JavaScriptBackend backend;
890 final ConstantSystem constantSystem; 889 final ConstantSystem constantSystem;
891 final CodegenWorkItem work; 890 final CodegenWorkItem work;
892 final RuntimeTypes rti; 891 final RuntimeTypes rti;
893 892
894 /* This field is used by the native handler. */ 893 /* This field is used by the native handler. */
895 final NativeEmitter nativeEmitter; 894 final NativeEmitter nativeEmitter;
896 895
897 final HGraph graph = new HGraph(); 896 final HGraph graph = new HGraph();
898 897
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 * Variables stored in the current activation. These variables are 956 * Variables stored in the current activation. These variables are
958 * being updated in try/catch blocks, and should be 957 * being updated in try/catch blocks, and should be
959 * accessed indirectly through [HLocalGet] and [HLocalSet]. 958 * accessed indirectly through [HLocalGet] and [HLocalSet].
960 */ 959 */
961 Map<Element, HLocalValue> activationVariables = <Element, HLocalValue>{}; 960 Map<Element, HLocalValue> activationVariables = <Element, HLocalValue>{};
962 961
963 // We build the Ssa graph by simulating a stack machine. 962 // We build the Ssa graph by simulating a stack machine.
964 List<HInstruction> stack = <HInstruction>[]; 963 List<HInstruction> stack = <HInstruction>[];
965 964
966 SsaBuilder(JavaScriptBackend backend, 965 SsaBuilder(JavaScriptBackend backend,
967 CodegenWorkItem work, 966 CodegenWorkItem work,
968 this.nativeEmitter) 967 this.nativeEmitter)
969 : this.backend = backend, 968 : this.backend = backend,
970 this.compiler = backend.compiler,
971 this.constantSystem = backend.constantSystem, 969 this.constantSystem = backend.constantSystem,
972 this.work = work, 970 this.work = work,
973 this.rti = backend.rti, 971 this.rti = backend.rti,
974 super(work.resolutionTree, backend.compiler) { 972 super(work.resolutionTree, backend.compiler) {
975 localsHandler = new LocalsHandler(this); 973 localsHandler = new LocalsHandler(this);
976 sourceElementStack.add(work.element); 974 sourceElementStack.add(work.element);
977 } 975 }
978 976
979 Element get sourceElement => sourceElementStack.last; 977 Element get sourceElement => sourceElementStack.last;
980 978
(...skipping 5135 matching lines...) Expand 10 before | Expand all | Expand 10 after
6116 DartType unaliased = type.unalias(builder.compiler); 6114 DartType unaliased = type.unalias(builder.compiler);
6117 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6115 if (unaliased is TypedefType) throw 'unable to unalias $type';
6118 unaliased.accept(this, builder); 6116 unaliased.accept(this, builder);
6119 } 6117 }
6120 6118
6121 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6119 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6122 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType'); 6120 ClassElement cls = builder.compiler.findHelper('DynamicRuntimeType');
6123 builder.push(new HDynamicType(type, new TypeMask.exact(cls))); 6121 builder.push(new HDynamicType(type, new TypeMask.exact(cls)));
6124 } 6122 }
6125 } 6123 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698