| 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 class Compiler implements Canceler, Logger { | 5 class Compiler implements Canceler, Logger { |
| 6 final Script script; | 6 final Script script; |
| 7 Queue<SourceString> worklist; | 7 Queue<SourceString> worklist; |
| 8 Universe universe; | 8 Universe universe; |
| 9 | 9 |
| 10 List<CompilerTask> tasks; | 10 List<CompilerTask> tasks; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 buffer.add('main();\n'); | 112 buffer.add('main();\n'); |
| 113 return buffer.toString(); | 113 return buffer.toString(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 reportWarning(Node node, String message) {} | 116 reportWarning(Node node, String message) {} |
| 117 } | 117 } |
| 118 | 118 |
| 119 class CompilerTask { | 119 class CompilerTask { |
| 120 final Compiler compiler; | 120 final Compiler compiler; |
| 121 final StopWatch watch; | 121 final Stopwatch watch; |
| 122 | 122 |
| 123 CompilerTask(this.compiler) : watch = new StopWatch(); | 123 CompilerTask(this.compiler) : watch = new Stopwatch(); |
| 124 | 124 |
| 125 String get name() => 'Unknown task'; | 125 String get name() => 'Unknown task'; |
| 126 int get timing() => watch.elapsedInMs(); | 126 int get timing() => watch.elapsedInMs(); |
| 127 | 127 |
| 128 measure(Function action) { | 128 measure(Function action) { |
| 129 // TODO(kasperl): Do we have to worry about exceptions here? | 129 // TODO(kasperl): Do we have to worry about exceptions here? |
| 130 watch.start(); | 130 watch.start(); |
| 131 var result = action(); | 131 var result = action(); |
| 132 watch.stop(); | 132 watch.stop(); |
| 133 return result; | 133 return result; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 final String TDIV_SUPPORT = """ | 177 final String TDIV_SUPPORT = """ |
| 178 function \$tdiv(a, b) { | 178 function \$tdiv(a, b) { |
| 179 var tmp = this / other; | 179 var tmp = this / other; |
| 180 if (tmp < 0) { | 180 if (tmp < 0) { |
| 181 return Math.ceil(tmp); | 181 return Math.ceil(tmp); |
| 182 } else { | 182 } else { |
| 183 return Math.floor(tmp); | 183 return Math.floor(tmp); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 """; | 186 """; |
| OLD | NEW |