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

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

Issue 707463003: Support enums in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 1 month 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 | « pkg/compiler/lib/src/scanner/scannerlib.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »
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 part of ssa; 5 part of ssa;
6 6
7 /// A synthetic local variable only used with the SSA graph. 7 /// A synthetic local variable only used with the SSA graph.
8 /// 8 ///
9 /// For instance used for holding return value of function or the exception of a 9 /// For instance used for holding return value of function or the exception of a
10 /// try-catch statement. 10 /// try-catch statement.
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 graph.entry.addBefore(graph.entry.last, parameter); 1485 graph.entry.addBefore(graph.entry.last, parameter);
1486 HInstruction value = 1486 HInstruction value =
1487 potentiallyCheckType(parameter, field.type); 1487 potentiallyCheckType(parameter, field.type);
1488 add(new HFieldSet(field, thisInstruction, value)); 1488 add(new HFieldSet(field, thisInstruction, value));
1489 return closeFunction(); 1489 return closeFunction();
1490 } 1490 }
1491 1491
1492 HGraph buildLazyInitializer(VariableElement variable) { 1492 HGraph buildLazyInitializer(VariableElement variable) {
1493 ast.Node node = variable.node; 1493 ast.Node node = variable.node;
1494 openFunction(variable, node); 1494 openFunction(variable, node);
1495 assert(variable.initializer != null); 1495 assert(invariant(variable, variable.initializer != null,
1496 message: "Non-constant variable $variable has no initializer."));
1496 visit(variable.initializer); 1497 visit(variable.initializer);
1497 HInstruction value = pop(); 1498 HInstruction value = pop();
1498 value = potentiallyCheckType(value, variable.type); 1499 value = potentiallyCheckType(value, variable.type);
1499 closeAndGotoExit(new HReturn(value)); 1500 closeAndGotoExit(new HReturn(value));
1500 return closeFunction(); 1501 return closeFunction();
1501 } 1502 }
1502 1503
1503 /** 1504 /**
1504 * Returns the constructor body associated with the given constructor or 1505 * Returns the constructor body associated with the given constructor or
1505 * creates a new constructor body, if none can be found. 1506 * creates a new constructor body, if none can be found.
(...skipping 5063 matching lines...) Expand 10 before | Expand all | Expand 10 after
6569 if (unaliased is TypedefType) throw 'unable to unalias $type'; 6570 if (unaliased is TypedefType) throw 'unable to unalias $type';
6570 unaliased.accept(this, builder); 6571 unaliased.accept(this, builder);
6571 } 6572 }
6572 6573
6573 void visitDynamicType(DynamicType type, SsaBuilder builder) { 6574 void visitDynamicType(DynamicType type, SsaBuilder builder) {
6574 JavaScriptBackend backend = builder.compiler.backend; 6575 JavaScriptBackend backend = builder.compiler.backend;
6575 ClassElement cls = backend.findHelper('DynamicRuntimeType'); 6576 ClassElement cls = backend.findHelper('DynamicRuntimeType');
6576 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); 6577 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld)));
6577 } 6578 }
6578 } 6579 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/scanner/scannerlib.dart ('k') | pkg/compiler/lib/src/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698