| 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 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 | 13 |
| 14 const int kMaxKeyedPolymorphism = 4; | 14 const int kMaxKeyedPolymorphism = 4; |
| 15 | 15 |
| 16 | 16 |
| 17 class ICUtility : public AllStatic { | 17 class ICUtility : public AllStatic { |
| 18 public: | 18 public: |
| 19 // Clear the inline cache to initial state. | 19 // Clear the inline cache to initial state. |
| 20 static void Clear(Isolate* isolate, Address address, Address constant_pool); | 20 static void Clear(Isolate* isolate, Address address, Address constant_pool); |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 | 23 |
| 24 class CallICState final BASE_EMBEDDED { | 24 class CallICState final BASE_EMBEDDED { |
| 25 public: | 25 public: |
| 26 explicit CallICState(ExtraICState extra_ic_state); | 26 explicit CallICState(int argc) : argc_(argc) {} |
| 27 | |
| 28 enum CallType { METHOD, FUNCTION }; | |
| 29 | |
| 30 CallICState(int argc, CallType call_type) | |
| 31 : argc_(argc), call_type_(call_type) {} | |
| 32 | 27 |
| 33 ExtraICState GetExtraICState() const; | 28 ExtraICState GetExtraICState() const; |
| 34 | 29 |
| 35 static void GenerateAheadOfTime(Isolate*, | 30 static void GenerateAheadOfTime(Isolate*, |
| 36 void (*Generate)(Isolate*, | 31 void (*Generate)(Isolate*, |
| 37 const CallICState&)); | 32 const CallICState&)); |
| 38 | 33 |
| 39 int arg_count() const { return argc_; } | 34 int arg_count() const { return argc_; } |
| 40 CallType call_type() const { return call_type_; } | |
| 41 | |
| 42 bool CallAsMethod() const { return call_type_ == METHOD; } | |
| 43 | 35 |
| 44 private: | 36 private: |
| 45 class ArgcBits : public BitField<int, 0, Code::kArgumentsBits> {}; | 37 class ArgcBits : public BitField<int, 0, Code::kArgumentsBits> {}; |
| 46 class CallTypeBits : public BitField<CallType, Code::kArgumentsBits, 1> {}; | |
| 47 | 38 |
| 48 const int argc_; | 39 const int argc_; |
| 49 const CallType call_type_; | |
| 50 }; | 40 }; |
| 51 | 41 |
| 52 | 42 |
| 53 std::ostream& operator<<(std::ostream& os, const CallICState& s); | 43 std::ostream& operator<<(std::ostream& os, const CallICState& s); |
| 54 | 44 |
| 55 | 45 |
| 56 class BinaryOpICState final BASE_EMBEDDED { | 46 class BinaryOpICState final BASE_EMBEDDED { |
| 57 public: | 47 public: |
| 58 BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); | 48 BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); |
| 59 BinaryOpICState(Isolate* isolate, Token::Value op, Strength strength) | 49 BinaryOpICState(Isolate* isolate, Token::Value op, Strength strength) |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 << LanguageModeState::kShift; | 256 << LanguageModeState::kShift; |
| 267 | 257 |
| 268 private: | 258 private: |
| 269 const ExtraICState state_; | 259 const ExtraICState state_; |
| 270 }; | 260 }; |
| 271 | 261 |
| 272 } // namespace internal | 262 } // namespace internal |
| 273 } // namespace v8 | 263 } // namespace v8 |
| 274 | 264 |
| 275 #endif // V8_IC_STATE_H_ | 265 #endif // V8_IC_STATE_H_ |
| OLD | NEW |