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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_
6 #define VM_FLOW_GRAPH_COMPILER_SHARED_H_
7
8 #include "vm/allocation.h"
9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h"
11 #include "vm/growable_array.h"
12
13 namespace dart {
14
15 class BlockEntryInstr;
16 class ExceptionHandlerList;
17 class ParsedFunction;
18
19 class FlowGraphCompilerShared : public ValueObject {
20 public:
21 explicit FlowGraphCompilerShared(const ParsedFunction& parsed_function,
22 intptr_t num_blocks);
23
24 virtual ~FlowGraphCompilerShared();
25
26 // Constructor is lighweight, major initialization work should occur here.
27 // This makes it easier to measure time spent in the compiler.
28 void InitCompiler();
29
30 const ParsedFunction& parsed_function() const { return parsed_function_; }
31 DescriptorList* pc_descriptors_list() const {
32 return pc_descriptors_list_;
33 }
34
35 // Returns assembler label associated with the given block entry.
36 Label* GetBlockLabel(BlockEntryInstr* block_entry) const;
37 void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset);
38
39 void FinalizeExceptionHandlers(const Code& code);
40 void FinalizePcDescriptors(const Code& code);
41 void FinalizeStackmaps(const Code& code);
42 void FinalizeVarDescriptors(const Code& code);
43
44 struct BlockInfo : public ZoneAllocated {
45 public:
46 BlockInfo() : label() { }
47
48 Label label;
49 };
50
51 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
52
53 private:
54 const ParsedFunction& parsed_function_;
55 ExceptionHandlerList* exception_handlers_list_;
56 DescriptorList* pc_descriptors_list_;
57 StackmapBuilder* stackmap_builder_;
58 const intptr_t num_blocks_;
59 GrowableArray<BlockInfo*> block_info_;
60
61 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared);
62 };
63
64
65 } // namespace dart
66
67
68 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698