| 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 RUNTIME_VM_JIT_OPTIMIZER_H_ | 5 #ifndef RUNTIME_VM_JIT_OPTIMIZER_H_ |
| 6 #define RUNTIME_VM_JIT_OPTIMIZER_H_ | 6 #define RUNTIME_VM_JIT_OPTIMIZER_H_ |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 bool TypeCheckAsClassEquality(const AbstractType& type); | 67 bool TypeCheckAsClassEquality(const AbstractType& type); |
| 68 void ReplaceWithTypeCast(InstanceCallInstr* instr); | 68 void ReplaceWithTypeCast(InstanceCallInstr* instr); |
| 69 | 69 |
| 70 bool TryReplaceInstanceCallWithInline(InstanceCallInstr* call); | 70 bool TryReplaceInstanceCallWithInline(InstanceCallInstr* call); |
| 71 | 71 |
| 72 // Insert a check of 'to_check' determined by 'unary_checks'. If the | 72 // Insert a check of 'to_check' determined by 'unary_checks'. If the |
| 73 // check fails it will deoptimize to 'deopt_id' using the deoptimization | 73 // check fails it will deoptimize to 'deopt_id' using the deoptimization |
| 74 // environment 'deopt_environment'. The check is inserted immediately | 74 // environment 'deopt_environment'. The check is inserted immediately |
| 75 // before 'insert_before'. | 75 // before 'insert_before'. |
| 76 void AddCheckClass(Definition* to_check, | 76 void AddCheckClass(Definition* to_check, |
| 77 const ICData& unary_checks, | 77 const Cids& cids, |
| 78 intptr_t deopt_id, | 78 intptr_t deopt_id, |
| 79 Environment* deopt_environment, | 79 Environment* deopt_environment, |
| 80 Instruction* insert_before); | 80 Instruction* insert_before); |
| 81 Instruction* GetCheckClass(Definition* to_check, | |
| 82 const ICData& unary_checks, | |
| 83 intptr_t deopt_id, | |
| 84 TokenPosition token_pos); | |
| 85 | 81 |
| 86 // Insert a Smi check if needed. | 82 // Insert a Smi check if needed. |
| 87 void AddCheckSmi(Definition* to_check, | 83 void AddCheckSmi(Definition* to_check, |
| 88 intptr_t deopt_id, | 84 intptr_t deopt_id, |
| 89 Environment* deopt_environment, | 85 Environment* deopt_environment, |
| 90 Instruction* insert_before); | 86 Instruction* insert_before); |
| 91 | 87 |
| 92 // Add a class check for a call's first argument immediately before the | 88 // Add a class check for a call's nth argument immediately before the |
| 93 // call, using the call's IC data to determine the check, and the call's | 89 // call, using the call's IC data to determine the check, and the call's |
| 94 // deopt ID and deoptimization environment if the check fails. | 90 // deopt ID and deoptimization environment if the check fails. |
| 95 void AddReceiverCheck(InstanceCallInstr* call); | 91 void AddChecksToArgNr(InstanceCallInstr* call, |
| 92 Definition* instr, |
| 93 int argument_number); |
| 94 |
| 95 // Add a class check for the call's first argument (receiver). |
| 96 void AddReceiverCheck(InstanceCallInstr* call) { |
| 97 AddChecksToArgNr(call, call->ArgumentAt(0), /* argument_number = */ 0); |
| 98 } |
| 96 | 99 |
| 97 void ReplaceCall(Definition* call, Definition* replacement); | 100 void ReplaceCall(Definition* call, Definition* replacement); |
| 98 | 101 |
| 99 | 102 |
| 100 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call, | 103 bool InstanceCallNeedsClassCheck(InstanceCallInstr* call, |
| 101 RawFunction::Kind kind) const; | 104 RawFunction::Kind kind) const; |
| 102 | 105 |
| 103 bool InlineFloat32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); | 106 bool InlineFloat32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
| 104 bool InlineInt32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); | 107 bool InlineInt32x4BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
| 105 bool InlineFloat64x2BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); | 108 bool InlineFloat64x2BinaryOp(InstanceCallInstr* call, Token::Kind op_kind); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 124 | 127 |
| 125 FlowGraph* flow_graph_; | 128 FlowGraph* flow_graph_; |
| 126 | 129 |
| 127 DISALLOW_COPY_AND_ASSIGN(JitOptimizer); | 130 DISALLOW_COPY_AND_ASSIGN(JitOptimizer); |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 | 133 |
| 131 } // namespace dart | 134 } // namespace dart |
| 132 | 135 |
| 133 #endif // RUNTIME_VM_JIT_OPTIMIZER_H_ | 136 #endif // RUNTIME_VM_JIT_OPTIMIZER_H_ |
| OLD | NEW |