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 5215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5226 inline ByteArray* unchecked_relocation_info(); | 5226 inline ByteArray* unchecked_relocation_info(); |
5227 | 5227 |
5228 inline int relocation_size(); | 5228 inline int relocation_size(); |
5229 | 5229 |
5230 // [flags]: Various code flags. | 5230 // [flags]: Various code flags. |
5231 inline Flags flags(); | 5231 inline Flags flags(); |
5232 inline void set_flags(Flags flags); | 5232 inline void set_flags(Flags flags); |
5233 | 5233 |
5234 // [flags]: Access to specific code flags. | 5234 // [flags]: Access to specific code flags. |
5235 inline Kind kind(); | 5235 inline Kind kind(); |
5236 inline Kind handler_kind() { | |
5237 return static_cast<Kind>(arguments_count()); | |
5238 } | |
5239 inline InlineCacheState ic_state(); // Only valid for IC stubs. | 5236 inline InlineCacheState ic_state(); // Only valid for IC stubs. |
5240 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. | 5237 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
5241 | 5238 |
5242 inline StubType type(); // Only valid for monomorphic IC stubs. | 5239 inline StubType type(); // Only valid for monomorphic IC stubs. |
5243 inline int arguments_count(); // Only valid for call IC stubs. | |
5244 | 5240 |
5245 // Testers for IC stub kinds. | 5241 // Testers for IC stub kinds. |
5246 inline bool is_inline_cache_stub(); | 5242 inline bool is_inline_cache_stub(); |
5247 inline bool is_debug_stub(); | 5243 inline bool is_debug_stub(); |
5248 inline bool is_handler() { return kind() == HANDLER; } | 5244 inline bool is_handler() { return kind() == HANDLER; } |
5249 inline bool is_load_stub() { return kind() == LOAD_IC; } | 5245 inline bool is_load_stub() { return kind() == LOAD_IC; } |
5250 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } | 5246 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } |
5251 inline bool is_store_stub() { return kind() == STORE_IC; } | 5247 inline bool is_store_stub() { return kind() == STORE_IC; } |
5252 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } | 5248 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } |
5253 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } | 5249 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5372 // which would make snapshot production non-reproducible. This method wipes | 5368 // which would make snapshot production non-reproducible. This method wipes |
5373 // out the to-be-overwritten header data for reproducible snapshots. | 5369 // out the to-be-overwritten header data for reproducible snapshots. |
5374 inline void WipeOutHeader(); | 5370 inline void WipeOutHeader(); |
5375 | 5371 |
5376 // Flags operations. | 5372 // Flags operations. |
5377 static inline Flags ComputeFlags( | 5373 static inline Flags ComputeFlags( |
5378 Kind kind, | 5374 Kind kind, |
5379 InlineCacheState ic_state = UNINITIALIZED, | 5375 InlineCacheState ic_state = UNINITIALIZED, |
5380 ExtraICState extra_ic_state = kNoExtraICState, | 5376 ExtraICState extra_ic_state = kNoExtraICState, |
5381 StubType type = NORMAL, | 5377 StubType type = NORMAL, |
5382 Kind handler_kind = STUB, | |
5383 InlineCacheHolderFlag holder = OWN_MAP); | 5378 InlineCacheHolderFlag holder = OWN_MAP); |
5384 | 5379 |
5385 static inline Flags ComputeMonomorphicFlags( | 5380 static inline Flags ComputeMonomorphicFlags( |
5386 Kind kind, | 5381 Kind kind, |
5387 ExtraICState extra_ic_state = kNoExtraICState, | 5382 ExtraICState extra_ic_state = kNoExtraICState, |
5388 InlineCacheHolderFlag holder = OWN_MAP, | 5383 InlineCacheHolderFlag holder = OWN_MAP, |
| 5384 StubType type = NORMAL); |
| 5385 |
| 5386 static inline Flags ComputeHandlerFlags( |
| 5387 Kind handler_kind, |
| 5388 ExtraICState extra_ic_state = kNoExtraICState, |
5389 StubType type = NORMAL, | 5389 StubType type = NORMAL, |
5390 Kind handler_kind = STUB); | 5390 InlineCacheHolderFlag holder = OWN_MAP); |
5391 | 5391 |
5392 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | 5392 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); |
5393 static inline StubType ExtractTypeFromFlags(Flags flags); | 5393 static inline StubType ExtractTypeFromFlags(Flags flags); |
5394 static inline Kind ExtractKindFromFlags(Flags flags); | 5394 static inline Kind ExtractKindFromFlags(Flags flags); |
5395 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 5395 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
5396 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); | 5396 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
5397 static inline int ExtractArgumentsCountFromFlags(Flags flags); | |
5398 | 5397 |
5399 static inline Flags RemoveTypeFromFlags(Flags flags); | 5398 static inline Flags RemoveTypeFromFlags(Flags flags); |
5400 | 5399 |
5401 // Convert a target address into a code object. | 5400 // Convert a target address into a code object. |
5402 static inline Code* GetCodeFromTargetAddress(Address address); | 5401 static inline Code* GetCodeFromTargetAddress(Address address); |
5403 | 5402 |
5404 // Convert an entry address into an object. | 5403 // Convert an entry address into an object. |
5405 static inline Object* GetObjectFromEntryAddress(Address location_of_address); | 5404 static inline Object* GetObjectFromEntryAddress(Address location_of_address); |
5406 | 5405 |
5407 // Returns the address of the first instruction. | 5406 // Returns the address of the first instruction. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5607 kSafepointTableOffsetBitCount> {}; // NOLINT | 5606 kSafepointTableOffsetBitCount> {}; // NOLINT |
5608 class StubMajorKeyField: public BitField<int, | 5607 class StubMajorKeyField: public BitField<int, |
5609 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT | 5608 kStubMajorKeyFirstBit, kStubMajorKeyBits> {}; // NOLINT |
5610 | 5609 |
5611 // KindSpecificFlags2 layout (FUNCTION) | 5610 // KindSpecificFlags2 layout (FUNCTION) |
5612 class BackEdgeTableOffsetField: public BitField<int, | 5611 class BackEdgeTableOffsetField: public BitField<int, |
5613 kIsCrankshaftedBit + 1, 29> {}; // NOLINT | 5612 kIsCrankshaftedBit + 1, 29> {}; // NOLINT |
5614 class BackEdgesPatchedForOSRField: public BitField<bool, | 5613 class BackEdgesPatchedForOSRField: public BitField<bool, |
5615 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT | 5614 kIsCrankshaftedBit + 1 + 29, 1> {}; // NOLINT |
5616 | 5615 |
5617 // Signed field cannot be encoded using the BitField class. | 5616 class HandlerKindField: public BitField<Kind, 17, 4> {}; |
5618 static const int kArgumentsCountShift = 17; | 5617 |
5619 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); | 5618 static const int kArgumentsBits = 16; |
5620 static const int kArgumentsBits = | |
5621 PlatformSmiTagging::kSmiValueSize - Code::kArgumentsCountShift + 1; | |
5622 static const int kMaxArguments = (1 << kArgumentsBits) - 1; | 5619 static const int kMaxArguments = (1 << kArgumentsBits) - 1; |
5623 | 5620 |
5624 // This constant should be encodable in an ARM instruction. | 5621 // This constant should be encodable in an ARM instruction. |
5625 static const int kFlagsNotUsedInLookup = | 5622 static const int kFlagsNotUsedInLookup = |
5626 TypeField::kMask | CacheHolderField::kMask; | 5623 TypeField::kMask | CacheHolderField::kMask; |
5627 | 5624 |
5628 private: | 5625 private: |
5629 friend class RelocIterator; | 5626 friend class RelocIterator; |
5630 | 5627 |
5631 void ClearInlineCaches(Kind* kind); | 5628 void ClearInlineCaches(Kind* kind); |
(...skipping 5127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10759 } else { | 10756 } else { |
10760 value &= ~(1 << bit_position); | 10757 value &= ~(1 << bit_position); |
10761 } | 10758 } |
10762 return value; | 10759 return value; |
10763 } | 10760 } |
10764 }; | 10761 }; |
10765 | 10762 |
10766 } } // namespace v8::internal | 10763 } } // namespace v8::internal |
10767 | 10764 |
10768 #endif // V8_OBJECTS_H_ | 10765 #endif // V8_OBJECTS_H_ |
OLD | NEW |