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 4277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4288 class FunctionVariableField | 4288 class FunctionVariableField |
4289 : public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {}; | 4289 : public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {}; |
4290 class FunctionVariableMode | 4290 class FunctionVariableMode |
4291 : public BitField<VariableMode, FunctionVariableField::kNext, 3> {}; | 4291 : public BitField<VariableMode, FunctionVariableField::kNext, 3> {}; |
4292 class AsmModuleField : public BitField<bool, FunctionVariableMode::kNext, 1> { | 4292 class AsmModuleField : public BitField<bool, FunctionVariableMode::kNext, 1> { |
4293 }; | 4293 }; |
4294 class AsmFunctionField : public BitField<bool, AsmModuleField::kNext, 1> {}; | 4294 class AsmFunctionField : public BitField<bool, AsmModuleField::kNext, 1> {}; |
4295 class HasSimpleParametersField | 4295 class HasSimpleParametersField |
4296 : public BitField<bool, AsmFunctionField::kNext, 1> {}; | 4296 : public BitField<bool, AsmFunctionField::kNext, 1> {}; |
4297 class FunctionKindField | 4297 class FunctionKindField |
4298 : public BitField<FunctionKind, HasSimpleParametersField::kNext, 8> {}; | 4298 : public BitField<FunctionKind, HasSimpleParametersField::kNext, 9> {}; |
4299 | 4299 |
4300 // BitFields representing the encoded information for context locals in the | 4300 // BitFields representing the encoded information for context locals in the |
4301 // ContextLocalInfoEntries part. | 4301 // ContextLocalInfoEntries part. |
4302 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4302 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
4303 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4303 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
4304 class ContextLocalMaybeAssignedFlag | 4304 class ContextLocalMaybeAssignedFlag |
4305 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4305 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
4306 | 4306 |
4307 friend class ScopeIterator; | 4307 friend class ScopeIterator; |
4308 }; | 4308 }; |
(...skipping 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6846 | 6846 |
6847 // Indicates that code for this function cannot be compiled with Crankshaft. | 6847 // Indicates that code for this function cannot be compiled with Crankshaft. |
6848 DECL_BOOLEAN_ACCESSORS(dont_crankshaft) | 6848 DECL_BOOLEAN_ACCESSORS(dont_crankshaft) |
6849 | 6849 |
6850 // Indicates that code for this function cannot be flushed. | 6850 // Indicates that code for this function cannot be flushed. |
6851 DECL_BOOLEAN_ACCESSORS(dont_flush) | 6851 DECL_BOOLEAN_ACCESSORS(dont_flush) |
6852 | 6852 |
6853 // Indicates that this function is a generator. | 6853 // Indicates that this function is a generator. |
6854 DECL_BOOLEAN_ACCESSORS(is_generator) | 6854 DECL_BOOLEAN_ACCESSORS(is_generator) |
6855 | 6855 |
| 6856 // Indicates that this function is an async function. |
| 6857 DECL_BOOLEAN_ACCESSORS(is_async) |
| 6858 |
| 6859 // Indicates that this function can be suspended, either via YieldExpressions |
| 6860 // or AwaitExpressions. |
| 6861 inline bool is_resumable() const; |
| 6862 |
6856 // Indicates that this function is an arrow function. | 6863 // Indicates that this function is an arrow function. |
6857 DECL_BOOLEAN_ACCESSORS(is_arrow) | 6864 DECL_BOOLEAN_ACCESSORS(is_arrow) |
6858 | 6865 |
6859 // Indicates that this function is a concise method. | 6866 // Indicates that this function is a concise method. |
6860 DECL_BOOLEAN_ACCESSORS(is_concise_method) | 6867 DECL_BOOLEAN_ACCESSORS(is_concise_method) |
6861 | 6868 |
6862 // Indicates that this function is a getter. | 6869 // Indicates that this function is a getter. |
6863 DECL_BOOLEAN_ACCESSORS(is_getter_function) | 6870 DECL_BOOLEAN_ACCESSORS(is_getter_function) |
6864 | 6871 |
6865 // Indicates that this function is a setter. | 6872 // Indicates that this function is a setter. |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7142 kFunctionKind, | 7149 kFunctionKind, |
7143 kIsArrow = kFunctionKind, | 7150 kIsArrow = kFunctionKind, |
7144 kIsGenerator, | 7151 kIsGenerator, |
7145 kIsConciseMethod, | 7152 kIsConciseMethod, |
7146 kIsDefaultConstructor, | 7153 kIsDefaultConstructor, |
7147 kIsSubclassConstructor, | 7154 kIsSubclassConstructor, |
7148 kIsBaseConstructor, | 7155 kIsBaseConstructor, |
7149 kIsGetterFunction, | 7156 kIsGetterFunction, |
7150 kIsSetterFunction, | 7157 kIsSetterFunction, |
7151 // byte 3 | 7158 // byte 3 |
| 7159 kIsAsyncFunction, |
7152 kDeserialized, | 7160 kDeserialized, |
7153 kIsDeclaration, | 7161 kIsDeclaration, |
7154 kCompilerHintsCount, // Pseudo entry | 7162 kCompilerHintsCount, // Pseudo entry |
7155 }; | 7163 }; |
7156 // Add hints for other modes when they're added. | 7164 // Add hints for other modes when they're added. |
7157 STATIC_ASSERT(LANGUAGE_END == 3); | 7165 STATIC_ASSERT(LANGUAGE_END == 3); |
7158 // kFunctionKind has to be byte-aligned | 7166 // kFunctionKind has to be byte-aligned |
7159 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); | 7167 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); |
7160 // Make sure that FunctionKind and byte 2 are in sync: | 7168 // Make sure that FunctionKind and byte 2 are in sync: |
7161 #define ASSERT_FUNCTION_KIND_ORDER(functionKind, compilerFunctionKind) \ | 7169 #define ASSERT_FUNCTION_KIND_ORDER(functionKind, compilerFunctionKind) \ |
7162 STATIC_ASSERT(FunctionKind::functionKind == \ | 7170 STATIC_ASSERT(FunctionKind::functionKind == \ |
7163 1 << (compilerFunctionKind - kFunctionKind)) | 7171 1 << (compilerFunctionKind - kFunctionKind)) |
7164 ASSERT_FUNCTION_KIND_ORDER(kArrowFunction, kIsArrow); | 7172 ASSERT_FUNCTION_KIND_ORDER(kArrowFunction, kIsArrow); |
7165 ASSERT_FUNCTION_KIND_ORDER(kGeneratorFunction, kIsGenerator); | 7173 ASSERT_FUNCTION_KIND_ORDER(kGeneratorFunction, kIsGenerator); |
7166 ASSERT_FUNCTION_KIND_ORDER(kConciseMethod, kIsConciseMethod); | 7174 ASSERT_FUNCTION_KIND_ORDER(kConciseMethod, kIsConciseMethod); |
7167 ASSERT_FUNCTION_KIND_ORDER(kDefaultConstructor, kIsDefaultConstructor); | 7175 ASSERT_FUNCTION_KIND_ORDER(kDefaultConstructor, kIsDefaultConstructor); |
7168 ASSERT_FUNCTION_KIND_ORDER(kSubclassConstructor, kIsSubclassConstructor); | 7176 ASSERT_FUNCTION_KIND_ORDER(kSubclassConstructor, kIsSubclassConstructor); |
7169 ASSERT_FUNCTION_KIND_ORDER(kBaseConstructor, kIsBaseConstructor); | 7177 ASSERT_FUNCTION_KIND_ORDER(kBaseConstructor, kIsBaseConstructor); |
7170 ASSERT_FUNCTION_KIND_ORDER(kGetterFunction, kIsGetterFunction); | 7178 ASSERT_FUNCTION_KIND_ORDER(kGetterFunction, kIsGetterFunction); |
7171 ASSERT_FUNCTION_KIND_ORDER(kSetterFunction, kIsSetterFunction); | 7179 ASSERT_FUNCTION_KIND_ORDER(kSetterFunction, kIsSetterFunction); |
7172 #undef ASSERT_FUNCTION_KIND_ORDER | 7180 #undef ASSERT_FUNCTION_KIND_ORDER |
7173 | 7181 |
7174 class FunctionKindBits : public BitField<FunctionKind, kIsArrow, 8> {}; | 7182 class FunctionKindBits : public BitField<FunctionKind, kIsArrow, 9> {}; |
7175 | 7183 |
7176 class DeoptCountBits : public BitField<int, 0, 4> {}; | 7184 class DeoptCountBits : public BitField<int, 0, 4> {}; |
7177 class OptReenableTriesBits : public BitField<int, 4, 18> {}; | 7185 class OptReenableTriesBits : public BitField<int, 4, 18> {}; |
7178 class ICAgeBits : public BitField<int, 22, 8> {}; | 7186 class ICAgeBits : public BitField<int, 22, 8> {}; |
7179 | 7187 |
7180 class OptCountBits : public BitField<int, 0, 22> {}; | 7188 class OptCountBits : public BitField<int, 0, 22> {}; |
7181 class DisabledOptimizationReasonBits : public BitField<int, 22, 8> {}; | 7189 class DisabledOptimizationReasonBits : public BitField<int, 22, 8> {}; |
7182 | 7190 |
7183 private: | 7191 private: |
7184 #if V8_HOST_ARCH_32_BIT | 7192 #if V8_HOST_ARCH_32_BIT |
(...skipping 3548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10733 } | 10741 } |
10734 return value; | 10742 return value; |
10735 } | 10743 } |
10736 }; | 10744 }; |
10737 | 10745 |
10738 | 10746 |
10739 } // NOLINT, false-positive due to second-order macros. | 10747 } // NOLINT, false-positive due to second-order macros. |
10740 } // NOLINT, false-positive due to second-order macros. | 10748 } // NOLINT, false-positive due to second-order macros. |
10741 | 10749 |
10742 #endif // V8_OBJECTS_H_ | 10750 #endif // V8_OBJECTS_H_ |
OLD | NEW |