Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
| 8 SsaCodeGeneratorTask generator; | 8 SsaCodeGeneratorTask generator; |
| 9 SsaBuilderTask builder; | 9 SsaBuilderTask builder; |
| 10 SsaOptimizerTask optimizer; | 10 SsaOptimizerTask optimizer; |
| (...skipping 6004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6015 visitSwitchCase(ast.SwitchCase node) { | 6015 visitSwitchCase(ast.SwitchCase node) { |
| 6016 compiler.internalError(node, 'SsaFromAstMixin.visitSwitchCase.'); | 6016 compiler.internalError(node, 'SsaFromAstMixin.visitSwitchCase.'); |
| 6017 } | 6017 } |
| 6018 | 6018 |
| 6019 visitCaseMatch(ast.CaseMatch node) { | 6019 visitCaseMatch(ast.CaseMatch node) { |
| 6020 compiler.internalError(node, 'SsaFromAstMixin.visitCaseMatch.'); | 6020 compiler.internalError(node, 'SsaFromAstMixin.visitCaseMatch.'); |
| 6021 } | 6021 } |
| 6022 | 6022 |
| 6023 /// Calls [buildTry] inside a synthetic try block with [buildFinally] in the | 6023 /// Calls [buildTry] inside a synthetic try block with [buildFinally] in the |
| 6024 /// finally block. | 6024 /// finally block. |
| 6025 /// | |
| 6026 /// Note that to get the right locals behavior, the code visited by [buildTry] | |
| 6027 /// and [buildFinally] must have been analyzed as if inside a try-statement by | |
| 6028 /// `../closure.dart`. | |
|
karlklose
2015/03/03 10:00:50
Maybe use the class name in '[]' instead of the fi
sigurdm
2015/03/03 12:40:56
Done.
| |
| 6025 void buildProtectedByFinally(void buildTry(), void buildFinally()) { | 6029 void buildProtectedByFinally(void buildTry(), void buildFinally()) { |
| 6030 // Save the current locals. The finally block must not reuse the existing | |
| 6031 // locals handler. None of the variables that have been defined in the | |
| 6032 // body-block will be used, but for loops we will add (unnecessary) phis | |
| 6033 // that will reference the body variables. This makes it look as if the | |
| 6034 // variables were used in a non-dominated block. | |
| 6026 HBasicBlock enterBlock = openNewBlock(); | 6035 HBasicBlock enterBlock = openNewBlock(); |
| 6027 HTry tryInstruction = new HTry(); | 6036 HTry tryInstruction = new HTry(); |
| 6028 close(tryInstruction); | 6037 close(tryInstruction); |
| 6029 bool oldInTryStatement = inTryStatement; | 6038 bool oldInTryStatement = inTryStatement; |
| 6030 inTryStatement = true; | 6039 inTryStatement = true; |
| 6031 | 6040 |
| 6032 HBasicBlock startTryBlock; | 6041 HBasicBlock startTryBlock; |
| 6033 HBasicBlock endTryBlock; | 6042 HBasicBlock endTryBlock; |
| 6034 HBasicBlock startFinallyBlock; | 6043 HBasicBlock startFinallyBlock; |
| 6035 HBasicBlock endFinallyBlock; | 6044 HBasicBlock endFinallyBlock; |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6927 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 6936 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 6928 unaliased.accept(this, builder); | 6937 unaliased.accept(this, builder); |
| 6929 } | 6938 } |
| 6930 | 6939 |
| 6931 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 6940 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 6932 JavaScriptBackend backend = builder.compiler.backend; | 6941 JavaScriptBackend backend = builder.compiler.backend; |
| 6933 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 6942 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
| 6934 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 6943 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 6935 } | 6944 } |
| 6936 } | 6945 } |
| OLD | NEW |