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

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

Issue 1935933002: Fix source information positions for deserialized patched elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes 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 /// Generate code using the cps-based IR pipeline. 5 /// Generate code using the cps-based IR pipeline.
6 library code_generator_task; 6 library code_generator_task;
7 7
8 import 'glue.dart'; 8 import 'glue.dart';
9 import 'codegen.dart'; 9 import 'codegen.dart';
10 import 'unsugar.dart'; 10 import 'unsugar.dart';
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 329
330 js.Fun compileToJavaScript( 330 js.Fun compileToJavaScript(
331 CodegenWorkItem work, tree_ir.FunctionDefinition definition) { 331 CodegenWorkItem work, tree_ir.FunctionDefinition definition) {
332 CodeGenerator codeGen = new CodeGenerator(glue, work.registry); 332 CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
333 Element element = work.element; 333 Element element = work.element;
334 js.Fun code = codeGen.buildFunction(definition); 334 js.Fun code = codeGen.buildFunction(definition);
335 if (element is FunctionElement && element.asyncMarker != AsyncMarker.SYNC) { 335 if (element is FunctionElement && element.asyncMarker != AsyncMarker.SYNC) {
336 code = backend.rewriteAsync(element, code); 336 code = backend.rewriteAsync(element, code);
337 work.registry.registerAsyncMarker(element); 337 work.registry.registerAsyncMarker(element);
338 } 338 }
339 return attachPosition(code, element); 339 return attachPosition(code, work.resolvedAst);
340 } 340 }
341 341
342 Iterable<CompilerTask> get tasks { 342 Iterable<CompilerTask> get tasks {
343 return <CompilerTask>[ 343 return <CompilerTask>[
344 cpsBuilderTask, 344 cpsBuilderTask,
345 cpsOptimizationTask, 345 cpsOptimizationTask,
346 treeBuilderTask, 346 treeBuilderTask,
347 treeOptimizationTask 347 treeOptimizationTask
348 ]..addAll(fallbackCompiler.tasks); 348 ]..addAll(fallbackCompiler.tasks);
349 } 349 }
350 350
351 js.Node attachPosition(js.Node node, AstElement element) { 351 js.Node attachPosition(js.Node node, ResolvedAst resolvedAst) {
352 return node.withSourceInformation(sourceInformationFactory 352 return node.withSourceInformation(sourceInformationFactory
353 .createBuilderForContext(element) 353 .createBuilderForContext(resolvedAst)
354 .buildDeclaration(backend.frontend.getResolvedAst(element))); 354 .buildDeclaration(resolvedAst));
355 } 355 }
356 } 356 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/io/start_end_information.dart ('k') | pkg/compiler/lib/src/serialization/equivalence.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698