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

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

Issue 1100723002: Add SourceInformationFactory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/task.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index 3a46bda3aaa8787271882c77f8890c7f66c6519b..89cf74c200ca98c655a7461c10752d06096165c7 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -21,7 +21,7 @@ import '../../types/types.dart' show TypeMask, UnionTypeMask, FlatTypeMask,
ForwardingTypeMask;
import '../../elements/elements.dart';
import '../../js/js.dart' as js;
-import '../../io/source_information.dart' show StartEndSourceInformation;
+import '../../io/source_information.dart' show SourceInformationFactory;
import '../../tree_ir/tree_ir_builder.dart' as tree_builder;
import '../../dart_backend/backend_ast_emitter.dart' as backend_ast_emitter;
import '../../cps_ir/optimizers.dart';
@@ -39,6 +39,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
final ConstantSystem constantSystem;
final Compiler compiler;
final Glue glue;
+ final SourceInformationFactory sourceInformationFactory;
TypeSystem types;
@@ -50,9 +51,10 @@ class CpsFunctionCompiler implements FunctionCompiler {
IrBuilderTask get irBuilderTask => compiler.irBuilder;
CpsFunctionCompiler(Compiler compiler, JavaScriptBackend backend,
- {bool generateSourceMap: true})
+ SourceInformationFactory sourceInformationFactory)
: fallbackCompiler =
- new ssa.SsaFunctionCompiler(backend, generateSourceMap),
+ new ssa.SsaFunctionCompiler(backend, sourceInformationFactory),
+ this.sourceInformationFactory = sourceInformationFactory,
constantSystem = backend.constantSystem,
compiler = compiler,
glue = new Glue(compiler);
@@ -221,7 +223,6 @@ class CpsFunctionCompiler implements FunctionCompiler {
js.Fun compileToJavaScript(CodegenWorkItem work,
tree_ir.FunctionDefinition definition) {
CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
-
return attachPosition(codeGen.buildFunction(definition), work.element);
}
@@ -232,6 +233,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
js.Node attachPosition(js.Node node, AstElement element) {
return node.withSourceInformation(
- StartEndSourceInformation.computeSourceInformation(element));
+ sourceInformationFactory.forContext(element)
+ .buildDeclaration(element));
}
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/js_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698