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

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

Issue 1193423002: dart2js: Avoid Object.create for bookeeping data structures during startup. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 jsAst.Expression finishedClassesAccess = 790 jsAst.Expression finishedClassesAccess =
791 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES); 791 generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES);
792 jsAst.Expression cyclicThrow = 792 jsAst.Expression cyclicThrow =
793 staticFunctionAccess(backend.getCyclicThrowHelper()); 793 staticFunctionAccess(backend.getCyclicThrowHelper());
794 jsAst.Expression laziesAccess = 794 jsAst.Expression laziesAccess =
795 generateEmbeddedGlobalAccess(embeddedNames.LAZIES); 795 generateEmbeddedGlobalAccess(embeddedNames.LAZIES);
796 796
797 return js.statement(''' 797 return js.statement('''
798 function init() { 798 function init() {
799 $isolatePropertiesName = Object.create(null); 799 $isolatePropertiesName = Object.create(null);
800 #allClasses = Object.create(null); 800 #allClasses = map();
801 #getTypeFromName = function(name) {return #allClasses[name];}; 801 #getTypeFromName = function(name) {return #allClasses[name];};
802 #interceptorsByTag = Object.create(null); 802 #interceptorsByTag = map();
803 #leafTags = Object.create(null); 803 #leafTags = map();
804 #finishedClasses = Object.create(null); 804 #finishedClasses = map();
805 805
806 if (#needsLazyInitializer) { 806 if (#needsLazyInitializer) {
807 // [staticName] is only provided in non-minified mode. If missing, we 807 // [staticName] is only provided in non-minified mode. If missing, we
808 // fall back to [fieldName]. Likewise, [prototype] is optional and 808 // fall back to [fieldName]. Likewise, [prototype] is optional and
809 // defaults to the isolateProperties object. 809 // defaults to the isolateProperties object.
810 $lazyInitializerName = function (fieldName, getterName, lazyValue, 810 $lazyInitializerName = function (fieldName, getterName, lazyValue,
811 staticName, prototype) { 811 staticName, prototype) {
812 if (!#lazies) #lazies = Object.create(null); 812 if (!#lazies) #lazies = Object.create(null);
813 #lazies[fieldName] = getterName; 813 #lazies[fieldName] = getterName;
814 814
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
2002 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2002 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2003 if (element.isInstanceMember) { 2003 if (element.isInstanceMember) {
2004 cachedClassBuilders.remove(element.enclosingClass); 2004 cachedClassBuilders.remove(element.enclosingClass);
2005 2005
2006 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2006 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2007 2007
2008 } 2008 }
2009 } 2009 }
2010 } 2010 }
2011 } 2011 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698