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

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

Issue 868283005: dart2js: make "CREATE_JS_ISOLATE" an embedded global. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 generateAccessorFunction, 359 generateAccessorFunction,
360 new jsAst.FunctionDeclaration( 360 new jsAst.FunctionDeclaration(
361 new jsAst.VariableDeclaration('defineClass'), defineClass) ]; 361 new jsAst.VariableDeclaration('defineClass'), defineClass) ];
362 362
363 if (compiler.hasIncrementalSupport) { 363 if (compiler.hasIncrementalSupport) {
364 result.add( 364 result.add(
365 js(r'#.defineClass = defineClass', [namer.accessIncrementalHelper])); 365 js(r'#.defineClass = defineClass', [namer.accessIncrementalHelper]));
366 } 366 }
367 367
368 if (hasIsolateSupport) { 368 if (hasIsolateSupport) {
369 jsAst.Expression createNewIsolateFunctionAccess =
370 generateEmbeddedGlobalAccess(embeddedNames.CREATE_NEW_ISOLATE);
371 var createIsolateAssignment =
372 js('# = function() { return new ${namer.isolateName}(); }',
373 createNewIsolateFunctionAccess);
374
369 jsAst.Expression classIdExtractorAccess = 375 jsAst.Expression classIdExtractorAccess =
370 generateEmbeddedGlobalAccess(embeddedNames.CLASS_ID_EXTRACTOR); 376 generateEmbeddedGlobalAccess(embeddedNames.CLASS_ID_EXTRACTOR);
371 var classIdExtractorAssignment = 377 var classIdExtractorAssignment =
372 js('# = function(o) { return o.constructor.name; }', 378 js('# = function(o) { return o.constructor.name; }',
373 classIdExtractorAccess); 379 classIdExtractorAccess);
374 380
375 jsAst.Expression classFieldsExtractorAccess = 381 jsAst.Expression classFieldsExtractorAccess =
376 generateEmbeddedGlobalAccess(embeddedNames.CLASS_FIELDS_EXTRACTOR); 382 generateEmbeddedGlobalAccess(embeddedNames.CLASS_FIELDS_EXTRACTOR);
377 var classFieldsExtractorAssignment = js(''' 383 var classFieldsExtractorAssignment = js('''
378 # = function(o) { 384 # = function(o) {
(...skipping 16 matching lines...) Expand all
395 [instanceFromClassIdAccess, allClassesAccess]); 401 [instanceFromClassIdAccess, allClassesAccess]);
396 402
397 jsAst.Expression initializeEmptyInstanceAccess = 403 jsAst.Expression initializeEmptyInstanceAccess =
398 generateEmbeddedGlobalAccess(embeddedNames.INITIALIZE_EMPTY_INSTANCE); 404 generateEmbeddedGlobalAccess(embeddedNames.INITIALIZE_EMPTY_INSTANCE);
399 var initializeEmptyInstanceAssignment = js(''' 405 var initializeEmptyInstanceAssignment = js('''
400 # = function(name, o, fields) { 406 # = function(name, o, fields) {
401 #[name].apply(o, fields); 407 #[name].apply(o, fields);
402 return o; 408 return o;
403 }''', [ initializeEmptyInstanceAccess, allClassesAccess ]); 409 }''', [ initializeEmptyInstanceAccess, allClassesAccess ]);
404 410
405 result.addAll([classIdExtractorAssignment, 411 result.addAll([createIsolateAssignment,
412 classIdExtractorAssignment,
406 classFieldsExtractorAssignment, 413 classFieldsExtractorAssignment,
407 instanceFromClassIdAssignment, 414 instanceFromClassIdAssignment,
408 initializeEmptyInstanceAssignment]); 415 initializeEmptyInstanceAssignment]);
409 } 416 }
410 417
411 return result; 418 return result;
412 } 419 }
413 420
414 /** Needs defineClass to be defined. */ 421 /** Needs defineClass to be defined. */
415 jsAst.Expression buildInheritFrom() { 422 jsAst.Expression buildInheritFrom() {
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { 2060 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
2054 if (element.isInstanceMember) { 2061 if (element.isInstanceMember) {
2055 cachedClassBuilders.remove(element.enclosingClass); 2062 cachedClassBuilders.remove(element.enclosingClass);
2056 2063
2057 nativeEmitter.cachedBuilders.remove(element.enclosingClass); 2064 nativeEmitter.cachedBuilders.remove(element.enclosingClass);
2058 2065
2059 } 2066 }
2060 } 2067 }
2061 } 2068 }
2062 } 2069 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698