mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
Fix defects
* using references for auto variables * embed identifier operations for non-generic block infos Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
parent
5170135d7b
commit
a4afdefbf2
4 changed files with 19 additions and 17 deletions
|
|
@ -676,13 +676,14 @@ void InterpretedCodeBlock::computeVariables()
|
|||
} else {
|
||||
m_blockInfos[i] = BlockInfo::genericBlockInfo(false, m_blockInfos[i]->identifiers().size());
|
||||
}
|
||||
ASSERT(!m_blockInfos[i]->identifiers().size());
|
||||
} else {
|
||||
m_blockInfos[i]->setCanAllocateEnvironmentOnStack(false);
|
||||
m_blockInfos[i]->setShouldAllocateEnvironment(m_blockInfos[i]->identifiers().size());
|
||||
}
|
||||
for (size_t j = 0; j < m_blockInfos[i]->identifiers().size(); j++) {
|
||||
m_blockInfos[i]->identifiers()[j].m_indexForIndexedStorage = SIZE_MAX;
|
||||
m_blockInfos[i]->identifiers()[j].m_needToAllocateOnStack = false;
|
||||
for (size_t j = 0; j < m_blockInfos[i]->identifiers().size(); j++) {
|
||||
m_blockInfos[i]->identifiers()[j].m_indexForIndexedStorage = SIZE_MAX;
|
||||
m_blockInfos[i]->identifiers()[j].m_needToAllocateOnStack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -762,13 +763,14 @@ void InterpretedCodeBlock::computeVariables()
|
|||
} else {
|
||||
m_blockInfos[i] = BlockInfo::genericBlockInfo(false, m_blockInfos[i]->identifiers().size());
|
||||
}
|
||||
ASSERT(!m_blockInfos[i]->identifiers().size());
|
||||
} else {
|
||||
m_blockInfos[i]->setCanAllocateEnvironmentOnStack(false);
|
||||
m_blockInfos[i]->setShouldAllocateEnvironment(m_blockInfos[i]->identifiers().size());
|
||||
}
|
||||
for (size_t j = 0; j < m_blockInfos[i]->identifiers().size(); j++) {
|
||||
m_blockInfos[i]->identifiers()[j].m_indexForIndexedStorage = SIZE_MAX;
|
||||
m_blockInfos[i]->identifiers()[j].m_needToAllocateOnStack = false;
|
||||
for (size_t j = 0; j < m_blockInfos[i]->identifiers().size(); j++) {
|
||||
m_blockInfos[i]->identifiers()[j].m_indexForIndexedStorage = SIZE_MAX;
|
||||
m_blockInfos[i]->identifiers()[j].m_needToAllocateOnStack = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5115,7 +5115,7 @@ public:
|
|||
this->expect(LeftBrace);
|
||||
this->parseDirectivePrologues(builder, body);
|
||||
|
||||
auto previousLabelSet = this->context->labelSet;
|
||||
auto previousLabelSet = std::move(this->context->labelSet);
|
||||
bool previousInIteration = this->context->inIteration;
|
||||
bool previousInSwitch = this->context->inSwitch;
|
||||
bool previousInFunctionBody = this->context->inFunctionBody;
|
||||
|
|
@ -5150,7 +5150,7 @@ public:
|
|||
this->context->allowLexicalDeclaration = oldAllowLexicalDeclaration;
|
||||
this->nameDeclaredCallback = oldNameCallback;
|
||||
|
||||
this->context->labelSet = previousLabelSet;
|
||||
this->context->labelSet = std::move(previousLabelSet);
|
||||
this->context->inIteration = previousInIteration;
|
||||
this->context->inSwitch = previousInSwitch;
|
||||
this->context->inFunctionBody = previousInFunctionBody;
|
||||
|
|
@ -6967,7 +6967,7 @@ public:
|
|||
params->appendChild(this->finalize(node, builder.createExpressionStatementNode(init)));
|
||||
}
|
||||
|
||||
auto previousLabelSet = this->context->labelSet;
|
||||
auto previousLabelSet = std::move(this->context->labelSet);
|
||||
bool previousInIteration = this->context->inIteration;
|
||||
bool previousInSwitch = this->context->inSwitch;
|
||||
bool previousInFunctionBody = this->context->inFunctionBody;
|
||||
|
|
@ -6996,7 +6996,7 @@ public:
|
|||
this->context->strict = previousStrict;
|
||||
this->context->allowYield = previousAllowYield;
|
||||
|
||||
this->context->labelSet = previousLabelSet;
|
||||
this->context->labelSet = std::move(previousLabelSet);
|
||||
this->context->inIteration = previousInIteration;
|
||||
this->context->inSwitch = previousInSwitch;
|
||||
this->context->inFunctionBody = previousInFunctionBody;
|
||||
|
|
@ -7022,7 +7022,7 @@ public:
|
|||
MetaNode nodeStart = this->createNode();
|
||||
StatementContainer* container = builder.createStatementContainer();
|
||||
|
||||
auto previousLabelSet = this->context->labelSet;
|
||||
auto previousLabelSet = std::move(this->context->labelSet);
|
||||
bool previousInIteration = this->context->inIteration;
|
||||
bool previousInSwitch = this->context->inSwitch;
|
||||
bool previousInFunctionBody = this->context->inFunctionBody;
|
||||
|
|
@ -7053,7 +7053,7 @@ public:
|
|||
this->context->strict = previousStrict;
|
||||
this->context->allowYield = previousAllowYield;
|
||||
|
||||
this->context->labelSet = previousLabelSet;
|
||||
this->context->labelSet = std::move(previousLabelSet);
|
||||
this->context->inIteration = previousInIteration;
|
||||
this->context->inSwitch = previousInSwitch;
|
||||
this->context->inFunctionBody = previousInFunctionBody;
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ Value AsyncGeneratorObject::asyncGeneratorResolve(ExecutionState& state, AsyncGe
|
|||
auto next = queue[0];
|
||||
queue.erase(0);
|
||||
// Let promiseCapability be next.[[Capability]].
|
||||
auto promiseCapability = next.m_capability;
|
||||
auto& promiseCapability = next.m_capability;
|
||||
// Let iteratorResult be ! CreateIterResultObject(value, done).
|
||||
Value iteratorResult = IteratorObject::createIterResultObject(state, value, done);
|
||||
// Perform ! Call(promiseCapability.[[Resolve]], undefined, « iteratorResult »).
|
||||
|
|
@ -239,7 +239,7 @@ Value AsyncGeneratorObject::asyncGeneratorReject(ExecutionState& state, AsyncGen
|
|||
auto next = queue[0];
|
||||
queue.erase(0);
|
||||
// Let promiseCapability be next.[[Capability]].
|
||||
auto promiseCapability = next.m_capability;
|
||||
auto& promiseCapability = next.m_capability;
|
||||
// Perform ! Call(promiseCapability.[[Reject]], undefined, « exception »).
|
||||
Object::call(state, promiseCapability.m_rejectFunction, Value(), 1, &exception);
|
||||
// Perform ! AsyncGeneratorResumeNext(generator).
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void RegExpObject::internalInit(ExecutionState& state, String* source, Option op
|
|||
m_source = source->length() ? source : defaultRegExpString;
|
||||
m_source = escapeSlashInPattern(m_source);
|
||||
|
||||
auto entry = getCacheEntryAndCompileIfNeeded(state, m_source, this->option());
|
||||
auto& entry = getCacheEntryAndCompileIfNeeded(state, m_source, this->option());
|
||||
if (entry.m_yarrError) {
|
||||
m_source = previousSource;
|
||||
setOptionValueForGC(previousOptions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue