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

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

Issue 2377813002: kernel->ssa: implement for-in loops (Closed)
Patch Set: fix another import Created 4 years, 3 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/kernel_ast_adapter.dart ('k') | tests/compiler/dart2js/kernel/helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/locals_handler.dart
diff --git a/pkg/compiler/lib/src/ssa/locals_handler.dart b/pkg/compiler/lib/src/ssa/locals_handler.dart
index 2aa766cda9e491236961fb64c0de7404a2a89c01..dc2babe5fc4c869bb6ea440a20e908623b0252a4 100644
--- a/pkg/compiler/lib/src/ssa/locals_handler.dart
+++ b/pkg/compiler/lib/src/ssa/locals_handler.dart
@@ -14,7 +14,7 @@ import '../native/native.dart' as native;
import '../tree/tree.dart' as ast;
import '../types/types.dart';
import '../world.dart' show ClosedWorld;
-import 'builder.dart' show SyntheticLocal;
+
import 'graph_builder.dart';
import 'nodes.dart';
import 'types.dart';
@@ -657,3 +657,20 @@ class LocalsHandler {
/// accessed indirectly through [HLocalGet] and [HLocalSet].
Map<Local, HLocalValue> activationVariables = <Local, HLocalValue>{};
}
+
+/// A synthetic local variable only used with the SSA graph.
+///
+/// For instance used for holding return value of function or the exception of a
+/// try-catch statement.
+class SyntheticLocal extends Local {
+ final String name;
+ final ExecutableElement executableContext;
+
+ // Avoid slow Object.hashCode.
+ final int hashCode = _nextHashCode = (_nextHashCode + 1).toUnsigned(30);
+ static int _nextHashCode = 0;
+
+ SyntheticLocal(this.name, this.executableContext);
+
+ toString() => 'SyntheticLocal($name)';
+}
« no previous file with comments | « pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart ('k') | tests/compiler/dart2js/kernel/helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698