mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Don't undo progress on batch compilation accidentally.
Don't undo progress on batch compilation accidentally.
This commit is contained in:
parent
ba8732b25b
commit
d23ddf632e
3 changed files with 4 additions and 17 deletions
|
|
@ -72,7 +72,7 @@ DecodeCodeSection(Decoder& d, ModuleGenerator& mg)
|
|||
return false;
|
||||
|
||||
if (sectionStart == Decoder::NotStarted) {
|
||||
if (mg.numFuncDefs() != 0)
|
||||
if (mg.env().numFuncDefs() != 0)
|
||||
return d.fail("expected function bodies");
|
||||
|
||||
return mg.finishFuncDefs();
|
||||
|
|
@ -82,11 +82,11 @@ DecodeCodeSection(Decoder& d, ModuleGenerator& mg)
|
|||
if (!d.readVarU32(&numFuncDefs))
|
||||
return d.fail("expected function body count");
|
||||
|
||||
if (numFuncDefs != mg.numFuncDefs())
|
||||
if (numFuncDefs != mg.env().numFuncDefs())
|
||||
return d.fail("function body count does not match function signature count");
|
||||
|
||||
for (uint32_t funcDefIndex = 0; funcDefIndex < numFuncDefs; funcDefIndex++) {
|
||||
if (!DecodeFunctionBody(d, mg, mg.numFuncImports() + funcDefIndex))
|
||||
if (!DecodeFunctionBody(d, mg, mg.env().numFuncImports() + funcDefIndex))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -792,15 +792,6 @@ ModuleGenerator::numFuncImports() const
|
|||
return metadata_->funcImports.length();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ModuleGenerator::numFuncDefs() const
|
||||
{
|
||||
// asm.js overallocates the length of funcSigs and in general does not know
|
||||
// the number of function definitions until it's done compiling.
|
||||
MOZ_ASSERT(!isAsmJS());
|
||||
return env_->funcSigs.length() - numFuncImports();
|
||||
}
|
||||
|
||||
const SigWithId&
|
||||
ModuleGenerator::funcSig(uint32_t funcIndex) const
|
||||
{
|
||||
|
|
@ -965,7 +956,7 @@ ModuleGenerator::finishFuncDefs()
|
|||
for (uint32_t i = AsmJSFirstDefFuncIndex; i < numFinishedFuncDefs_; i++)
|
||||
MOZ_ASSERT(funcCodeRange(i).funcIndex() == i);
|
||||
} else {
|
||||
MOZ_ASSERT(numFinishedFuncDefs_ == numFuncDefs());
|
||||
MOZ_ASSERT(numFinishedFuncDefs_ == env_->numFuncDefs());
|
||||
for (uint32_t i = 0; i < env_->numFuncs(); i++)
|
||||
MOZ_ASSERT(funcCodeRange(i).funcIndex() == i);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -286,10 +286,6 @@ private:
|
|||
// Globals:
|
||||
const GlobalDescVector& globals() const { return env_->globals; }
|
||||
|
||||
// Functions declarations:
|
||||
uint32_t numFuncImports() const;
|
||||
uint32_t numFuncDefs() const;
|
||||
|
||||
// Function definitions:
|
||||
MOZ_MUST_USE bool startFuncDefs();
|
||||
MOZ_MUST_USE bool startFuncDef(uint32_t lineOrBytecode, FunctionGenerator* fg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue