OLD | NEW |
---|---|
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 /** | 5 /** |
6 * Top level generator object for writing code and keeping track of | 6 * Top level generator object for writing code and keeping track of |
7 * dependencies. | 7 * dependencies. |
8 * | 8 * |
9 * Should have two compilation models, but only one implemented so far. | 9 * Should have two compilation models, but only one implemented so far. |
10 * | 10 * |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 | 43 |
44 // Write the main library. This will cause all libraries to be written in | 44 // Write the main library. This will cause all libraries to be written in |
45 // the topographic sort order. | 45 // the topographic sort order. |
46 writeTypes(main.declaringType.library); | 46 writeTypes(main.declaringType.library); |
47 | 47 |
48 // Write Function call stubs. Since Function is an interface we need to do | 48 // Write Function call stubs. Since Function is an interface we need to do |
49 // this explicitly. | 49 // this explicitly. |
50 _writeDynamicStubs(world.functionType); | 50 _writeDynamicStubs(world.functionType); |
51 | 51 |
52 _writeGlobals(); | 52 _writeGlobals(); |
53 writer.writeln('${mainCall.code};'); | 53 writer.writeln('RunEntry(function () {${mainCall.code};}, []);'); |
jimhug
2011/11/08 15:39:01
Does this cause any issues with our stack traces?
| |
54 } | 54 } |
55 | 55 |
56 GlobalValue globalForStaticField(FieldMember field, Value fieldValue, | 56 GlobalValue globalForStaticField(FieldMember field, Value fieldValue, |
57 List<Value> dependencies) { | 57 List<Value> dependencies) { |
58 var fullname = "${field.declaringType.jsname}.${field.jsname}"; | 58 var fullname = "${field.declaringType.jsname}.${field.jsname}"; |
59 if (!globals.containsKey(fullname)) { | 59 if (!globals.containsKey(fullname)) { |
60 globals[fullname] = new GlobalValue.fromStatic( | 60 globals[fullname] = new GlobalValue.fromStatic( |
61 field, fieldValue, dependencies); | 61 field, fieldValue, dependencies); |
62 } | 62 } |
63 return globals[fullname]; | 63 return globals[fullname]; |
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2176 result.add(new Value(world.varType, '\$$i', false, /*needsTemp:*/false)); | 2176 result.add(new Value(world.varType, '\$$i', false, /*needsTemp:*/false)); |
2177 } | 2177 } |
2178 for (int i = bareCount; i < length; i++) { | 2178 for (int i = bareCount; i < length; i++) { |
2179 var name = getName(i); | 2179 var name = getName(i); |
2180 if (name == null) name = '\$$i'; | 2180 if (name == null) name = '\$$i'; |
2181 result.add(new Value(world.varType, name, false, /*needsTemp:*/false)); | 2181 result.add(new Value(world.varType, name, false, /*needsTemp:*/false)); |
2182 } | 2182 } |
2183 return new Arguments(nodes, result); | 2183 return new Arguments(nodes, result); |
2184 } | 2184 } |
2185 } | 2185 } |
OLD | NEW |