Remove duplicated parameter-check methods

Signed-off-by: Hyukwoo Park <hyukwoo.park@jbnu.ac.kr>
This commit is contained in:
Hyukwoo Park 2026-03-03 10:24:32 +09:00 committed by Patrick Kim
commit 989e6922b6
4 changed files with 5 additions and 15 deletions

View file

@ -423,7 +423,7 @@ void InterpretedCodeBlock::recordFunctionParsingInfo(ASTScopeContext* scopeCtx,
void InterpretedCodeBlock::captureArguments(bool needToAllocateOnStack)
{
AtomicString arguments = m_context->staticStrings().arguments;
ASSERT(!hasParameterName(arguments));
ASSERT(!isParameterName(arguments));
ASSERT(!isGlobalCodeBlock() && !isArrowFunctionExpression() && isKindOfFunction());
if (m_usesArgumentsObject) {

View file

@ -925,7 +925,7 @@ public:
return findVarName(name) != SIZE_MAX;
}
bool hasParameterName(const AtomicString& name)
bool isParameterName(const AtomicString& name)
{
for (size_t i = 0; i < parameterNamesCount(); i++) {
if (m_parameterNames[i] == name) {
@ -935,16 +935,6 @@ public:
return false;
}
bool isParameterName(const AtomicString& name)
{
size_t r = findVarName(name);
if (r != SIZE_MAX) {
return m_identifierInfos[r].m_isParameterName;
}
return false;
}
void markHeapAllocatedEnvironmentFromHere(LexicalBlockIndex blockIndex = 0, InterpretedCodeBlock* to = nullptr);
void setConstructedObjectPropertyCount(size_t s)

View file

@ -186,7 +186,7 @@ InterpretedCodeBlock* ScriptParser::generateCodeBlockTreeFromASTWalker(Context*
bool needToCaptureArguments = false;
InterpretedCodeBlock* argumentsObjectHolder = codeBlock;
while (argumentsObjectHolder && !argumentsObjectHolder->isGlobalCodeBlock()) {
if (UNLIKELY(argumentsObjectHolder->hasParameterName(arguments))) {
if (UNLIKELY(argumentsObjectHolder->isParameterName(arguments))) {
// no need to create arguments object since it has a parameter of which name is `arguments`
break;
}

View file

@ -107,7 +107,7 @@ public:
context->addLexicallyDeclaredNames(m_name);
}
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->hasParameterName(m_name)) {
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->isParameterName(m_name)) {
context->addInitializedParameterNames(m_name);
}
@ -205,7 +205,7 @@ public:
codeBlock->pushCode(EnsureArgumentsObject(ByteCodeLOC(m_loc.index)), context, this->m_loc.index);
}
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->hasParameterName(m_name)) {
if (context->m_inParameterInitialization && codeBlock->m_codeBlock->isParameterName(m_name)) {
addParameterReferenceErrorIfNeeds(codeBlock, context);
}