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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bool HasSideEffects() const { | 116 bool HasSideEffects() const { |
117 return Max(left_kind_, right_kind_) == GENERIC; | 117 return Max(left_kind_, right_kind_) == GENERIC; |
118 } | 118 } |
119 | 119 |
120 // Returns true if the IC should enable the inline smi code (i.e. if either | 120 // Returns true if the IC should enable the inline smi code (i.e. if either |
121 // parameter may be a smi). | 121 // parameter may be a smi). |
122 bool UseInlinedSmiCode() const { | 122 bool UseInlinedSmiCode() const { |
123 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); | 123 return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); |
124 } | 124 } |
125 | 125 |
126 static const int FIRST_TOKEN = Token::BIT_OR; | 126 enum { FIRST_TOKEN = Token::BIT_OR, LAST_TOKEN = Token::MOD }; |
127 static const int LAST_TOKEN = Token::MOD; | |
128 | 127 |
129 Token::Value op() const { return op_; } | 128 Token::Value op() const { return op_; } |
130 OverwriteMode mode() const { return mode_; } | 129 OverwriteMode mode() const { return mode_; } |
131 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 130 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
132 | 131 |
133 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } | 132 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } |
134 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } | 133 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } |
135 Type* GetResultType(Zone* zone) const; | 134 Type* GetResultType(Zone* zone) const; |
136 | 135 |
137 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); | 136 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 private: | 228 private: |
230 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; | 229 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; |
231 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 230 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
232 | 231 |
233 const ExtraICState state_; | 232 const ExtraICState state_; |
234 }; | 233 }; |
235 } | 234 } |
236 } | 235 } |
237 | 236 |
238 #endif // V8_IC_STATE_H_ | 237 #endif // V8_IC_STATE_H_ |
OLD | NEW |