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

Side by Side Diff: sdk/lib/_internal/compiler/js_lib/js_mirrors.dart

Issue 974803002: Defer addStubs to class instantiation time. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and fixes. Created 5 years, 9 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) 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 library dart._js_mirrors; 5 library dart._js_mirrors;
6 6
7 import 'dart:_js_embedded_names' show 7 import 'dart:_js_embedded_names' show
8 JsGetName, 8 JsGetName,
9 ALL_CLASSES, 9 ALL_CLASSES,
10 LAZIES, 10 LAZIES,
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 if (typeVariables.isEmpty) return _jsConstructor; 1673 if (typeVariables.isEmpty) return _jsConstructor;
1674 var type = [_jsConstructor]; 1674 var type = [_jsConstructor];
1675 for (int i = 0; i < typeVariables.length; i ++) { 1675 for (int i = 0; i < typeVariables.length; i ++) {
1676 type.add(JsMirrorSystem._dynamicType._asRuntimeType); 1676 type.add(JsMirrorSystem._dynamicType._asRuntimeType);
1677 } 1677 }
1678 return type; 1678 return type;
1679 } 1679 }
1680 1680
1681 List<JsMethodMirror> _getMethodsWithOwner(DeclarationMirror methodOwner) { 1681 List<JsMethodMirror> _getMethodsWithOwner(DeclarationMirror methodOwner) {
1682 var prototype = JS('', '#.prototype', _jsConstructor); 1682 var prototype = JS('', '#.prototype', _jsConstructor);
1683 // The prototype might not have been processed yet, so do that now.
1684 JS('', '#[#]()', prototype,
1685 JS_GET_NAME(JsGetName.DEFERRED_ACTION_PROPERTY));
1683 List<String> keys = extractKeys(prototype); 1686 List<String> keys = extractKeys(prototype);
1684 var result = <JsMethodMirror>[]; 1687 var result = <JsMethodMirror>[];
1685 for (String key in keys) { 1688 for (String key in keys) {
1686 if (isReflectiveDataInPrototype(key)) continue; 1689 if (isReflectiveDataInPrototype(key)) continue;
1687 String simpleName = mangledNames[key]; 1690 String simpleName = mangledNames[key];
1688 // [simpleName] can be null if [key] represents an implementation 1691 // [simpleName] can be null if [key] represents an implementation
1689 // detail, for example, a bailout method, or runtime type support. 1692 // detail, for example, a bailout method, or runtime type support.
1690 // It might also be null if the user has limited what is reified for 1693 // It might also be null if the user has limited what is reified for
1691 // reflection with metadata. 1694 // reflection with metadata.
1692 if (simpleName == null) continue; 1695 if (simpleName == null) continue;
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
3039 // have a part (following a '.') that starts with '_'. 3042 // have a part (following a '.') that starts with '_'.
3040 const int UNDERSCORE = 0x5f; 3043 const int UNDERSCORE = 0x5f;
3041 if (name.isEmpty) return true; 3044 if (name.isEmpty) return true;
3042 int index = -1; 3045 int index = -1;
3043 do { 3046 do {
3044 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false; 3047 if (name.codeUnitAt(index + 1) == UNDERSCORE) return false;
3045 index = name.indexOf('.', index + 1); 3048 index = name.indexOf('.', index + 1);
3046 } while (index >= 0 && index + 1 < name.length); 3049 } while (index >= 0 && index + 1 < name.length);
3047 return true; 3050 return true;
3048 } 3051 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen_helpers.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_names.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698