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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 886773004: Supported versioned patching. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index 0d6edac0eadb4d6f880645dc193f33c8d6f713c7..c9002c2cc803b65681de440a48342b7a8dac2d9f 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -251,6 +251,9 @@ abstract class Backend {
/// Backend callback methods for the resolution phase.
ResolutionCallbacks get resolutionCallbacks;
+ // TODO(johnniwinther): Move this to the JavaScriptBackend.
+ String get patchVersion => null;
+
/// Set of classes that need to be considered for reflection although not
/// otherwise visible during resolution.
Iterable<ClassElement> classesRequiredForReflection = const [];
@@ -800,8 +803,8 @@ abstract class Compiler implements DiagnosticListener {
ConstantValue proxyConstant;
// TODO(johnniwinther): Move this to the JavaScriptBackend.
- /// The constant for the [patch] variable defined in dart:_js_helper.
- ConstantValue patchConstant;
+ /// The class for patch annotation defined in dart:_js_helper.
+ ClassElement patchAnnotationClass;
// TODO(johnniwinther): Move this to the JavaScriptBackend.
ClassElement nativeAnnotationClass;
@@ -1245,6 +1248,7 @@ abstract class Compiler implements DiagnosticListener {
} else if (uri == DART_NATIVE_TYPED_DATA) {
typedDataClass = findRequiredElement(library, 'NativeTypedData');
} else if (uri == js_backend.JavaScriptBackend.DART_JS_HELPER) {
+ patchAnnotationClass = findRequiredElement(library, '_Patch');
nativeAnnotationClass = findRequiredElement(library, 'Native');
}
return backend.onLibraryScanned(library, loader);
@@ -1327,14 +1331,6 @@ abstract class Compiler implements DiagnosticListener {
resolver.constantCompiler.compileConstant(
coreLibrary.find('proxy')).value;
- // TODO(johnniwinther): Move this to the JavaScript backend.
- LibraryElement jsHelperLibrary = loadedLibraries.getLibrary(
- js_backend.JavaScriptBackend.DART_JS_HELPER);
- if (jsHelperLibrary != null) {
- patchConstant = resolver.constantCompiler.compileConstant(
- jsHelperLibrary.find('patch')).value;
- }
-
if (preserveComments) {
return libraryLoader.loadLibrary(DART_MIRRORS)
.then((LibraryElement libraryElement) {
@@ -1354,6 +1350,10 @@ abstract class Compiler implements DiagnosticListener {
return element;
}
+ // TODO(johnniwinther): Move this to [PatchParser] when it is moved to the
+ // [JavaScriptBackend]. Currently needed for testing.
+ String get patchVersion => backend.patchVersion;
+
void onClassResolved(ClassElement cls) {
if (mirrorSystemClass == cls) {
mirrorSystemGetNameFunction =
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698