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

Unified Diff: sdk/lib/js/dartium/js_dartium.dart

Issue 1999803002: Optimization for patch file generation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Test one CL at a time Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/js/dartium/js_dartium.dart
diff --git a/sdk/lib/js/dartium/js_dartium.dart b/sdk/lib/js/dartium/js_dartium.dart
index 97e927ebffab4c9e3b9326f638f37914f9f59c82..8d0b248e4a54097b78e4f4950afc734ab5fd1139 100644
--- a/sdk/lib/js/dartium/js_dartium.dart
+++ b/sdk/lib/js/dartium/js_dartium.dart
@@ -311,7 +311,16 @@ bool _isAnonymousClass(mirrors.ClassMirror mirror) {
return false;
}
-bool _hasJsName(mirrors.DeclarationMirror mirror) => _getJsName(mirror) != null;
+bool _hasJsName(mirrors.DeclarationMirror mirror) {
+ if (_atJsType != null) {
+ for (var annotation in mirror.metadata) {
+ if (annotation.type.reflectedType == _atJsType) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
var _domNameType;
@@ -634,15 +643,7 @@ ${sb}
// Remember the @JS type to compare annotation type.
var _atJsType = -1;
-/**
- * Generates part files defining source code for JSObjectImpl, all DOM classes
- * classes. This codegen is needed so that type checks for all registered
- * JavaScript interop classes pass.
- * If genCachedPatches is true then the patch files don't exist this is a special
- * signal to generate and emit the patches to stdout to be captured and put into
- * the file sdk/lib/js/dartium/cached_patches.dart
- */
-List<String> _generateInteropPatchFiles(List<String> libraryPaths, genCachedPatches) {
+void setupJsTypeCache() {
// Cache the @JS Type.
if (_atJsType == -1) {
var uri = new Uri(scheme: "package", path: "js/js.dart");
@@ -656,6 +657,19 @@ List<String> _generateInteropPatchFiles(List<String> libraryPaths, genCachedPatc
_atJsType = null;
}
}
+}
+
+/**
+ * Generates part files defining source code for JSObjectImpl, all DOM classes
+ * classes. This codegen is needed so that type checks for all registered
+ * JavaScript interop classes pass.
+ * If genCachedPatches is true then the patch files don't exist this is a special
+ * signal to generate and emit the patches to stdout to be captured and put into
+ * the file sdk/lib/js/dartium/cached_patches.dart
+ */
+List<String> _generateInteropPatchFiles(List<String> libraryPaths, genCachedPatches) {
+ // Cache the @JS Type.
+ if (_atJsType == -1) setupJsTypeCache();
var ret = _generateExternalMethods(libraryPaths, genCachedPatches ? false : true);
var libraryPrefixes = new Map<mirrors.LibraryMirror, String>();
« no previous file with comments | « no previous file | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698