| 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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess"; | 669 mainEnsureGetter = "$mainAccess.$invocationName = $mainAccess"; |
| 670 } | 670 } |
| 671 | 671 |
| 672 // TODO(ngeoffray): These globals are currently required by the isolate | 672 // TODO(ngeoffray): These globals are currently required by the isolate |
| 673 // library, but since leg already generates code on an Isolate object, they | 673 // library, but since leg already generates code on an Isolate object, they |
| 674 // are not really needed. We should remove them once Leg replaces Frog. | 674 // are not really needed. We should remove them once Leg replaces Frog. |
| 675 buffer.add(""" | 675 buffer.add(""" |
| 676 var \$globalThis = $currentIsolate; | 676 var \$globalThis = $currentIsolate; |
| 677 var \$globalState; | 677 var \$globalState; |
| 678 var \$globals; | 678 var \$globals; |
| 679 var \$isWorker; |
| 680 var \$supportsWorkers; |
| 681 var \$thisScriptUrl; |
| 679 function \$static_init(){}; | 682 function \$static_init(){}; |
| 680 | 683 |
| 681 function \$initGlobals(context) { | 684 function \$initGlobals(context) { |
| 682 context.isolateStatics = new ${namer.ISOLATE}(); | 685 context.isolateStatics = new ${namer.ISOLATE}(); |
| 683 } | 686 } |
| 684 function \$setGlobals(context) { | 687 function \$setGlobals(context) { |
| 685 $currentIsolate = context.isolateStatics; | 688 $currentIsolate = context.isolateStatics; |
| 686 \$globalThis = $currentIsolate; | 689 \$globalThis = $currentIsolate; |
| 687 } | 690 } |
| 688 $mainEnsureGetter | 691 $mainEnsureGetter |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 nativeEmitter.emitDynamicDispatchMetadata(); | 729 nativeEmitter.emitDynamicDispatchMetadata(); |
| 727 mainBuffer.add( | 730 mainBuffer.add( |
| 728 'var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); | 731 'var ${namer.CURRENT_ISOLATE} = new ${namer.ISOLATE}();\n'); |
| 729 nativeEmitter.assembleCode(mainBuffer); | 732 nativeEmitter.assembleCode(mainBuffer); |
| 730 emitMain(mainBuffer); | 733 emitMain(mainBuffer); |
| 731 compiler.assembledCode = mainBuffer.toString(); | 734 compiler.assembledCode = mainBuffer.toString(); |
| 732 }); | 735 }); |
| 733 return compiler.assembledCode; | 736 return compiler.assembledCode; |
| 734 } | 737 } |
| 735 } | 738 } |
| OLD | NEW |