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

Side by Side Diff: pkg/compiler/lib/src/patch_parser.dart

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * This library contains the infrastructure to parse and integrate patch files. 6 * This library contains the infrastructure to parse and integrate patch files.
7 * 7 *
8 * Three types of elements can be patched: [LibraryElement], [ClassElement], 8 * Three types of elements can be patched: [LibraryElement], [ClassElement],
9 * [FunctionElement]. Patches are introduced in patch libraries which are loaded 9 * [FunctionElement]. Patches are introduced in patch libraries which are loaded
10 * together with the corresponding origin library. Which libraries that are 10 * together with the corresponding origin library. Which libraries that are
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 Compiler compiler, Element element, MetadataAnnotation annotation) { 404 Compiler compiler, Element element, MetadataAnnotation annotation) {
405 return getPatchVersion(annotation); 405 return getPatchVersion(annotation);
406 } 406 }
407 407
408 @override 408 @override
409 void validate(Compiler compiler, Element element, 409 void validate(Compiler compiler, Element element,
410 MetadataAnnotation annotation, ConstantValue constant) { 410 MetadataAnnotation annotation, ConstantValue constant) {
411 ResolutionDartType annotationType = 411 ResolutionDartType annotationType =
412 constant.getType(compiler.commonElements); 412 constant.getType(compiler.commonElements);
413 if (annotationType.element != 413 if (annotationType.element !=
414 compiler.backend.helpers.patchAnnotationClass) { 414 compiler.commonElements.patchAnnotationClass) {
415 DiagnosticReporter reporter = compiler.reporter; 415 DiagnosticReporter reporter = compiler.reporter;
416 reporter.internalError(annotation, 'Invalid patch annotation.'); 416 reporter.internalError(annotation, 'Invalid patch annotation.');
417 } 417 }
418 } 418 }
419 } 419 }
420 420
421 void tryPatchGetter( 421 void tryPatchGetter(
422 DiagnosticReporter reporter, Element origin, FunctionElement patch) { 422 DiagnosticReporter reporter, Element origin, FunctionElement patch) {
423 if (!origin.isAbstractField) { 423 if (!origin.isAbstractField) {
424 reporter.reportError( 424 reporter.reportError(
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 527
528 class PatchVersion { 528 class PatchVersion {
529 final String tag; 529 final String tag;
530 530
531 const PatchVersion(this.tag); 531 const PatchVersion(this.tag);
532 532
533 bool isActive(String patchTag) => tag == null || tag == patchTag; 533 bool isActive(String patchTag) => tag == null || tag == patchTag;
534 534
535 String toString() => 'PatchVersion($tag)'; 535 String toString() => 'PatchVersion($tag)';
536 } 536 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/native/ssa.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698