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

Side by Side Diff: frog/leg/ssa/builder.dart

Issue 9740003: Disable closures in initializers and fail instead of crashing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file. Created 8 years, 9 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
« no previous file with comments | « no previous file | frog/leg/ssa/closure.dart » ('j') | frog/leg/ssa/closure.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 1232
1233 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge. 1233 conditionBlock.addSuccessor(loopEntryBlock); // The back-edge.
1234 loopEntryBlock.postProcessLoopHeader(); 1234 loopEntryBlock.postProcessLoopHeader();
1235 1235
1236 endLoop(loopEntryBlock, conditionBlock, jumpHandler, localsHandler); 1236 endLoop(loopEntryBlock, conditionBlock, jumpHandler, localsHandler);
1237 jumpHandler.close(); 1237 jumpHandler.close();
1238 } 1238 }
1239 1239
1240 visitFunctionExpression(FunctionExpression node) { 1240 visitFunctionExpression(FunctionExpression node) {
1241 ClosureData nestedClosureData = closureDataCache[node]; 1241 ClosureData nestedClosureData = closureDataCache[node];
1242 if (nestedClosureData === null) {
1243 // TODO(floitsch): we can only assume that the reason for not having a
1244 // closure data here is, because the function is inside an initializer.
1245 compiler.unimplemented("Closures inside initializers", node: node);
1246 }
1242 assert(nestedClosureData !== null); 1247 assert(nestedClosureData !== null);
1243 assert(nestedClosureData.closureClassElement !== null); 1248 assert(nestedClosureData.closureClassElement !== null);
1244 ClassElement closureClassElement = 1249 ClassElement closureClassElement =
1245 nestedClosureData.closureClassElement; 1250 nestedClosureData.closureClassElement;
1246 FunctionElement callElement = nestedClosureData.callElement; 1251 FunctionElement callElement = nestedClosureData.callElement;
1247 compiler.enqueue(new WorkItem.toCodegen(callElement, elements)); 1252 compiler.enqueue(new WorkItem.toCodegen(callElement, elements));
1248 compiler.registerInstantiatedClass(closureClassElement); 1253 compiler.registerInstantiatedClass(closureClassElement);
1249 assert(closureClassElement.members.isEmpty()); 1254 assert(closureClassElement.members.isEmpty());
1250 1255
1251 List<HInstruction> capturedVariables = <HInstruction>[]; 1256 List<HInstruction> capturedVariables = <HInstruction>[];
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 HInstruction concat = new HAdd(target, left, right); 2810 HInstruction concat = new HAdd(target, left, right);
2806 builder.add(concat); 2811 builder.add(concat);
2807 return concat; 2812 return concat;
2808 } 2813 }
2809 2814
2810 HInstruction result() { 2815 HInstruction result() {
2811 flushAccumulator(); 2816 flushAccumulator();
2812 return prefix; 2817 return prefix;
2813 } 2818 }
2814 } 2819 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/ssa/closure.dart » ('j') | frog/leg/ssa/closure.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698