| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 441 } |
| 442 } | 442 } |
| 443 writer.exitBlock('}'); | 443 writer.exitBlock('}'); |
| 444 | 444 |
| 445 // Keep const expressions shared across isolates. Note that the frog | 445 // Keep const expressions shared across isolates. Note that the frog |
| 446 // isolate library needs this because we wrote it's bootstrap and | 446 // isolate library needs this because we wrote it's bootstrap and |
| 447 // book-keeping directly in Dart. Specifically, that code uses | 447 // book-keeping directly in Dart. Specifically, that code uses |
| 448 // [HashMapImplementation] which internally uses a constant expression. | 448 // [HashMapImplementation] which internally uses a constant expression. |
| 449 for (var global in list) { | 449 for (var global in list) { |
| 450 if (global.field == null) { | 450 if (global.field == null) { |
| 451 writer.writeln('${global.name} = ${global.exp.code};'); | 451 writer.writeln('var ${global.name} = ${global.exp.code};'); |
| 452 } | 452 } |
| 453 } | 453 } |
| 454 } | 454 } |
| 455 | 455 |
| 456 if (!corejs.useIsolates) { | 456 if (!corejs.useIsolates) { |
| 457 if (hasStatics) { | 457 if (hasStatics) { |
| 458 writer.writeln('var \$globals = {};'); | 458 writer.writeln('var \$globals = {};'); |
| 459 } | 459 } |
| 460 if (globals.length > 0) { | 460 if (globals.length > 0) { |
| 461 writer.writeln('\$static_init();'); | 461 writer.writeln('\$static_init();'); |
| (...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 result.add(new Value(world.varType, '\$$i', null, /*needsTemp:*/false)); | 2390 result.add(new Value(world.varType, '\$$i', null, /*needsTemp:*/false)); |
| 2391 } | 2391 } |
| 2392 for (int i = bareCount; i < length; i++) { | 2392 for (int i = bareCount; i < length; i++) { |
| 2393 var name = getName(i); | 2393 var name = getName(i); |
| 2394 if (name == null) name = '\$$i'; | 2394 if (name == null) name = '\$$i'; |
| 2395 result.add(new Value(world.varType, name, null, /*needsTemp:*/false)); | 2395 result.add(new Value(world.varType, name, null, /*needsTemp:*/false)); |
| 2396 } | 2396 } |
| 2397 return new Arguments(nodes, result); | 2397 return new Arguments(nodes, result); |
| 2398 } | 2398 } |
| 2399 } | 2399 } |
| OLD | NEW |