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

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

Issue 767643002: dart2js: Make usage of names more consistent between compiler and runtime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix long lines. Created 6 years 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
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 // constructor. 372 // constructor.
373 // For engines where we have access to the '__proto__' we can manipulate 373 // For engines where we have access to the '__proto__' we can manipulate
374 // the object literal directly. For other engines we have to create a new 374 // the object literal directly. For other engines we have to create a new
375 // object and copy over the members. 375 // object and copy over the members.
376 376
377 String reflectableField = namer.reflectableField; 377 String reflectableField = namer.reflectableField;
378 jsAst.Expression allClassesAccess = 378 jsAst.Expression allClassesAccess =
379 generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES); 379 generateEmbeddedGlobalAccess(embeddedNames.ALL_CLASSES);
380 jsAst.Expression metadataAccess = 380 jsAst.Expression metadataAccess =
381 generateEmbeddedGlobalAccess(embeddedNames.METADATA); 381 generateEmbeddedGlobalAccess(embeddedNames.METADATA);
382 String signaturePropertyName = namer.operatorSignature;
382 383
383 return js(''' 384 return js('''
384 function(collectedClasses, isolateProperties, existingIsolateProperties) { 385 function(collectedClasses, isolateProperties, existingIsolateProperties) {
385 var pendingClasses = Object.create(null); 386 var pendingClasses = Object.create(null);
386 var allClasses = #allClasses; 387 var allClasses = #allClasses;
387 var constructors; 388 var constructors;
388 389
389 if (#debugFastObjects) 390 if (#debugFastObjects)
390 print("Number of classes: " + 391 print("Number of classes: " +
391 Object.getOwnPropertyNames(\$\$).length); 392 Object.getOwnPropertyNames(\$\$).length);
(...skipping 27 matching lines...) Expand all
419 classData = fields = classData[0]; 420 classData = fields = classData[0];
420 } 421 }
421 var s = fields.split(";"); 422 var s = fields.split(";");
422 fields = s[1] == "" ? [] : s[1].split(","); 423 fields = s[1] == "" ? [] : s[1].split(",");
423 supr = s[0]; 424 supr = s[0];
424 split = supr.split(":"); 425 split = supr.split(":");
425 if (split.length == 2) { 426 if (split.length == 2) {
426 supr = split[0]; 427 supr = split[0];
427 var functionSignature = split[1]; 428 var functionSignature = split[1];
428 if (functionSignature) 429 if (functionSignature)
429 desc.\$signature = (function(s) { 430 desc.$signaturePropertyName = (function(s) {
430 return function(){ return #metadata[s]; }; 431 return function(){ return #metadata[s]; };
431 })(functionSignature); 432 })(functionSignature);
432 } 433 }
433 434
434 if (#needsMixinSupport) 435 if (#needsMixinSupport)
435 if (supr && supr.indexOf("+") > 0) { 436 if (supr && supr.indexOf("+") > 0) {
436 s = supr.split("+"); 437 s = supr.split("+");
437 supr = s[0]; 438 supr = s[0];
438 var mixin = collectedClasses[s[1]]; 439 var mixin = collectedClasses[s[1]];
439 if (mixin instanceof Array) mixin = mixin[1]; 440 if (mixin instanceof Array) mixin = mixin[1];
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2011 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2011 if (element.isInstanceMember) { 2012 if (element.isInstanceMember) {
2012 cachedClassBuilders.remove(element.enclosingClass); 2013 cachedClassBuilders.remove(element.enclosingClass);
2013 2014
2014 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2015 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2015 2016
2016 } 2017 }
2017 } 2018 }
2018 } 2019 }
2019 } 2020 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698