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

Unified Diff: runtime/vm/flow_graph_compiler_shared.h

Issue 10447133: FlowGraphCompiler is not a visitor any longer. Start consolidating shared code between the x64 and … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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: runtime/vm/flow_graph_compiler_shared.h
===================================================================
--- runtime/vm/flow_graph_compiler_shared.h (revision 0)
+++ runtime/vm/flow_graph_compiler_shared.h (revision 0)
@@ -0,0 +1,68 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_
+#define VM_FLOW_GRAPH_COMPILER_SHARED_H_
+
+#include "vm/allocation.h"
+#include "vm/assembler.h"
+#include "vm/code_descriptors.h"
+#include "vm/growable_array.h"
+
+namespace dart {
+
+class BlockEntryInstr;
+class ExceptionHandlerList;
+class ParsedFunction;
+
+class FlowGraphCompilerShared : public ValueObject {
+ public:
+ explicit FlowGraphCompilerShared(const ParsedFunction& parsed_function,
+ intptr_t num_blocks);
+
+ virtual ~FlowGraphCompilerShared();
+
+ // Constructor is lighweight, major initialization work should occur here.
+ // This makes it easier to measure time spent in the compiler.
+ void InitCompiler();
+
+ const ParsedFunction& parsed_function() const { return parsed_function_; }
+ DescriptorList* pc_descriptors_list() const {
+ return pc_descriptors_list_;
+ }
+
+ // Returns assembler label associated with the given block entry.
+ Label* GetBlockLabel(BlockEntryInstr* block_entry) const;
+ void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset);
+
+ void FinalizeExceptionHandlers(const Code& code);
+ void FinalizePcDescriptors(const Code& code);
+ void FinalizeStackmaps(const Code& code);
+ void FinalizeVarDescriptors(const Code& code);
+
+ struct BlockInfo : public ZoneAllocated {
+ public:
+ BlockInfo() : label() { }
+
+ Label label;
+ };
+
+ const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
+
+ private:
+ const ParsedFunction& parsed_function_;
+ ExceptionHandlerList* exception_handlers_list_;
+ DescriptorList* pc_descriptors_list_;
+ StackmapBuilder* stackmap_builder_;
+ const intptr_t num_blocks_;
+ GrowableArray<BlockInfo*> block_info_;
+
+ DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared);
+};
+
+
+} // namespace dart
+
+
+#endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_

Powered by Google App Engine
This is Rietveld 408576698