| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 deopt_id, | 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 BitmapBuilder* stack_bitmap); | 84 LocationSummary* locs); |
| 85 | 85 |
| 86 void GenerateCall(intptr_t token_pos, | 86 void GenerateCall(intptr_t token_pos, |
| 87 intptr_t try_index, | 87 intptr_t try_index, |
| 88 const ExternalLabel* label, | 88 const ExternalLabel* label, |
| 89 PcDescriptors::Kind kind, | 89 PcDescriptors::Kind kind, |
| 90 BitmapBuilder* stack_bitmap); | 90 LocationSummary* locs); |
| 91 | 91 |
| 92 void GenerateAssertAssignable(intptr_t deopt_id, | 92 void GenerateAssertAssignable(intptr_t deopt_id, |
| 93 intptr_t token_pos, | 93 intptr_t token_pos, |
| 94 intptr_t try_index, | 94 intptr_t try_index, |
| 95 const AbstractType& dst_type, | 95 const AbstractType& dst_type, |
| 96 const String& dst_name, | 96 const String& dst_name, |
| 97 BitmapBuilder* stack_bitmap); | 97 LocationSummary* locs); |
| 98 | 98 |
| 99 void GenerateInstanceOf(intptr_t deopt_id, | 99 void GenerateInstanceOf(intptr_t deopt_id, |
| 100 intptr_t token_pos, | 100 intptr_t token_pos, |
| 101 intptr_t try_index, | 101 intptr_t try_index, |
| 102 const AbstractType& type, | 102 const AbstractType& type, |
| 103 bool negate_result, | 103 bool negate_result, |
| 104 BitmapBuilder* stack_bitmap); | 104 LocationSummary* locs); |
| 105 | 105 |
| 106 void GenerateInstanceCall(intptr_t deopt_id, | 106 void GenerateInstanceCall(intptr_t deopt_id, |
| 107 intptr_t token_pos, | 107 intptr_t token_pos, |
| 108 intptr_t try_index, | 108 intptr_t try_index, |
| 109 const String& function_name, | 109 const String& function_name, |
| 110 intptr_t argument_count, | 110 intptr_t argument_count, |
| 111 const Array& argument_names, | 111 const Array& argument_names, |
| 112 intptr_t checked_argument_count, | 112 intptr_t checked_argument_count, |
| 113 BitmapBuilder* stack_bitmap); | 113 LocationSummary* locs); |
| 114 | 114 |
| 115 void GenerateStaticCall(intptr_t deopt_id, | 115 void GenerateStaticCall(intptr_t deopt_id, |
| 116 intptr_t token_pos, | 116 intptr_t token_pos, |
| 117 intptr_t try_index, | 117 intptr_t try_index, |
| 118 const Function& function, | 118 const Function& function, |
| 119 intptr_t argument_count, | 119 intptr_t argument_count, |
| 120 const Array& argument_names, | 120 const Array& argument_names, |
| 121 BitmapBuilder* stack_bitmap); | 121 LocationSummary* locs); |
| 122 | 122 |
| 123 void GenerateInlinedMathSqrt(Label* done); | 123 void GenerateInlinedMathSqrt(Label* done); |
| 124 | 124 |
| 125 void GenerateNumberTypeCheck(Register kClassIdReg, | 125 void GenerateNumberTypeCheck(Register kClassIdReg, |
| 126 const AbstractType& type, | 126 const AbstractType& type, |
| 127 Label* is_instance_lbl, | 127 Label* is_instance_lbl, |
| 128 Label* is_not_instance_lbl); | 128 Label* is_not_instance_lbl); |
| 129 void GenerateStringTypeCheck(Register kClassIdReg, | 129 void GenerateStringTypeCheck(Register kClassIdReg, |
| 130 Label* is_instance_lbl, | 130 Label* is_instance_lbl, |
| 131 Label* is_not_instance_lbl); | 131 Label* is_not_instance_lbl); |
| 132 void GenerateListTypeCheck(Register kClassIdReg, | 132 void GenerateListTypeCheck(Register kClassIdReg, |
| 133 Label* is_instance_lbl); | 133 Label* is_instance_lbl); |
| 134 | 134 |
| 135 void EmitComment(Instruction* instr); | 135 void EmitComment(Instruction* instr); |
| 136 | 136 |
| 137 void EmitClassChecksNoSmi(const ICData& ic_data, | 137 void EmitClassChecksNoSmi(const ICData& ic_data, |
| 138 Register instance_reg, | 138 Register instance_reg, |
| 139 Register temp_reg, | 139 Register temp_reg, |
| 140 Label* deopt); | 140 Label* deopt); |
| 141 | 141 |
| 142 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit | 142 void EmitInstanceCall(ExternalLabel* target_label, |
| 143 // pc-descriptor information. | 143 const ICData& ic_data, |
| 144 intptr_t EmitInstanceCall(ExternalLabel* target_label, | 144 const Array& arguments_descriptor, |
| 145 const ICData& ic_data, | 145 intptr_t argument_count, |
| 146 const Array& arguments_descriptor, | 146 intptr_t deopt_id, |
| 147 intptr_t argument_count); | 147 intptr_t token_pos, |
| 148 intptr_t try_index, |
| 149 LocationSummary* locs); |
| 148 | 150 |
| 149 void EmitLoadIndexedGeneric(LoadIndexedComp* comp); | 151 void EmitLoadIndexedGeneric(LoadIndexedComp* comp); |
| 150 void EmitTestAndCall(const ICData& ic_data, | 152 void EmitTestAndCall(const ICData& ic_data, |
| 151 Register class_id_reg, | 153 Register class_id_reg, |
| 152 intptr_t arg_count, | 154 intptr_t arg_count, |
| 153 const Array& arg_names, | 155 const Array& arg_names, |
| 154 Label* deopt, | 156 Label* deopt, |
| 155 Label* done, // Can be NULL, which means fallthrough. | 157 Label* done, // Can be NULL, which means fallthrough. |
| 156 intptr_t deopt_id, | 158 intptr_t deopt_id, |
| 157 intptr_t token_index, | 159 intptr_t token_index, |
| 158 intptr_t try_index, | 160 intptr_t try_index, |
| 159 BitmapBuilder* stack_bitmap); | 161 LocationSummary* locs); |
| 160 | 162 |
| 161 void EmitDoubleCompareBranch(Condition true_condition, | 163 void EmitDoubleCompareBranch(Condition true_condition, |
| 162 XmmRegister left, | 164 XmmRegister left, |
| 163 XmmRegister right, | 165 XmmRegister right, |
| 164 BranchInstr* branch); | 166 BranchInstr* branch); |
| 165 void EmitDoubleCompareBool(Condition true_condition, | 167 void EmitDoubleCompareBool(Condition true_condition, |
| 166 XmmRegister left, | 168 XmmRegister left, |
| 167 XmmRegister right, | 169 XmmRegister right, |
| 168 Register result); | 170 Register result); |
| 169 | 171 |
| 170 intptr_t StackSize() const; | 172 intptr_t StackSize() const; |
| 171 | 173 |
| 172 // Returns assembler label associated with the given block entry. | 174 // Returns assembler label associated with the given block entry. |
| 173 Label* GetBlockLabel(BlockEntryInstr* block_entry) const; | 175 Label* GetBlockLabel(BlockEntryInstr* block_entry) const; |
| 174 | 176 |
| 175 // Returns true if there is a next block after the current one in | 177 // Returns true if there is a next block after the current one in |
| 176 // the block order and if it is the given block. | 178 // the block order and if it is the given block. |
| 177 bool IsNextBlock(BlockEntryInstr* block_entry) const; | 179 bool IsNextBlock(BlockEntryInstr* block_entry) const; |
| 178 | 180 |
| 179 void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset); | 181 void AddExceptionHandler(intptr_t try_index, intptr_t pc_offset); |
| 180 void AddCurrentDescriptor(PcDescriptors::Kind kind, | 182 void AddCurrentDescriptor(PcDescriptors::Kind kind, |
| 181 intptr_t deopt_id, | 183 intptr_t deopt_id, |
| 182 intptr_t token_pos, | 184 intptr_t token_pos, |
| 183 intptr_t try_index); | 185 intptr_t try_index); |
| 186 |
| 187 void RecordSafepoint(LocationSummary* locs); |
| 188 |
| 184 Label* AddDeoptStub(intptr_t deopt_id, | 189 Label* AddDeoptStub(intptr_t deopt_id, |
| 185 intptr_t try_index_, | 190 intptr_t try_index_, |
| 186 DeoptReasonId reason); | 191 DeoptReasonId reason); |
| 187 | 192 |
| 188 void AddSlowPathCode(SlowPathCode* slow_path); | 193 void AddSlowPathCode(SlowPathCode* slow_path); |
| 189 | 194 |
| 190 void FinalizeExceptionHandlers(const Code& code); | 195 void FinalizeExceptionHandlers(const Code& code); |
| 191 void FinalizePcDescriptors(const Code& code); | 196 void FinalizePcDescriptors(const Code& code); |
| 192 void FinalizeDeoptInfo(const Code& code); | 197 void FinalizeDeoptInfo(const Code& code); |
| 193 void FinalizeStackmaps(const Code& code); | 198 void FinalizeStackmaps(const Code& code); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 209 private: | 214 private: |
| 210 friend class DeoptimizationStub; | 215 friend class DeoptimizationStub; |
| 211 | 216 |
| 212 void GenerateDeferredCode(); | 217 void GenerateDeferredCode(); |
| 213 | 218 |
| 214 void EmitInstructionPrologue(Instruction* instr); | 219 void EmitInstructionPrologue(Instruction* instr); |
| 215 | 220 |
| 216 // Emit code to load a Value into register 'dst'. | 221 // Emit code to load a Value into register 'dst'. |
| 217 void LoadValue(Register dst, Value* value); | 222 void LoadValue(Register dst, Value* value); |
| 218 | 223 |
| 219 // Returns pc-offset (in bytes) of the pc after the call, can be used to emit | 224 void EmitStaticCall(const Function& function, |
| 220 // pc-descriptor information. | 225 const Array& arguments_descriptor, |
| 221 intptr_t EmitStaticCall(const Function& function, | 226 intptr_t argument_count, |
| 222 const Array& arguments_descriptor, | 227 intptr_t deopt_id, |
| 223 intptr_t argument_count); | 228 intptr_t token_pos, |
| 229 intptr_t try_index, |
| 230 LocationSummary* locs); |
| 224 | 231 |
| 225 // Type checking helper methods. | 232 // Type checking helper methods. |
| 226 void CheckClassIds(Register class_id_reg, | 233 void CheckClassIds(Register class_id_reg, |
| 227 const GrowableArray<intptr_t>& class_ids, | 234 const GrowableArray<intptr_t>& class_ids, |
| 228 Label* is_instance_lbl, | 235 Label* is_instance_lbl, |
| 229 Label* is_not_instance_lbl); | 236 Label* is_not_instance_lbl); |
| 230 | 237 |
| 231 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t token_pos, | 238 RawSubtypeTestCache* GenerateInlineInstanceof(intptr_t token_pos, |
| 232 const AbstractType& type, | 239 const AbstractType& type, |
| 233 Label* is_instance_lbl, | 240 Label* is_instance_lbl, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 // that should be used when deoptimizing we store it in this variable. | 326 // that should be used when deoptimizing we store it in this variable. |
| 320 // In future AddDeoptStub should be moved out of the instruction template. | 327 // In future AddDeoptStub should be moved out of the instruction template. |
| 321 Environment* pending_deoptimization_env_; | 328 Environment* pending_deoptimization_env_; |
| 322 | 329 |
| 323 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 330 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 324 }; | 331 }; |
| 325 | 332 |
| 326 } // namespace dart | 333 } // namespace dart |
| 327 | 334 |
| 328 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ | 335 #endif // VM_FLOW_GRAPH_COMPILER_IA32_H_ |
| OLD | NEW |