OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IC_STATE_H_ | 5 #ifndef V8_IC_STATE_H_ |
6 #define V8_IC_STATE_H_ | 6 #define V8_IC_STATE_H_ |
7 | 7 |
8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return Max(left_kind_, right_kind_) == GENERIC; | 105 return Max(left_kind_, right_kind_) == GENERIC; |
106 } | 106 } |
107 | 107 |
108 // Returns true if the IC should enable the inline smi code (i.e. if either | 108 // Returns true if the IC should enable the inline smi code (i.e. if either |
109 // parameter may be a smi). | 109 // parameter may be a smi). |
110 bool UseInlinedSmiCode() const { | 110 bool UseInlinedSmiCode() const { |
111 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); | 111 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); |
112 } | 112 } |
113 | 113 |
114 static const int FIRST_TOKEN = Token::BIT_OR; | 114 static const int FIRST_TOKEN = Token::BIT_OR; |
115 static const int LAST_TOKEN = Token::MOD; | 115 static const int LAST_TOKEN = Token::EXP; |
116 | 116 |
117 Token::Value op() const { return op_; } | 117 Token::Value op() const { return op_; } |
118 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 118 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
119 | 119 |
120 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } | 120 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } |
121 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } | 121 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } |
122 Type* GetResultType(Zone* zone) const; | 122 Type* GetResultType(Zone* zone) const; |
123 | 123 |
124 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); | 124 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); |
125 | 125 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 private: | 214 private: |
215 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; | 215 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; |
216 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 216 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
217 | 217 |
218 const ExtraICState state_; | 218 const ExtraICState state_; |
219 }; | 219 }; |
220 } | 220 } |
221 } | 221 } |
222 | 222 |
223 #endif // V8_IC_STATE_H_ | 223 #endif // V8_IC_STATE_H_ |
OLD | NEW |