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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10537025: Prototype re-compiling methods in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 8 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 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 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 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 wrapExpressionGraph(conditionExpression), 1486 wrapExpressionGraph(conditionExpression),
1487 wrapStatementGraph(bodyGraph), 1487 wrapStatementGraph(bodyGraph),
1488 null, 1488 null,
1489 loopEntryBlock.loopInformation.target, 1489 loopEntryBlock.loopInformation.target,
1490 loopEntryBlock.loopInformation.labels); 1490 loopEntryBlock.loopInformation.labels);
1491 loopEntryBlock.setBlockFlow(loopBlockInfo, current); 1491 loopEntryBlock.setBlockFlow(loopBlockInfo, current);
1492 loopInfo.loopBlockInformation = loopBlockInfo; 1492 loopInfo.loopBlockInformation = loopBlockInfo;
1493 } 1493 }
1494 1494
1495 visitFunctionExpression(FunctionExpression node) { 1495 visitFunctionExpression(FunctionExpression node) {
1496 if (compiler.pass == 2) {
1497 throw new Pass2BailoutException("visitFunctionExpression");
1498 }
1496 ClosureData nestedClosureData = builder.closureDataCache[node]; 1499 ClosureData nestedClosureData = builder.closureDataCache[node];
1497 if (nestedClosureData === null) { 1500 if (nestedClosureData === null) {
1498 // TODO(floitsch): we can only assume that the reason for not having a 1501 // TODO(floitsch): we can only assume that the reason for not having a
1499 // closure data here is, because the function is inside an initializer. 1502 // closure data here is, because the function is inside an initializer.
1500 compiler.unimplemented("Closures inside initializers", node: node); 1503 compiler.unimplemented("Closures inside initializers", node: node);
1501 } 1504 }
1502 assert(nestedClosureData !== null); 1505 assert(nestedClosureData !== null);
1503 assert(nestedClosureData.closureClassElement !== null); 1506 assert(nestedClosureData.closureClassElement !== null);
1504 ClassElement closureClassElement = 1507 ClassElement closureClassElement =
1505 nestedClosureData.closureClassElement; 1508 nestedClosureData.closureClassElement;
1506 FunctionElement callElement = nestedClosureData.callElement; 1509 FunctionElement callElement = nestedClosureData.callElement;
1507 // TODO(ahe): This should be registered in codegen, not here. 1510 if (compiler.pass == 1) {
floitsch 2012/06/07 10:59:39 Shouldn't be needed: we bailout earlier, and even
Søren Gjesse 2012/06/13 10:55:09 Removed. Actually the bailout is also removed but
1508 compiler.enqueuer.codegen.addToWorkList(callElement, elements); 1511 // TODO(ahe): This should be registered in codegen, not here.
1509 // TODO(ahe): This should be registered in codegen, not here. 1512 compiler.enqueuer.codegen.addToWorkList(callElement, elements);
1510 compiler.enqueuer.codegen.registerInstantiatedClass(closureClassElement); 1513 // TODO(ahe): This should be registered in codegen, not here.
1511 assert(closureClassElement.members.isEmpty()); 1514 compiler.enqueuer.codegen.registerInstantiatedClass(closureClassElement);
1515 assert(closureClassElement.members.isEmpty());
1516 }
1512 1517
1513 List<HInstruction> capturedVariables = <HInstruction>[]; 1518 List<HInstruction> capturedVariables = <HInstruction>[];
1514 for (Element member in closureClassElement.backendMembers) { 1519 for (Element member in closureClassElement.backendMembers) {
1515 // The backendMembers also contains the call method(s). We are only 1520 // The backendMembers also contains the call method(s). We are only
1516 // interested in the fields. 1521 // interested in the fields.
1517 if (member.kind == ElementKind.FIELD) { 1522 if (member.kind == ElementKind.FIELD) {
1518 Element capturedLocal = nestedClosureData.capturedFieldMapping[member]; 1523 Element capturedLocal = nestedClosureData.capturedFieldMapping[member];
1519 assert(capturedLocal != null); 1524 assert(capturedLocal != null);
1520 capturedVariables.add(localsHandler.readLocal(capturedLocal)); 1525 capturedVariables.add(localsHandler.readLocal(capturedLocal));
1521 } 1526 }
(...skipping 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3429 void visitNodeList(NodeList node) { 3434 void visitNodeList(NodeList node) {
3430 node.visitChildren(this); 3435 node.visitChildren(this);
3431 } 3436 }
3432 3437
3433 HInstruction concat(HInstruction left, HInstruction right) { 3438 HInstruction concat(HInstruction left, HInstruction right) {
3434 HInstruction instruction = new HStringConcat(left, right); 3439 HInstruction instruction = new HStringConcat(left, right);
3435 builder.add(instruction); 3440 builder.add(instruction);
3436 return instruction; 3441 return instruction;
3437 } 3442 }
3438 } 3443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698