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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1902363002: Derive source information from ResolvedAst. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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
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 48d318df9a0629c8223c919055dfad83d5cc4ab9..5938e1c36f1e13b63a9ce7c9fb1b24b11fc1d10e 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -39,7 +39,8 @@ class SsaCodeGeneratorTask extends CompilerTask {
NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
js.Fun buildJavaScriptFunction(
- FunctionElement element, List<js.Parameter> parameters, js.Block body) {
+ ResolvedAst resolvedAst, List<js.Parameter> parameters, js.Block body) {
+ FunctionElement element = resolvedAst.element;
js.AsyncModifier asyncModifier = element.asyncMarker.isAsync
? (element.asyncMarker.isYielding
? const js.AsyncModifier.asyncStar()
@@ -50,8 +51,8 @@ class SsaCodeGeneratorTask extends CompilerTask {
return new js.Fun(parameters, body, asyncModifier: asyncModifier)
.withSourceInformation(sourceInformationFactory
- .createBuilderForContext(element)
- .buildDeclaration(element));
+ .createBuilderForContext(resolvedAst.element)
+ .buildDeclaration(resolvedAst));
}
js.Expression generateCode(CodegenWorkItem work, HGraph graph) {
@@ -62,12 +63,12 @@ class SsaCodeGeneratorTask extends CompilerTask {
}
}
- js.Expression generateLazyInitializer(work, graph) {
+ js.Expression generateLazyInitializer(CodegenWorkItem work, HGraph graph) {
return measure(() {
compiler.tracer.traceGraph("codegen", graph);
SourceInformation sourceInformation = sourceInformationFactory
.createBuilderForContext(work.element)
- .buildDeclaration(work.element);
+ .buildDeclaration(work.resolvedAst);
SsaCodeGenerator codegen = new SsaCodeGenerator(backend, work);
codegen.visitGraph(graph);
return new js.Fun(codegen.parameters, codegen.body)
@@ -84,7 +85,8 @@ class SsaCodeGeneratorTask extends CompilerTask {
SsaCodeGenerator codegen = new SsaCodeGenerator(backend, work);
codegen.visitGraph(graph);
compiler.tracer.traceGraph("codegen", graph);
- return buildJavaScriptFunction(element, codegen.parameters, codegen.body);
+ return buildJavaScriptFunction(
+ work.resolvedAst, codegen.parameters, codegen.body);
});
}
}
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | tests/compiler/dart2js/serialization_compilation_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698