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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.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/ssa/builder.dart ('k') | pkg/js_ast/lib/src/printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>(),
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/js_ast/lib/src/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698