| OLD | NEW |
| 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 Loading... |
| 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 GenerateInlinedGetter(intptr_t offset) = 0; |
| 128 virtual void GenerateInlinedSetter(intptr_t offset) = 0; |
| 129 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit |
| 130 // pc-descriptor information. |
| 131 virtual intptr_t EmitInstanceCall(ExternalLabel* target_label, |
| 132 const ICData& ic_data, |
| 133 const Array& arguments_descriptor, |
| 134 intptr_t argument_count) = 0; |
| 135 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit |
| 136 // pc-descriptor information. |
| 137 virtual intptr_t EmitStaticCall(const Function& function, |
| 138 const Array& arguments_descriptor, |
| 139 intptr_t argument_count) = 0; |
| 140 |
| 141 |
| 108 struct BlockInfo : public ZoneAllocated { | 142 struct BlockInfo : public ZoneAllocated { |
| 109 public: | 143 public: |
| 110 BlockInfo() : label() { } | 144 BlockInfo() : label() { } |
| 111 | 145 |
| 112 Label label; | 146 Label label; |
| 113 }; | 147 }; |
| 114 | 148 |
| 115 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } | 149 const GrowableArray<BlockInfo*>& block_info() const { return block_info_; } |
| 116 | 150 |
| 151 // Bail out of the flow graph compiler. Does not return to the caller. |
| 152 void Bailout(const char* reason); |
| 153 |
| 117 private: | 154 private: |
| 118 // Map a block number in a forward iteration into the block number in the | 155 // Map a block number in a forward iteration into the block number in the |
| 119 // corresponding reverse iteration. Used to obtain an index into | 156 // corresponding reverse iteration. Used to obtain an index into |
| 120 // block_order for reverse iterations. | 157 // block_order for reverse iterations. |
| 121 intptr_t reverse_index(intptr_t index) const { | 158 intptr_t reverse_index(intptr_t index) const { |
| 122 return block_order_.length() - index - 1; | 159 return block_order_.length() - index - 1; |
| 123 } | 160 } |
| 124 | 161 |
| 125 class Assembler* assembler_; | 162 class Assembler* assembler_; |
| 126 const ParsedFunction& parsed_function_; | 163 const ParsedFunction& parsed_function_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 138 const bool is_optimizing_; | 175 const bool is_optimizing_; |
| 139 | 176 |
| 140 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared); | 177 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompilerShared); |
| 141 }; | 178 }; |
| 142 | 179 |
| 143 | 180 |
| 144 } // namespace dart | 181 } // namespace dart |
| 145 | 182 |
| 146 | 183 |
| 147 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_ | 184 #endif // VM_FLOW_GRAPH_COMPILER_SHARED_H_ |
| OLD | NEW |