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 5045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5056 // [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the | 5056 // [is_turbofanned]: For kind STUB or OPTIMIZED_FUNCTION, tells whether the |
5057 // code object was generated by the TurboFan optimizing compiler. | 5057 // code object was generated by the TurboFan optimizing compiler. |
5058 inline bool is_turbofanned(); | 5058 inline bool is_turbofanned(); |
5059 inline void set_is_turbofanned(bool value); | 5059 inline void set_is_turbofanned(bool value); |
5060 | 5060 |
5061 // [can_have_weak_objects]: For kind OPTIMIZED_FUNCTION, tells whether the | 5061 // [can_have_weak_objects]: For kind OPTIMIZED_FUNCTION, tells whether the |
5062 // embedded objects in code should be treated weakly. | 5062 // embedded objects in code should be treated weakly. |
5063 inline bool can_have_weak_objects(); | 5063 inline bool can_have_weak_objects(); |
5064 inline void set_can_have_weak_objects(bool value); | 5064 inline void set_can_have_weak_objects(bool value); |
5065 | 5065 |
| 5066 // [is_construct_stub]: For kind BUILTIN, tells whether the code object |
| 5067 // represents a hand-written construct stub |
| 5068 // (e.g., NumberConstructor_ConstructStub). |
| 5069 inline bool is_construct_stub(); |
| 5070 inline void set_is_construct_stub(bool value); |
| 5071 |
5066 // [has_deoptimization_support]: For FUNCTION kind, tells if it has | 5072 // [has_deoptimization_support]: For FUNCTION kind, tells if it has |
5067 // deoptimization support. | 5073 // deoptimization support. |
5068 inline bool has_deoptimization_support(); | 5074 inline bool has_deoptimization_support(); |
5069 inline void set_has_deoptimization_support(bool value); | 5075 inline void set_has_deoptimization_support(bool value); |
5070 | 5076 |
5071 // [has_debug_break_slots]: For FUNCTION kind, tells if it has | 5077 // [has_debug_break_slots]: For FUNCTION kind, tells if it has |
5072 // been compiled with debug break slots. | 5078 // been compiled with debug break slots. |
5073 inline bool has_debug_break_slots(); | 5079 inline bool has_debug_break_slots(); |
5074 inline void set_has_debug_break_slots(bool value); | 5080 inline void set_has_debug_break_slots(bool value); |
5075 | 5081 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5391 PlatformSmiTagging::kSmiValueSize - | 5397 PlatformSmiTagging::kSmiValueSize - |
5392 KindField::kNext + 1> {}; | 5398 KindField::kNext + 1> {}; |
5393 | 5399 |
5394 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION) | 5400 // KindSpecificFlags1 layout (STUB, BUILTIN and OPTIMIZED_FUNCTION) |
5395 static const int kStackSlotsFirstBit = 0; | 5401 static const int kStackSlotsFirstBit = 0; |
5396 static const int kStackSlotsBitCount = 24; | 5402 static const int kStackSlotsBitCount = 24; |
5397 static const int kMarkedForDeoptimizationBit = | 5403 static const int kMarkedForDeoptimizationBit = |
5398 kStackSlotsFirstBit + kStackSlotsBitCount; | 5404 kStackSlotsFirstBit + kStackSlotsBitCount; |
5399 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; | 5405 static const int kIsTurbofannedBit = kMarkedForDeoptimizationBit + 1; |
5400 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; | 5406 static const int kCanHaveWeakObjects = kIsTurbofannedBit + 1; |
| 5407 // Could be moved to overlap previous bits when we need more space. |
| 5408 static const int kIsConstructStub = kCanHaveWeakObjects + 1; |
5401 | 5409 |
5402 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); | 5410 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32); |
5403 STATIC_ASSERT(kCanHaveWeakObjects + 1 <= 32); | 5411 STATIC_ASSERT(kIsConstructStub + 1 <= 32); |
5404 | 5412 |
5405 class StackSlotsField: public BitField<int, | 5413 class StackSlotsField: public BitField<int, |
5406 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT | 5414 kStackSlotsFirstBit, kStackSlotsBitCount> {}; // NOLINT |
5407 class MarkedForDeoptimizationField | 5415 class MarkedForDeoptimizationField |
5408 : public BitField<bool, kMarkedForDeoptimizationBit, 1> {}; // NOLINT | 5416 : public BitField<bool, kMarkedForDeoptimizationBit, 1> {}; // NOLINT |
5409 class IsTurbofannedField : public BitField<bool, kIsTurbofannedBit, 1> { | 5417 class IsTurbofannedField : public BitField<bool, kIsTurbofannedBit, 1> { |
5410 }; // NOLINT | 5418 }; // NOLINT |
5411 class CanHaveWeakObjectsField | 5419 class CanHaveWeakObjectsField |
5412 : public BitField<bool, kCanHaveWeakObjects, 1> {}; // NOLINT | 5420 : public BitField<bool, kCanHaveWeakObjects, 1> {}; // NOLINT |
| 5421 class IsConstructStubField : public BitField<bool, kIsConstructStub, 1> { |
| 5422 }; // NOLINT |
5413 | 5423 |
5414 // KindSpecificFlags2 layout (ALL) | 5424 // KindSpecificFlags2 layout (ALL) |
5415 static const int kIsCrankshaftedBit = 0; | 5425 static const int kIsCrankshaftedBit = 0; |
5416 class IsCrankshaftedField: public BitField<bool, | 5426 class IsCrankshaftedField: public BitField<bool, |
5417 kIsCrankshaftedBit, 1> {}; // NOLINT | 5427 kIsCrankshaftedBit, 1> {}; // NOLINT |
5418 | 5428 |
5419 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) | 5429 // KindSpecificFlags2 layout (STUB and OPTIMIZED_FUNCTION) |
5420 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1; | 5430 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1; |
5421 static const int kSafepointTableOffsetBitCount = 30; | 5431 static const int kSafepointTableOffsetBitCount = 30; |
5422 | 5432 |
(...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6871 FixedArray::kHeaderSize + kPointerSize * (kLiteralsOffset - kEntryLength); | 6881 FixedArray::kHeaderSize + kPointerSize * (kLiteralsOffset - kEntryLength); |
6872 static const int kOffsetToPreviousOsrAstId = | 6882 static const int kOffsetToPreviousOsrAstId = |
6873 FixedArray::kHeaderSize + kPointerSize * (kOsrAstIdOffset - kEntryLength); | 6883 FixedArray::kHeaderSize + kPointerSize * (kOsrAstIdOffset - kEntryLength); |
6874 | 6884 |
6875 // [scope_info]: Scope info. | 6885 // [scope_info]: Scope info. |
6876 DECL_ACCESSORS(scope_info, ScopeInfo) | 6886 DECL_ACCESSORS(scope_info, ScopeInfo) |
6877 | 6887 |
6878 // [construct stub]: Code stub for constructing instances of this function. | 6888 // [construct stub]: Code stub for constructing instances of this function. |
6879 DECL_ACCESSORS(construct_stub, Code) | 6889 DECL_ACCESSORS(construct_stub, Code) |
6880 | 6890 |
| 6891 // Sets the given code as the construct stub, and marks builtin code objects |
| 6892 // as a construct stub. |
| 6893 void SetConstructStub(Code* code); |
| 6894 |
6881 // Returns if this function has been compiled to native code yet. | 6895 // Returns if this function has been compiled to native code yet. |
6882 inline bool is_compiled(); | 6896 inline bool is_compiled(); |
6883 | 6897 |
6884 // [length]: The function length - usually the number of declared parameters. | 6898 // [length]: The function length - usually the number of declared parameters. |
6885 // Use up to 2^30 parameters. | 6899 // Use up to 2^30 parameters. |
6886 inline int length() const; | 6900 inline int length() const; |
6887 inline void set_length(int value); | 6901 inline void set_length(int value); |
6888 | 6902 |
6889 // [internal formal parameter count]: The declared number of parameters. | 6903 // [internal formal parameter count]: The declared number of parameters. |
6890 // For subclass constructors, also includes new.target. | 6904 // For subclass constructors, also includes new.target. |
(...skipping 4074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10965 } | 10979 } |
10966 return value; | 10980 return value; |
10967 } | 10981 } |
10968 }; | 10982 }; |
10969 | 10983 |
10970 | 10984 |
10971 } // NOLINT, false-positive due to second-order macros. | 10985 } // NOLINT, false-positive due to second-order macros. |
10972 } // NOLINT, false-positive due to second-order macros. | 10986 } // NOLINT, false-positive due to second-order macros. |
10973 | 10987 |
10974 #endif // V8_OBJECTS_H_ | 10988 #endif // V8_OBJECTS_H_ |
OLD | NEW |