| 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 |
| 11 | 11 |
| 12 #include "vm/code_generator.h" | 12 #include "vm/code_generator.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 // Forward declarations. | 16 // Forward declarations. |
| 17 class DeoptimizationBlob; | 17 class DeoptimizationBlob; |
| 18 | 18 |
| 19 // Temporary hierarchy, until optimized code generator implemented. | 19 // Temporary hierarchy, until optimized code generator implemented. |
| 20 // The optimizing compiler does not run if type checks are enabled. | 20 // The optimizing compiler does not run if type checks are enabled. |
| 21 class OptimizingCodeGenerator : public CodeGenerator { | 21 class OptimizingCodeGenerator : public CodeGenerator { |
| 22 public: | 22 public: |
| 23 OptimizingCodeGenerator(Assembler* assembler, | 23 OptimizingCodeGenerator(Assembler* assembler, |
| 24 const ParsedFunction& parsed_function); | 24 const ParsedFunction& parsed_function); |
| 25 | 25 |
| 26 virtual void VisitBinaryOpNode(BinaryOpNode* node); | 26 virtual void VisitBinaryOpNode(BinaryOpNode* node); |
| 27 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node); | 27 virtual void VisitIncrOpLocalNode(IncrOpLocalNode* node); |
| 28 virtual void VisitIncrOpInstanceFieldNode(IncrOpInstanceFieldNode* node); |
| 28 virtual void VisitInstanceGetterNode(InstanceGetterNode* node); | 29 virtual void VisitInstanceGetterNode(InstanceGetterNode* node); |
| 29 virtual void VisitInstanceSetterNode(InstanceSetterNode* node); | 30 virtual void VisitInstanceSetterNode(InstanceSetterNode* node); |
| 30 virtual void VisitComparisonNode(ComparisonNode* node); | 31 virtual void VisitComparisonNode(ComparisonNode* node); |
| 31 virtual void VisitLoadIndexedNode(LoadIndexedNode* node); | 32 virtual void VisitLoadIndexedNode(LoadIndexedNode* node); |
| 32 virtual void VisitStoreIndexedNode(StoreIndexedNode* node); | 33 virtual void VisitStoreIndexedNode(StoreIndexedNode* node); |
| 33 virtual void VisitLiteralNode(LiteralNode* node); | 34 virtual void VisitLiteralNode(LiteralNode* node); |
| 34 virtual void VisitLoadLocalNode(LoadLocalNode* node); | 35 virtual void VisitLoadLocalNode(LoadLocalNode* node); |
| 35 virtual void VisitStoreLocalNode(StoreLocalNode* node); | 36 virtual void VisitStoreLocalNode(StoreLocalNode* node); |
| 36 virtual void VisitForNode(ForNode* node); | 37 virtual void VisitForNode(ForNode* node); |
| 37 virtual void VisitDoWhileNode(DoWhileNode* node); | 38 virtual void VisitDoWhileNode(DoWhileNode* node); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 60 Register reg1, | 61 Register reg1, |
| 61 Register reg2); | 62 Register reg2); |
| 62 DeoptimizationBlob* AddDeoptimizationBlob(AstNode* node, | 63 DeoptimizationBlob* AddDeoptimizationBlob(AstNode* node, |
| 63 Register reg1, | 64 Register reg1, |
| 64 Register reg2, | 65 Register reg2, |
| 65 Register reg3); | 66 Register reg3); |
| 66 | 67 |
| 67 void IntrinsifyGetter(); | 68 void IntrinsifyGetter(); |
| 68 void IntrinsifySetter(); | 69 void IntrinsifySetter(); |
| 69 | 70 |
| 70 void InlineInstanceGettersWithSameTarget(InstanceGetterNode* node, | 71 bool ICDataToSameInlineableInstanceGetter(const ICData& ic_data); |
| 71 const Function& target); | 72 void InlineInstanceGettersWithSameTarget(AstNode* node, |
| 73 AstNode* receiver, |
| 74 const String& field_name, |
| 75 Register recv_reg); |
| 72 | 76 |
| 73 // Helper method to load a value quickly into register instead of pushing | 77 // Helper method to load a value quickly into register instead of pushing |
| 74 // and popping it. | 78 // and popping it. |
| 75 void VisitLoadOne(AstNode* node, Register reg); | 79 void VisitLoadOne(AstNode* node, Register reg); |
| 76 void VisitLoadTwo(AstNode* left, | 80 void VisitLoadTwo(AstNode* left, |
| 77 AstNode* right, | 81 AstNode* right, |
| 78 Register left_reg, | 82 Register left_reg, |
| 79 Register right_reg); | 83 Register right_reg); |
| 80 | 84 |
| 81 bool IsInlineableInstanceGetter(const Function& function); | 85 bool IsInlineableInstanceGetter(const Function& function); |
| 86 void InlineInstanceGetter(AstNode* node, |
| 87 intptr_t id, |
| 88 AstNode* receiver, |
| 89 const String& field_name, |
| 90 Register recv_reg); |
| 82 | 91 |
| 83 void CallDeoptimize(intptr_t node_id, intptr_t token_index); | 92 void CallDeoptimize(intptr_t node_id, intptr_t token_index); |
| 84 | 93 |
| 85 void GenerateSmiBinaryOp(BinaryOpNode* node); | 94 void GenerateSmiBinaryOp(BinaryOpNode* node); |
| 86 void GenerateSmiShiftBinaryOp(BinaryOpNode* node); | 95 void GenerateSmiShiftBinaryOp(BinaryOpNode* node); |
| 87 | 96 |
| 88 void GenerateDoubleBinaryOp(BinaryOpNode* node); | 97 void GenerateDoubleBinaryOp(BinaryOpNode* node); |
| 89 void GenerateMintBinaryOp(BinaryOpNode* node, bool allow_smi); | 98 void GenerateMintBinaryOp(BinaryOpNode* node, bool allow_smi); |
| 90 void CheckIfDoubleOrSmi(Register reg, | 99 void CheckIfDoubleOrSmi(Register reg, |
| 91 Register temp, | 100 Register temp, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 122 const Class& smi_class_; | 131 const Class& smi_class_; |
| 123 const Class& double_class_; | 132 const Class& double_class_; |
| 124 | 133 |
| 125 DISALLOW_IMPLICIT_CONSTRUCTORS(OptimizingCodeGenerator); | 134 DISALLOW_IMPLICIT_CONSTRUCTORS(OptimizingCodeGenerator); |
| 126 }; | 135 }; |
| 127 | 136 |
| 128 } // namespace dart | 137 } // namespace dart |
| 129 | 138 |
| 130 | 139 |
| 131 #endif // VM_OPT_CODE_GENERATOR_IA32_H_ | 140 #endif // VM_OPT_CODE_GENERATOR_IA32_H_ |
| OLD | NEW |