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

Side by Side Diff: tests/compiler/dart2js/compiler_helper.dart

Issue 2302363003: No longer store the compilation-context in WorkItem. (Closed)
Patch Set: ... lint Created 4 years, 3 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/tracer.dart ('k') | no next file » | 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 library compiler_helper; 5 library compiler_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 import 'package:compiler/src/elements/elements.dart' 10 import 'package:compiler/src/elements/elements.dart'
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 await compiler.init(); 75 await compiler.init();
76 compiler.parseScript(code); 76 compiler.parseScript(code);
77 lego.Element element = compiler.mainApp.find(entry); 77 lego.Element element = compiler.mainApp.find(entry);
78 if (element == null) return null; 78 if (element == null) return null;
79 compiler.phase = Compiler.PHASE_RESOLVING; 79 compiler.phase = Compiler.PHASE_RESOLVING;
80 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution, 80 compiler.backend.enqueueHelpers(compiler.enqueuer.resolution,
81 compiler.globalDependencies); 81 compiler.globalDependencies);
82 compiler.processQueue(compiler.enqueuer.resolution, element); 82 compiler.processQueue(compiler.enqueuer.resolution, element);
83 compiler.world.populate(); 83 compiler.world.populate();
84 compiler.backend.onResolutionComplete(); 84 compiler.backend.onResolutionComplete();
85 var context = new js.JavaScriptItemCompilationContext(); 85 ResolutionWorkItem resolutionWork = new ResolutionWorkItem(element);
86 ResolutionWorkItem resolutionWork =
87 new ResolutionWorkItem(element, context);
88 resolutionWork.run(compiler, compiler.enqueuer.resolution); 86 resolutionWork.run(compiler, compiler.enqueuer.resolution);
89 CodegenWorkItem work = 87 CodegenWorkItem work = new CodegenWorkItem(compiler, element);
90 new CodegenWorkItem(compiler, element, context);
91 compiler.phase = Compiler.PHASE_COMPILING; 88 compiler.phase = Compiler.PHASE_COMPILING;
92 work.run(compiler, compiler.enqueuer.codegen); 89 work.run(compiler, compiler.enqueuer.codegen);
93 js.JavaScriptBackend backend = compiler.backend; 90 js.JavaScriptBackend backend = compiler.backend;
94 String generated = backend.getGeneratedCode(element); 91 String generated = backend.getGeneratedCode(element);
95 if (check != null) { 92 if (check != null) {
96 check(generated); 93 check(generated);
97 } 94 }
98 return returnAll ? outputCollector.getOutput('', 'js') : generated; 95 return returnAll ? outputCollector.getOutput('', 'js') : generated;
99 } else { 96 } else {
100 List<String> options = <String>[ 97 List<String> options = <String>[
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); 287 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
291 final spaceRe = new RegExp('\\s+'); 288 final spaceRe = new RegExp('\\s+');
292 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); 289 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
293 if (shouldMatch) { 290 if (shouldMatch) {
294 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); 291 Expect.isTrue(new RegExp(regexp).hasMatch(generated));
295 } else { 292 } else {
296 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); 293 Expect.isFalse(new RegExp(regexp).hasMatch(generated));
297 } 294 }
298 }); 295 });
299 } 296 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tracer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698