| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 4951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4962 inline ByteArray* unchecked_relocation_info(); | 4962 inline ByteArray* unchecked_relocation_info(); |
| 4963 | 4963 |
| 4964 inline int relocation_size(); | 4964 inline int relocation_size(); |
| 4965 | 4965 |
| 4966 // [flags]: Various code flags. | 4966 // [flags]: Various code flags. |
| 4967 inline Flags flags(); | 4967 inline Flags flags(); |
| 4968 inline void set_flags(Flags flags); | 4968 inline void set_flags(Flags flags); |
| 4969 | 4969 |
| 4970 // [flags]: Access to specific code flags. | 4970 // [flags]: Access to specific code flags. |
| 4971 inline Kind kind(); | 4971 inline Kind kind(); |
| 4972 inline InlineCacheState ic_state(); // Only valid for IC stubs. | |
| 4973 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. | 4972 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. |
| 4974 | 4973 |
| 4975 // Testers for IC stub kinds. | 4974 // Testers for IC stub kinds. |
| 4976 inline bool is_inline_cache_stub(); | 4975 inline bool is_inline_cache_stub(); |
| 4977 inline bool is_debug_stub(); | 4976 inline bool is_debug_stub(); |
| 4978 inline bool is_handler(); | 4977 inline bool is_handler(); |
| 4979 inline bool is_call_stub(); | 4978 inline bool is_call_stub(); |
| 4980 inline bool is_binary_op_stub(); | 4979 inline bool is_binary_op_stub(); |
| 4981 inline bool is_compare_ic_stub(); | 4980 inline bool is_compare_ic_stub(); |
| 4982 inline bool is_to_boolean_ic_stub(); | 4981 inline bool is_to_boolean_ic_stub(); |
| 4983 inline bool is_optimized_code(); | 4982 inline bool is_optimized_code(); |
| 4984 inline bool is_wasm_code(); | 4983 inline bool is_wasm_code(); |
| 4985 inline bool embeds_maps_weakly(); | |
| 4986 | 4984 |
| 4987 inline bool IsCodeStubOrIC(); | 4985 inline bool IsCodeStubOrIC(); |
| 4988 | 4986 |
| 4989 inline void set_raw_kind_specific_flags1(int value); | 4987 inline void set_raw_kind_specific_flags1(int value); |
| 4990 inline void set_raw_kind_specific_flags2(int value); | 4988 inline void set_raw_kind_specific_flags2(int value); |
| 4991 | 4989 |
| 4992 // Testers for interpreter builtins. | 4990 // Testers for interpreter builtins. |
| 4993 inline bool is_interpreter_trampoline_builtin(); | 4991 inline bool is_interpreter_trampoline_builtin(); |
| 4994 | 4992 |
| 4995 // [is_crankshafted]: For kind STUB or ICs, tells whether or not a code | 4993 // [is_crankshafted]: For kind STUB or ICs, tells whether or not a code |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5098 // snapshot so that it can be written in one, fast, memcpy during | 5096 // snapshot so that it can be written in one, fast, memcpy during |
| 5099 // deserialization. The deserializer will overwrite some pointers, rather | 5097 // deserialization. The deserializer will overwrite some pointers, rather |
| 5100 // like a runtime linker, but the random allocation addresses used in the | 5098 // like a runtime linker, but the random allocation addresses used in the |
| 5101 // mksnapshot process would still be present in the unlinked snapshot data, | 5099 // mksnapshot process would still be present in the unlinked snapshot data, |
| 5102 // which would make snapshot production non-reproducible. This method wipes | 5100 // which would make snapshot production non-reproducible. This method wipes |
| 5103 // out the to-be-overwritten header data for reproducible snapshots. | 5101 // out the to-be-overwritten header data for reproducible snapshots. |
| 5104 inline void WipeOutHeader(); | 5102 inline void WipeOutHeader(); |
| 5105 | 5103 |
| 5106 // Flags operations. | 5104 // Flags operations. |
| 5107 static inline Flags ComputeFlags( | 5105 static inline Flags ComputeFlags( |
| 5108 Kind kind, InlineCacheState ic_state = UNINITIALIZED, | |
| 5109 ExtraICState extra_ic_state = kNoExtraICState, | |
| 5110 CacheHolderFlag holder = kCacheOnReceiver); | |
| 5111 | |
| 5112 static inline Flags ComputeMonomorphicFlags( | |
| 5113 Kind kind, ExtraICState extra_ic_state = kNoExtraICState, | 5106 Kind kind, ExtraICState extra_ic_state = kNoExtraICState, |
| 5114 CacheHolderFlag holder = kCacheOnReceiver); | 5107 CacheHolderFlag holder = kCacheOnReceiver); |
| 5115 | 5108 |
| 5116 static inline Flags ComputeHandlerFlags( | 5109 static inline Flags ComputeHandlerFlags( |
| 5117 Kind handler_kind, CacheHolderFlag holder = kCacheOnReceiver); | 5110 Kind handler_kind, CacheHolderFlag holder = kCacheOnReceiver); |
| 5118 | 5111 |
| 5119 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); | |
| 5120 static inline CacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); | 5112 static inline CacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); |
| 5121 static inline Kind ExtractKindFromFlags(Flags flags); | 5113 static inline Kind ExtractKindFromFlags(Flags flags); |
| 5122 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); | 5114 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); |
| 5123 | 5115 |
| 5124 static inline Flags RemoveHolderFromFlags(Flags flags); | 5116 static inline Flags RemoveHolderFromFlags(Flags flags); |
| 5125 | 5117 |
| 5126 // Convert a target address into a code object. | 5118 // Convert a target address into a code object. |
| 5127 static inline Code* GetCodeFromTargetAddress(Address address); | 5119 static inline Code* GetCodeFromTargetAddress(Address address); |
| 5128 | 5120 |
| 5129 // Convert an entry address into an object. | 5121 // Convert an entry address into an object. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5281 static const int kFullCodeFlags = kKindSpecificFlags1Offset; | 5273 static const int kFullCodeFlags = kKindSpecificFlags1Offset; |
| 5282 class FullCodeFlagsHasDeoptimizationSupportField: | 5274 class FullCodeFlagsHasDeoptimizationSupportField: |
| 5283 public BitField<bool, 0, 1> {}; // NOLINT | 5275 public BitField<bool, 0, 1> {}; // NOLINT |
| 5284 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; | 5276 class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {}; |
| 5285 class FullCodeFlagsHasRelocInfoForSerialization | 5277 class FullCodeFlagsHasRelocInfoForSerialization |
| 5286 : public BitField<bool, 2, 1> {}; | 5278 : public BitField<bool, 2, 1> {}; |
| 5287 // Bit 3 in this bitfield is unused. | 5279 // Bit 3 in this bitfield is unused. |
| 5288 class ProfilerTicksField : public BitField<int, 4, 28> {}; | 5280 class ProfilerTicksField : public BitField<int, 4, 28> {}; |
| 5289 | 5281 |
| 5290 // Flags layout. BitField<type, shift, size>. | 5282 // Flags layout. BitField<type, shift, size>. |
| 5291 class ICStateField : public BitField<InlineCacheState, 0, 3> {}; | 5283 class CacheHolderField : public BitField<CacheHolderFlag, 0, 2> {}; |
| 5292 class CacheHolderField : public BitField<CacheHolderFlag, 3, 2> {}; | 5284 class KindField : public BitField<Kind, CacheHolderField::kNext, 5> {}; |
| 5293 class KindField : public BitField<Kind, 5, 5> {}; | 5285 class ExtraICStateField : public BitField<ExtraICState, KindField::kNext, |
| 5294 class ExtraICStateField | 5286 PlatformSmiTagging::kSmiValueSize - |
| 5295 : public BitField<ExtraICState, 10, PlatformSmiTagging::kSmiValueSize - | 5287 KindField::kNext + 1> {}; |
| 5296 10 + 1> {}; // NOLINT | |
| 5297 | 5288 |
| 5298 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION) | 5289 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION) |
| 5299 static const int kStackSlotsFirstBit = 0; | 5290 static const int kStackSlotsFirstBit = 0; |
| 5300 static const int kStackSlotsBitCount = 24; | 5291 static const int kStackSlotsBitCount = 24; |
| 5301 static const int kMarkedForDeoptimizationBit = | 5292 static const int kMarkedForDeoptimizationBit = |
| 5302 kStackSlotsFirstBit + kStackSlotsBitCount; | 5293 kStackSlotsFirstBit + kStackSlotsBitCount; |
| 5303 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; | 5294 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; |
| 5304 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; | 5295 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; |
| 5305 | 5296 |
| 5306 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); | 5297 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); |
| (...skipping 5499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10806 } | 10797 } |
| 10807 return value; | 10798 return value; |
| 10808 } | 10799 } |
| 10809 }; | 10800 }; |
| 10810 | 10801 |
| 10811 | 10802 |
| 10812 } // NOLINT, false-positive due to second-order macros. | 10803 } // NOLINT, false-positive due to second-order macros. |
| 10813 } // NOLINT, false-positive due to second-order macros. | 10804 } // NOLINT, false-positive due to second-order macros. |
| 10814 | 10805 |
| 10815 #endif // V8_OBJECTS_H_ | 10806 #endif // V8_OBJECTS_H_ |
| OLD | NEW |