| 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_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
| 6 #define VM_FLOW_GRAPH_COMPILER_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_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/assembler_macros.h" | 10 #include "vm/assembler_macros.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 FlowGraphCompiler* compiler_; | 133 FlowGraphCompiler* compiler_; |
| 134 | 134 |
| 135 // List of moves not yet resolved. | 135 // List of moves not yet resolved. |
| 136 GrowableArray<MoveOperands*> moves_; | 136 GrowableArray<MoveOperands*> moves_; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 | 139 |
| 140 class DeoptimizationStub : public ZoneAllocated { | 140 class DeoptimizationStub : public ZoneAllocated { |
| 141 public: | 141 public: |
| 142 DeoptimizationStub(intptr_t deopt_id, | 142 DeoptimizationStub(intptr_t deopt_id, |
| 143 intptr_t deopt_token_pos, | |
| 144 intptr_t try_index, | 143 intptr_t try_index, |
| 145 DeoptReasonId reason) | 144 DeoptReasonId reason) |
| 146 : deopt_id_(deopt_id), | 145 : deopt_id_(deopt_id), |
| 147 deopt_token_pos_(deopt_token_pos), | |
| 148 try_index_(try_index), | 146 try_index_(try_index), |
| 149 reason_(reason), | 147 reason_(reason), |
| 150 registers_(2), | 148 registers_(2), |
| 151 deoptimization_env_(NULL), | 149 deoptimization_env_(NULL), |
| 152 entry_label_() {} | 150 entry_label_() {} |
| 153 | 151 |
| 154 void Push(Register reg) { registers_.Add(reg); } | 152 void Push(Register reg) { registers_.Add(reg); } |
| 155 Label* entry_label() { return &entry_label_; } | 153 Label* entry_label() { return &entry_label_; } |
| 156 | 154 |
| 157 // Implementation is in architecture specific file. | 155 // Implementation is in architecture specific file. |
| 158 void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix); | 156 void GenerateCode(FlowGraphCompiler* compiler, intptr_t stub_ix); |
| 159 | 157 |
| 160 void set_deoptimization_env(Environment* env) { | 158 void set_deoptimization_env(Environment* env) { |
| 161 deoptimization_env_ = env; | 159 deoptimization_env_ = env; |
| 162 } | 160 } |
| 163 | 161 |
| 164 RawDeoptInfo* CreateDeoptInfo(FlowGraphCompiler* compiler); | 162 RawDeoptInfo* CreateDeoptInfo(FlowGraphCompiler* compiler); |
| 165 | 163 |
| 166 private: | 164 private: |
| 167 const intptr_t deopt_id_; | 165 const intptr_t deopt_id_; |
| 168 const intptr_t deopt_token_pos_; | |
| 169 const intptr_t try_index_; | 166 const intptr_t try_index_; |
| 170 const DeoptReasonId reason_; | 167 const DeoptReasonId reason_; |
| 171 GrowableArray<Register> registers_; | 168 GrowableArray<Register> registers_; |
| 172 const Environment* deoptimization_env_; | 169 const Environment* deoptimization_env_; |
| 173 Label entry_label_; | 170 Label entry_label_; |
| 174 | 171 |
| 175 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); | 172 DISALLOW_COPY_AND_ASSIGN(DeoptimizationStub); |
| 176 }; | 173 }; |
| 177 | 174 |
| 178 } // namespace dart | 175 } // namespace dart |
| 179 | 176 |
| 180 #if defined(TARGET_ARCH_IA32) | 177 #if defined(TARGET_ARCH_IA32) |
| 181 #include "vm/flow_graph_compiler_ia32.h" | 178 #include "vm/flow_graph_compiler_ia32.h" |
| 182 #elif defined(TARGET_ARCH_X64) | 179 #elif defined(TARGET_ARCH_X64) |
| 183 #include "vm/flow_graph_compiler_x64.h" | 180 #include "vm/flow_graph_compiler_x64.h" |
| 184 #elif defined(TARGET_ARCH_ARM) | 181 #elif defined(TARGET_ARCH_ARM) |
| 185 #include "vm/flow_graph_compiler_arm.h" | 182 #include "vm/flow_graph_compiler_arm.h" |
| 186 #else | 183 #else |
| 187 #error Unknown architecture. | 184 #error Unknown architecture. |
| 188 #endif | 185 #endif |
| 189 | 186 |
| 190 #endif // VM_FLOW_GRAPH_COMPILER_H_ | 187 #endif // VM_FLOW_GRAPH_COMPILER_H_ |
| OLD | NEW |