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

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

Issue 1024893002: Do not emit stubName for static functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 5 years, 8 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/old_emitter/container_builder.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // TODO(ahe): Share these with js_helper.dart. 7 // TODO(ahe): Share these with js_helper.dart.
8 const FUNCTION_INDEX = 0; 8 const FUNCTION_INDEX = 0;
9 const NAME_INDEX = 1; 9 const NAME_INDEX = 1;
10 const CALL_NAME_INDEX = 2; 10 const CALL_NAME_INDEX = 2;
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 var index = $FUNCTION_INDEX, alias = array[index], f; 660 var index = $FUNCTION_INDEX, alias = array[index], f;
661 if (typeof alias == "string") { 661 if (typeof alias == "string") {
662 f = array[++index]; 662 f = array[++index];
663 } else { 663 } else {
664 f = alias; 664 f = alias;
665 alias = name; 665 alias = name;
666 } 666 }
667 var funcs = [prototype[name] = prototype[alias] = f]; 667 var funcs = [prototype[name] = prototype[alias] = f];
668 f.\$stubName = name; 668 f.\$stubName = name;
669 functions.push(name); 669 functions.push(name);
670 for (; index < array.length; index += 2) { 670 for (index++; index < array.length; index++) {
671 f = array[index + 1]; 671 f = array[index];
672 if (typeof f != "function") break; 672 if (typeof f != "function") break;
673 f.\$stubName = ${readString("array", "index + 2")}; 673 if (!isStatic) {
674 f.\$stubName = ${readString("array", "++index")};
675 }
674 funcs.push(f); 676 funcs.push(f);
675 if (f.\$stubName) { 677 if (f.\$stubName) {
676 prototype[f.\$stubName] = f; 678 prototype[f.\$stubName] = f;
677 functions.push(f.\$stubName); 679 functions.push(f.\$stubName);
678 } 680 }
679 } 681 }
680 index++; 682
681 for (var i = 0; i < funcs.length; index++, i++) { 683 for (var i = 0; i < funcs.length; index++, i++) {
682 funcs[i].\$callName = ${readString("array", "index")}; 684 funcs[i].\$callName = ${readString("array", "index")};
683 } 685 }
684 var getterStubName = ${readString("array", "index")}; 686 var getterStubName = ${readString("array", "index")};
685 array = array.slice(++index); 687 array = array.slice(++index);
686 var requiredParameterInfo = ${readInt("array", "0")}; 688 var requiredParameterInfo = ${readInt("array", "0")};
687 var requiredParameterCount = requiredParameterInfo >> 1; 689 var requiredParameterCount = requiredParameterInfo >> 1;
688 var isAccessor = (requiredParameterInfo & 1) === 1; 690 var isAccessor = (requiredParameterInfo & 1) === 1;
689 var isSetter = requiredParameterInfo === 3; 691 var isSetter = requiredParameterInfo === 3;
690 var isGetter = requiredParameterInfo === 1; 692 var isGetter = requiredParameterInfo === 1;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 (function() { 843 (function() {
842 var result = $array[$index]; 844 var result = $array[$index];
843 if ($check) { 845 if ($check) {
844 throw new Error( 846 throw new Error(
845 name + ": expected value of type \'$type\' at index " + ($index) + 847 name + ": expected value of type \'$type\' at index " + ($index) +
846 " but got " + (typeof result)); 848 " but got " + (typeof result));
847 } 849 }
848 return result; 850 return result;
849 })()'''; 851 })()''';
850 } 852 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698