Index: pkg/compiler/lib/src/ssa/codegen.dart |
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart |
index 16b093681ef285a7cfba119a3ae62760512f64d9..ac17c4787e1a39f41c232ca4e4533142e62071ac 100644 |
--- a/pkg/compiler/lib/src/ssa/codegen.dart |
+++ b/pkg/compiler/lib/src/ssa/codegen.dart |
@@ -7,10 +7,13 @@ part of ssa; |
class SsaCodeGeneratorTask extends CompilerTask { |
final JavaScriptBackend backend; |
+ final SourceInformationFactory sourceInformationFactory; |
- SsaCodeGeneratorTask(JavaScriptBackend backend) |
+ SsaCodeGeneratorTask(JavaScriptBackend backend, |
+ this.sourceInformationFactory) |
: this.backend = backend, |
super(backend.compiler); |
+ |
String get name => 'SSA code generator'; |
NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter; |
@@ -31,8 +34,9 @@ class SsaCodeGeneratorTask extends CompilerTask { |
? const js.AsyncModifier.syncStar() |
: const js.AsyncModifier.sync()); |
- return attachPosition( |
- new js.Fun(parameters, body, asyncModifier: asyncModifier), element); |
+ return new js.Fun(parameters, body, asyncModifier: asyncModifier) |
+ .withSourceInformation(sourceInformationFactory.forContext(element) |
+ .buildDeclaration(element)); |
} |
js.Expression generateCode(CodegenWorkItem work, HGraph graph) { |
@@ -46,10 +50,13 @@ class SsaCodeGeneratorTask extends CompilerTask { |
js.Expression generateLazyInitializer(work, graph) { |
return measure(() { |
compiler.tracer.traceGraph("codegen", graph); |
+ SourceInformation sourceInformation = |
+ sourceInformationFactory.forContext(work.element) |
+ .buildDeclaration(work.element); |
SsaCodeGenerator codegen = new SsaCodeGenerator(backend, work); |
codegen.visitGraph(graph); |
- return new js.Fun(codegen.parameters, |
- attachPosition(codegen.body, work.element)); |
+ return new js.Fun(codegen.parameters, codegen.body) |
+ .withSourceInformation(sourceInformation); |
}); |
} |
@@ -135,7 +142,8 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor { |
// if branches. |
SubGraph subGraph; |
- SsaCodeGenerator(this.backend, CodegenWorkItem work) |
+ SsaCodeGenerator(this.backend, CodegenWorkItem work, |
+ {SourceInformation sourceInformation}) |
: this.work = work, |
declaredLocals = new Set<String>(), |
collectedVariableDeclarations = new Set<String>(), |