Changeset 278591 in webkit for trunk/Source/JavaScriptCore/bytecompiler
- Timestamp:
- Jun 7, 2021, 8:22:27 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore/bytecompiler
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r278588 r278591 529 529 functionSymbolTable->set(NoLockingNecessary, name, entry); 530 530 } 531 OpPutToScope::emit(this, m_lexicalEnvironmentRegister, UINT_MAX, virtualRegisterForArgumentIncludingThis(1 + i), GetPutInfo(ThrowIfNotFound, LocalClosureVar, InitializationMode::NotInitialization, ecmaMode), SymbolTableOrScopeDepth::symbolTable(VirtualRegister { symbolTableConstantIndex }), offset.offset());531 OpPutToScope::emit(this, m_lexicalEnvironmentRegister, UINT_MAX, virtualRegisterForArgumentIncludingThis(1 + i), GetPutInfo(ThrowIfNotFound, ResolvedClosureVar, InitializationMode::NotInitialization, ecmaMode), SymbolTableOrScopeDepth::symbolTable(VirtualRegister { symbolTableConstantIndex }), offset.offset()); 532 532 } 533 533 … … 567 567 functionSymbolTable->set(NoLockingNecessary, name, SymbolTableEntry(VarOffset(offset))); 568 568 569 OpPutToScope::emit(this, m_lexicalEnvironmentRegister, addConstant(ident), virtualRegisterForArgumentIncludingThis(1 + i), GetPutInfo(ThrowIfNotFound, LocalClosureVar, InitializationMode::NotInitialization, ecmaMode), SymbolTableOrScopeDepth::symbolTable(VirtualRegister { symbolTableConstantIndex }), offset.offset());569 OpPutToScope::emit(this, m_lexicalEnvironmentRegister, addConstant(ident), virtualRegisterForArgumentIncludingThis(1 + i), GetPutInfo(ThrowIfNotFound, ResolvedClosureVar, InitializationMode::NotInitialization, ecmaMode), SymbolTableOrScopeDepth::symbolTable(VirtualRegister { symbolTableConstantIndex }), offset.offset()); 570 570 } 571 571 } … … 843 843 844 844 bool shouldInitializeBlockScopedFunctions = false; // We generate top-level function declarations in ::generate(). 845 pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);845 pushLexicalScope(m_scopeNode, ScopeType::LetConstScope, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions); 846 846 } 847 847 … … 908 908 909 909 bool shouldInitializeBlockScopedFunctions = false; // We generate top-level function declarations in ::generate(). 910 pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);910 pushLexicalScope(m_scopeNode, ScopeType::LetConstScope, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions); 911 911 } 912 912 … … 990 990 991 991 VariableEnvironment& lexicalVariables = moduleProgramNode->lexicalVariables(); 992 instantiateLexicalVariables(lexicalVariables, moduleEnvironmentSymbolTable, ScopeRegisterType::Block, lookUpVarKind);992 instantiateLexicalVariables(lexicalVariables, ScopeType::LetConstScope, moduleEnvironmentSymbolTable, ScopeRegisterType::Block, lookUpVarKind); 993 993 994 994 // We keep the symbol table in the constant pool. … … 1864 1864 1865 1865 template<typename LookUpVarKindFunctor> 1866 bool BytecodeGenerator::instantiateLexicalVariables(const VariableEnvironment& lexicalVariables, S ymbolTable* symbolTable, ScopeRegisterType scopeRegisterType, LookUpVarKindFunctor lookUpVarKind)1866 bool BytecodeGenerator::instantiateLexicalVariables(const VariableEnvironment& lexicalVariables, ScopeType scopeType, SymbolTable* symbolTable, ScopeRegisterType scopeRegisterType, LookUpVarKindFunctor lookUpVarKind) 1867 1867 { 1868 1868 bool hasCapturedVariables = false; 1869 1869 { 1870 bool hasPrivateNames = lexicalVariables.privateNamesSize(); 1871 // We need to ensure that @privateClassBrand and @privateBrand offsets are 0 and 1 respectively. 1872 // To ensure that, we first define them, and later, we filter them out from lexicalVariables. 1873 if (scopeType == ScopeType::ClassScope) { 1874 if (hasPrivateNames) { 1875 hasCapturedVariables = true; 1876 VarOffset privateClassBrandOffset = VarOffset(symbolTable->takeNextScopeOffset(NoLockingNecessary)); 1877 ASSERT(privateClassBrandOffset.rawOffset() == PrivateNameEntry::privateClassBrandOffset); 1878 symbolTable->add(NoLockingNecessary, propertyNames().builtinNames().privateClassBrandPrivateName().impl(), SymbolTableEntry { privateClassBrandOffset, static_cast<unsigned>(PropertyAttribute::ReadOnly) }); 1879 1880 VarOffset privateBrandOffset = VarOffset(symbolTable->takeNextScopeOffset(NoLockingNecessary)); 1881 ASSERT(privateBrandOffset.rawOffset() == PrivateNameEntry::privateBrandOffset); 1882 symbolTable->add(NoLockingNecessary, propertyNames().builtinNames().privateBrandPrivateName().impl(), SymbolTableEntry { privateBrandOffset, static_cast<unsigned>(PropertyAttribute::ReadOnly) }); 1883 } 1884 } 1885 1870 1886 for (auto& entry : lexicalVariables) { 1871 1887 ASSERT(entry.value.isLet() || entry.value.isConst() || entry.value.isFunction()); 1872 1888 ASSERT(!entry.value.isVar()); 1873 SymbolTableEntry symbolTableEntry = symbolTable->get(NoLockingNecessary, entry.key.get()); 1889 1890 auto* key = entry.key.get(); 1891 if (scopeType == ScopeType::ClassScope) { 1892 if (hasPrivateNames) { 1893 if (key == propertyNames().builtinNames().privateClassBrandPrivateName()) { 1894 ASSERT(entry.value.isConst()); 1895 continue; 1896 } 1897 if (key == propertyNames().builtinNames().privateBrandPrivateName()) { 1898 ASSERT(entry.value.isConst()); 1899 continue; 1900 } 1901 } else { 1902 ASSERT(key != propertyNames().builtinNames().privateClassBrandPrivateName()); 1903 ASSERT(key != propertyNames().builtinNames().privateBrandPrivateName()); 1904 } 1905 } 1906 1907 #if ASSERT_ENABLED 1908 SymbolTableEntry symbolTableEntry = symbolTable->get(NoLockingNecessary, key); 1874 1909 ASSERT(symbolTableEntry.isNull()); 1910 #endif 1875 1911 1876 1912 // Imported bindings which are not the namespace bindings are not allocated … … 1881 1917 continue; 1882 1918 1883 VarKind varKind = lookUpVarKind( entry.key.get(), entry.value);1919 VarKind varKind = lookUpVarKind(key, entry.value); 1884 1920 VarOffset varOffset; 1885 1921 if (varKind == VarKind::Scope) { … … 1898 1934 1899 1935 SymbolTableEntry newEntry(varOffset, static_cast<unsigned>(entry.value.isConst() ? PropertyAttribute::ReadOnly : PropertyAttribute::None)); 1900 symbolTable->add(NoLockingNecessary, entry.key.get(), newEntry);1936 symbolTable->add(NoLockingNecessary, key, newEntry); 1901 1937 1902 1938 // FIXME: only do this if there is an eval() within a nested scope --- otherwise it isn't needed. … … 1907 1943 continue; 1908 1944 1909 auto findResult = privateEnvironment->find( entry.key.get());1945 auto findResult = privateEnvironment->find(key); 1910 1946 1911 1947 if (findResult == privateEnvironment->end()) … … 1944 1980 } 1945 1981 1946 void BytecodeGenerator::pushLexicalScope(VariableEnvironmentNode* node, TDZCheckOptimization tdzCheckOptimization, NestedScopeType nestedScopeType, RegisterID** constantSymbolTableResult, bool shouldInitializeBlockScopedFunctions)1982 void BytecodeGenerator::pushLexicalScope(VariableEnvironmentNode* node, ScopeType scopeType, TDZCheckOptimization tdzCheckOptimization, NestedScopeType nestedScopeType, RegisterID** constantSymbolTableResult, bool shouldInitializeBlockScopedFunctions) 1947 1983 { 1948 1984 VariableEnvironment& environment = node->lexicalVariables(); 1949 1985 RegisterID* constantSymbolTableResultTemp = nullptr; 1950 pushLexicalScopeInternal(environment, tdzCheckOptimization, nestedScopeType, &constantSymbolTableResultTemp, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);1986 pushLexicalScopeInternal(environment, tdzCheckOptimization, nestedScopeType, &constantSymbolTableResultTemp, TDZRequirement::UnderTDZ, scopeType, ScopeRegisterType::Block); 1951 1987 1952 1988 if (shouldInitializeBlockScopedFunctions) … … 1972 2008 break; 1973 2009 case ScopeType::LetConstScope: 2010 case ScopeType::ClassScope: 1974 2011 symbolTable->setScopeType(SymbolTable::ScopeType::LexicalScope); 1975 2012 break; … … 1986 2023 }; 1987 2024 1988 bool hasCapturedVariables = instantiateLexicalVariables(environment, s ymbolTable, scopeRegisterType, lookUpVarKind);2025 bool hasCapturedVariables = instantiateLexicalVariables(environment, scopeType, symbolTable, scopeRegisterType, lookUpVarKind); 1989 2026 1990 2027 RegisterID* newScope = nullptr; … … 2450 2487 scope, 2451 2488 addConstant(variable.ident()), 2452 GetPutInfo(resolveMode, variable.offset().isScope() ? LocalClosureVar : resolveType(), InitializationMode::NotInitialization, ecmaMode()),2489 GetPutInfo(resolveMode, variable.offset().isScope() ? ResolvedClosureVar : resolveType(), InitializationMode::NotInitialization, ecmaMode()), 2453 2490 localScopeDepth(), 2454 2491 variable.offset().isScope() ? variable.offset().scopeOffset().offset() : 0); … … 2477 2514 if (variable.offset().isScope()) { 2478 2515 offset = variable.offset().scopeOffset(); 2479 getPutInfo = GetPutInfo(resolveMode, LocalClosureVar, initializationMode, ecmaMode());2516 getPutInfo = GetPutInfo(resolveMode, ResolvedClosureVar, initializationMode, ecmaMode()); 2480 2517 symbolTableOrScopeDepth = SymbolTableOrScopeDepth::symbolTable(VirtualRegister { variable.symbolTableConstantIndex() }); 2481 2518 } else { 2482 ASSERT(resolveType() != LocalClosureVar);2519 ASSERT(resolveType() != ResolvedClosureVar); 2483 2520 getPutInfo = GetPutInfo(resolveMode, resolveType(), initializationMode, ecmaMode()); 2484 2521 symbolTableOrScopeDepth = SymbolTableOrScopeDepth::scopeDepth(localScopeDepth()); … … 2761 2798 } 2762 2799 2763 void BytecodeGenerator::emitCreatePrivateBrand( RegisterID* scope,const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)2800 void BytecodeGenerator::emitCreatePrivateBrand(const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd) 2764 2801 { 2765 2802 RefPtr<RegisterID> createPrivateSymbol = moveLinkTimeConstant(nullptr, LinkTimeConstant::createPrivateSymbol); … … 2771 2808 Variable privateBrandVar = variable(propertyNames().builtinNames().privateBrandPrivateName()); 2772 2809 2773 emitPutToScope(scope , privateBrandVar, newSymbol, DoNotThrowIfNotFound, InitializationMode::ConstInitialization);2810 emitPutToScope(scopeRegister(), privateBrandVar, newSymbol, DoNotThrowIfNotFound, InitializationMode::ConstInitialization); 2774 2811 } 2775 2812 … … 2791 2828 RegisterID* BytecodeGenerator::emitGetPrivateBrand(RegisterID* dst, RegisterID* scope, bool isStatic) 2792 2829 { 2793 Variable privateBrandVar = isStatic 2794 ? variable(propertyNames().builtinNames().privateClassBrandPrivateName()) 2795 : variable(propertyNames().builtinNames().privateBrandPrivateName()); 2796 return emitGetFromScope(dst, scope, privateBrandVar, ThrowIfNotFound); 2830 ASSERT(scope); 2831 OpGetFromScope::emit( 2832 this, 2833 kill(dst), 2834 scope, 2835 addConstant(isStatic ? propertyNames().builtinNames().privateClassBrandPrivateName() : propertyNames().builtinNames().privateBrandPrivateName()), 2836 GetPutInfo(ThrowIfNotFound, ResolvedClosureVar, InitializationMode::NotInitialization, ecmaMode()), 2837 0, 2838 isStatic ? PrivateNameEntry::privateClassBrandOffset : PrivateNameEntry::privateBrandOffset); 2839 return dst; 2797 2840 } 2798 2841 -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
r278588 r278591 690 690 // This doesn't emit expression info. If using this, make sure you shouldn't be emitting text offset. 691 691 void emitProfileType(RegisterID* registerToProfile, ProfileTypeBytecodeFlag); 692 // These variables are associated with variables in a program. They could be Locals, LocalClosureVar, or ClosureVar.692 // These variables are associated with variables in a program. They could be Locals, ResolvedClosureVar, or ClosureVar. 693 693 void emitProfileType(RegisterID* registerToProfile, const Variable&, const JSTextPosition& startDivot, const JSTextPosition& endDivot); 694 694 … … 843 843 RegisterID* emitHasPrivateName(RegisterID* dst, RegisterID* base, RegisterID* property); 844 844 845 void emitCreatePrivateBrand( RegisterID* dst,const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);845 void emitCreatePrivateBrand(const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd); 846 846 void emitInstallPrivateBrand(RegisterID* target); 847 847 void emitInstallPrivateClassBrand(RegisterID* target); … … 1100 1100 enum class TDZCheckOptimization { Optimize, DoNotOptimize }; 1101 1101 enum class NestedScopeType { IsNested, IsNotNested }; 1102 enum class ScopeType { CatchScope, LetConstScope, FunctionNameScope, ClassScope }; 1102 1103 private: 1103 1104 enum class TDZRequirement { UnderTDZ, NotUnderTDZ }; 1104 enum class ScopeType { CatchScope, LetConstScope, FunctionNameScope };1105 1105 enum class ScopeRegisterType { Var, Block }; 1106 1106 void pushLexicalScopeInternal(VariableEnvironment&, TDZCheckOptimization, NestedScopeType, RegisterID** constantSymbolTableResult, TDZRequirement, ScopeType, ScopeRegisterType); … … 1108 1108 void popLexicalScopeInternal(VariableEnvironment&); 1109 1109 template<typename LookUpVarKindFunctor> 1110 bool instantiateLexicalVariables(const VariableEnvironment&, S ymbolTable*, ScopeRegisterType, LookUpVarKindFunctor);1110 bool instantiateLexicalVariables(const VariableEnvironment&, ScopeType, SymbolTable*, ScopeRegisterType, LookUpVarKindFunctor); 1111 1111 void emitPrefillStackTDZVariables(const VariableEnvironment&, SymbolTable*); 1112 1112 RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope); … … 1130 1130 bool isSuperCallUsedInInnerArrowFunction(); 1131 1131 bool isThisUsedInInnerArrowFunction(); 1132 void pushLexicalScope(VariableEnvironmentNode*, TDZCheckOptimization, NestedScopeType = NestedScopeType::IsNotNested, RegisterID** constantSymbolTableResult = nullptr, bool shouldInitializeBlockScopedFunctions = true); 1132 void pushLexicalScope(VariableEnvironmentNode*, ScopeType, TDZCheckOptimization, NestedScopeType = NestedScopeType::IsNotNested, RegisterID** constantSymbolTableResult = nullptr, bool shouldInitializeBlockScopedFunctions = true); 1133 void pushClassLexicalScope(VariableEnvironmentNode*); 1133 1134 void popLexicalScope(VariableEnvironmentNode*); 1134 1135 void prepareLexicalScopeForNextForLoopIteration(VariableEnvironmentNode*, RegisterID* loopSymbolTable); -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r278578 r278591 983 983 Variable var = generator.variable(identifierName); 984 984 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 985 985 ASSERT(scope); // Private names are always captured. 986 986 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 987 987 generator.emitCheckPrivateBrand(base, privateBrandSymbol.get(), privateTraits.isStatic()); … … 993 993 Variable var = generator.variable(identifierName); 994 994 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 995 995 ASSERT(scope); // Private names are always captured. 996 996 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 997 997 generator.emitCheckPrivateBrand(base, privateBrandSymbol.get(), privateTraits.isStatic()); … … 1008 1008 Variable var = generator.variable(identifierName); 1009 1009 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 1010 1010 ASSERT(scope); // Private names are always captured. 1011 1011 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 1012 1012 generator.emitCheckPrivateBrand(base, privateBrandSymbol.get(), privateTraits.isStatic()); … … 1020 1020 1021 1021 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 1022 ASSERT(scope); // Private names are always captured. 1022 1023 RefPtr<RegisterID> privateName = generator.newTemporary(); 1023 1024 generator.emitGetFromScope(privateName.get(), scope.get(), var, DoNotThrowIfNotFound); … … 1048 1049 Variable var = generator.variable(identifierName); 1049 1050 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 1050 1051 ASSERT(scope); // Private names are always captured. 1051 1052 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 1052 1053 generator.emitCheckPrivateBrand(base, privateBrandSymbol.get(), privateTraits.isStatic()); … … 1065 1066 Variable var = generator.variable(identifierName); 1066 1067 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 1067 1068 ASSERT(scope); // Private names are always captured. 1068 1069 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 1069 1070 generator.emitCheckPrivateBrand(base, privateBrandSymbol.get(), privateTraits.isStatic()); … … 1078 1079 1079 1080 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 1081 ASSERT(scope); // Private names are always captured. 1080 1082 RefPtr<RegisterID> privateName = generator.newTemporary(); 1081 1083 generator.emitGetFromScope(privateName.get(), scope.get(), var, DoNotThrowIfNotFound); … … 2418 2420 Variable var = generator.variable(ident); 2419 2421 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2422 ASSERT(scope); // Private names are always captured. 2420 2423 RefPtr<RegisterID> privateName = generator.newTemporary(); 2421 2424 generator.emitGetFromScope(privateName.get(), scope.get(), var, DoNotThrowIfNotFound); … … 2432 2435 Variable var = generator.variable(ident); 2433 2436 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2434 2437 ASSERT(scope); // Private names are always captured. 2435 2438 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 2436 2439 generator.emitCheckPrivateBrand(base.get(), privateBrandSymbol.get(), privateTraits.isStatic()); … … 2443 2446 Variable var = generator.variable(ident); 2444 2447 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2445 2448 ASSERT(scope); // Private names are always captured. 2446 2449 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 2447 2450 generator.emitCheckPrivateBrand(base.get(), privateBrandSymbol.get(), privateTraits.isStatic()); … … 2721 2724 Variable var = generator.variable(ident); 2722 2725 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2723 2726 ASSERT(scope); // Private names are always captured. 2724 2727 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 2725 2728 generator.emitCheckPrivateBrand(base.get(), privateBrandSymbol.get(), privateTraits.isStatic()); … … 2732 2735 Variable var = generator.variable(ident); 2733 2736 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 2734 2737 ASSERT(scope); // Private names are always captured. 2735 2738 RefPtr<RegisterID> privateBrandSymbol = generator.emitGetPrivateBrand(generator.newTemporary(), scope.get(), privateTraits.isStatic()); 2736 2739 generator.emitCheckPrivateBrand(base.get(), privateBrandSymbol.get(), privateTraits.isStatic()); … … 3214 3217 Variable var = generator.variable(identifier); 3215 3218 RefPtr<RegisterID> scope = generator.emitResolveScope(nullptr, var); 3219 ASSERT(scope); // Private names are always captured. 3216 3220 3217 3221 if (privateTraits.isField()) { … … 3820 3824 if (!m_statements) 3821 3825 return; 3822 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested);3826 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested); 3823 3827 m_statements->emitBytecode(generator, dst); 3824 3828 generator.popLexicalScope(this); … … 4033 4037 4034 4038 RegisterID* forLoopSymbolTable = nullptr; 4035 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable);4039 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable); 4036 4040 4037 4041 if (m_expr1) … … 4184 4188 4185 4189 RegisterID* forLoopSymbolTable = nullptr; 4186 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable);4190 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable); 4187 4191 4188 4192 if (m_lexpr->isAssignResolveNode()) … … 4353 4357 4354 4358 RegisterID* forLoopSymbolTable = nullptr; 4355 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable);4359 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested, &forLoopSymbolTable); 4356 4360 auto extractor = scopedLambda<void(BytecodeGenerator&, RegisterID*)>([this, dst](BytecodeGenerator& generator, RegisterID* value) 4357 4361 { … … 4687 4691 RefPtr<RegisterID> r0 = generator.emitNode(m_expr); 4688 4692 4689 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::DoNotOptimize, BytecodeGenerator::NestedScopeType::IsNested);4693 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::LetConstScope, BytecodeGenerator::TDZCheckOptimization::DoNotOptimize, BytecodeGenerator::NestedScopeType::IsNested); 4690 4694 m_block->emitBytecodeForBlock(generator, r0.get(), dst); 4691 4695 generator.popLexicalScope(this); … … 5187 5191 5188 5192 if (m_needsLexicalScope) 5189 generator.pushLexicalScope(this, BytecodeGenerator:: TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested);5193 generator.pushLexicalScope(this, BytecodeGenerator::ScopeType::ClassScope, BytecodeGenerator::TDZCheckOptimization::Optimize, BytecodeGenerator::NestedScopeType::IsNested); 5190 5194 5191 5195 bool hasPrivateNames = !!m_lexicalVariables.privateNamesSize(); … … 5195 5199 generator.pushPrivateAccessNames(m_lexicalVariables.privateNameEnvironment()); 5196 5200 if (shouldEmitPrivateBrand) 5197 generator.emitCreatePrivateBrand( generator.scopeRegister(),m_position, m_position, m_position);5201 generator.emitCreatePrivateBrand(m_position, m_position, m_position); 5198 5202 5199 5203 RefPtr<RegisterID> superclass;
Note:
See TracChangeset
for help on using the changeset viewer.