| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_OPT_CODE_GENERATOR_IA32_H_ | 5 #ifndef VM_OPT_CODE_GENERATOR_IA32_H_ |
| 6 #define VM_OPT_CODE_GENERATOR_IA32_H_ | 6 #define VM_OPT_CODE_GENERATOR_IA32_H_ |
| 7 | 7 |
| 8 #ifndef VM_OPT_CODE_GENERATOR_H_ | 8 #ifndef VM_OPT_CODE_GENERATOR_H_ |
| 9 #error Do not include opt_code_generator_ia32.h; use opt_code_generator.h. | 9 #error Do not include opt_code_generator_ia32.h; use opt_code_generator.h. |
| 10 #endif | 10 #endif |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 Register reg1, | 66 Register reg1, |
| 67 Register reg2, | 67 Register reg2, |
| 68 DeoptReasonId reason_id); | 68 DeoptReasonId reason_id); |
| 69 DeoptimizationBlob* AddDeoptimizationBlob(AstNode* node, | 69 DeoptimizationBlob* AddDeoptimizationBlob(AstNode* node, |
| 70 Register reg1, | 70 Register reg1, |
| 71 Register reg2, | 71 Register reg2, |
| 72 Register reg3, | 72 Register reg3, |
| 73 DeoptReasonId reason_id); | 73 DeoptReasonId reason_id); |
| 74 | 74 |
| 75 void InlineInstanceGettersWithSameTarget(AstNode* node, | 75 void InlineInstanceGettersWithSameTarget(AstNode* node, |
| 76 intptr_t id, | |
| 77 AstNode* receiver, | 76 AstNode* receiver, |
| 78 const String& field_name, | 77 const String& field_name, |
| 79 Register recv_reg); | 78 Register recv_reg); |
| 80 | 79 |
| 81 // Helper method to load a value quickly into register instead of pushing | 80 // Helper method to load a value quickly into register instead of pushing |
| 82 // and popping it. | 81 // and popping it. |
| 83 void VisitLoadOne(AstNode* node, Register reg); | 82 void VisitLoadOne(AstNode* node, Register reg); |
| 84 void VisitLoadTwo(AstNode* left, | 83 void VisitLoadTwo(AstNode* left, |
| 85 AstNode* right, | 84 AstNode* right, |
| 86 Register left_reg, | 85 Register left_reg, |
| 87 Register right_reg); | 86 Register right_reg); |
| 88 | 87 |
| 89 void InlineInstanceGetter(AstNode* node, | 88 void InlineInstanceGetter(AstNode* node, |
| 90 intptr_t id, | |
| 91 AstNode* receiver, | 89 AstNode* receiver, |
| 92 const String& field_name, | 90 const String& field_name, |
| 93 Register recv_reg); | 91 Register recv_reg); |
| 94 | 92 |
| 95 void GenerateInstanceSetter(const InstanceSetterArgs& args); | 93 void GenerateInstanceSetter(const InstanceSetterArgs& args); |
| 96 void InlineInstanceSetter(AstNode* node, | 94 void InlineInstanceSetter(AstNode* node, |
| 97 intptr_t id, | |
| 98 AstNode* receiver, | 95 AstNode* receiver, |
| 99 const String& field_name, | 96 const String& field_name, |
| 100 Register recv_reg, | 97 Register recv_reg, |
| 101 Register value_reg); | 98 Register value_reg); |
| 102 | 99 |
| 103 void CallDeoptimize(intptr_t node_id, intptr_t token_index); | 100 void CallDeoptimize(intptr_t node_id, intptr_t token_index); |
| 104 | 101 |
| 105 void GenerateSmiUnaryOp(UnaryOpNode* node); | 102 void GenerateSmiUnaryOp(UnaryOpNode* node); |
| 106 void GenerateDoubleUnaryOp(UnaryOpNode* node); | 103 void GenerateDoubleUnaryOp(UnaryOpNode* node); |
| 107 | 104 |
| 108 void GenerateSmiBinaryOp(BinaryOpNode* node); | 105 void GenerateSmiBinaryOp(BinaryOpNode* node); |
| 109 void GenerateSmiShiftBinaryOp(BinaryOpNode* node); | 106 void GenerateSmiShiftBinaryOp(BinaryOpNode* node); |
| 110 | 107 |
| 111 void GenerateDoubleBinaryOp(BinaryOpNode* node, bool receiver_can_be_smi); | 108 void GenerateDoubleBinaryOp(BinaryOpNode* node, bool receiver_can_be_smi); |
| 112 void GenerateMintBinaryOp(BinaryOpNode* node, bool allow_smi); | 109 void GenerateMintBinaryOp(BinaryOpNode* node, bool allow_smi); |
| 113 void CheckIfDoubleOrSmi(Register reg, | 110 void CheckIfDoubleOrSmi(Register reg, |
| 114 Register temp, | 111 Register temp, |
| 115 Label* is_smi, | 112 Label* is_smi, |
| 116 Label* not_double_or_smi); | 113 Label* not_double_or_smi); |
| 117 void GenerateDirectCall(intptr_t node_id, | 114 void GenerateDirectCall(intptr_t node_id, |
| 118 intptr_t token_index, | 115 intptr_t token_index, |
| 119 const Function& target, | 116 const Function& target, |
| 120 intptr_t arg_count, | 117 intptr_t arg_count, |
| 121 const Array& optional_argument_names); | 118 const Array& optional_argument_names); |
| 122 void GenerateCheckedInstanceCalls(AstNode* node, | 119 void GenerateCheckedInstanceCalls(AstNode* node, |
| 123 AstNode* receiver, | 120 AstNode* receiver, |
| 124 intptr_t node_id, | |
| 125 intptr_t token_index, | 121 intptr_t token_index, |
| 126 intptr_t num_args, | 122 intptr_t num_args, |
| 127 const Array& optional_arguments_names); | 123 const Array& optional_arguments_names); |
| 128 void GenerateInlineCacheCall(intptr_t node_id, | 124 void GenerateInlineCacheCall(intptr_t node_id, |
| 129 intptr_t token_index, | 125 intptr_t token_index, |
| 130 const ICData& ic_data, | 126 const ICData& ic_data, |
| 131 intptr_t num_args, | 127 intptr_t num_args, |
| 132 const Array& optional_arguments_names); | 128 const Array& optional_arguments_names); |
| 133 void NormalizeClassChecks(const ICData& ic_data, | 129 void NormalizeClassChecks(const ICData& ic_data, |
| 134 const Function& null_target, | 130 const Function& null_target, |
| 135 GrowableArray<const Class*>* classes, | 131 GrowableArray<const Class*>* classes, |
| 136 GrowableArray<const Function*>* targets); | 132 GrowableArray<const Function*>* targets); |
| 137 bool GenerateSmiComparison(ComparisonNode* node); | 133 bool GenerateSmiComparison(ComparisonNode* node); |
| 138 void GenerateSmiEquality(ComparisonNode* node); | 134 void GenerateSmiEquality(ComparisonNode* node); |
| 139 bool GenerateDoubleComparison(ComparisonNode* node); | 135 bool GenerateDoubleComparison(ComparisonNode* node); |
| 140 bool GenerateEqualityComparison(ComparisonNode* node); | 136 bool GenerateEqualityComparison(ComparisonNode* node); |
| 141 void GenerateLogicalBinaryOp(BinaryOpNode* node); | 137 void GenerateLogicalBinaryOp(BinaryOpNode* node); |
| 142 void GenerateConditionalJumps(const CodeGenInfo& nInfo, Condition condition); | 138 void GenerateConditionalJumps(const CodeGenInfo& nInfo, Condition condition); |
| 143 bool TryInlineInstanceCall(InstanceCallNode* node); | 139 bool TryInlineInstanceCall(InstanceCallNode* node); |
| 144 bool TryInlineStaticCall(StaticCallNode* node); | 140 bool TryInlineStaticCall(StaticCallNode* node); |
| 145 | 141 |
| 146 bool IsResultInEaxRequested(AstNode* node) const; | 142 bool IsResultInEaxRequested(AstNode* node) const; |
| 147 bool NodeMayBeSmi(AstNode* node) const; | 143 bool NodeMayBeSmi(AstNode* node) const; |
| 148 | 144 |
| 149 void HandleResult(AstNode* node, Register result_reg); | 145 void HandleResult(AstNode* node, Register result_reg); |
| 150 void PropagateBackLocalClass(AstNode* node, const Class& cls); | 146 void PropagateBackLocalClass(AstNode* node, const Class& cls); |
| 151 | 147 |
| 152 void PrintCollectedClassesAtId(AstNode* node, intptr_t id); | 148 void PrintCollectedClasses(AstNode* node); |
| 153 void TraceOpt(AstNode* node, const char* message); | 149 void TraceOpt(AstNode* node, const char* message); |
| 154 void TraceNotOpt(AstNode* node, const char* message); | 150 void TraceNotOpt(AstNode* node, const char* message); |
| 155 | 151 |
| 156 GrowableArray<DeoptimizationBlob*> deoptimization_blobs_; | 152 GrowableArray<DeoptimizationBlob*> deoptimization_blobs_; |
| 157 ClassesForLocals* classes_for_locals_; | 153 ClassesForLocals* classes_for_locals_; |
| 158 const Class& smi_class_; | 154 const Class& smi_class_; |
| 159 const Class& double_class_; | 155 const Class& double_class_; |
| 160 const Class& growable_object_array_class_; | 156 const Class& growable_object_array_class_; |
| 161 | 157 |
| 162 DISALLOW_IMPLICIT_CONSTRUCTORS(OptimizingCodeGenerator); | 158 DISALLOW_IMPLICIT_CONSTRUCTORS(OptimizingCodeGenerator); |
| 163 }; | 159 }; |
| 164 | 160 |
| 165 } // namespace dart | 161 } // namespace dart |
| 166 | 162 |
| 167 | 163 |
| 168 #endif // VM_OPT_CODE_GENERATOR_IA32_H_ | 164 #endif // VM_OPT_CODE_GENERATOR_IA32_H_ |
| OLD | NEW |