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

Side by Side Diff: runtime/vm/flow_graph_compiler_shared.h

Issue 10500005: More shared code. (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
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_shared.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_ 5 #ifndef VM_FLOW_GRAPH_COMPILER_SHARED_H_
6 #define VM_FLOW_GRAPH_COMPILER_SHARED_H_ 6 #define VM_FLOW_GRAPH_COMPILER_SHARED_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 intptr_t deopt_token_index, 95 intptr_t deopt_token_index,
96 intptr_t try_index_, 96 intptr_t try_index_,
97 DeoptReasonId reason, 97 DeoptReasonId reason,
98 Register reg1, 98 Register reg1,
99 Register reg2); 99 Register reg2);
100 100
101 void FinalizeExceptionHandlers(const Code& code); 101 void FinalizeExceptionHandlers(const Code& code);
102 void FinalizePcDescriptors(const Code& code); 102 void FinalizePcDescriptors(const Code& code);
103 void FinalizeStackmaps(const Code& code); 103 void FinalizeStackmaps(const Code& code);
104 void FinalizeVarDescriptors(const Code& code); 104 void FinalizeVarDescriptors(const Code& code);
105 void FinalizeComments(const Code& code);
106
107 void GenerateInstanceCall(intptr_t cid,
108 intptr_t token_index,
109 intptr_t try_index,
110 const String& function_name,
111 intptr_t argument_count,
112 const Array& argument_names,
113 intptr_t checked_argument_count);
114 void GenerateStaticCall(intptr_t cid,
115 intptr_t token_index,
116 intptr_t try_index,
117 const Function& function,
118 intptr_t argument_count,
119 const Array& argument_names);
105 120
106 void GenerateDeferredCode(); 121 void GenerateDeferredCode();
107 122
123
124 // Returns 'true' if code generation for this function is complete, i.e.,
125 // no fall-through to regular code is needed.
126 bool TryIntrinsify();
127 virtual void IntrinsifyGetter() = 0;
Vyacheslav Egorov (Google) 2012/06/04 13:05:52 The names are a bit confusing, I had to look at th
srdjan 2012/06/04 15:52:46 Changed names to GenerateInlinedSetter/Getter, pas
128 virtual void IntrinsifySetter() = 0;
129 virtual intptr_t EmitInstanceCall(ExternalLabel* target_label,
Vyacheslav Egorov (Google) 2012/06/04 13:05:52 please document return values of these functions.
srdjan 2012/06/04 15:52:46 // Returns pc-offset (in bytes) of the pc after th
130 const ICData& ic_data,
131 const Array& arguments_descriptor,
132 intptr_t argument_count) = 0;
133 virtual intptr_t EmitStaticCall(const Function& function,
134 const Array& arguments_descriptor,
135 intptr_t argument_count) = 0;
136
137
108 struct BlockInfo : public ZoneAllocated { 138 struct BlockInfo : public ZoneAllocated {
109 public: 139 public:
110 BlockInfo() : label() { } 140 BlockInfo() : label() { }
111 141
112 Label label; 142 Label label;
113 }; 143 };
114 144
115 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } 145 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
116 146
147 // Bail out of the flow graph compiler. Does not return to the caller.
148 void Bailout(const char* reason);
149
117 private: 150 private:
118 // Map a block number in a forward iteration into the block number in the 151 // Map a block number in a forward iteration into the block number in the
119 // corresponding reverse iteration. Used to obtain an index into 152 // corresponding reverse iteration. Used to obtain an index into
120 // block_order for reverse iterations. 153 // block_order for reverse iterations.
121 intptr_t reverse_index(intptr_t index) const { 154 intptr_t reverse_index(intptr_t index) const {
122 return block_order_.length() - index - 1; 155 return block_order_.length() - index - 1;
123 } 156 }
124 157
125 class Assembler* assembler_; 158 class Assembler* assembler_;
126 const ParsedFunction& parsed_function_; 159 const ParsedFunction& parsed_function_;
(...skipping 11 matching lines...) Expand all
138 const bool is_optimizing_; 171 const bool is_optimizing_;
139 172
140 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared); 173 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared);
141 }; 174 };
142 175
143 176
144 } // namespace dart 177 } // namespace dart
145 178
146 179
147 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_ 180 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698