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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder_kernel.dart

Issue 2685573002: Replace Backend with JavaScriptBackend. (Closed)
Patch Set: Updated cf. comment Created 3 years, 10 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; 9 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
10 import '../common/names.dart'; 10 import '../common/names.dart';
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 // TODO(sra): The element type of a container type mask might be better. 807 // TODO(sra): The element type of a container type mask might be better.
808 TypeMask type = astAdapter.inferredIndexType(forInStatement); 808 TypeMask type = astAdapter.inferredIndexType(forInStatement);
809 809
810 HInstruction index = localsHandler.readLocal(indexVariable); 810 HInstruction index = localsHandler.readLocal(indexVariable);
811 HInstruction value = new HIndex(array, index, null, type); 811 HInstruction value = new HIndex(array, index, null, type);
812 add(value); 812 add(value);
813 813
814 Local loopVariableLocal = astAdapter.getLocal(forInStatement.variable); 814 Local loopVariableLocal = astAdapter.getLocal(forInStatement.variable);
815 localsHandler.updateLocal(loopVariableLocal, value); 815 localsHandler.updateLocal(loopVariableLocal, value);
816 // Hint to name loop value after name of loop variable. 816 // Hint to name loop value after name of loop variable.
817 if (loopVariableLocal is !SyntheticLocal) { 817 if (loopVariableLocal is! SyntheticLocal) {
818 value.sourceElement ??= loopVariableLocal; 818 value.sourceElement ??= loopVariableLocal;
819 } 819 }
820 820
821 forInStatement.body.accept(this); 821 forInStatement.body.accept(this);
822 } 822 }
823 823
824 void buildUpdate() { 824 void buildUpdate() {
825 // See buildBody as to why we check here. 825 // See buildBody as to why we check here.
826 buildConcurrentModificationErrorCheck(); 826 buildConcurrentModificationErrorCheck();
827 827
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 } 869 }
870 870
871 void buildBody() { 871 void buildBody() {
872 TypeMask mask = astAdapter.typeOfIteratorCurrent(forInStatement); 872 TypeMask mask = astAdapter.typeOfIteratorCurrent(forInStatement);
873 _pushDynamicInvocation(forInStatement, mask, [iterator], 873 _pushDynamicInvocation(forInStatement, mask, [iterator],
874 selector: Selectors.current); 874 selector: Selectors.current);
875 Local loopVariableLocal = astAdapter.getLocal(forInStatement.variable); 875 Local loopVariableLocal = astAdapter.getLocal(forInStatement.variable);
876 HInstruction value = pop(); 876 HInstruction value = pop();
877 localsHandler.updateLocal(loopVariableLocal, value); 877 localsHandler.updateLocal(loopVariableLocal, value);
878 // Hint to name loop value after name of loop variable. 878 // Hint to name loop value after name of loop variable.
879 if (loopVariableLocal is !SyntheticLocal) { 879 if (loopVariableLocal is! SyntheticLocal) {
880 value.sourceElement ??= loopVariableLocal; 880 value.sourceElement ??= loopVariableLocal;
881 } 881 }
882 forInStatement.body.accept(this); 882 forInStatement.body.accept(this);
883 } 883 }
884 884
885 loopHandler.handleLoop( 885 loopHandler.handleLoop(
886 forInStatement, buildInitializer, buildCondition, () {}, buildBody); 886 forInStatement, buildInitializer, buildCondition, () {}, buildBody);
887 } 887 }
888 888
889 void _buildAsyncForIn(ir.ForInStatement forInStatement) { 889 void _buildAsyncForIn(ir.ForInStatement forInStatement) {
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
3221 enterBlock.setBlockFlow( 3221 enterBlock.setBlockFlow(
3222 new HTryBlockInformation( 3222 new HTryBlockInformation(
3223 kernelBuilder.wrapStatementGraph(bodyGraph), 3223 kernelBuilder.wrapStatementGraph(bodyGraph),
3224 exception, 3224 exception,
3225 kernelBuilder.wrapStatementGraph(catchGraph), 3225 kernelBuilder.wrapStatementGraph(catchGraph),
3226 kernelBuilder.wrapStatementGraph(finallyGraph)), 3226 kernelBuilder.wrapStatementGraph(finallyGraph)),
3227 exitBlock); 3227 exitBlock);
3228 kernelBuilder.inTryStatement = previouslyInTryStatement; 3228 kernelBuilder.inTryStatement = previouslyInTryStatement;
3229 } 3229 }
3230 } 3230 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698