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

Unified Diff: pkg/compiler/lib/src/ssa/graph_builder.dart

Issue 2283443002: Make LocalsHandler depend on GraphBuilder instead of SsaBuilder. (Closed)
Patch Set: fix tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/graph_builder.dart
diff --git a/pkg/compiler/lib/src/ssa/graph_builder.dart b/pkg/compiler/lib/src/ssa/graph_builder.dart
index 9da63208c2044172a5841a8c2d695b884f1eb75e..969899f617e6e1032d0ca4031d2e56906a95b95d 100644
--- a/pkg/compiler/lib/src/ssa/graph_builder.dart
+++ b/pkg/compiler/lib/src/ssa/graph_builder.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import '../elements/elements.dart';
+import '../types/types.dart';
import 'nodes.dart';
/// Base class for objects that build up an SSA graph.
@@ -35,6 +37,11 @@ abstract class GraphBuilder {
/// [isAborted].
bool isReachable = true;
+ HParameterValue lastAddedParameter;
+
+ Map<ParameterElement, HInstruction> parameters =
+ <ParameterElement, HInstruction>{};
+
HBasicBlock addNewBlock() {
HBasicBlock block = graph.addNewBlock();
// If adding a new block during building of an expression, it is due to
@@ -84,4 +91,15 @@ abstract class GraphBuilder {
void add(HInstruction instruction) {
current.add(instruction);
}
+
+ HParameterValue addParameter(Entity parameter, TypeMask type) {
+ HParameterValue result = new HParameterValue(parameter, type);
+ if (lastAddedParameter == null) {
+ graph.entry.addBefore(graph.entry.first, result);
+ } else {
+ graph.entry.addAfter(lastAddedParameter, result);
+ }
+ lastAddedParameter = result;
+ return result;
+ }
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | pkg/compiler/lib/src/ssa/locals_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698