| 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 /** | 5 /** |
| 6 * A function element that represents a closure call. The signature is copied | 6 * A function element that represents a closure call. The signature is copied |
| 7 * from the given element. | 7 * from the given element. |
| 8 */ | 8 */ |
| 9 class ClosureInvocationElement extends FunctionElement { | 9 class ClosureInvocationElement extends FunctionElement { |
| 10 ClosureInvocationElement(SourceString name, | 10 ClosureInvocationElement(SourceString name, |
| (...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 String mainEnsureGetter = ''; | 1286 String mainEnsureGetter = ''; |
| 1287 // Since we pass the closurized version of the main method to | 1287 // Since we pass the closurized version of the main method to |
| 1288 // the isolate method, we must make sure that it exists. | 1288 // the isolate method, we must make sure that it exists. |
| 1289 if (!compiler.codegenWorld.staticFunctionsNeedingGetter.contains(appMain)) { | 1289 if (!compiler.codegenWorld.staticFunctionsNeedingGetter.contains(appMain)) { |
| 1290 Selector selector = new Selector.callClosure(0); | 1290 Selector selector = new Selector.callClosure(0); |
| 1291 String invocationName = "${namer.closureInvocationName(selector)}"; | 1291 String invocationName = "${namer.closureInvocationName(selector)}"; |
| 1292 mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess"; | 1292 mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess"; |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 // TODO(ngeoffray): These globals are currently required by the isolate | 1295 // TODO(ngeoffray): These globals are currently required by the isolate |
| 1296 // library, but since leg already generates code on an Isolate object, they | 1296 // library. They should be removed. |
| 1297 // are not really needed. We should remove them once Leg replaces Frog. | |
| 1298 buffer.add(""" | 1297 buffer.add(""" |
| 1299 var \$globalThis = $currentIsolate; | 1298 var \$globalThis = $currentIsolate; |
| 1300 var \$globalState; | 1299 var \$globalState; |
| 1301 var \$globals; | 1300 var \$globals; |
| 1302 var \$isWorker = false; | 1301 var \$isWorker = false; |
| 1303 var \$supportsWorkers = false; | 1302 var \$supportsWorkers = false; |
| 1304 var \$thisScriptUrl; | 1303 var \$thisScriptUrl; |
| 1305 function \$static_init(){}; | 1304 function \$static_init(){}; |
| 1306 | 1305 |
| 1307 function \$initGlobals(context) { | 1306 function \$initGlobals(context) { |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1434 const String HOOKS_API_USAGE = """ | 1433 const String HOOKS_API_USAGE = """ |
| 1435 // Generated by dart2js, the Dart to JavaScript compiler. | 1434 // Generated by dart2js, the Dart to JavaScript compiler. |
| 1436 // The code supports the following hooks: | 1435 // The code supports the following hooks: |
| 1437 // dartPrint(message) - if this function is defined it is called | 1436 // dartPrint(message) - if this function is defined it is called |
| 1438 // instead of the Dart [print] method. | 1437 // instead of the Dart [print] method. |
| 1439 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1438 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 1440 // method will not be invoked directly. | 1439 // method will not be invoked directly. |
| 1441 // Instead, a closure that will invoke [main] is | 1440 // Instead, a closure that will invoke [main] is |
| 1442 // passed to [dartMainRunner]. | 1441 // passed to [dartMainRunner]. |
| 1443 """; | 1442 """; |
| OLD | NEW |