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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ir/inodes.dart

Issue 57873002: Build new IR for functions returning a constant (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
OLDNEW
(Empty)
1 part of ir;
2
3 class Position {
4 SourceFile sourceFile;
ngeoffray 2013/11/05 12:58:35 Probably not something we want to put on each inst
lukas 2013/11/05 17:10:50 True!
5 int offset;
6 Position(this.sourceFile, this.offset);
7 }
8
9 abstract class INode {
10 Position pos;
11 INode(this.pos);
12 }
13
14 class NoValue extends INode {
15 static NoValue _instance;
ngeoffray 2013/11/05 12:58:35 How about a const constructor?
lukas 2013/11/05 17:10:50 Yes, much better.
16 factory NoValue() {
17 if (_instance == null) _instance = new NoValue.internal();
18 return _instance;
19 }
20 NoValue.internal() : super(new Position(null, 0));
21 }
22
23 class IFunction extends INode {
24 List<INode> statements;
25 IFunction(Position pos, this.statements) : super(pos);
26
27 bool hasBody() => statements.isNotEmpty;
28 }
29
30 class IReturn extends INode {
31 IFunction function;
32 INode value;
33 IReturn(Position pos, this.function, this.value) : super(pos);
34 }
35
36 class IConstant extends INode {
37 Constant value;
ngeoffray 2013/11/05 12:58:35 final?
lukas 2013/11/05 17:10:50 Done.
38 IConstant(Position pos, this.value) : super(pos);
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698