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 10 matching lines...) Expand all Loading... |
21 ConstantPoolArray* constant_pool); | 21 ConstantPoolArray* constant_pool); |
22 }; | 22 }; |
23 | 23 |
24 | 24 |
25 class CallICState FINAL BASE_EMBEDDED { | 25 class CallICState FINAL BASE_EMBEDDED { |
26 public: | 26 public: |
27 explicit CallICState(ExtraICState extra_ic_state); | 27 explicit CallICState(ExtraICState extra_ic_state); |
28 | 28 |
29 enum CallType { METHOD, FUNCTION }; | 29 enum CallType { METHOD, FUNCTION }; |
30 | 30 |
31 CallICState(int argc, CallType call_type) | 31 CallICState(int argc, CallType call_type, bool is_spread = false) |
32 : argc_(argc), call_type_(call_type) {} | 32 : argc_(argc), call_type_(call_type), is_spread_(is_spread) {} |
33 | 33 |
34 ExtraICState GetExtraICState() const; | 34 ExtraICState GetExtraICState() const; |
35 | 35 |
36 static void GenerateAheadOfTime(Isolate*, | 36 static void GenerateAheadOfTime(Isolate*, |
37 void (*Generate)(Isolate*, | 37 void (*Generate)(Isolate*, |
38 const CallICState&)); | 38 const CallICState&)); |
39 | 39 |
40 int arg_count() const { return argc_; } | 40 int arg_count() const { return argc_; } |
41 CallType call_type() const { return call_type_; } | 41 CallType call_type() const { return call_type_; } |
| 42 bool is_spread() const { return is_spread_; } |
42 | 43 |
43 bool CallAsMethod() const { return call_type_ == METHOD; } | 44 bool CallAsMethod() const { return call_type_ == METHOD; } |
44 | 45 |
45 private: | 46 private: |
46 class ArgcBits : public BitField<int, 0, Code::kArgumentsBits> {}; | 47 class ArgcBits : public BitField<int, 0, Code::kArgumentsBits> {}; |
47 class CallTypeBits : public BitField<CallType, Code::kArgumentsBits, 1> {}; | 48 class CallTypeBits : public BitField<CallType, Code::kArgumentsBits, 1> {}; |
| 49 class IsSpreadBits : public BitField<bool, CallTypeBits::kNext, 1> {}; |
48 | 50 |
49 const int argc_; | 51 const int argc_; |
50 const CallType call_type_; | 52 const CallType call_type_; |
| 53 const bool is_spread_; |
51 }; | 54 }; |
52 | 55 |
53 | 56 |
54 std::ostream& operator<<(std::ostream& os, const CallICState& s); | 57 std::ostream& operator<<(std::ostream& os, const CallICState& s); |
55 | 58 |
56 | 59 |
57 class BinaryOpICState FINAL BASE_EMBEDDED { | 60 class BinaryOpICState FINAL BASE_EMBEDDED { |
58 public: | 61 public: |
59 BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); | 62 BinaryOpICState(Isolate* isolate, ExtraICState extra_ic_state); |
60 | 63 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 private: | 217 private: |
215 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; | 218 class ContextualModeBits : public BitField<ContextualMode, 0, 1> {}; |
216 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 219 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
217 | 220 |
218 const ExtraICState state_; | 221 const ExtraICState state_; |
219 }; | 222 }; |
220 } | 223 } |
221 } | 224 } |
222 | 225 |
223 #endif // V8_IC_STATE_H_ | 226 #endif // V8_IC_STATE_H_ |
OLD | NEW |