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

Unified Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10917208: Change interfaces to abstract classes in dart2js compiler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « lib/compiler/implementation/scanner/scanner.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/builder.dart
diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart
index abcada3b388b2c058cac460201ec69384a6d23b7..ca2cfd959c6294583ba6ee3dd8fa4932266529a5 100644
--- a/lib/compiler/implementation/ssa/builder.dart
+++ b/lib/compiler/implementation/ssa/builder.dart
@@ -709,8 +709,10 @@ class JumpHandlerEntry {
}
-interface JumpHandler default JumpHandlerImpl {
- JumpHandler(SsaBuilder builder, TargetElement target);
+abstract class JumpHandler {
+ factory JumpHandler(SsaBuilder builder, TargetElement target) {
ngeoffray 2012/09/12 09:30:56 You know that this won't be valid after we switch
Lasse Reichstein Nielsen 2012/09/12 10:17:46 I think it'll still be valid. We still need normal
+ return new TargetJumpHandler(builder, target);
+ }
void generateBreak([LabelElement label]);
void generateContinue([LabelElement label]);
void forEachBreak(void action(HBreak instruction, LocalsHandler locals));
@@ -726,37 +728,35 @@ interface JumpHandler default JumpHandlerImpl {
// handler associated with it.
class NullJumpHandler implements JumpHandler {
final Compiler compiler;
+
NullJumpHandler(this.compiler);
void generateBreak([LabelElement label]) {
- // TODO(lrn): Need a compiler object and a location. Since label
- // is optional, it may be null so we also need a position.
compiler.internalError('generateBreak should not be called');
}
void generateContinue([LabelElement label]) {
- // TODO(lrn): Need a compiler object and a location. Since label
- // is optional, it may be null so we also need a position.
compiler.internalError('generateContinue should not be called');
}
void forEachBreak(Function ignored) { }
void forEachContinue(Function ignored) { }
void close() { }
- final TargetElement target = null;
+
List<LabelElement> labels() => const <LabelElement>[];
+ TargetElement get target => null;
}
// Records breaks until a target block is available.
// Breaks are always forward jumps.
// Continues in loops are implemented as breaks of the body.
// Continues in switches is currently not handled.
-class JumpHandlerImpl implements JumpHandler {
+class TargetJumpHandler implements JumpHandler {
final SsaBuilder builder;
final TargetElement target;
final List<JumpHandlerEntry> jumps;
- JumpHandlerImpl(SsaBuilder builder, this.target)
+ TargetJumpHandler(SsaBuilder builder, this.target)
: this.builder = builder,
jumps = <JumpHandlerEntry>[] {
assert(builder.jumpTargets[target] === null);
« no previous file with comments | « lib/compiler/implementation/scanner/scanner.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698