OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4774 V(BUILTIN) \ | 4774 V(BUILTIN) \ |
4775 V(REGEXP) | 4775 V(REGEXP) |
4776 | 4776 |
4777 #define IC_KIND_LIST(V) \ | 4777 #define IC_KIND_LIST(V) \ |
4778 V(LOAD_IC) \ | 4778 V(LOAD_IC) \ |
4779 V(KEYED_LOAD_IC) \ | 4779 V(KEYED_LOAD_IC) \ |
4780 V(CALL_IC) \ | 4780 V(CALL_IC) \ |
4781 V(KEYED_CALL_IC) \ | 4781 V(KEYED_CALL_IC) \ |
4782 V(STORE_IC) \ | 4782 V(STORE_IC) \ |
4783 V(KEYED_STORE_IC) \ | 4783 V(KEYED_STORE_IC) \ |
4784 V(UNARY_OP_IC) \ | |
4785 V(BINARY_OP_IC) \ | 4784 V(BINARY_OP_IC) \ |
4786 V(COMPARE_IC) \ | 4785 V(COMPARE_IC) \ |
4787 V(COMPARE_NIL_IC) \ | 4786 V(COMPARE_NIL_IC) \ |
4788 V(TO_BOOLEAN_IC) | 4787 V(TO_BOOLEAN_IC) |
4789 | 4788 |
4790 #define CODE_KIND_LIST(V) \ | 4789 #define CODE_KIND_LIST(V) \ |
4791 NON_IC_KIND_LIST(V) \ | 4790 NON_IC_KIND_LIST(V) \ |
4792 IC_KIND_LIST(V) | 4791 IC_KIND_LIST(V) |
4793 | 4792 |
4794 enum Kind { | 4793 enum Kind { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4893 inline Kind kind(); | 4892 inline Kind kind(); |
4894 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 4893 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
4895 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. | 4894 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
4896 | 4895 |
4897 inline ExtraICState extended_extra_ic_state(); // Only valid for | 4896 inline ExtraICState extended_extra_ic_state(); // Only valid for |
4898 // non-call IC stubs. | 4897 // non-call IC stubs. |
4899 static bool needs_extended_extra_ic_state(Kind kind) { | 4898 static bool needs_extended_extra_ic_state(Kind kind) { |
4900 // TODO(danno): This is a bit of a hack right now since there are still | 4899 // TODO(danno): This is a bit of a hack right now since there are still |
4901 // clients of this API that pass "extra" values in for argc. These clients | 4900 // clients of this API that pass "extra" values in for argc. These clients |
4902 // should be retrofitted to used ExtendedExtraICState. | 4901 // should be retrofitted to used ExtendedExtraICState. |
4903 return kind == COMPARE_NIL_IC || kind == TO_BOOLEAN_IC || | 4902 return kind == COMPARE_NIL_IC || kind == TO_BOOLEAN_IC; |
4904 kind == UNARY_OP_IC; | |
4905 } | 4903 } |
4906 | 4904 |
4907 inline StubType type(); // Only valid for monomorphic IC stubs. | 4905 inline StubType type(); // Only valid for monomorphic IC stubs. |
4908 inline int arguments_count(); // Only valid for call IC stubs. | 4906 inline int arguments_count(); // Only valid for call IC stubs. |
4909 | 4907 |
4910 // Testers for IC stub kinds. | 4908 // Testers for IC stub kinds. |
4911 inline bool is_inline_cache_stub(); | 4909 inline bool is_inline_cache_stub(); |
4912 inline bool is_debug_break(); | 4910 inline bool is_debug_break(); |
4913 inline bool is_load_stub() { return kind() == LOAD_IC; } | 4911 inline bool is_load_stub() { return kind() == LOAD_IC; } |
4914 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 4912 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
4915 inline bool is_store_stub() { return kind() == STORE_IC; } | 4913 inline bool is_store_stub() { return kind() == STORE_IC; } |
4916 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 4914 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
4917 inline bool is_call_stub() { return kind() == CALL_IC; } | 4915 inline bool is_call_stub() { return kind() == CALL_IC; } |
4918 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } | 4916 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } |
4919 inline bool is_unary_op_stub() { return kind() == UNARY_OP_IC; } | |
4920 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } | 4917 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
4921 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } | 4918 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } |
4922 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } | 4919 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } |
4923 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } | 4920 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } |
4924 | 4921 |
4925 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. | 4922 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. |
4926 inline int major_key(); | 4923 inline int major_key(); |
4927 inline void set_major_key(int value); | 4924 inline void set_major_key(int value); |
4928 | 4925 |
4929 // For kind STUB or ICs, tells whether or not a code object was generated by | 4926 // For kind STUB or ICs, tells whether or not a code object was generated by |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4983 inline void set_back_edge_table_offset(unsigned offset); | 4980 inline void set_back_edge_table_offset(unsigned offset); |
4984 | 4981 |
4985 inline bool back_edges_patched_for_osr(); | 4982 inline bool back_edges_patched_for_osr(); |
4986 inline void set_back_edges_patched_for_osr(bool value); | 4983 inline void set_back_edges_patched_for_osr(bool value); |
4987 | 4984 |
4988 // [check type]: For kind CALL_IC, tells how to check if the | 4985 // [check type]: For kind CALL_IC, tells how to check if the |
4989 // receiver is valid for the given call. | 4986 // receiver is valid for the given call. |
4990 inline CheckType check_type(); | 4987 inline CheckType check_type(); |
4991 inline void set_check_type(CheckType value); | 4988 inline void set_check_type(CheckType value); |
4992 | 4989 |
4993 // [type-recording unary op type]: For kind UNARY_OP_IC. | |
4994 inline byte unary_op_type(); | |
4995 inline void set_unary_op_type(byte value); | |
4996 | |
4997 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. | 4990 // [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in. |
4998 inline byte to_boolean_state(); | 4991 inline byte to_boolean_state(); |
4999 | 4992 |
5000 // [has_function_cache]: For kind STUB tells whether there is a function | 4993 // [has_function_cache]: For kind STUB tells whether there is a function |
5001 // cache is passed to the stub. | 4994 // cache is passed to the stub. |
5002 inline bool has_function_cache(); | 4995 inline bool has_function_cache(); |
5003 inline void set_has_function_cache(bool flag); | 4996 inline void set_has_function_cache(bool flag); |
5004 | 4997 |
5005 | 4998 |
5006 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether | 4999 // [marked_for_deoptimization]: For kind OPTIMIZED_FUNCTION tells whether |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5225 class KindField: public BitField<Kind, 7, 4> {}; | 5218 class KindField: public BitField<Kind, 7, 4> {}; |
5226 class IsPregeneratedField: public BitField<bool, 11, 1> {}; | 5219 class IsPregeneratedField: public BitField<bool, 11, 1> {}; |
5227 class ExtraICStateField: public BitField<ExtraICState, 12, 5> {}; | 5220 class ExtraICStateField: public BitField<ExtraICState, 12, 5> {}; |
5228 class ExtendedExtraICStateField: public BitField<ExtraICState, 12, | 5221 class ExtendedExtraICStateField: public BitField<ExtraICState, 12, |
5229 PlatformSmiTagging::kSmiValueSize - 12 + 1> {}; // NOLINT | 5222 PlatformSmiTagging::kSmiValueSize - 12 + 1> {}; // NOLINT |
5230 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); | 5223 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); |
5231 | 5224 |
5232 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) | 5225 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) |
5233 static const int kStackSlotsFirstBit = 0; | 5226 static const int kStackSlotsFirstBit = 0; |
5234 static const int kStackSlotsBitCount = 24; | 5227 static const int kStackSlotsBitCount = 24; |
5235 static const int kUnaryOpTypeFirstBit = | |
5236 kStackSlotsFirstBit + kStackSlotsBitCount; | |
5237 static const int kUnaryOpTypeBitCount = 3; | |
5238 static const int kHasFunctionCacheFirstBit = | 5228 static const int kHasFunctionCacheFirstBit = |
5239 kStackSlotsFirstBit + kStackSlotsBitCount; | 5229 kStackSlotsFirstBit + kStackSlotsBitCount; |
5240 static const int kHasFunctionCacheBitCount = 1; | 5230 static const int kHasFunctionCacheBitCount = 1; |
5241 static const int kMarkedForDeoptimizationFirstBit = | 5231 static const int kMarkedForDeoptimizationFirstBit = |
5242 kStackSlotsFirstBit + kStackSlotsBitCount + 1; | 5232 kStackSlotsFirstBit + kStackSlotsBitCount + 1; |
5243 static const int kMarkedForDeoptimizationBitCount = 1; | 5233 static const int kMarkedForDeoptimizationBitCount = 1; |
5244 | 5234 |
5245 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); | 5235 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); |
5246 STATIC_ASSERT(kUnaryOpTypeFirstBit + kUnaryOpTypeBitCount <= 32); | |
5247 STATIC_ASSERT(kHasFunctionCacheFirstBit + kHasFunctionCacheBitCount <= 32); | 5236 STATIC_ASSERT(kHasFunctionCacheFirstBit + kHasFunctionCacheBitCount <= 32); |
5248 STATIC_ASSERT(kMarkedForDeoptimizationFirstBit + | 5237 STATIC_ASSERT(kMarkedForDeoptimizationFirstBit + |
5249 kMarkedForDeoptimizationBitCount <= 32); | 5238 kMarkedForDeoptimizationBitCount <= 32); |
5250 | 5239 |
5251 class StackSlotsField: public BitField<int, | 5240 class StackSlotsField: public BitField<int, |
5252 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT | 5241 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT |
5253 class UnaryOpTypeField: public BitField<int, | |
5254 kUnaryOpTypeFirstBit, kUnaryOpTypeBitCount> {}; // NOLINT | |
5255 class HasFunctionCacheField: public BitField<bool, | 5242 class HasFunctionCacheField: public BitField<bool, |
5256 kHasFunctionCacheFirstBit, kHasFunctionCacheBitCount> {}; // NOLINT | 5243 kHasFunctionCacheFirstBit, kHasFunctionCacheBitCount> {}; // NOLINT |
5257 class MarkedForDeoptimizationField: public BitField<bool, | 5244 class MarkedForDeoptimizationField: public BitField<bool, |
5258 kMarkedForDeoptimizationFirstBit, | 5245 kMarkedForDeoptimizationFirstBit, |
5259 kMarkedForDeoptimizationBitCount> {}; // NOLINT | 5246 kMarkedForDeoptimizationBitCount> {}; // NOLINT |
5260 | 5247 |
5261 // KindSpecificFlags2 layout (ALL) | 5248 // KindSpecificFlags2 layout (ALL) |
5262 static const int kIsCrankshaftedBit = 0; | 5249 static const int kIsCrankshaftedBit = 0; |
5263 class IsCrankshaftedField: public BitField<bool, | 5250 class IsCrankshaftedField: public BitField<bool, |
5264 kIsCrankshaftedBit, 1> {}; // NOLINT | 5251 kIsCrankshaftedBit, 1> {}; // NOLINT |
(...skipping 4917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10182 } else { | 10169 } else { |
10183 value &= ~(1 << bit_position); | 10170 value &= ~(1 << bit_position); |
10184 } | 10171 } |
10185 return value; | 10172 return value; |
10186 } | 10173 } |
10187 }; | 10174 }; |
10188 | 10175 |
10189 } } // namespace v8::internal | 10176 } } // namespace v8::internal |
10190 | 10177 |
10191 #endif // V8_OBJECTS_H_ | 10178 #endif // V8_OBJECTS_H_ |
OLD | NEW |