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 4911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4922 // For kind STUB or ICs, tells whether or not a code object was generated by | 4922 // For kind STUB or ICs, tells whether or not a code object was generated by |
4923 // the optimizing compiler (but it may not be an optimized function). | 4923 // the optimizing compiler (but it may not be an optimized function). |
4924 bool is_crankshafted(); | 4924 bool is_crankshafted(); |
4925 inline void set_is_crankshafted(bool value); | 4925 inline void set_is_crankshafted(bool value); |
4926 | 4926 |
4927 // For stubs, tells whether they should always exist, so that they can be | 4927 // For stubs, tells whether they should always exist, so that they can be |
4928 // called from other stubs. | 4928 // called from other stubs. |
4929 inline bool is_pregenerated(); | 4929 inline bool is_pregenerated(); |
4930 inline void set_is_pregenerated(bool value); | 4930 inline void set_is_pregenerated(bool value); |
4931 | 4931 |
| 4932 inline bool is_thumb_mode(); |
| 4933 |
4932 // [optimizable]: For FUNCTION kind, tells if it is optimizable. | 4934 // [optimizable]: For FUNCTION kind, tells if it is optimizable. |
4933 inline bool optimizable(); | 4935 inline bool optimizable(); |
4934 inline void set_optimizable(bool value); | 4936 inline void set_optimizable(bool value); |
4935 | 4937 |
4936 // [has_deoptimization_support]: For FUNCTION kind, tells if it has | 4938 // [has_deoptimization_support]: For FUNCTION kind, tells if it has |
4937 // deoptimization support. | 4939 // deoptimization support. |
4938 inline bool has_deoptimization_support(); | 4940 inline bool has_deoptimization_support(); |
4939 inline void set_has_deoptimization_support(bool value); | 4941 inline void set_has_deoptimization_support(bool value); |
4940 | 4942 |
4941 // [has_debug_break_slots]: For FUNCTION kind, tells if it has | 4943 // [has_debug_break_slots]: For FUNCTION kind, tells if it has |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5039 KeyedAccessStoreMode store_mode, | 5041 KeyedAccessStoreMode store_mode, |
5040 StrictModeFlag strict_mode) { | 5042 StrictModeFlag strict_mode) { |
5041 return ExtraICStateKeyedAccessStoreMode::encode(store_mode) | | 5043 return ExtraICStateKeyedAccessStoreMode::encode(store_mode) | |
5042 ExtraICStateStrictMode::encode(strict_mode); | 5044 ExtraICStateStrictMode::encode(strict_mode); |
5043 } | 5045 } |
5044 | 5046 |
5045 static inline ExtraICState ComputeExtraICState(StubHolder stub_holder) { | 5047 static inline ExtraICState ComputeExtraICState(StubHolder stub_holder) { |
5046 return ExtraICStateStubHolder::encode(stub_holder); | 5048 return ExtraICStateStubHolder::encode(stub_holder); |
5047 } | 5049 } |
5048 | 5050 |
| 5051 static inline Flags SetThumbModeInFlags(Flags flag); |
| 5052 |
5049 // Flags operations. | 5053 // Flags operations. |
5050 static inline Flags ComputeFlags( | 5054 static inline Flags ComputeFlags( |
5051 Kind kind, | 5055 Kind kind, |
5052 InlineCacheState ic_state = UNINITIALIZED, | 5056 InlineCacheState ic_state = UNINITIALIZED, |
5053 ExtraICState extra_ic_state = kNoExtraICState, | 5057 ExtraICState extra_ic_state = kNoExtraICState, |
5054 StubType type = NORMAL, | 5058 StubType type = NORMAL, |
5055 int argc = -1, | 5059 int argc = -1, |
5056 InlineCacheHolderFlag holder = OWN_MAP); | 5060 InlineCacheHolderFlag holder = OWN_MAP, |
| 5061 bool thumb_mode = false); |
5057 | 5062 |
5058 static inline Flags ComputeMonomorphicFlags( | 5063 static inline Flags ComputeMonomorphicFlags( |
5059 Kind kind, | 5064 Kind kind, |
5060 ExtraICState extra_ic_state = kNoExtraICState, | 5065 ExtraICState extra_ic_state = kNoExtraICState, |
5061 StubType type = NORMAL, | 5066 StubType type = NORMAL, |
5062 int argc = -1, | 5067 int argc = -1, |
5063 InlineCacheHolderFlag holder = OWN_MAP); | 5068 InlineCacheHolderFlag holder = OWN_MAP); |
5064 | 5069 |
5065 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 5070 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
5066 static inline StubType ExtractTypeFromFlags(Flags flags); | 5071 static inline StubType ExtractTypeFromFlags(Flags flags); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5209 | 5214 |
5210 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; | 5215 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; |
5211 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; | 5216 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; |
5212 | 5217 |
5213 // Flags layout. BitField<type, shift, size>. | 5218 // Flags layout. BitField<type, shift, size>. |
5214 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; | 5219 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; |
5215 class TypeField: public BitField<StubType, 3, 3> {}; | 5220 class TypeField: public BitField<StubType, 3, 3> {}; |
5216 class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {}; | 5221 class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {}; |
5217 class KindField: public BitField<Kind, 7, 4> {}; | 5222 class KindField: public BitField<Kind, 7, 4> {}; |
5218 class IsPregeneratedField: public BitField<bool, 11, 1> {}; | 5223 class IsPregeneratedField: public BitField<bool, 11, 1> {}; |
5219 class ExtraICStateField: public BitField<ExtraICState, 12, 5> {}; | 5224 class IsThumbModeField: public BitField<bool, 12, 1> {}; |
5220 class ExtendedExtraICStateField: public BitField<ExtraICState, 12, | 5225 class ExtraICStateField: public BitField<ExtraICState, 13, 5> {}; |
5221 PlatformSmiTagging::kSmiValueSize - 12 + 1> {}; // NOLINT | 5226 class ExtendedExtraICStateField: public BitField<ExtraICState, 13, |
| 5227 PlatformSmiTagging::kSmiValueSize - 13 + 1> {}; // NOLINT |
5222 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); | 5228 STATIC_ASSERT(ExtraICStateField::kShift == ExtendedExtraICStateField::kShift); |
5223 | 5229 |
5224 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) | 5230 // KindSpecificFlags1 layout (STUB and OPTIMIZED_FUNCTION) |
5225 static const int kStackSlotsFirstBit = 0; | 5231 static const int kStackSlotsFirstBit = 0; |
5226 static const int kStackSlotsBitCount = 24; | 5232 static const int kStackSlotsBitCount = 24; |
5227 static const int kHasFunctionCacheFirstBit = | 5233 static const int kHasFunctionCacheFirstBit = |
5228 kStackSlotsFirstBit + kStackSlotsBitCount; | 5234 kStackSlotsFirstBit + kStackSlotsBitCount; |
5229 static const int kHasFunctionCacheBitCount = 1; | 5235 static const int kHasFunctionCacheBitCount = 1; |
5230 static const int kMarkedForDeoptimizationFirstBit = | 5236 static const int kMarkedForDeoptimizationFirstBit = |
5231 kStackSlotsFirstBit + kStackSlotsBitCount + 1; | 5237 kStackSlotsFirstBit + kStackSlotsBitCount + 1; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5267 class StubMajorKeyField: public BitField<int, | 5273 class StubMajorKeyField: public BitField<int, |
5268 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT | 5274 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT |
5269 | 5275 |
5270 // KindSpecificFlags2 layout (FUNCTION) | 5276 // KindSpecificFlags2 layout (FUNCTION) |
5271 class BackEdgeTableOffsetField: public BitField<int, | 5277 class BackEdgeTableOffsetField: public BitField<int, |
5272 kIsCrankshaftedBit + 1, 29> {}; // NOLINT | 5278 kIsCrankshaftedBit + 1, 29> {}; // NOLINT |
5273 class BackEdgesPatchedForOSRField: public BitField<bool, | 5279 class BackEdgesPatchedForOSRField: public BitField<bool, |
5274 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT | 5280 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT |
5275 | 5281 |
5276 // Signed field cannot be encoded using the BitField class. | 5282 // Signed field cannot be encoded using the BitField class. |
5277 static const int kArgumentsCountShift = 17; | 5283 static const int kArgumentsCountShift = 18; |
5278 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); | 5284 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); |
5279 static const int kArgumentsBits = | 5285 static const int kArgumentsBits = |
5280 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; | 5286 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; |
5281 static const int kMaxArguments = (1 << kArgumentsBits) - 1; | 5287 static const int kMaxArguments = (1 << kArgumentsBits) - 1; |
5282 | 5288 |
5283 // ICs can use either argument count or ExtendedExtraIC, since their storage | 5289 // ICs can use either argument count or ExtendedExtraIC, since their storage |
5284 // overlaps. | 5290 // overlaps. |
5285 STATIC_ASSERT(ExtraICStateField::kShift + | 5291 STATIC_ASSERT(ExtraICStateField::kShift + |
5286 ExtraICStateField::kSize + kArgumentsBits == | 5292 ExtraICStateField::kSize + kArgumentsBits == |
5287 ExtendedExtraICStateField::kShift + | 5293 ExtendedExtraICStateField::kShift + |
(...skipping 4955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10243 } else { | 10249 } else { |
10244 value &= ~(1 << bit_position); | 10250 value &= ~(1 << bit_position); |
10245 } | 10251 } |
10246 return value; | 10252 return value; |
10247 } | 10253 } |
10248 }; | 10254 }; |
10249 | 10255 |
10250 } } // namespace v8::internal | 10256 } } // namespace v8::internal |
10251 | 10257 |
10252 #endif // V8_OBJECTS_H_ | 10258 #endif // V8_OBJECTS_H_ |
OLD | NEW |