Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 836753002: dart2js: First part of native support in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 7
8 class OldEmitter implements Emitter { 8 class OldEmitter implements Emitter {
9 final Compiler compiler; 9 final Compiler compiler;
10 final CodeEmitterTask task; 10 final CodeEmitterTask task;
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 backend.isolateHelperLibrary.find(JavaScriptBackend.START_ROOT_ISOLATE); 937 backend.isolateHelperLibrary.find(JavaScriptBackend.START_ROOT_ISOLATE);
938 mainCallClosure = buildIsolateSetupClosure(main, isolateMain); 938 mainCallClosure = buildIsolateSetupClosure(main, isolateMain);
939 } else if (compiler.hasIncrementalSupport) { 939 } else if (compiler.hasIncrementalSupport) {
940 mainCallClosure = js( 940 mainCallClosure = js(
941 'function() { return #(); }', 941 'function() { return #(); }',
942 backend.emitter.staticFunctionAccess(main)); 942 backend.emitter.staticFunctionAccess(main));
943 } else { 943 } else {
944 mainCallClosure = backend.emitter.staticFunctionAccess(main); 944 mainCallClosure = backend.emitter.staticFunctionAccess(main);
945 } 945 }
946 946
947 bool initializeAffinityTag = backend.needToInitializeIsolateAffinityTag; 947 if (NativeGenerator.needsIsolateAffinityTagInitialization(backend)) {
948 jsAst.Statement nativeBoilerPlate = 948 jsAst.Statement nativeBoilerPlate =
949 NativeGenerator.generateIsolateAffinityTagInitialization( 949 NativeGenerator.generateIsolateAffinityTagInitialization(
950 generateEmbeddedGlobalAccess, 950 backend,
951 initializeIsolateAffinityTag: initializeAffinityTag, 951 generateEmbeddedGlobalAccess,
952 initializeDispatchProperty: backend.needToInitializeDispatchProperty); 952 js("convertToFastObject", []));
953 buffer.write(jsAst.prettyPrint(nativeBoilerPlate, 953 buffer.write(jsAst.prettyPrint(nativeBoilerPlate,
954 compiler, monitor: compiler.dumpInfoTask)); 954 compiler, monitor: compiler.dumpInfoTask));
955 }
955 956
956 jsAst.Expression currentScriptAccess = 957 jsAst.Expression currentScriptAccess =
957 generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT); 958 generateEmbeddedGlobalAccess(embeddedNames.CURRENT_SCRIPT);
958 959
959 addComment('BEGIN invoke [main].', buffer); 960 addComment('BEGIN invoke [main].', buffer);
960 // This code finds the currently executing script by listening to the 961 // This code finds the currently executing script by listening to the
961 // onload event of all script tags and getting the first script which 962 // onload event of all script tags and getting the first script which
962 // finishes. Since onload is called immediately after execution this should 963 // finishes. Since onload is called immediately after execution this should
963 // not substantially change execution order. 964 // not substantially change execution order.
964 jsAst.Statement invokeMain = js.statement(''' 965 jsAst.Statement invokeMain = js.statement('''
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
2030 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2031 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2031 if (element.isInstanceMember) { 2032 if (element.isInstanceMember) {
2032 cachedClassBuilders.remove(element.enclosingClass); 2033 cachedClassBuilders.remove(element.enclosingClass);
2033 2034
2034 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2035 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2035 2036
2036 } 2037 }
2037 } 2038 }
2038 } 2039 }
2039 } 2040 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698