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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 4383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4394 VariableLocation* location, InitializationFlag* init_flag, | 4394 VariableLocation* location, InitializationFlag* init_flag, |
4395 MaybeAssignedFlag* maybe_assigned_flag); | 4395 MaybeAssignedFlag* maybe_assigned_flag); |
4396 | 4396 |
4397 // Used for the function name variable for named function expressions, and for | 4397 // Used for the function name variable for named function expressions, and for |
4398 // the receiver. | 4398 // the receiver. |
4399 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; | 4399 enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED }; |
4400 | 4400 |
4401 // Properties of scopes. | 4401 // Properties of scopes. |
4402 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; | 4402 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; |
4403 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; | 4403 class CallsEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {}; |
4404 STATIC_ASSERT(LANGUAGE_END == 3); | 4404 STATIC_ASSERT(LANGUAGE_END == 2); |
4405 class LanguageModeField | 4405 class LanguageModeField |
4406 : public BitField<LanguageMode, CallsEvalField::kNext, 2> {}; | 4406 : public BitField<LanguageMode, CallsEvalField::kNext, 1> {}; |
4407 class DeclarationScopeField | 4407 class DeclarationScopeField |
4408 : public BitField<bool, LanguageModeField::kNext, 1> {}; | 4408 : public BitField<bool, LanguageModeField::kNext, 1> {}; |
4409 class ReceiverVariableField | 4409 class ReceiverVariableField |
4410 : public BitField<VariableAllocationInfo, DeclarationScopeField::kNext, | 4410 : public BitField<VariableAllocationInfo, DeclarationScopeField::kNext, |
4411 2> {}; | 4411 2> {}; |
4412 class HasNewTargetField | 4412 class HasNewTargetField |
4413 : public BitField<bool, ReceiverVariableField::kNext, 1> {}; | 4413 : public BitField<bool, ReceiverVariableField::kNext, 1> {}; |
4414 class FunctionVariableField | 4414 class FunctionVariableField |
4415 : public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {}; | 4415 : public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {}; |
4416 class FunctionVariableMode | 4416 class FunctionVariableMode |
(...skipping 3157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7574 kIsSubclassConstructor, | 7574 kIsSubclassConstructor, |
7575 kIsBaseConstructor, | 7575 kIsBaseConstructor, |
7576 kIsGetterFunction, | 7576 kIsGetterFunction, |
7577 kIsSetterFunction, | 7577 kIsSetterFunction, |
7578 // byte 3 | 7578 // byte 3 |
7579 kIsAsyncFunction, | 7579 kIsAsyncFunction, |
7580 kDeserialized, | 7580 kDeserialized, |
7581 kIsDeclaration, | 7581 kIsDeclaration, |
7582 kCompilerHintsCount, // Pseudo entry | 7582 kCompilerHintsCount, // Pseudo entry |
7583 }; | 7583 }; |
7584 // Add hints for other modes when they're added. | |
7585 STATIC_ASSERT(LANGUAGE_END == 3); | |
7586 // kFunctionKind has to be byte-aligned | 7584 // kFunctionKind has to be byte-aligned |
7587 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); | 7585 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); |
7588 // Make sure that FunctionKind and byte 2 are in sync: | 7586 // Make sure that FunctionKind and byte 2 are in sync: |
7589 #define ASSERT_FUNCTION_KIND_ORDER(functionKind, compilerFunctionKind) \ | 7587 #define ASSERT_FUNCTION_KIND_ORDER(functionKind, compilerFunctionKind) \ |
7590 STATIC_ASSERT(FunctionKind::functionKind == \ | 7588 STATIC_ASSERT(FunctionKind::functionKind == \ |
7591 1 << (compilerFunctionKind - kFunctionKind)) | 7589 1 << (compilerFunctionKind - kFunctionKind)) |
7592 ASSERT_FUNCTION_KIND_ORDER(kArrowFunction, kIsArrow); | 7590 ASSERT_FUNCTION_KIND_ORDER(kArrowFunction, kIsArrow); |
7593 ASSERT_FUNCTION_KIND_ORDER(kGeneratorFunction, kIsGenerator); | 7591 ASSERT_FUNCTION_KIND_ORDER(kGeneratorFunction, kIsGenerator); |
7594 ASSERT_FUNCTION_KIND_ORDER(kConciseMethod, kIsConciseMethod); | 7592 ASSERT_FUNCTION_KIND_ORDER(kConciseMethod, kIsConciseMethod); |
7595 ASSERT_FUNCTION_KIND_ORDER(kDefaultConstructor, kIsDefaultConstructor); | 7593 ASSERT_FUNCTION_KIND_ORDER(kDefaultConstructor, kIsDefaultConstructor); |
(...skipping 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11173 } | 11171 } |
11174 return value; | 11172 return value; |
11175 } | 11173 } |
11176 }; | 11174 }; |
11177 | 11175 |
11178 | 11176 |
11179 } // NOLINT, false-positive due to second-order macros. | 11177 } // NOLINT, false-positive due to second-order macros. |
11180 } // NOLINT, false-positive due to second-order macros. | 11178 } // NOLINT, false-positive due to second-order macros. |
11181 | 11179 |
11182 #endif // V8_OBJECTS_H_ | 11180 #endif // V8_OBJECTS_H_ |
OLD | NEW |