| OLD | NEW |
| 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 compilerIsolate(port) { | 5 compilerIsolate(port) { |
| 6 Runner runner = new Runner(); | 6 Runner runner = new Runner(); |
| 7 runner.init(); | 7 runner.init(); |
| 8 | 8 |
| 9 port.receive((msg, replyTo) { | 9 port.receive((msg, replyTo) { |
| 10 replyTo.send(runner.update(msg)); | 10 replyTo.send(runner.update(msg)); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 | 250 |
| 251 reportWarning(Node node, var message) { | 251 reportWarning(Node node, var message) { |
| 252 print(message); | 252 print(message); |
| 253 } | 253 } |
| 254 | 254 |
| 255 reportError(Node node, var message) { | 255 reportError(Node node, var message) { |
| 256 cancel(message.toString(), node); | 256 cancel(message.toString(), node); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void cancel([String reason, Node node, token, instruction, element]) { | 259 void cancel(String reason, {Node node, token, instruction, element}) { |
| 260 print(reason); | 260 print(reason); |
| 261 } | 261 } |
| 262 | 262 |
| 263 Element runSelective(Script script) { | 263 Element runSelective(Script script) { |
| 264 Stopwatch sw = new Stopwatch()..start(); | 264 Stopwatch sw = new Stopwatch()..start(); |
| 265 Element e; | 265 Element e; |
| 266 try { | 266 try { |
| 267 e = runCompilerSelective(script); | 267 e = runCompilerSelective(script); |
| 268 } on CompilerCancelledException catch (exception) { | 268 } on CompilerCancelledException catch (exception) { |
| 269 log(exception.toString()); | 269 log(exception.toString()); |
| 270 log('compilation failed'); | 270 log('compilation failed'); |
| 271 return null; | 271 return null; |
| 272 } | 272 } |
| 273 log('compilation succeeded: ${sw.elapsedInMs()}ms'); | 273 log('compilation succeeded: ${sw.elapsedInMs()}ms'); |
| 274 return e; | 274 return e; |
| 275 } | 275 } |
| 276 | 276 |
| 277 LibraryElement runCompilerSelective(Script script) { | 277 LibraryElement runCompilerSelective(Script script) { |
| 278 mainApp = new LibraryElement(script); | 278 mainApp = new LibraryElement(script); |
| 279 | 279 |
| 280 universe.libraries.remove(script.uri.toString()); | 280 universe.libraries.remove(script.uri.toString()); |
| 281 Element element; | 281 Element element; |
| 282 withCurrentElement(mainApp, () { | 282 withCurrentElement(mainApp, () { |
| 283 scanner.scan(mainApp); | 283 scanner.scan(mainApp); |
| 284 }); | 284 }); |
| 285 return mainApp; | 285 return mainApp; |
| 286 } | 286 } |
| 287 } | 287 } |
| OLD | NEW |