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

Unified Diff: lib/compiler/implementation/compiler.dart

Issue 10668029: Associate partial source map with each code block in Universe.generatedCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « no previous file | lib/compiler/implementation/dart2js.dart » ('j') | lib/compiler/implementation/dart2js.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index a08bbd08dc024914728f20795c54c9b77b288acf..c36bf085413af705fd1cbee24da865740ed1b442 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -25,8 +25,8 @@ class WorkItem {
bool isAnalyzed() => resolutionTree !== null;
String run(Compiler compiler, Enqueuer world) {
- String code = world.universe.generatedCode[element];
- if (code !== null) return code;
+ CodeBlock codeBlock = world.universe.generatedCode[element];
+ if (codeBlock !== null) return codeBlock.code;
resolutionTree = compiler.analyze(this, world);
return compiler.codegen(this, world);
}
@@ -44,7 +44,7 @@ class Backend {
}
abstract void enqueueHelpers(Enqueuer world);
- abstract String codegen(WorkItem work);
+ abstract CodeBlock codegen(WorkItem work);
abstract void processNativeClasses(Enqueuer world,
Collection<LibraryElement> libraries);
abstract void assembleProgram();
@@ -86,13 +86,13 @@ class JavaScriptBackend extends Backend {
}
}
- String codegen(WorkItem work) {
+ CodeBlock codegen(WorkItem work) {
HGraph graph = builder.build(work);
optimizer.optimize(work, graph);
if (work.allowSpeculativeOptimization
&& optimizer.trySpeculativeOptimizations(work, graph)) {
- String code = generator.generateBailoutMethod(work, graph);
- compiler.codegenWorld.addBailoutCode(work, code);
+ CodeBlock codeBlock = generator.generateBailoutMethod(work, graph);
+ compiler.codegenWorld.addBailoutCode(work, codeBlock);
optimizer.prepareForSpeculativeOptimizations(work, graph);
optimizer.optimize(work, graph);
}
@@ -580,11 +580,11 @@ class Compiler implements DiagnosticListener {
assert(phase == PHASE_RECOMPILING);
while (!world.recompilationCandidates.isEmpty()) {
WorkItem work = world.recompilationCandidates.next();
- String oldCode = world.universe.generatedCode[work.element];
+ String oldCode = world.universe.generatedCode[work.element].code;
world.universe.generatedCode.remove(work.element);
world.universe.generatedBailoutCode.remove(work.element);
withCurrentElement(work.element, () => work.run(this, world));
- String newCode = world.universe.generatedCode[work.element];
+ String newCode = world.universe.generatedCode[work.element].code;
if (REPORT_PASS2_OPTIMIZATIONS && newCode != oldCode) {
log("Pass 2 optimization:");
log("Before:\n$oldCode");
@@ -700,9 +700,9 @@ class Compiler implements DiagnosticListener {
constantHandler.compileWorkItem(work);
return null;
} else {
- String code = backend.codegen(work);
- codegenWorld.addGeneratedCode(work, code);
- return code;
+ CodeBlock codeBlock = backend.codegen(work);
+ codegenWorld.addGeneratedCode(work, codeBlock);
+ return codeBlock.code;
}
}
« no previous file with comments | « no previous file | lib/compiler/implementation/dart2js.dart » ('j') | lib/compiler/implementation/dart2js.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698