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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart

Issue 889573005: dart2js: emit callstubs in new emitter and rename to stubs. (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
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 library dart2js.new_js_emitter.model_emitter; 5 library dart2js.new_js_emitter.model_emitter;
6 6
7 import '../../dart2jslib.dart' show Compiler; 7 import '../../dart2jslib.dart' show Compiler;
8 import '../../js/js.dart' as js; 8 import '../../js/js.dart' as js;
9 import '../../js_backend/js_backend.dart' show 9 import '../../js_backend/js_backend.dart' show
10 JavaScriptBackend, 10 JavaScriptBackend,
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 397 }
398 Iterable<Method> methods = cls.methods.expand((Method method) { 398 Iterable<Method> methods = cls.methods.expand((Method method) {
399 // TODO(floitsch): can there be anything else than a DartMethod? 399 // TODO(floitsch): can there be anything else than a DartMethod?
400 if (method is DartMethod) { 400 if (method is DartMethod) {
401 return [method]..addAll(method.parameterStubs); 401 return [method]..addAll(method.parameterStubs);
402 } else { 402 } else {
403 return [method]; 403 return [method];
404 } 404 }
405 }); 405 });
406 Iterable<Method> isChecks = cls.isChecks; 406 Iterable<Method> isChecks = cls.isChecks;
407 Iterable<Method> stubs = cls.stubs;
407 Iterable<Method> gettersSetters = _generateGettersSetters(cls); 408 Iterable<Method> gettersSetters = _generateGettersSetters(cls);
408 Iterable<Method> allMethods = 409 Iterable<Method> allMethods =
409 [methods, isChecks, gettersSetters].expand((x) => x); 410 [methods, isChecks, stubs, gettersSetters].expand((x) => x);
410 elements.addAll(allMethods.expand((e) => [js.string(e.name), e.code])); 411 elements.addAll(allMethods.expand((e) => [js.string(e.name), e.code]));
411 return unparse(compiler, new js.ArrayInitializer(elements)); 412 return unparse(compiler, new js.ArrayInitializer(elements));
412 } 413 }
413 414
414 js.Expression emitLazyInitializer(StaticField field) { 415 js.Expression emitLazyInitializer(StaticField field) {
415 assert(field.isLazy); 416 assert(field.isLazy);
416 return unparse(compiler, field.code); 417 return unparse(compiler, field.code);
417 } 418 }
418 419
419 Iterable<js.Expression> emitStaticMethod(StaticMethod method) { 420 Iterable<js.Expression> emitStaticMethod(StaticMethod method) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 624
624 var end = Date.now(); 625 var end = Date.now();
625 print('Setup: ' + (end - start) + ' ms.'); 626 print('Setup: ' + (end - start) + ' ms.');
626 627
627 #main(); // Start main. 628 #main(); // Start main.
628 629
629 }(Date.now(), #code) 630 }(Date.now(), #code)
630 }"""; 631 }""";
631 632
632 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698