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

Side by Side Diff: pkg/compiler/lib/src/js_backend/patch_resolver.dart

Issue 2000323006: Make CompilerTask independent of compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart2js.js_backend.patch_resolver; 5 library dart2js.js_backend.patch_resolver;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show Resolution; 8 import '../common/resolution.dart' show Resolution;
9 import '../common/tasks.dart' show CompilerTask; 9 import '../common/tasks.dart' show CompilerTask;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
11 import '../dart_types.dart'; 11 import '../dart_types.dart';
12 import '../elements/elements.dart'; 12 import '../elements/elements.dart';
13 import '../elements/modelx.dart'; 13 import '../elements/modelx.dart';
14 import '../tree/tree.dart'; 14 import '../tree/tree.dart';
15 15
16 class PatchResolverTask extends CompilerTask { 16 class PatchResolverTask extends CompilerTask {
17 PatchResolverTask(Compiler compiler) : super(compiler); 17 final Compiler compiler;
18 PatchResolverTask(Compiler compiler)
19 : compiler = compiler,
20 super(compiler.measurer);
21
22 DiagnosticReporter get reporter => compiler.reporter;
18 23
19 Resolution get resolution => compiler.resolution; 24 Resolution get resolution => compiler.resolution;
20 25
21 String get name => 'JavaScript patch resolver'; 26 String get name => 'JavaScript patch resolver';
22 27
23 FunctionElement resolveExternalFunction(FunctionElementX element) { 28 FunctionElement resolveExternalFunction(FunctionElementX element) {
24 if (element.isPatched) { 29 if (element.isPatched) {
25 FunctionElementX patch = element.patch; 30 FunctionElementX patch = element.patch;
26 reporter.withCurrentElement(patch, () { 31 reporter.withCurrentElement(patch, () {
27 patch.computeType(resolution); 32 patch.computeType(resolution);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 'originParameterCount': originSignature.optionalParameterCount, 157 'originParameterCount': originSignature.optionalParameterCount,
153 'patchParameterCount': patchSignature.optionalParameterCount 158 'patchParameterCount': patchSignature.optionalParameterCount
154 }); 159 });
155 }); 160 });
156 } else { 161 } else {
157 checkMatchingPatchParameters(origin, originSignature.optionalParameters, 162 checkMatchingPatchParameters(origin, originSignature.optionalParameters,
158 patchSignature.optionalParameters); 163 patchSignature.optionalParameters);
159 } 164 }
160 } 165 }
161 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698