| 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_IA32_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_IA32_H_ |
| 6 #define VM_FLOW_GRAPH_COMPILER_IA32_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_IA32_H_ |
| 7 | 7 |
| 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ | 8 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
| 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_ia32.h. | 9 #error Include flow_graph_compiler.h instead of flow_graph_compiler_ia32.h. |
| 10 #endif | 10 #endif |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void LoadDoubleOrSmiToXmm(XmmRegister result, | 71 void LoadDoubleOrSmiToXmm(XmmRegister result, |
| 72 Register reg, | 72 Register reg, |
| 73 Register temp, | 73 Register temp, |
| 74 Label* not_double_or_smi); | 74 Label* not_double_or_smi); |
| 75 | 75 |
| 76 // Returns 'true' if code generation for this function is complete, i.e., | 76 // Returns 'true' if code generation for this function is complete, i.e., |
| 77 // no fall-through to regular code is needed. | 77 // no fall-through to regular code is needed. |
| 78 bool TryIntrinsify(); | 78 bool TryIntrinsify(); |
| 79 | 79 |
| 80 void GenerateCallRuntime(intptr_t cid, | 80 void GenerateCallRuntime(intptr_t deopt_id, |
| 81 intptr_t token_pos, | 81 intptr_t token_pos, |
| 82 intptr_t try_index, | 82 intptr_t try_index, |
| 83 const RuntimeEntry& entry); | 83 const RuntimeEntry& entry); |
| 84 | 84 |
| 85 void GenerateCall(intptr_t token_pos, | 85 void GenerateCall(intptr_t token_pos, |
| 86 intptr_t try_index, | 86 intptr_t try_index, |
| 87 const ExternalLabel* label, | 87 const ExternalLabel* label, |
| 88 PcDescriptors::Kind kind); | 88 PcDescriptors::Kind kind); |
| 89 | 89 |
| 90 void GenerateAssertAssignable(intptr_t cid, | 90 void GenerateAssertAssignable(intptr_t deopt_id, |
| 91 intptr_t token_pos, | 91 intptr_t token_pos, |
| 92 intptr_t try_index, | 92 intptr_t try_index, |
| 93 const AbstractType& dst_type, | 93 const AbstractType& dst_type, |
| 94 const String& dst_name); | 94 const String& dst_name); |
| 95 | 95 |
| 96 void GenerateInstanceOf(intptr_t cid, | 96 void GenerateInstanceOf(intptr_t deopt_id, |
| 97 intptr_t token_pos, | 97 intptr_t token_pos, |
| 98 intptr_t try_index, | 98 intptr_t try_index, |
| 99 const AbstractType& type, | 99 const AbstractType& type, |
| 100 bool negate_result); | 100 bool negate_result); |
| 101 | 101 |
| 102 void GenerateInstanceCall(intptr_t cid, | 102 void GenerateInstanceCall(intptr_t deopt_id, |
| 103 intptr_t token_pos, | 103 intptr_t token_pos, |
| 104 intptr_t try_index, | 104 intptr_t try_index, |
| 105 const String& function_name, | 105 const String& function_name, |
| 106 intptr_t argument_count, | 106 intptr_t argument_count, |
| 107 const Array& argument_names, | 107 const Array& argument_names, |
| 108 intptr_t checked_argument_count); | 108 intptr_t checked_argument_count); |
| 109 | 109 |
| 110 void GenerateStaticCall(intptr_t cid, | 110 void GenerateStaticCall(intptr_t deopt_id, |
| 111 intptr_t token_pos, | 111 intptr_t token_pos, |
| 112 intptr_t try_index, | 112 intptr_t try_index, |
| 113 const Function& function, | 113 const Function& function, |
| 114 intptr_t argument_count, | 114 intptr_t argument_count, |
| 115 const Array& argument_names); | 115 const Array& argument_names); |
| 116 | 116 |
| 117 void GenerateInlinedMathSqrt(Label* done); | 117 void GenerateInlinedMathSqrt(Label* done); |
| 118 | 118 |
| 119 void GenerateNumberTypeCheck(Register kClassIdReg, | 119 void GenerateNumberTypeCheck(Register kClassIdReg, |
| 120 const AbstractType& type, | 120 const AbstractType& type, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 140 const Array& arguments_descriptor, | 140 const Array& arguments_descriptor, |
| 141 intptr_t argument_count); | 141 intptr_t argument_count); |
| 142 | 142 |
| 143 void EmitLoadIndexedGeneric(LoadIndexedComp* comp); | 143 void EmitLoadIndexedGeneric(LoadIndexedComp* comp); |
| 144 void EmitTestAndCall(const ICData& ic_data, | 144 void EmitTestAndCall(const ICData& ic_data, |
| 145 Register class_id_reg, | 145 Register class_id_reg, |
| 146 intptr_t arg_count, | 146 intptr_t arg_count, |
| 147 const Array& arg_names, | 147 const Array& arg_names, |
| 148 Label* deopt, | 148 Label* deopt, |
| 149 Label* done, // Can be NULL, which means fallthrough. | 149 Label* done, // Can be NULL, which means fallthrough. |
| 150 intptr_t cid, | 150 intptr_t deopt_id, |
| 151 intptr_t token_index, | 151 intptr_t token_index, |
| 152 intptr_t try_index); | 152 intptr_t try_index); |
| 153 | 153 |
| 154 void EmitDoubleCompareBranch(Condition true_condition, | 154 void EmitDoubleCompareBranch(Condition true_condition, |
| 155 XmmRegister left, | 155 XmmRegister left, |
| 156 XmmRegister right, | 156 XmmRegister right, |
| 157 BranchInstr* branch); | 157 BranchInstr* branch); |
| 158 void EmitDoubleCompareBool(Condition true_condition, | 158 void EmitDoubleCompareBool(Condition true_condition, |
| 159 XmmRegister left, | 159 XmmRegister left, |
| 160 XmmRegister right, | 160 XmmRegister right, |
| 161 Register result); | 161 Register result); |
| 162 | 162 |
| 163 intptr_t StackSize() const; | 163 intptr_t StackSize() const; |
| 164 | 164 |
| 165 // Returns assembler label associated with the given block entry. | 165 // Returns assembler label associated with the given block entry. |
| 166 Label* GetBlockLabel(BlockEntryInstr* block_entry) const; | 166 Label* GetBlockLabel(BlockEntryInstr* block_entry) const; |
| 167 | 167 |
| 168 // Returns true if there is a next block after the current one in | 168 // Returns true if there is a next block after the current one in |
| 169 // the block order and if it is the given block. | 169 // the block order and if it is the given block. |
| 170 bool IsNextBlock(BlockEntryInstr* block_entry) const; | 170 bool IsNextBlock(BlockEntryInstr* block_entry) const; |
| 171 | 171 |
| 172 void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset); | 172 void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset); |
| 173 void AddCurrentDescriptor(PcDescriptors::Kind kind, | 173 void AddCurrentDescriptor(PcDescriptors::Kind kind, |
| 174 intptr_t cid, | 174 intptr_t deopt_id, |
| 175 intptr_t token_pos, | 175 intptr_t token_pos, |
| 176 intptr_t try_index); | 176 intptr_t try_index); |
| 177 Label* AddDeoptStub(intptr_t deopt_id, | 177 Label* AddDeoptStub(intptr_t deopt_id, |
| 178 intptr_t deopt_token_pos, | 178 intptr_t deopt_token_pos, |
| 179 intptr_t try_index_, | 179 intptr_t try_index_, |
| 180 DeoptReasonId reason, | 180 DeoptReasonId reason, |
| 181 Register reg1 = kNoRegister, | 181 Register reg1 = kNoRegister, |
| 182 Register reg2 = kNoRegister, | 182 Register reg2 = kNoRegister, |
| 183 Register reg3 = kNoRegister); | 183 Register reg3 = kNoRegister); |
| 184 | 184 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 213 intptr_t EmitStaticCall(const Function& function, | 213 intptr_t EmitStaticCall(const Function& function, |
| 214 const Array& arguments_descriptor, | 214 const Array& arguments_descriptor, |
| 215 intptr_t argument_count); | 215 intptr_t argument_count); |
| 216 | 216 |
| 217 // Type checking helper methods. | 217 // Type checking helper methods. |
| 218 void CheckClassIds(Register class_id_reg, | 218 void CheckClassIds(Register class_id_reg, |
| 219 const GrowableArray<intptr_t>& class_ids, | 219 const GrowableArray<intptr_t>& class_ids, |
| 220 Label* is_instance_lbl, | 220 Label* is_instance_lbl, |
| 221 Label* is_not_instance_lbl); | 221 Label* is_not_instance_lbl); |
| 222 | 222 |
| 223 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t cid, | 223 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t token_pos, |
| 224 intptr_t token_pos, | |
| 225 const AbstractType& type, | 224 const AbstractType& type, |
| 226 Label* is_instance_lbl, | 225 Label* is_instance_lbl, |
| 227 Label* is_not_instance_lbl); | 226 Label* is_not_instance_lbl); |
| 228 | 227 |
| 229 RawSubtypeTestCache* GenerateInstantiatedTypeWithArgumentsTest( | 228 RawSubtypeTestCache* GenerateInstantiatedTypeWithArgumentsTest( |
| 230 intptr_t cid, | |
| 231 intptr_t token_pos, | 229 intptr_t token_pos, |
| 232 const AbstractType& dst_type, | 230 const AbstractType& dst_type, |
| 233 Label* is_instance_lbl, | 231 Label* is_instance_lbl, |
| 234 Label* is_not_instance_lbl); | 232 Label* is_not_instance_lbl); |
| 235 | 233 |
| 236 bool GenerateInstantiatedTypeNoArgumentsTest(intptr_t cid, | 234 bool GenerateInstantiatedTypeNoArgumentsTest(intptr_t token_pos, |
| 237 intptr_t token_pos, | |
| 238 const AbstractType& dst_type, | 235 const AbstractType& dst_type, |
| 239 Label* is_instance_lbl, | 236 Label* is_instance_lbl, |
| 240 Label* is_not_instance_lbl); | 237 Label* is_not_instance_lbl); |
| 241 | 238 |
| 242 RawSubtypeTestCache* GenerateUninstantiatedTypeTest( | 239 RawSubtypeTestCache* GenerateUninstantiatedTypeTest( |
| 243 intptr_t cid, | |
| 244 intptr_t token_pos, | 240 intptr_t token_pos, |
| 245 const AbstractType& dst_type, | 241 const AbstractType& dst_type, |
| 246 Label* is_instance_lbl, | 242 Label* is_instance_lbl, |
| 247 Label* is_not_instance_label); | 243 Label* is_not_instance_label); |
| 248 | 244 |
| 249 RawSubtypeTestCache* GenerateSubtype1TestCacheLookup( | 245 RawSubtypeTestCache* GenerateSubtype1TestCacheLookup( |
| 250 intptr_t cid, | |
| 251 intptr_t token_pos, | 246 intptr_t token_pos, |
| 252 const Class& type_class, | 247 const Class& type_class, |
| 253 Label* is_instance_lbl, | 248 Label* is_instance_lbl, |
| 254 Label* is_not_instance_lbl); | 249 Label* is_not_instance_lbl); |
| 255 | 250 |
| 256 enum TypeTestStubKind { | 251 enum TypeTestStubKind { |
| 257 kTestTypeOneArg, | 252 kTestTypeOneArg, |
| 258 kTestTypeTwoArgs, | 253 kTestTypeTwoArgs, |
| 259 kTestTypeThreeArgs, | 254 kTestTypeThreeArgs, |
| 260 }; | 255 }; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // that should be used when deoptimizing we store it in this variable. | 308 // that should be used when deoptimizing we store it in this variable. |
| 314 // In future AddDeoptStub should be moved out of the instruction template. | 309 // In future AddDeoptStub should be moved out of the instruction template. |
| 315 Environment* pending_deoptimization_env_; | 310 Environment* pending_deoptimization_env_; |
| 316 | 311 |
| 317 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 312 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 318 }; | 313 }; |
| 319 | 314 |
| 320 } // namespace dart | 315 } // namespace dart |
| 321 | 316 |
| 322 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ | 317 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ |
| OLD | NEW |