| 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(ExtraICState extra_ic_state) |
| 27 : bit_field_(extra_ic_state) {} | 27 : bit_field_(extra_ic_state) {} |
| 28 CallICState(int argc, ConvertReceiverMode convert_mode) | 28 CallICState(int argc, ConvertReceiverMode convert_mode, |
| 29 TailCallMode tail_call_mode) |
| 29 : bit_field_(ArgcBits::encode(argc) | | 30 : bit_field_(ArgcBits::encode(argc) | |
| 30 ConvertModeBits::encode(convert_mode)) {} | 31 ConvertModeBits::encode(convert_mode) | |
| 32 TailCallModeBits::encode(tail_call_mode)) {} |
| 31 | 33 |
| 32 ExtraICState GetExtraICState() const { return bit_field_; } | 34 ExtraICState GetExtraICState() const { return bit_field_; } |
| 33 | 35 |
| 34 static void GenerateAheadOfTime(Isolate*, | 36 static void GenerateAheadOfTime(Isolate*, |
| 35 void (*Generate)(Isolate*, | 37 void (*Generate)(Isolate*, |
| 36 const CallICState&)); | 38 const CallICState&)); |
| 37 | 39 |
| 38 int argc() const { return ArgcBits::decode(bit_field_); } | 40 int argc() const { return ArgcBits::decode(bit_field_); } |
| 39 ConvertReceiverMode convert_mode() const { | 41 ConvertReceiverMode convert_mode() const { |
| 40 return ConvertModeBits::decode(bit_field_); | 42 return ConvertModeBits::decode(bit_field_); |
| 41 } | 43 } |
| 44 TailCallMode tail_call_mode() const { |
| 45 return TailCallModeBits::decode(bit_field_); |
| 46 } |
| 42 | 47 |
| 43 private: | 48 private: |
| 44 typedef BitField<int, 0, Code::kArgumentsBits> ArgcBits; | 49 typedef BitField<int, 0, Code::kArgumentsBits> ArgcBits; |
| 45 typedef BitField<ConvertReceiverMode, Code::kArgumentsBits, 2> | 50 typedef BitField<ConvertReceiverMode, ArgcBits::kNext, 2> ConvertModeBits; |
| 46 ConvertModeBits; | 51 typedef BitField<TailCallMode, ConvertModeBits::kNext, 1> TailCallModeBits; |
| 47 | 52 |
| 48 int const bit_field_; | 53 int const bit_field_; |
| 49 }; | 54 }; |
| 50 | 55 |
| 51 | 56 |
| 52 std::ostream& operator<<(std::ostream& os, const CallICState& s); | 57 std::ostream& operator<<(std::ostream& os, const CallICState& s); |
| 53 | 58 |
| 54 | 59 |
| 55 class BinaryOpICState final BASE_EMBEDDED { | 60 class BinaryOpICState final BASE_EMBEDDED { |
| 56 public: | 61 public: |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 << LanguageModeState::kShift; | 270 << LanguageModeState::kShift; |
| 266 | 271 |
| 267 private: | 272 private: |
| 268 const ExtraICState state_; | 273 const ExtraICState state_; |
| 269 }; | 274 }; |
| 270 | 275 |
| 271 } // namespace internal | 276 } // namespace internal |
| 272 } // namespace v8 | 277 } // namespace v8 |
| 273 | 278 |
| 274 #endif // V8_IC_STATE_H_ | 279 #endif // V8_IC_STATE_H_ |
| OLD | NEW |