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

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

Issue 10827180: Move types out of the HInstructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplifications. Created 8 years, 4 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: lib/compiler/implementation/compiler.dart
diff --git a/lib/compiler/implementation/compiler.dart b/lib/compiler/implementation/compiler.dart
index 9853fa87d9eb8e195969797c190b654d2c844ff9..d013b4d1365be4fac5b9f8e9f330ac53ea63a3fd 100644
--- a/lib/compiler/implementation/compiler.dart
+++ b/lib/compiler/implementation/compiler.dart
@@ -14,13 +14,21 @@ final bool REPORT_EXCESS_RESOLUTION = false;
*/
final bool REPORT_PASS2_OPTIMIZATIONS = false;
+/**
+ * Contains backend-specific data that is used throughout the compilation of
+ * one work item.
+ */
+class ItemCompilationContext {
+}
+
class WorkItem {
+ final ItemCompilationContext compilationContext;
final Element element;
TreeElements resolutionTree;
bool allowSpeculativeOptimization = true;
List<HTypeGuard> guards = const <HTypeGuard>[];
- WorkItem(this.element, this.resolutionTree);
+ WorkItem(this.element, this.resolutionTree, this.compilationContext);
bool isAnalyzed() => resolutionTree !== null;
@@ -49,6 +57,17 @@ class Backend {
Collection<LibraryElement> libraries);
abstract void assembleProgram();
abstract List<CompilerTask> get tasks();
+
+ ItemCompilationContext createItemCompilationContext() {
+ return new ItemCompilationContext();
+ }
+}
+
+class JavaScriptItemCompilationContext extends ItemCompilationContext {
+ final HTypeMap types;
+
+ JavaScriptItemCompilationContext()
+ : types = new HTypeMap();
ngeoffray 2012/08/16 13:07:00 fits in one line
floitsch 2012/08/16 14:10:04 Done.
}
class JavaScriptBackend extends Backend {
@@ -204,6 +223,10 @@ class JavaScriptBackend extends Backend {
if (!fields.containsKey(field)) return HType.CONFLICTING;
return fields[field];
}
+
+ JavaScriptItemCompilationContext createItemCompilationContext() {
+ return new JavaScriptItemCompilationContext();
+ }
}
class Compiler implements DiagnosticListener {
@@ -1078,7 +1101,7 @@ class Tracer {
const Tracer();
- void traceCompilation(String methodName) {
+ void traceCompilation(String methodName, ItemCompilationContext context) {
}
void traceGraph(String name, var graph) {
« no previous file with comments | « no previous file | lib/compiler/implementation/enqueue.dart » ('j') | lib/compiler/implementation/ssa/codegen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698