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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/validate.dart

Issue 350903002: Move validation to validate.dart and add comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Upload Created 6 years, 6 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 | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/critical_edge2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/validate.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/validate.dart b/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
index e751b4dcce6c206f6edc371e919fe2656978e10c..5d916194880b1fcb283317545dea560030820c52 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/validate.dart
@@ -36,7 +36,16 @@ class HValidator extends HInstructionVisitor {
markInvalid("If node without two successors");
}
if (block.last is HConditionalBranch && block.successors.length != 2) {
- markInvalid("Conditional node without two successors");
+ markInvalid("Conditional node without two successors");
+ }
+ if (block.last is HLoopBranch) {
ngeoffray 2014/06/24 15:45:00 Why just limiting to HLoopBranch? A generic critic
floitsch 2014/06/24 18:29:43 Done.
+ // Assert that the block we inserted to avoid critical edges satisfies
+ // our assumptions. That is, it must not contain any instructions
+ // (although it may contain phy-updates).
ngeoffray 2014/06/24 15:45:01 phy -> phi
floitsch 2014/06/24 18:29:43 Done.
+ HBasicBlock avoidCriticalEdgeBlock = block.successors.last;
+ if (avoidCriticalEdgeBlock.first is! HGoto) {
+ markInvalid("Critical edge block contains instructions");
+ }
}
if (block.last is HGoto && block.successors.length != 1) {
markInvalid("Goto node with not exactly one successor");
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen.dart ('k') | tests/language/critical_edge2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698