summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/scope-info.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/objects/scope-info.h')
-rw-r--r--deps/v8/src/objects/scope-info.h67
1 files changed, 23 insertions, 44 deletions
diff --git a/deps/v8/src/objects/scope-info.h b/deps/v8/src/objects/scope-info.h
index 0b8eb61b00..123b9b1797 100644
--- a/deps/v8/src/objects/scope-info.h
+++ b/deps/v8/src/objects/scope-info.h
@@ -51,7 +51,7 @@ class ScopeInfo : public FixedArray {
bool is_class_scope() const;
// Does this scope make a sloppy eval call?
- bool CallsSloppyEval() const;
+ bool SloppyEvalCanExtendVars() const;
// Return the number of context slots for code if a context is allocated. This
// number consists of three parts:
@@ -130,9 +130,6 @@ class ScopeInfo : public FixedArray {
// Return the initialization flag of the given context local.
MaybeAssignedFlag ContextLocalMaybeAssignedFlag(int var) const;
- // Return whether access to the variable requries a brand check.
- RequiresBrandCheckFlag RequiresBrandCheck(int var) const;
-
// Return true if this local was introduced by the compiler, and should not be
// exposed to the user in a debugger.
static bool VariableIsSynthetic(String name);
@@ -144,8 +141,7 @@ class ScopeInfo : public FixedArray {
// mode for that variable.
static int ContextSlotIndex(ScopeInfo scope_info, String name,
VariableMode* mode, InitializationFlag* init_flag,
- MaybeAssignedFlag* maybe_assigned_flag,
- RequiresBrandCheckFlag* requires_brand_check);
+ MaybeAssignedFlag* maybe_assigned_flag);
// Lookup metadata of a MODULE-allocated variable. Return 0 if there is no
// module variable with the given name (the index value of a MODULE variable
@@ -224,39 +220,26 @@ class ScopeInfo : public FixedArray {
enum VariableAllocationInfo { NONE, STACK, CONTEXT, UNUSED };
// Properties of scopes.
- class ScopeTypeField : public BitField<ScopeType, 0, 4> {};
- class CallsSloppyEvalField : public BitField<bool, ScopeTypeField::kNext, 1> {
- };
+ using ScopeTypeField = BitField<ScopeType, 0, 4>;
+ using SloppyEvalCanExtendVarsField = ScopeTypeField::Next<bool, 1>;
STATIC_ASSERT(LanguageModeSize == 2);
- class LanguageModeField
- : public BitField<LanguageMode, CallsSloppyEvalField::kNext, 1> {};
- class DeclarationScopeField
- : public BitField<bool, LanguageModeField::kNext, 1> {};
- class ReceiverVariableField
- : public BitField<VariableAllocationInfo, DeclarationScopeField::kNext,
- 2> {};
- class HasClassBrandField
- : public BitField<bool, ReceiverVariableField::kNext, 1> {};
- class HasNewTargetField
- : public BitField<bool, HasClassBrandField::kNext, 1> {};
- class FunctionVariableField
- : public BitField<VariableAllocationInfo, HasNewTargetField::kNext, 2> {};
+ using LanguageModeField = SloppyEvalCanExtendVarsField::Next<LanguageMode, 1>;
+ using DeclarationScopeField = LanguageModeField::Next<bool, 1>;
+ using ReceiverVariableField =
+ DeclarationScopeField::Next<VariableAllocationInfo, 2>;
+ using HasClassBrandField = ReceiverVariableField::Next<bool, 1>;
+ using HasNewTargetField = HasClassBrandField::Next<bool, 1>;
+ using FunctionVariableField =
+ HasNewTargetField::Next<VariableAllocationInfo, 2>;
// TODO(cbruni): Combine with function variable field when only storing the
// function name.
- class HasInferredFunctionNameField
- : public BitField<bool, FunctionVariableField::kNext, 1> {};
- class IsAsmModuleField
- : public BitField<bool, HasInferredFunctionNameField::kNext, 1> {};
- class HasSimpleParametersField
- : public BitField<bool, IsAsmModuleField::kNext, 1> {};
- class FunctionKindField
- : public BitField<FunctionKind, HasSimpleParametersField::kNext, 5> {};
- class HasOuterScopeInfoField
- : public BitField<bool, FunctionKindField::kNext, 1> {};
- class IsDebugEvaluateScopeField
- : public BitField<bool, HasOuterScopeInfoField::kNext, 1> {};
- class ForceContextAllocationField
- : public BitField<bool, IsDebugEvaluateScopeField::kNext, 1> {};
+ using HasInferredFunctionNameField = FunctionVariableField::Next<bool, 1>;
+ using IsAsmModuleField = HasInferredFunctionNameField::Next<bool, 1>;
+ using HasSimpleParametersField = IsAsmModuleField::Next<bool, 1>;
+ using FunctionKindField = HasSimpleParametersField::Next<FunctionKind, 5>;
+ using HasOuterScopeInfoField = FunctionKindField::Next<bool, 1>;
+ using IsDebugEvaluateScopeField = HasOuterScopeInfoField::Next<bool, 1>;
+ using ForceContextAllocationField = IsDebugEvaluateScopeField::Next<bool, 1>;
STATIC_ASSERT(kLastFunctionKind <= FunctionKindField::kMax);
@@ -323,14 +306,10 @@ class ScopeInfo : public FixedArray {
static const int kPositionInfoEntries = 2;
// Properties of variables.
- class VariableModeField : public BitField<VariableMode, 0, 3> {};
- class InitFlagField : public BitField<InitializationFlag, 3, 1> {};
- class MaybeAssignedFlagField : public BitField<MaybeAssignedFlag, 4, 1> {};
- class RequiresBrandCheckField
- : public BitField<RequiresBrandCheckFlag, MaybeAssignedFlagField::kNext,
- 1> {};
- class ParameterNumberField
- : public BitField<uint32_t, RequiresBrandCheckField::kNext, 16> {};
+ using VariableModeField = BitField<VariableMode, 0, 4>;
+ using InitFlagField = VariableModeField::Next<InitializationFlag, 1>;
+ using MaybeAssignedFlagField = InitFlagField::Next<MaybeAssignedFlag, 1>;
+ using ParameterNumberField = MaybeAssignedFlagField::Next<uint32_t, 16>;
friend class ScopeIterator;
friend std::ostream& operator<<(std::ostream& os,