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 enum { FIRST_TOKEN = Token::BIT_OR, LAST_TOKEN = Token::MOD }; | 126 static const int FIRST_TOKEN = Token::BIT_OR; |
| 127 static const int LAST_TOKEN = Token::MOD; |
127 | 128 |
128 Token::Value op() const { return op_; } | 129 Token::Value op() const { return op_; } |
129 OverwriteMode mode() const { return mode_; } | 130 OverwriteMode mode() const { return mode_; } |
130 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } | 131 Maybe<int> fixed_right_arg() const { return fixed_right_arg_; } |
131 | 132 |
132 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } | 133 Type* GetLeftType(Zone* zone) const { return KindToType(left_kind_, zone); } |
133 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } | 134 Type* GetRightType(Zone* zone) const { return KindToType(right_kind_, zone); } |
134 Type* GetResultType(Zone* zone) const; | 135 Type* GetResultType(Zone* zone) const; |
135 | 136 |
136 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); | 137 void Update(Handle<Object> left, Handle<Object> right, Handle<Object> result); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 private: | 229 private: |
229 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; | 230 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; |
230 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 231 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
231 | 232 |
232 const ExtraICState state_; | 233 const ExtraICState state_; |
233 }; | 234 }; |
234 } | 235 } |
235 } | 236 } |
236 | 237 |
237 #endif // V8_IC_STATE_H_ | 238 #endif // V8_IC_STATE_H_ |
OLD | NEW |