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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.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: Check for critical edges. Created 6 years, 5 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
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 class SsaCodeGeneratorTask extends CompilerTask { 7 class SsaCodeGeneratorTask extends CompilerTask {
8 8
9 final JavaScriptBackend backend; 9 final JavaScriptBackend backend;
10 10
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 currentBlockInformation = oldInfo; 748 currentBlockInformation = oldInfo;
749 } else { 749 } else {
750 generateStatements(info.body); 750 generateStatements(info.body);
751 } 751 }
752 } 752 }
753 753
754 bool visitLoopInfo(HLoopBlockInformation info) { 754 bool visitLoopInfo(HLoopBlockInformation info) {
755 HExpressionInformation condition = info.condition; 755 HExpressionInformation condition = info.condition;
756 bool isConditionExpression = isJSCondition(condition); 756 bool isConditionExpression = isJSCondition(condition);
757 757
758 // Assert that the block we inserted to avoid critical edges satisfies
759 // basic assumptions.
760 assert(!condition.end.successors.last.isEmpty);
761 assert(condition.end.successors.last.first is HGoto);
762 assert(condition.end.successors.last.first.next == null);
763
764 js.Loop loop; 758 js.Loop loop;
765 759
766 switch (info.kind) { 760 switch (info.kind) {
767 // Treate all three "test-first" loops the same way. 761 // Treate all three "test-first" loops the same way.
768 case HLoopBlockInformation.FOR_LOOP: 762 case HLoopBlockInformation.FOR_LOOP:
769 case HLoopBlockInformation.WHILE_LOOP: 763 case HLoopBlockInformation.WHILE_LOOP:
770 case HLoopBlockInformation.FOR_IN_LOOP: 764 case HLoopBlockInformation.FOR_IN_LOOP:
771 case HLoopBlockInformation.SWITCH_CONTINUE_LOOP: 765 case HLoopBlockInformation.SWITCH_CONTINUE_LOOP:
772 HBlockInformation initialization = info.initializer; 766 HBlockInformation initialization = info.initializer;
773 int initializationType = TYPE_STATEMENT; 767 int initializationType = TYPE_STATEMENT;
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 js.PropertyAccess accessHelper(String name) { 2711 js.PropertyAccess accessHelper(String name) {
2718 Element helper = compiler.findHelper(name); 2712 Element helper = compiler.findHelper(name);
2719 if (helper == null) { 2713 if (helper == null) {
2720 // For mocked-up tests. 2714 // For mocked-up tests.
2721 return js.js('(void 0).$name'); 2715 return js.js('(void 0).$name');
2722 } 2716 }
2723 registry.registerStaticUse(helper); 2717 registry.registerStaticUse(helper);
2724 return backend.namer.elementAccess(helper); 2718 return backend.namer.elementAccess(helper);
2725 } 2719 }
2726 } 2720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698